diff --git a/ccm-cms-assets-imagestep/.svnignore b/ccm-cms-assets-imagestep/.svnignore new file mode 100755 index 000000000..378eac25d --- /dev/null +++ b/ccm-cms-assets-imagestep/.svnignore @@ -0,0 +1 @@ +build diff --git a/ccm-cms-assets-imagestep/README b/ccm-cms-assets-imagestep/README new file mode 100755 index 000000000..e69de29bb diff --git a/ccm-cms-assets-imagestep/application.xml b/ccm-cms-assets-imagestep/application.xml new file mode 100755 index 000000000..1668a023f --- /dev/null +++ b/ccm-cms-assets-imagestep/application.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + UI step for attaching an image to article (or other content types). + + diff --git a/ccm-cms-assets-imagestep/pdl/com/arsdigita/cms/contentassets/ItemImageAttachment.pdl b/ccm-cms-assets-imagestep/pdl/com/arsdigita/cms/contentassets/ItemImageAttachment.pdl new file mode 100755 index 000000000..4f7b4c643 --- /dev/null +++ b/ccm-cms-assets-imagestep/pdl/com/arsdigita/cms/contentassets/ItemImageAttachment.pdl @@ -0,0 +1,27 @@ +model com.arsdigita.cms.contentassets; + +import com.arsdigita.cms.ContentItem; +import com.arsdigita.cms.ReusableImageAsset; +import com.arsdigita.cms.contenttypes.Link; +import com.arsdigita.kernel.ACSObject; + +object type ItemImageAttachment extends ACSObject { + String[0..1] useContext = cms_item_image_attachment.use_context VARCHAR( 100 ); + String[0..1] caption = cms_item_image_attachment.caption VARCHAR( 100 ); + String[0..1] title = cms_item_image_attachment.title VARCHAR( 200 ); + String[0..1] description = cms_item_image_attachment.description VARCHAR( 4000 ); + component Link[0..1] imageLink = join cms_item_image_attachment.link_id to cms_links.link_id; + + composite ReusableImageAsset[0..1] image + = join cms_item_image_attachment.image_id to cms_images.image_id; + + reference key (cms_item_image_attachment.attachment_id); +} + +association { + component ItemImageAttachment[0..n] imageAttachments + = join cms_items.item_id to cms_item_image_attachment.item_id; + + composite ContentItem[0..1] item + = join cms_item_image_attachment.item_id to cms_items.item_id; +} diff --git a/ccm-cms-assets-imagestep/sql/ccm-cms-assets-imagestep/oracle-se-create.sql b/ccm-cms-assets-imagestep/sql/ccm-cms-assets-imagestep/oracle-se-create.sql new file mode 100755 index 000000000..c0dc9966a --- /dev/null +++ b/ccm-cms-assets-imagestep/sql/ccm-cms-assets-imagestep/oracle-se-create.sql @@ -0,0 +1,2 @@ +@ ddl/oracle-se/create.sql +@ ddl/oracle-se/deferred.sql diff --git a/ccm-cms-assets-imagestep/sql/ccm-cms-assets-imagestep/oracle-se/upgrade/6.2.0-6.2.1/alter-table-cms_item_image_attachment.sql b/ccm-cms-assets-imagestep/sql/ccm-cms-assets-imagestep/oracle-se/upgrade/6.2.0-6.2.1/alter-table-cms_item_image_attachment.sql new file mode 100755 index 000000000..a300c3e9a --- /dev/null +++ b/ccm-cms-assets-imagestep/sql/ccm-cms-assets-imagestep/oracle-se/upgrade/6.2.0-6.2.1/alter-table-cms_item_image_attachment.sql @@ -0,0 +1,23 @@ +-- +-- Copyright (C) 2005 Runtime Collective Ltd. All Rights Reserved. +-- +-- This library is free software; you can redistribute it and/or +-- modify it under the terms of the GNU Lesser General Public License +-- as published by the Free Software Foundation; either version 2.1 of +-- the License, or (at your option) any later version. +-- +-- This library is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +-- Lesser General Public License for more details. +-- +-- You should have received a copy of the GNU Lesser General Public +-- License along with this library; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-- +-- $Id: alter-table-authoring_steps.sql 285 2005-02-22 00:29:02Z sskracic $ +-- $DateTime: 2004/08/17 23:15:09 $ + +alter table cms_item_image_attachment add (title VARCHAR(200)); +alter table cms_item_image_attachment add (description VARCHAR(4000)); + diff --git a/ccm-cms-assets-imagestep/sql/ccm-cms-assets-imagestep/oracle-se/upgrade/6.5.0-6.5.1/add_link_column.sql b/ccm-cms-assets-imagestep/sql/ccm-cms-assets-imagestep/oracle-se/upgrade/6.5.0-6.5.1/add_link_column.sql new file mode 100644 index 000000000..89328429b --- /dev/null +++ b/ccm-cms-assets-imagestep/sql/ccm-cms-assets-imagestep/oracle-se/upgrade/6.5.0-6.5.1/add_link_column.sql @@ -0,0 +1,25 @@ +-- +-- Copyright (C) 2005 Chris Gilbert. All Rights Reserved. +-- +-- This library is free software; you can redistribute it and/or +-- modify it under the terms of the GNU Lesser General Public License +-- as published by the Free Software Foundation; either version 2.1 of +-- the License, or (at your option) any later version. +-- +-- This library is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +-- Lesser General Public License for more details. +-- +-- You should have received a copy of the GNU Lesser General Public +-- License along with this library; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-- + +alter table cms_item_image_attachment add (link_id NUMBER); + +alter table cms_item_image_attachment add + constraint cms_ite_ima_att_lin_id_f_eeymm foreign key (link_id) + references cms_links(link_id); + + diff --git a/ccm-cms-assets-imagestep/sql/ccm-cms-assets-imagestep/postgres-create.sql b/ccm-cms-assets-imagestep/sql/ccm-cms-assets-imagestep/postgres-create.sql new file mode 100755 index 000000000..38209a696 --- /dev/null +++ b/ccm-cms-assets-imagestep/sql/ccm-cms-assets-imagestep/postgres-create.sql @@ -0,0 +1,4 @@ +begin; +\i ddl/postgres/create.sql +\i ddl/postgres/deferred.sql +end; diff --git a/ccm-cms-assets-imagestep/sql/ccm-cms-assets-imagestep/postgres/upgrade/6.2.0-6.2.1/alter-table-cms_item_image_attachment.sql b/ccm-cms-assets-imagestep/sql/ccm-cms-assets-imagestep/postgres/upgrade/6.2.0-6.2.1/alter-table-cms_item_image_attachment.sql new file mode 100755 index 000000000..57ee78599 --- /dev/null +++ b/ccm-cms-assets-imagestep/sql/ccm-cms-assets-imagestep/postgres/upgrade/6.2.0-6.2.1/alter-table-cms_item_image_attachment.sql @@ -0,0 +1,23 @@ +-- +-- Copyright (C) 2005 Runtime Collective Ltd. All Rights Reserved. +-- +-- This library is free software; you can redistribute it and/or +-- modify it under the terms of the GNU Lesser General Public License +-- as published by the Free Software Foundation; either version 2.1 of +-- the License, or (at your option) any later version. +-- +-- This library is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +-- Lesser General Public License for more details. +-- +-- You should have received a copy of the GNU Lesser General Public +-- License along with this library; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-- +-- $Id: alter-table-authoring_steps.sql 285 2005-02-22 00:29:02Z sskracic $ +-- $DateTime: 2004/08/17 23:15:09 $ + +alter table cms_item_image_attachment add title VARCHAR(200); +alter table cms_item_image_attachment add description VARCHAR(4000); + diff --git a/ccm-cms-assets-imagestep/sql/ccm-cms-assets-imagestep/postgres/upgrade/6.5.0-6.5.1/add_link_column.sql b/ccm-cms-assets-imagestep/sql/ccm-cms-assets-imagestep/postgres/upgrade/6.5.0-6.5.1/add_link_column.sql new file mode 100644 index 000000000..876cd42aa --- /dev/null +++ b/ccm-cms-assets-imagestep/sql/ccm-cms-assets-imagestep/postgres/upgrade/6.5.0-6.5.1/add_link_column.sql @@ -0,0 +1,25 @@ +-- +-- Copyright (C) 2005 Chris Gilbert. All Rights Reserved. +-- +-- This library is free software; you can redistribute it and/or +-- modify it under the terms of the GNU Lesser General Public License +-- as published by the Free Software Foundation; either version 2.1 of +-- the License, or (at your option) any later version. +-- +-- This library is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +-- Lesser General Public License for more details. +-- +-- You should have received a copy of the GNU Lesser General Public +-- License along with this library; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-- + +alter table cms_item_image_attachment add link_id INTEGER; + +alter table cms_item_image_attachment add + constraint cms_ite_ima_att_lin_id_f_eeymm foreign key (link_id) + references cms_links(link_id); + + diff --git a/ccm-cms-assets-imagestep/sql/ccm-cms-assets-imagestep/upgrade/oracle-se-1.0.0-2.0.0.sql b/ccm-cms-assets-imagestep/sql/ccm-cms-assets-imagestep/upgrade/oracle-se-1.0.0-2.0.0.sql new file mode 100755 index 000000000..a113f3dee --- /dev/null +++ b/ccm-cms-assets-imagestep/sql/ccm-cms-assets-imagestep/upgrade/oracle-se-1.0.0-2.0.0.sql @@ -0,0 +1,51 @@ + +PROMPT ImageStep 1.0.0 -> 2.0.0 Upgrade Script (Oracle) + +update acs_objects set +object_type = 'com.arsdigita.cms.ReusableImageAsset', +default_domain_class = 'com.arsdigita.cms.ReusableImageAsset' +where object_type = 'com.arsdigita.cms.contenttypes.AttachableImage'; + +drop table cms_attachable_images; + +@@ ../ddl/postgres/table-cms_item_image_attachment-auto.sql +alter table cms_item_image_attachment add + constraint cms_ite_ima_att_att_id_f_ahq60 foreign key (attachment_id) + references acs_objects(object_id); +alter table cms_item_image_attachment add + constraint cms_ite_ima_att_ima_id_f_kz3mi foreign key (image_id) + references cms_images(image_id); +alter table cms_item_image_attachment add + constraint cms_ite_ima_att_ite_id_f_wg1gi foreign key (item_id) + references cms_items(item_id); + +insert into cms_item_image_attachment +(use_context, caption, image_id, item_id, attachment_id) +select '', substr(map.caption, 0, 100), map.image_id, map.article_id, map.map_id +from cms_article_image_map map; + +delete from cms_article_image_map; + +delete from cms_items +where item_id in ( + select object_id from acs_objects + where object_type = 'com.arsdigita.cms.ArticleImageAssociation' ); + +delete from cms_published_links +where pending_source in ( + select object_id from acs_objects + where object_type = 'com.arsdigita.cms.ArticleImageAssociation' ); + +update inits +set class_name = 'com.arsdigita.cms.ItemImageAttachmentInitializer' +where class_name = 'com.arsdigita.cms.AttachableImageInitializer'; + +update acs_objects set +object_type = 'com.arsdigita.cms.contenttypes.ItemImageAttachment', +default_domain_class = 'com.arsdigita.cms.contenttypes.ItemImageAttachment' +where object_type = 'com.arsdigita.cms.ArticleImageAssociation'; + +update authoring_steps +set label_key = 'com.arsdigita.cms.image_step_label', label_bundle = 'com.arsdigita.cms.ImageStepResources', description_key = 'com.arsdigita.cms.image_step_description', description_bundle = 'com.arsdigita.cms.ImageStepResources', component = 'com.arsdigita.cms.contenttypes.ui.ImageStep' +where component = 'com.arsdigita.cms.ui.authoring.ArticleImage'; + diff --git a/ccm-cms-assets-imagestep/sql/ccm-cms-assets-imagestep/upgrade/oracle-se-6.2.0-6.2.1.sql b/ccm-cms-assets-imagestep/sql/ccm-cms-assets-imagestep/upgrade/oracle-se-6.2.0-6.2.1.sql new file mode 100755 index 000000000..868061fe7 --- /dev/null +++ b/ccm-cms-assets-imagestep/sql/ccm-cms-assets-imagestep/upgrade/oracle-se-6.2.0-6.2.1.sql @@ -0,0 +1,23 @@ +-- +-- Copyright (C) 2005 Runtime Collective Ltd. All Rights Reserved. +-- +-- This library is free software; you can redistribute it and/or +-- modify it under the terms of the GNU Lesser General Public License +-- as published by the Free Software Foundation; either version 2.1 of +-- the License, or (at your option) any later version. +-- +-- This library is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +-- Lesser General Public License for more details. +-- +-- You should have received a copy of the GNU Lesser General Public +-- License along with this library; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-- +-- $Id: alter-table-authoring_steps.sql 285 2005-02-22 00:29:02Z sskracic $ +-- $DateTime: 2004/08/17 23:15:09 $ + +PROMPT ImageStep 6.2.0 -> 6.2.1 Upgrade Script (Oracle) + +@@ ../oracle-se/upgrade/6.2.0-6.2.1/alter-table-cms_item_image_attachment.sql diff --git a/ccm-cms-assets-imagestep/sql/ccm-cms-assets-imagestep/upgrade/oracle-se-6.5.0-6.5.1.sql b/ccm-cms-assets-imagestep/sql/ccm-cms-assets-imagestep/upgrade/oracle-se-6.5.0-6.5.1.sql new file mode 100644 index 000000000..a8e45dfa5 --- /dev/null +++ b/ccm-cms-assets-imagestep/sql/ccm-cms-assets-imagestep/upgrade/oracle-se-6.5.0-6.5.1.sql @@ -0,0 +1,4 @@ + +PROMPT ImageStep 6.5.0 -> 6.5.1 Upgrade Script (Oracle) + +@@ ../oracle-se/upgrade/6.5.0-6.5.1/add_link_column.sql diff --git a/ccm-cms-assets-imagestep/sql/ccm-cms-assets-imagestep/upgrade/postgres-1.0.0-2.0.0.sql b/ccm-cms-assets-imagestep/sql/ccm-cms-assets-imagestep/upgrade/postgres-1.0.0-2.0.0.sql new file mode 100755 index 000000000..c34ee8ac4 --- /dev/null +++ b/ccm-cms-assets-imagestep/sql/ccm-cms-assets-imagestep/upgrade/postgres-1.0.0-2.0.0.sql @@ -0,0 +1,53 @@ + +update acs_objects set +object_type = 'com.arsdigita.cms.ReusableImageAsset', +default_domain_class = 'com.arsdigita.cms.ReusableImageAsset' +where object_type = 'com.arsdigita.cms.contenttypes.AttachableImage'; + +drop table cms_attachable_images; + + + + +@@ ../ddl/postgres/table-cms_item_image_attachment-auto.sql +alter table cms_item_image_attachment add + constraint cms_ite_ima_att_att_id_f_ahq60 foreign key (attachment_id) + references acs_objects(object_id); +alter table cms_item_image_attachment add + constraint cms_ite_ima_att_ima_id_f_kz3mi foreign key (image_id) + references cms_images(image_id); +alter table cms_item_image_attachment add + constraint cms_ite_ima_att_ite_id_f_wg1gi foreign key (item_id) + references cms_items(item_id); + + +insert into cms_item_image_attachment +(use_context, caption, image_id, item_id, attachment_id) +select '', map.caption, map.image_id, map.article_id, map.map_id +from cms_article_image_map map; + +delete from cms_article_image_map; + + +delete from cms_items +where item_id in ( + select object_id from acs_objects + where object_type = 'com.arsdigita.cms.ArticleImageAssociation' ); + +delete from cms_published_links +where pending_source in ( + select object_id from acs_objects + where object_type = 'com.arsdigita.cms.ArticleImageAssociation' ); + +update inits +set class_name = 'com.arsdigita.cms.ItemImageAttachmentInitializer' +where class_name = 'com.arsdigita.cms.AttachableImageInitializer'; + +update acs_objects set +object_type = 'com.arsdigita.cms.contenttypes.ItemImageAttachment', +default_domain_class = 'com.arsdigita.cms.contenttypes.ItemImageAttachment' +where object_type = 'com.arsdigita.cms.ArticleImageAssociation'; + +update authoring_steps +set label_key = 'com.arsdigita.cms.image_step_label', label_bundle = 'com.arsdigita.cms.ImageStepResources', description_key = 'com.arsdigita.cms.image_step_description', description_bundle = 'com.arsdigita.cms.ImageStepResources', component = 'com.arsdigita.cms.contenttypes.ui.ImageStep' +where component = 'com.arsdigita.cms.ui.authoring.ArticleImage'; diff --git a/ccm-cms-assets-imagestep/sql/ccm-cms-assets-imagestep/upgrade/postgres-6.2.0-6.2.1.sql b/ccm-cms-assets-imagestep/sql/ccm-cms-assets-imagestep/upgrade/postgres-6.2.0-6.2.1.sql new file mode 100755 index 000000000..6c09d39e5 --- /dev/null +++ b/ccm-cms-assets-imagestep/sql/ccm-cms-assets-imagestep/upgrade/postgres-6.2.0-6.2.1.sql @@ -0,0 +1,27 @@ +-- +-- Copyright (C) 2005 Runtime Collective Ltd. All Rights Reserved. +-- +-- This library is free software; you can redistribute it and/or +-- modify it under the terms of the GNU Lesser General Public License +-- as published by the Free Software Foundation; either version 2.1 of +-- the License, or (at your option) any later version. +-- +-- This library is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +-- Lesser General Public License for more details. +-- +-- You should have received a copy of the GNU Lesser General Public +-- License along with this library; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-- +-- $Id: alter-table-authoring_steps.sql 285 2005-02-22 00:29:02Z sskracic $ +-- $DateTime: 2004/08/17 23:15:09 $ + +\echo ImageStep 6.2.0 -> 6.2.1 Upgrade Script (PostgreSQL) + +begin; + +\i ../postgres/upgrade/6.2.0-6.2.1/alter-table-cms_item_image_attachment.sql + +commit; diff --git a/ccm-cms-assets-imagestep/sql/ccm-cms-assets-imagestep/upgrade/postgres-6.5.0-6.5.1.sql b/ccm-cms-assets-imagestep/sql/ccm-cms-assets-imagestep/upgrade/postgres-6.5.0-6.5.1.sql new file mode 100644 index 000000000..bff18b237 --- /dev/null +++ b/ccm-cms-assets-imagestep/sql/ccm-cms-assets-imagestep/upgrade/postgres-6.5.0-6.5.1.sql @@ -0,0 +1,7 @@ +\echo ImageStep 6.5.0 -> 6.5.1 Upgrade Script (PostgreSQL) + +begin; + +\i ../postgres/upgrade/6.5.0-6.5.1/add_link_column.sql + +commit; diff --git a/ccm-cms-assets-imagestep/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contentassets/ItemImageAttachment.xml b/ccm-cms-assets-imagestep/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contentassets/ItemImageAttachment.xml new file mode 100755 index 000000000..1f7ec32eb --- /dev/null +++ b/ccm-cms-assets-imagestep/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contentassets/ItemImageAttachment.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ccm-cms-assets-imagestep/src/ccm-cms-assets-imagestep.config b/ccm-cms-assets-imagestep/src/ccm-cms-assets-imagestep.config new file mode 100755 index 000000000..2b8f1bc8f --- /dev/null +++ b/ccm-cms-assets-imagestep/src/ccm-cms-assets-imagestep.config @@ -0,0 +1,7 @@ + + + + + + diff --git a/ccm-cms-assets-imagestep/src/ccm-cms-assets-imagestep.load b/ccm-cms-assets-imagestep/src/ccm-cms-assets-imagestep.load new file mode 100755 index 000000000..5a50c0fb6 --- /dev/null +++ b/ccm-cms-assets-imagestep/src/ccm-cms-assets-imagestep.load @@ -0,0 +1,12 @@ + + + + + +
+ + + + + + diff --git a/ccm-cms-assets-imagestep/src/ccm-cms-assets-imagestep.upgrade b/ccm-cms-assets-imagestep/src/ccm-cms-assets-imagestep.upgrade new file mode 100755 index 000000000..c2272b611 --- /dev/null +++ b/ccm-cms-assets-imagestep/src/ccm-cms-assets-imagestep.upgrade @@ -0,0 +1,11 @@ + + +