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"
|
name="ccm-cms-types-agenda"
|
||||||
prettyName="Red Hat CCM Content Types"
|
prettyName="Red Hat CCM Content Types"
|
||||||
version="6.6.0"
|
version="6.6.0"
|
||||||
release="1"
|
release="2"
|
||||||
webapp="ROOT">
|
webapp="ROOT">
|
||||||
<ccm:dependencies>
|
<ccm:dependencies>
|
||||||
<ccm:requires name="ccm-core" version="6.6.0" relation="ge"/>
|
<ccm:requires name="ccm-core" version="6.6.0" relation="ge"/>
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
name="ccm-cms-types-event"
|
name="ccm-cms-types-event"
|
||||||
prettyName="Red Hat CCM Content Types"
|
prettyName="Red Hat CCM Content Types"
|
||||||
version="6.6.0"
|
version="6.6.0"
|
||||||
release="1"
|
release="2"
|
||||||
webapp="ROOT">
|
webapp="ROOT">
|
||||||
<ccm:dependencies>
|
<ccm:dependencies>
|
||||||
<ccm:requires name="ccm-core" version="6.6.0" relation="ge"/>
|
<ccm:requires name="ccm-core" version="6.6.0" relation="ge"/>
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
name="ccm-cms-types-newsitem"
|
name="ccm-cms-types-newsitem"
|
||||||
prettyName="Red Hat CCM Content Types"
|
prettyName="Red Hat CCM Content Types"
|
||||||
version="6.6.0"
|
version="6.6.0"
|
||||||
release="1"
|
release="2"
|
||||||
webapp="ROOT">
|
webapp="ROOT">
|
||||||
<ccm:dependencies>
|
<ccm:dependencies>
|
||||||
<ccm:requires name="ccm-core" version="6.6.0" relation="ge"/>
|
<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[1..1] label = content_types.label VARCHAR(1000);
|
||||||
String[0..1] description = content_types.description VARCHAR(4000);
|
String[0..1] description = content_types.description VARCHAR(4000);
|
||||||
String[0..1] className = content_types.classname VARCHAR(200);
|
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
|
// can make use of extending content types
|
||||||
String[0..1] ancestors = content_types.ancestors VARCHAR(2000);
|
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);
|
String[1..1] mode = content_types.mode CHAR(1);
|
||||||
BigDecimal[0..1] itemFormID = content_types.item_form_id INTEGER;
|
BigDecimal[0..1] itemFormID = content_types.item_form_id INTEGER;
|
||||||
|
|
@ -64,7 +64,7 @@ association {
|
||||||
do {
|
do {
|
||||||
select
|
select
|
||||||
t.type_id, t.object_type, t.label, t.description, t.classname,
|
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
|
from
|
||||||
content_types t, content_section_type_map m, authoring_kits a
|
content_types t, content_section_type_map m, authoring_kits a
|
||||||
where
|
where
|
||||||
|
|
@ -79,7 +79,7 @@ association {
|
||||||
creatableContentTypes.description = t.description;
|
creatableContentTypes.description = t.description;
|
||||||
creatableContentTypes.className = t.classname;
|
creatableContentTypes.className = t.classname;
|
||||||
creatableContentTypes.ancestors = t.ancestors;
|
creatableContentTypes.ancestors = t.ancestors;
|
||||||
creatableContentTypes.decendats = t.decendats;
|
creatableContentTypes.descendants = t.descendants;
|
||||||
creatableContentTypes.mode = t.mode;
|
creatableContentTypes.mode = t.mode;
|
||||||
creatableContentTypes.itemFormID = t.item_form_id;
|
creatableContentTypes.itemFormID = t.item_form_id;
|
||||||
}
|
}
|
||||||
|
|
@ -112,7 +112,7 @@ association {
|
||||||
do {
|
do {
|
||||||
select
|
select
|
||||||
t.type_id, t.object_type, t.label, t.description, t.classname,
|
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
|
from
|
||||||
content_types t
|
content_types t
|
||||||
where
|
where
|
||||||
|
|
@ -127,7 +127,7 @@ association {
|
||||||
notAssociatedContentTypes.description = t.description;
|
notAssociatedContentTypes.description = t.description;
|
||||||
notAssociatedContentTypes.className = t.classname;
|
notAssociatedContentTypes.className = t.classname;
|
||||||
notAssociatedContentTypes.ancestors = t.ancestors;
|
notAssociatedContentTypes.ancestors = t.ancestors;
|
||||||
notAssociatedContentTypes.decendats = t.decendats;
|
notAssociatedContentTypes.descendants = t.descendants;
|
||||||
notAssociatedContentTypes.mode = t.mode;
|
notAssociatedContentTypes.mode = t.mode;
|
||||||
notAssociatedContentTypes.itemFormID = t.item_form_id;
|
notAssociatedContentTypes.itemFormID = t.item_form_id;
|
||||||
}
|
}
|
||||||
|
|
@ -156,7 +156,7 @@ query registeredContentTypes {
|
||||||
do {
|
do {
|
||||||
select
|
select
|
||||||
t.type_id, t.object_type, t.label,
|
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
|
t.mode, t.item_form_id
|
||||||
from content_types t
|
from content_types t
|
||||||
where t.mode != 'I'
|
where t.mode != 'I'
|
||||||
|
|
@ -169,7 +169,7 @@ query registeredContentTypes {
|
||||||
type.description = t.description;
|
type.description = t.description;
|
||||||
type.className = t.classname;
|
type.className = t.classname;
|
||||||
type.ancestors = t.ancestors;
|
type.ancestors = t.ancestors;
|
||||||
type.decendats = t.decendats;
|
type.descendants = t.descendants;
|
||||||
type.mode = t.mode;
|
type.mode = t.mode;
|
||||||
type.itemFormID = t.item_form_id;
|
type.itemFormID = t.item_form_id;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,22 +19,19 @@
|
||||||
-- $DateTime: 2004/08/17 23:15:09 $
|
-- $DateTime: 2004/08/17 23:15:09 $
|
||||||
|
|
||||||
create table content_types (
|
create table content_types (
|
||||||
type_id integer
|
type_id integer constraint content_types_type_id_fk
|
||||||
constraint content_types_type_id_fk references
|
references acs_objects
|
||||||
acs_objects
|
|
||||||
constraint content_types_pk primary key,
|
constraint content_types_pk primary key,
|
||||||
object_type varchar(100)
|
object_type varchar(100) constraint content_types_object_type_un unique
|
||||||
constraint content_types_object_type_un unique
|
|
||||||
constraint content_types_object_type_nil not null,
|
constraint content_types_object_type_nil not null,
|
||||||
label varchar(1000) not null,
|
label varchar(1000) not null,
|
||||||
description varchar(4000),
|
description varchar(4000),
|
||||||
classname varchar(200),
|
classname varchar(200),
|
||||||
ancestors varchar(2000),
|
ancestors varchar(2000),
|
||||||
decendats varchar(2000),
|
descendants varchar(2000),
|
||||||
mode char(1) default '' not null
|
mode char(1) default '' not null
|
||||||
constraint content_types_mode_ck
|
constraint content_types_mode_ck
|
||||||
check ( mode in ('D', 'H', 'I') ),
|
check ( mode in ('D', 'H', 'I') ),
|
||||||
item_form_id integer
|
item_form_id integer constraint content_types_form_id_fk
|
||||||
constraint content_types_form_id_fk references
|
references bebop_components (component_id)
|
||||||
bebop_components (component_id)
|
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ alter table content_types
|
||||||
|
|
||||||
alter table content_types
|
alter table content_types
|
||||||
add column ancestors character varying(2000),
|
add column ancestors character varying(2000),
|
||||||
add column decendants character varying(2000) ;
|
add column descendants character varying(2000) ;
|
||||||
|
|
||||||
|
|
||||||
update content_types
|
update content_types
|
||||||
|
|
|
||||||
|
|
@ -793,7 +793,7 @@ public class ContentSection extends Application {
|
||||||
|
|
||||||
// Or must be a decendant of the requested type
|
// Or must be a decendant of the requested type
|
||||||
try {
|
try {
|
||||||
StringTokenizer strTok = new StringTokenizer(ct.getDecendants(), "/");
|
StringTokenizer strTok = new StringTokenizer(ct.getDescendants(), "/");
|
||||||
while (strTok.hasMoreElements()) {
|
while (strTok.hasMoreElements()) {
|
||||||
or.addFilter(ff.equals(ContentType.ID, (String) strTok.nextElement()));
|
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_ID = "itemFormID";
|
||||||
public static final String ITEM_FORM = "itemForm";
|
public static final String ITEM_FORM = "itemForm";
|
||||||
public static final String ANCESTORS = "ancestors";
|
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.
|
* 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
|
* @param newAncestor ID of the ancestor to add
|
||||||
*/
|
*/
|
||||||
public void addAncestor(BigDecimal newAncestor) {
|
public void addAncestor(BigDecimal newAncestor) {
|
||||||
// Get the list of decendats from db
|
// Get the list of descendants from db
|
||||||
String ancestors = (String) get(ANCESTORS);
|
String ancestors = (String) get(ANCESTORS);
|
||||||
|
|
||||||
// Only add if the newAncestor in not yet in the list
|
// 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
|
* @param ancestor ID to be removed
|
||||||
*/
|
*/
|
||||||
public void delAncestor(BigDecimal ancestor) {
|
public void delAncestor(BigDecimal ancestor) {
|
||||||
// Get the list of decendats from db
|
// Get the list of descendants from db
|
||||||
String ancestors = (String) get(ANCESTORS);
|
String ancestors = (String) get(ANCESTORS);
|
||||||
|
|
||||||
// Only try to remove from a non-empty string
|
// 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
|
* Add a descendant to the list of descendants, if not already in list
|
||||||
* @param newDecendant ID of the decendant to add
|
* @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
|
// Get the list of descendants from db
|
||||||
String decendats = (String) get(DECENDANTS);
|
String descendants = (String) get(DESCENDANTS);
|
||||||
|
|
||||||
// Only add if the newDecendant in not yet in the list
|
// Only add if the newDescendant in not yet in the list
|
||||||
if (decendats == null) {
|
if (descendants == null) {
|
||||||
decendats = newDecendant.toString();
|
descendants = newDescendant.toString();
|
||||||
} else if (!decendats.contains(newDecendant.toString())) {
|
} else if (!descendants.contains(newDescendant.toString())) {
|
||||||
|
|
||||||
if (decendats.length() == 0) {
|
if (descendants.length() == 0) {
|
||||||
// First entry in list
|
// First entry in list
|
||||||
decendats = newDecendant.toString();
|
descendants = newDescendant.toString();
|
||||||
} else {
|
} else {
|
||||||
// Additional entry in the list
|
// Additional entry in the list
|
||||||
decendats += "/" + newDecendant.toString();
|
descendants += "/" + newDescendant.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write new data back to db
|
// Write new data back to db
|
||||||
set(DECENDANTS, decendats);
|
set(DESCENDANTS, descendants);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the list of decendats
|
* Get the list of descendants
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String getDecendants() {
|
public String getDescendants() {
|
||||||
return (String) get(DECENDANTS);
|
return (String) get(DESCENDANTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove a decendant from the list of decendats
|
* Remove a descendant from the list of descendants
|
||||||
* @param decendant ID to be removed
|
* @param descendant ID to be removed
|
||||||
*/
|
*/
|
||||||
public void delDecendants(BigDecimal decendant) {
|
public void delDescendants(BigDecimal descendant) {
|
||||||
// Get the list of decendats from db
|
// Get the list of descendants from db
|
||||||
String decendats = (String) get(DECENDANTS);
|
String descendants = (String) get(DESCENDANTS);
|
||||||
|
|
||||||
// Only try to remove from a non-empty string
|
// 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
|
// Remove ancestor ID from list
|
||||||
decendats.replace(decendant.toString(), "");
|
descendants.replace(descendant.toString(), "");
|
||||||
// Delete the additional slash
|
// Delete the additional slash
|
||||||
decendats.replace("//", "/");
|
descendants.replace("//", "/");
|
||||||
|
|
||||||
// If the list only contains a single slash,
|
// If the list only contains a single slash,
|
||||||
// we have just removed the last list entry, so the list is empty
|
// we have just removed the last list entry, so the list is empty
|
||||||
if (decendats.equals("/")) {
|
if (descendants.equals("/")) {
|
||||||
decendats = "";
|
descendants = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write new data back to db
|
// Write new data back to db
|
||||||
set(DECENDANTS, decendats);
|
set(DESCENDANTS, descendants);
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////
|
//////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Fetching/Finding content types.
|
// Fetching/Finding content types.
|
||||||
//
|
//
|
||||||
|
//////////////////////////////////////
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find the content type with the associated with the object type.
|
* Find the content type with the associated with the object type.
|
||||||
*
|
*
|
||||||
|
|
@ -558,7 +560,7 @@ public class ContentType extends ACSObject {
|
||||||
return new ContentTypeCollection(dc);
|
return new ContentTypeCollection(dc);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ContentTypeCollection getDecendantsOf(ContentType ct) {
|
public static ContentTypeCollection getDescendantsOf(ContentType ct) {
|
||||||
ContentTypeCollection ctc = ContentType.getRegisteredContentTypes();
|
ContentTypeCollection ctc = ContentType.getRegisteredContentTypes();
|
||||||
|
|
||||||
// The Filter Factory
|
// The Filter Factory
|
||||||
|
|
@ -570,9 +572,9 @@ public class ContentType extends ACSObject {
|
||||||
// The content type must be either of the requested type
|
// The content type must be either of the requested type
|
||||||
or.addFilter(ff.equals(ContentType.ID, ct.ID));
|
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 {
|
try {
|
||||||
StringTokenizer strTok = new StringTokenizer(ct.getDecendants(), "/");
|
StringTokenizer strTok = new StringTokenizer(ct.getDescendants(), "/");
|
||||||
while (strTok.hasMoreElements()) {
|
while (strTok.hasMoreElements()) {
|
||||||
or.addFilter(ff.equals(ContentType.ID, (String) strTok.nextElement()));
|
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
|
// Add parent ancestors to this content types ancestor list
|
||||||
// Also while we iterate through the list, we also need to add
|
// 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()) {
|
while (strTok.hasMoreElements()) {
|
||||||
BigDecimal ctID = new BigDecimal(strTok.nextToken());
|
BigDecimal ctID = new BigDecimal(strTok.nextToken());
|
||||||
|
|
||||||
// Get the current content type
|
// Get the current content type
|
||||||
try {
|
try {
|
||||||
ContentType ct = new ContentType(ctID);
|
ContentType ct = new ContentType(ctID);
|
||||||
ct.addDecendants(ctID);
|
ct.addDescendants(ctID);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
// The db is broken. There is no content type for this ID
|
// 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
|
// Add parent to ancestor list
|
||||||
type.addAncestor(parent.getID());
|
type.addAncestor(parent.getID());
|
||||||
|
|
||||||
// Add this to parent decendats
|
// Add this to parent descendants
|
||||||
parent.addDecendants(type.getID());
|
parent.addDescendants(type.getID());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -216,7 +216,7 @@ public class ItemSearchFolderBrowser extends Table {
|
||||||
try {
|
try {
|
||||||
ContentType ct = new ContentType(singleTypeID);
|
ContentType ct = new ContentType(singleTypeID);
|
||||||
|
|
||||||
StringTokenizer strTok = new StringTokenizer(ct.getDecendants(), "/");
|
StringTokenizer strTok = new StringTokenizer(ct.getDescendants(), "/");
|
||||||
while (strTok.hasMoreElements()) {
|
while (strTok.hasMoreElements()) {
|
||||||
or.addFilter(ff.equals(ContentItem.CONTENT_TYPE + "." + ContentType.ID, (String) strTok.nextElement()));
|
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) {
|
public ContentTypeFilterWidget(ContentType parentType) {
|
||||||
this(ContentType.getDecendantsOf(parentType));
|
this(ContentType.getDescendantsOf(parentType));
|
||||||
m_parentType = parentType;
|
m_parentType = parentType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -116,7 +116,7 @@ public class ContentTypeFilterWidget extends FilterWidget {
|
||||||
if (parentType == null) {
|
if (parentType == null) {
|
||||||
typesCollection = ContentType.getRegisteredContentTypes();
|
typesCollection = ContentType.getRegisteredContentTypes();
|
||||||
} else {
|
} else {
|
||||||
typesCollection = ContentType.getDecendantsOf(parentType);
|
typesCollection = ContentType.getDescendantsOf(parentType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue