From ce727c4078d801d7c29bf2392ec24e546d43f114 Mon Sep 17 00:00:00 2001 From: pb Date: Tue, 25 Jan 2011 00:10:35 +0000 Subject: [PATCH] =?UTF-8?q?Typo=20fixed,=20trunk=20compiliert=20wieder.=20?= =?UTF-8?q?Release=20Nummern=20erh=C3=B6ht.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.libreccm.org/ccm/trunk@711 8810af33-2d31-482b-a856-94f89814c4df --- ccm-cms-types-agenda/application.xml | 2 +- ccm-cms-types-event/application.xml | 2 +- ccm-cms-types-newsitem/application.xml | 2 +- .../arsdigita/content-section/ContentType.pdl | 16 ++--- .../content-section/table-content_types.sql | 31 ++++---- .../6.6.0-6.6.1/upd_table_content_types.sql | 2 +- .../src/com/arsdigita/cms/ContentSection.java | 2 +- .../src/com/arsdigita/cms/ContentType.java | 72 ++++++++++--------- .../installer/xml/ContentTypeHelperImpl.java | 8 +-- .../cms/ui/ItemSearchFolderBrowser.java | 2 +- .../ui/search/ContentTypeFilterWidget.java | 4 +- 11 files changed, 71 insertions(+), 72 deletions(-) diff --git a/ccm-cms-types-agenda/application.xml b/ccm-cms-types-agenda/application.xml index ab20d1a23..136d66165 100755 --- a/ccm-cms-types-agenda/application.xml +++ b/ccm-cms-types-agenda/application.xml @@ -3,7 +3,7 @@ name="ccm-cms-types-agenda" prettyName="Red Hat CCM Content Types" version="6.6.0" - release="1" + release="2" webapp="ROOT"> diff --git a/ccm-cms-types-event/application.xml b/ccm-cms-types-event/application.xml index d1ca90278..bc1b27337 100755 --- a/ccm-cms-types-event/application.xml +++ b/ccm-cms-types-event/application.xml @@ -3,7 +3,7 @@ name="ccm-cms-types-event" prettyName="Red Hat CCM Content Types" version="6.6.0" - release="1" + release="2" webapp="ROOT"> diff --git a/ccm-cms-types-newsitem/application.xml b/ccm-cms-types-newsitem/application.xml index 33cb62e68..7450a1257 100755 --- a/ccm-cms-types-newsitem/application.xml +++ b/ccm-cms-types-newsitem/application.xml @@ -3,7 +3,7 @@ name="ccm-cms-types-newsitem" prettyName="Red Hat CCM Content Types" version="6.6.0" - release="1" + release="2" webapp="ROOT"> diff --git a/ccm-cms/pdl/com/arsdigita/content-section/ContentType.pdl b/ccm-cms/pdl/com/arsdigita/content-section/ContentType.pdl index 52b5f96e7..57d423188 100755 --- a/ccm-cms/pdl/com/arsdigita/content-section/ContentType.pdl +++ b/ccm-cms/pdl/com/arsdigita/content-section/ContentType.pdl @@ -27,10 +27,10 @@ object type ContentType extends ACSObject { String[1..1] label = content_types.label VARCHAR(1000); String[0..1] description = content_types.description VARCHAR(4000); String[0..1] className = content_types.classname VARCHAR(200); - // Quasimodo: Store the information about ancenstors and decendants, so we + // Quasimodo: Store the information about ancenstors and descendants, so we // can make use of extending content types String[0..1] ancestors = content_types.ancestors VARCHAR(2000); - String[0..1] decendants = content_types.decendants VARCHAR(2000); + String[0..1] descendants = content_types.descendants VARCHAR(2000); String[1..1] mode = content_types.mode CHAR(1); BigDecimal[0..1] itemFormID = content_types.item_form_id INTEGER; @@ -64,7 +64,7 @@ association { do { select t.type_id, t.object_type, t.label, t.description, t.classname, - t.ancestors, t.decendats, t.mode, t.item_form_id + t.ancestors, t.descendants, t.mode, t.item_form_id from content_types t, content_section_type_map m, authoring_kits a where @@ -79,7 +79,7 @@ association { creatableContentTypes.description = t.description; creatableContentTypes.className = t.classname; creatableContentTypes.ancestors = t.ancestors; - creatableContentTypes.decendats = t.decendats; + creatableContentTypes.descendants = t.descendants; creatableContentTypes.mode = t.mode; creatableContentTypes.itemFormID = t.item_form_id; } @@ -112,7 +112,7 @@ association { do { select t.type_id, t.object_type, t.label, t.description, t.classname, - t.ancestors, t.decendats, t.mode, t.item_form_id + t.ancestors, t.descendants, t.mode, t.item_form_id from content_types t where @@ -127,7 +127,7 @@ association { notAssociatedContentTypes.description = t.description; notAssociatedContentTypes.className = t.classname; notAssociatedContentTypes.ancestors = t.ancestors; - notAssociatedContentTypes.decendats = t.decendats; + notAssociatedContentTypes.descendants = t.descendants; notAssociatedContentTypes.mode = t.mode; notAssociatedContentTypes.itemFormID = t.item_form_id; } @@ -156,7 +156,7 @@ query registeredContentTypes { do { select t.type_id, t.object_type, t.label, - t.description, t.classname, t.ancestors, t.decendats, + t.description, t.classname, t.ancestors, t.descendants, t.mode, t.item_form_id from content_types t where t.mode != 'I' @@ -169,7 +169,7 @@ query registeredContentTypes { type.description = t.description; type.className = t.classname; type.ancestors = t.ancestors; - type.decendats = t.decendats; + type.descendants = t.descendants; type.mode = t.mode; type.itemFormID = t.item_form_id; } diff --git a/ccm-cms/sql/ccm-cms/default/content-section/table-content_types.sql b/ccm-cms/sql/ccm-cms/default/content-section/table-content_types.sql index 209fe1ecc..feb577843 100755 --- a/ccm-cms/sql/ccm-cms/default/content-section/table-content_types.sql +++ b/ccm-cms/sql/ccm-cms/default/content-section/table-content_types.sql @@ -19,22 +19,19 @@ -- $DateTime: 2004/08/17 23:15:09 $ create table content_types ( - type_id integer - constraint content_types_type_id_fk references - acs_objects - constraint content_types_pk primary key, - object_type varchar(100) - constraint content_types_object_type_un unique - constraint content_types_object_type_nil not null, - label varchar(1000) not null, - description varchar(4000), - classname varchar(200), - ancestors varchar(2000), - decendats varchar(2000), - mode char(1) default '' not null - constraint content_types_mode_ck + type_id integer constraint content_types_type_id_fk + references acs_objects + constraint content_types_pk primary key, + object_type varchar(100) constraint content_types_object_type_un unique + constraint content_types_object_type_nil not null, + label varchar(1000) not null, + description varchar(4000), + classname varchar(200), + ancestors varchar(2000), + descendants varchar(2000), + mode char(1) default '' not null + constraint content_types_mode_ck check ( mode in ('D', 'H', 'I') ), - item_form_id integer - constraint content_types_form_id_fk references - bebop_components (component_id) + item_form_id integer constraint content_types_form_id_fk + references bebop_components (component_id) ); diff --git a/ccm-cms/sql/ccm-cms/default/upgrade/6.6.0-6.6.1/upd_table_content_types.sql b/ccm-cms/sql/ccm-cms/default/upgrade/6.6.0-6.6.1/upd_table_content_types.sql index 962753339..cf83a38b6 100644 --- a/ccm-cms/sql/ccm-cms/default/upgrade/6.6.0-6.6.1/upd_table_content_types.sql +++ b/ccm-cms/sql/ccm-cms/default/upgrade/6.6.0-6.6.1/upd_table_content_types.sql @@ -20,7 +20,7 @@ alter table content_types alter table content_types add column ancestors character varying(2000), - add column decendants character varying(2000) ; + add column descendants character varying(2000) ; update content_types diff --git a/ccm-cms/src/com/arsdigita/cms/ContentSection.java b/ccm-cms/src/com/arsdigita/cms/ContentSection.java index 9a1846e38..7cc184b38 100755 --- a/ccm-cms/src/com/arsdigita/cms/ContentSection.java +++ b/ccm-cms/src/com/arsdigita/cms/ContentSection.java @@ -793,7 +793,7 @@ public class ContentSection extends Application { // Or must be a decendant of the requested type try { - StringTokenizer strTok = new StringTokenizer(ct.getDecendants(), "/"); + StringTokenizer strTok = new StringTokenizer(ct.getDescendants(), "/"); while (strTok.hasMoreElements()) { or.addFilter(ff.equals(ContentType.ID, (String) strTok.nextElement())); } diff --git a/ccm-cms/src/com/arsdigita/cms/ContentType.java b/ccm-cms/src/com/arsdigita/cms/ContentType.java index 8251b7b9e..fa22491d7 100755 --- a/ccm-cms/src/com/arsdigita/cms/ContentType.java +++ b/ccm-cms/src/com/arsdigita/cms/ContentType.java @@ -70,7 +70,7 @@ public class ContentType extends ACSObject { public static final String ITEM_FORM_ID = "itemFormID"; public static final String ITEM_FORM = "itemForm"; public static final String ANCESTORS = "ancestors"; - public static final String DECENDANTS = "decendats"; + public static final String DESCENDANTS = "descendants"; /** * Default constructor. This creates a new folder. @@ -343,11 +343,11 @@ public class ContentType extends ACSObject { } /** - * Add an ancestor to the list of decendats, if not already in the list + * Add an ancestor to the list of descendants, if not already in the list * @param newAncestor ID of the ancestor to add */ public void addAncestor(BigDecimal newAncestor) { - // Get the list of decendats from db + // Get the list of descendants from db String ancestors = (String) get(ANCESTORS); // Only add if the newAncestor in not yet in the list @@ -368,11 +368,11 @@ public class ContentType extends ACSObject { } /** - * Remove an ancestor id from the list of decendats + * Remove an ancestor id from the list of descendants * @param ancestor ID to be removed */ public void delAncestor(BigDecimal ancestor) { - // Get the list of decendats from db + // Get the list of descendants from db String ancestors = (String) get(ANCESTORS); // Only try to remove from a non-empty string @@ -403,71 +403,73 @@ public class ContentType extends ACSObject { } /** - * Add a decendant to the list of decendats, if not already in list - * @param newDecendant ID of the decendant to add + * Add a descendant to the list of descendants, if not already in list + * @param newDescendant ID of the descendant to add */ - public void addDecendants(BigDecimal newDecendant) { + public void addDescendants(BigDecimal newDescendant) { - // Get the list of decendats from db - String decendats = (String) get(DECENDANTS); + // Get the list of descendants from db + String descendants = (String) get(DESCENDANTS); - // Only add if the newDecendant in not yet in the list - if (decendats == null) { - decendats = newDecendant.toString(); - } else if (!decendats.contains(newDecendant.toString())) { + // Only add if the newDescendant in not yet in the list + if (descendants == null) { + descendants = newDescendant.toString(); + } else if (!descendants.contains(newDescendant.toString())) { - if (decendats.length() == 0) { + if (descendants.length() == 0) { // First entry in list - decendats = newDecendant.toString(); + descendants = newDescendant.toString(); } else { // Additional entry in the list - decendats += "/" + newDecendant.toString(); + descendants += "/" + newDescendant.toString(); } } // Write new data back to db - set(DECENDANTS, decendats); + set(DESCENDANTS, descendants); } /** - * Get the list of decendats + * Get the list of descendants * @return */ - public String getDecendants() { - return (String) get(DECENDANTS); + public String getDescendants() { + return (String) get(DESCENDANTS); } /** - * Remove a decendant from the list of decendats - * @param decendant ID to be removed + * Remove a descendant from the list of descendants + * @param descendant ID to be removed */ - public void delDecendants(BigDecimal decendant) { - // Get the list of decendats from db - String decendats = (String) get(DECENDANTS); + public void delDescendants(BigDecimal descendant) { + // Get the list of descendants from db + String descendants = (String) get(DESCENDANTS); // Only try to remove from a non-empty string - if (decendats != null && decendats.length() > 0) { + if (descendants != null && descendants.length() > 0) { // Remove ancestor ID from list - decendats.replace(decendant.toString(), ""); + descendants.replace(descendant.toString(), ""); // Delete the additional slash - decendats.replace("//", "/"); + descendants.replace("//", "/"); // If the list only contains a single slash, // we have just removed the last list entry, so the list is empty - if (decendats.equals("/")) { - decendats = ""; + if (descendants.equals("/")) { + descendants = ""; } } // Write new data back to db - set(DECENDANTS, decendats); + set(DESCENDANTS, descendants); } ////////////////////////////////////// // // Fetching/Finding content types. // + ////////////////////////////////////// + /** * Find the content type with the associated with the object type. * @@ -558,7 +560,7 @@ public class ContentType extends ACSObject { return new ContentTypeCollection(dc); } - public static ContentTypeCollection getDecendantsOf(ContentType ct) { + public static ContentTypeCollection getDescendantsOf(ContentType ct) { ContentTypeCollection ctc = ContentType.getRegisteredContentTypes(); // The Filter Factory @@ -570,9 +572,9 @@ public class ContentType extends ACSObject { // The content type must be either of the requested type or.addFilter(ff.equals(ContentType.ID, ct.ID)); - // Or must be a decendant of the requested type + // Or must be a descendant of the requested type try { - StringTokenizer strTok = new StringTokenizer(ct.getDecendants(), "/"); + StringTokenizer strTok = new StringTokenizer(ct.getDescendants(), "/"); while (strTok.hasMoreElements()) { or.addFilter(ff.equals(ContentType.ID, (String) strTok.nextElement())); } diff --git a/ccm-cms/src/com/arsdigita/cms/installer/xml/ContentTypeHelperImpl.java b/ccm-cms/src/com/arsdigita/cms/installer/xml/ContentTypeHelperImpl.java index 384f486ef..bf5d7b1a6 100755 --- a/ccm-cms/src/com/arsdigita/cms/installer/xml/ContentTypeHelperImpl.java +++ b/ccm-cms/src/com/arsdigita/cms/installer/xml/ContentTypeHelperImpl.java @@ -357,14 +357,14 @@ public class ContentTypeHelperImpl implements ContentTypeHelper { // Add parent ancestors to this content types ancestor list // Also while we iterate through the list, we also need to add - // this content type as decendant to all entries in the ancestor list + // this content type as descendant to all entries in the ancestor list while (strTok.hasMoreElements()) { BigDecimal ctID = new BigDecimal(strTok.nextToken()); // Get the current content type try { ContentType ct = new ContentType(ctID); - ct.addDecendants(ctID); + ct.addDescendants(ctID); } catch (Exception ex) { // The db is broken. There is no content type for this ID } @@ -377,8 +377,8 @@ public class ContentTypeHelperImpl implements ContentTypeHelper { // Add parent to ancestor list type.addAncestor(parent.getID()); - // Add this to parent decendats - parent.addDecendants(type.getID()); + // Add this to parent descendants + parent.addDescendants(type.getID()); } } } diff --git a/ccm-cms/src/com/arsdigita/cms/ui/ItemSearchFolderBrowser.java b/ccm-cms/src/com/arsdigita/cms/ui/ItemSearchFolderBrowser.java index 29b6f89f1..50b26af82 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/ItemSearchFolderBrowser.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/ItemSearchFolderBrowser.java @@ -216,7 +216,7 @@ public class ItemSearchFolderBrowser extends Table { try { ContentType ct = new ContentType(singleTypeID); - StringTokenizer strTok = new StringTokenizer(ct.getDecendants(), "/"); + StringTokenizer strTok = new StringTokenizer(ct.getDescendants(), "/"); while (strTok.hasMoreElements()) { or.addFilter(ff.equals(ContentItem.CONTENT_TYPE + "." + ContentType.ID, (String) strTok.nextElement())); } diff --git a/ccm-cms/src/com/arsdigita/cms/ui/search/ContentTypeFilterWidget.java b/ccm-cms/src/com/arsdigita/cms/ui/search/ContentTypeFilterWidget.java index 7da8b4bed..1eb2209bd 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/search/ContentTypeFilterWidget.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/search/ContentTypeFilterWidget.java @@ -62,7 +62,7 @@ public class ContentTypeFilterWidget extends FilterWidget { } public ContentTypeFilterWidget(ContentType parentType) { - this(ContentType.getDecendantsOf(parentType)); + this(ContentType.getDescendantsOf(parentType)); m_parentType = parentType; } @@ -116,7 +116,7 @@ public class ContentTypeFilterWidget extends FilterWidget { if (parentType == null) { typesCollection = ContentType.getRegisteredContentTypes(); } else { - typesCollection = ContentType.getDecendantsOf(parentType); + typesCollection = ContentType.getDescendantsOf(parentType); } }