Typo fixed, trunk compiliert wieder. Release Nummern erhöht.
git-svn-id: https://svn.libreccm.org/ccm/trunk@711 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
3ecac2aff0
commit
ce727c4078
|
|
@ -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">
|
||||
<ccm:dependencies>
|
||||
<ccm:requires name="ccm-core" version="6.6.0" relation="ge"/>
|
||||
|
|
|
|||
|
|
@ -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">
|
||||
<ccm:dependencies>
|
||||
<ccm:requires name="ccm-core" version="6.6.0" relation="ge"/>
|
||||
|
|
|
|||
|
|
@ -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">
|
||||
<ccm:dependencies>
|
||||
<ccm:requires name="ccm-core" version="6.6.0" relation="ge"/>
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
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
|
||||
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),
|
||||
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)
|
||||
);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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()));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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()));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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()));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue