- Verschiedene Formatierungen
- Bug im ldn-importer gefixt - SimpleDomainObjectTraversalAdapter um remove-Methoden erweitert git-svn-id: https://svn.libreccm.org/ccm/trunk@597 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
db9baf50d5
commit
478a66f4b9
|
|
@ -69,6 +69,7 @@ public class ContentItemTraversalAdapter
|
||||||
* to the asset's adapter, otherwise delegates to
|
* to the asset's adapter, otherwise delegates to
|
||||||
* the content item's primary adapter
|
* the content item's primary adapter
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean processProperty(DomainObject obj,
|
public boolean processProperty(DomainObject obj,
|
||||||
String path,
|
String path,
|
||||||
Property prop,
|
Property prop,
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.cms.dispatcher;
|
package com.arsdigita.cms.dispatcher;
|
||||||
|
|
||||||
|
|
||||||
import com.arsdigita.bebop.PageState;
|
import com.arsdigita.bebop.PageState;
|
||||||
import com.arsdigita.cms.CMS;
|
import com.arsdigita.cms.CMS;
|
||||||
import com.arsdigita.cms.ContentItem;
|
import com.arsdigita.cms.ContentItem;
|
||||||
|
|
@ -45,7 +44,6 @@ import org.apache.log4j.Logger;
|
||||||
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>The default <tt>XMLGenerator</tt> implementation.</p>
|
* <p>The default <tt>XMLGenerator</tt> implementation.</p>
|
||||||
*
|
*
|
||||||
|
|
@ -56,25 +54,25 @@ import java.util.Iterator;
|
||||||
public class SimpleXMLGenerator implements XMLGenerator {
|
public class SimpleXMLGenerator implements XMLGenerator {
|
||||||
|
|
||||||
private static Logger s_log =
|
private static Logger s_log =
|
||||||
Logger.getLogger(SimpleXMLGenerator.class);
|
Logger.getLogger(SimpleXMLGenerator.class);
|
||||||
|
public static final String ADAPTER_CONTEXT = SimpleXMLGenerator.class.
|
||||||
public static final String ADAPTER_CONTEXT = SimpleXMLGenerator.class.getName();
|
getName();
|
||||||
|
|
||||||
// Register general purpose adaptor for all content items
|
// Register general purpose adaptor for all content items
|
||||||
static {
|
static {
|
||||||
SimpleDomainObjectTraversalAdapter adapter =
|
SimpleDomainObjectTraversalAdapter adapter =
|
||||||
new SimpleDomainObjectTraversalAdapter();
|
new SimpleDomainObjectTraversalAdapter();
|
||||||
adapter.addAssociationProperty("/object/type");
|
adapter.addAssociationProperty("/object/type");
|
||||||
adapter.addAssociationProperty("/object/categories");
|
adapter.addAssociationProperty("/object/categories");
|
||||||
|
|
||||||
DomainObjectTraversal.registerAdapter(
|
DomainObjectTraversal.registerAdapter(
|
||||||
ContentItem.BASE_DATA_OBJECT_TYPE,
|
ContentItem.BASE_DATA_OBJECT_TYPE,
|
||||||
adapter,
|
adapter,
|
||||||
ADAPTER_CONTEXT
|
ADAPTER_CONTEXT);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public SimpleXMLGenerator() {}
|
public SimpleXMLGenerator() {
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates the XML to render the content panel.
|
* Generates the XML to render the content panel.
|
||||||
|
|
@ -91,50 +89,54 @@ public class SimpleXMLGenerator implements XMLGenerator {
|
||||||
s_log.info("Generate XML for item " + item.getOID());
|
s_log.info("Generate XML for item " + item.getOID());
|
||||||
|
|
||||||
|
|
||||||
Party currentParty = Kernel.getContext().getParty();
|
Party currentParty = Kernel.getContext().getParty();
|
||||||
if (currentParty == null) {
|
if (currentParty == null) {
|
||||||
currentParty = Kernel.getPublicUser();
|
currentParty = Kernel.getPublicUser();
|
||||||
}
|
}
|
||||||
// check if current user can edit the current item (nb privilege is granted on draft item, but live item
|
// check if current user can edit the current item (nb privilege is granted on draft item, but live item
|
||||||
// has draft as its permission context
|
// has draft as its permission context
|
||||||
//
|
//
|
||||||
// Note that the xml that is generated is only of use if you DO NOT CACHE content pages.
|
// Note that the xml that is generated is only of use if you DO NOT CACHE content pages.
|
||||||
// cg.
|
// cg.
|
||||||
|
|
||||||
PermissionDescriptor edit = new PermissionDescriptor(PrivilegeDescriptor.get(SecurityManager.CMS_EDIT_ITEM), item, currentParty);
|
PermissionDescriptor edit = new PermissionDescriptor(PrivilegeDescriptor.
|
||||||
if (PermissionService.checkPermission(edit)) {
|
get(SecurityManager.CMS_EDIT_ITEM), item, currentParty);
|
||||||
parent.addAttribute("canEdit", "true");
|
if (PermissionService.checkPermission(edit)) {
|
||||||
}
|
parent.addAttribute("canEdit", "true");
|
||||||
PermissionDescriptor publish = new PermissionDescriptor(PrivilegeDescriptor.get(SecurityManager.CMS_PUBLISH), item, currentParty);
|
}
|
||||||
if (PermissionService.checkPermission(publish)) {
|
PermissionDescriptor publish = new PermissionDescriptor(PrivilegeDescriptor.
|
||||||
parent.addAttribute("canPublish", "true");
|
get(SecurityManager.CMS_PUBLISH), item, currentParty);
|
||||||
}
|
if (PermissionService.checkPermission(publish)) {
|
||||||
|
parent.addAttribute("canPublish", "true");
|
||||||
|
}
|
||||||
String className = item.getDefaultDomainClass();
|
String className = item.getDefaultDomainClass();
|
||||||
|
|
||||||
// Ensure correct subtype of ContentItem is instantiated
|
// Ensure correct subtype of ContentItem is instantiated
|
||||||
if (!item.getClass().getName().equals(className)) {
|
if (!item.getClass().getName().equals(className)) {
|
||||||
s_log.info("Specializing item");
|
s_log.info("Specializing item");
|
||||||
try {
|
try {
|
||||||
item = (ContentItem)DomainObjectFactory
|
item = (ContentItem) DomainObjectFactory.newInstance(new OID(item.
|
||||||
.newInstance(new OID(item.getObjectType().getQualifiedName(),
|
getObjectType().getQualifiedName(),
|
||||||
item.getID()));
|
item.
|
||||||
|
getID()));
|
||||||
} catch (DataObjectNotFoundException ex) {
|
} catch (DataObjectNotFoundException ex) {
|
||||||
throw new UncheckedWrapperException(
|
throw new UncheckedWrapperException(
|
||||||
(String)GlobalizationUtil.globalize(
|
(String) GlobalizationUtil.globalize(
|
||||||
"cms.dispatcher.cannot_find_domain_object"
|
"cms.dispatcher.cannot_find_domain_object").localize(),
|
||||||
).localize(), ex);
|
ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Implementing XMLGenerator directly is now deprecated
|
// Implementing XMLGenerator directly is now deprecated
|
||||||
if ( item instanceof XMLGenerator) {
|
if (item instanceof XMLGenerator) {
|
||||||
s_log.info("Item implements XMLGenerator interface");
|
s_log.info("Item implements XMLGenerator interface");
|
||||||
XMLGenerator xitem = (XMLGenerator)item;
|
XMLGenerator xitem = (XMLGenerator) item;
|
||||||
xitem.generateXML(state, parent, useContext);
|
xitem.generateXML(state, parent, useContext);
|
||||||
|
|
||||||
} else if (className.equals("com.arsdigita.cms.UserDefinedContentItem")) {
|
} else if (className.equals(
|
||||||
|
"com.arsdigita.cms.UserDefinedContentItem")) {
|
||||||
s_log.info("Item is a user defined content item");
|
s_log.info("Item is a user defined content item");
|
||||||
UserDefinedContentItem UDItem = (UserDefinedContentItem)item;
|
UserDefinedContentItem UDItem = (UserDefinedContentItem) item;
|
||||||
generateUDItemXML(UDItem, state, parent, useContext);
|
generateUDItemXML(UDItem, state, parent, useContext);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -144,7 +146,7 @@ public class SimpleXMLGenerator implements XMLGenerator {
|
||||||
Element content = startElement(useContext);
|
Element content = startElement(useContext);
|
||||||
|
|
||||||
ContentItemXMLRenderer renderer =
|
ContentItemXMLRenderer renderer =
|
||||||
new ContentItemXMLRenderer(content);
|
new ContentItemXMLRenderer(content);
|
||||||
|
|
||||||
renderer.setWrapAttributes(true);
|
renderer.setWrapAttributes(true);
|
||||||
renderer.setWrapRoot(false);
|
renderer.setWrapRoot(false);
|
||||||
|
|
@ -157,7 +159,6 @@ public class SimpleXMLGenerator implements XMLGenerator {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetches the current content item. This method can be overidden to
|
* Fetches the current content item. This method can be overidden to
|
||||||
* fetch any {@link com.arsdigita.cms.ContentItem}, but by default,
|
* fetch any {@link com.arsdigita.cms.ContentItem}, but by default,
|
||||||
|
|
@ -191,10 +192,9 @@ public class SimpleXMLGenerator implements XMLGenerator {
|
||||||
element.addAttribute("javaClass", UDItem.getContentType().getClassName());
|
element.addAttribute("javaClass", UDItem.getContentType().getClassName());
|
||||||
|
|
||||||
DynamicObjectType dot = new DynamicObjectType(
|
DynamicObjectType dot = new DynamicObjectType(
|
||||||
UDItem.getSpecificObjectType()
|
UDItem.getSpecificObjectType());
|
||||||
);
|
Iterator declaredProperties =
|
||||||
Iterator declaredProperties = dot.getObjectType()
|
dot.getObjectType().getDeclaredProperties();
|
||||||
.getDeclaredProperties();
|
|
||||||
Property currentProperty = null;
|
Property currentProperty = null;
|
||||||
Object value = null;
|
Object value = null;
|
||||||
while (declaredProperties.hasNext()) {
|
while (declaredProperties.hasNext()) {
|
||||||
|
|
@ -202,12 +202,12 @@ public class SimpleXMLGenerator implements XMLGenerator {
|
||||||
value = (Object) UDItem.get(currentProperty.getName());
|
value = (Object) UDItem.get(currentProperty.getName());
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
element.addContent(
|
element.addContent(
|
||||||
UDItemAttrElement(currentProperty.getName(),
|
UDItemAttrElement(currentProperty.getName(),
|
||||||
value.toString()));
|
value.toString()));
|
||||||
} else {
|
} else {
|
||||||
element.addContent(
|
element.addContent(
|
||||||
UDItemAttrElement(currentProperty.getName(),
|
UDItemAttrElement(currentProperty.getName(),
|
||||||
"none specified"));
|
"none specified"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -216,11 +216,9 @@ public class SimpleXMLGenerator implements XMLGenerator {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private Element startElement(String useContext) {
|
private Element startElement(String useContext) {
|
||||||
Element element = new Element("cms:item", CMS.CMS_XML_NS);
|
Element element = new Element("cms:item", CMS.CMS_XML_NS);
|
||||||
if ( useContext != null ) {
|
if (useContext != null) {
|
||||||
element.addAttribute("useContext", useContext);
|
element.addAttribute("useContext", useContext);
|
||||||
}
|
}
|
||||||
return element;
|
return element;
|
||||||
|
|
@ -229,10 +227,10 @@ public class SimpleXMLGenerator implements XMLGenerator {
|
||||||
private Element UDItemElement(String useContext) {
|
private Element UDItemElement(String useContext) {
|
||||||
Element element = new Element("cms:UDItemAttributes", CMS.CMS_XML_NS);
|
Element element = new Element("cms:UDItemAttributes", CMS.CMS_XML_NS);
|
||||||
/*
|
/*
|
||||||
if ( useContext != null ) {
|
if ( useContext != null ) {
|
||||||
element.addAttribute("useContext", useContext);
|
element.addAttribute("useContext", useContext);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
return element;
|
return element;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -242,5 +240,4 @@ public class SimpleXMLGenerator implements XMLGenerator {
|
||||||
element.addAttribute("UDItemAttrValue", value);
|
element.addAttribute("UDItemAttrValue", value);
|
||||||
return element;
|
return element;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,33 +37,36 @@ import org.apache.log4j.Logger;
|
||||||
public class ContentPageMetadataProvider extends ContentItemMetadataProvider {
|
public class ContentPageMetadataProvider extends ContentItemMetadataProvider {
|
||||||
|
|
||||||
public static final String ADAPTER_CONTEXT =
|
public static final String ADAPTER_CONTEXT =
|
||||||
ContentPageMetadataProvider.class.getName();
|
ContentPageMetadataProvider.class.getName();
|
||||||
|
|
||||||
private static final Logger s_log =
|
private static final Logger s_log =
|
||||||
Logger.getLogger(ContentPageMetadataProvider.class);
|
Logger.getLogger(
|
||||||
|
ContentPageMetadataProvider.class);
|
||||||
|
|
||||||
public String getTitle(DomainObject dobj) {
|
public String getTitle(DomainObject dobj) {
|
||||||
if (dobj instanceof ContentPage) {
|
if (dobj instanceof ContentPage) {
|
||||||
ContentPage item = (ContentPage)dobj;
|
ContentPage item = (ContentPage) dobj;
|
||||||
String title = item.getTitle();
|
s_log.debug(String.format("getting title of item with oid '%s'",
|
||||||
if (StringUtils.emptyString(title)) {
|
item.getOID().toString()));
|
||||||
throw new IllegalArgumentException(
|
s_log.debug(String.format("and name '%s'", item.getName()));
|
||||||
"ContentPage must have non-blank title!"
|
s_log.debug(String.format("and title '%s'", item.getTitle()));
|
||||||
);
|
String title = item.getTitle();
|
||||||
}
|
if (StringUtils.emptyString(title)) {
|
||||||
return title;
|
throw new IllegalArgumentException(
|
||||||
|
"ContentPage must have non-blank title!");
|
||||||
|
}
|
||||||
|
return title;
|
||||||
} else {
|
} else {
|
||||||
// this is not pretty,
|
// this is not pretty,
|
||||||
// but fails more gracefully for items which are not contentpages
|
// but fails more gracefully for items which are not contentpages
|
||||||
s_log.warn("Item is not a ContentPage.");
|
s_log.warn("Item is not a ContentPage.");
|
||||||
return "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
|
return "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSummary(DomainObject dobj) {
|
public String getSummary(DomainObject dobj) {
|
||||||
if (dobj instanceof ContentPage) {
|
if (dobj instanceof ContentPage) {
|
||||||
ContentPage item = (ContentPage)dobj;
|
ContentPage item = (ContentPage) dobj;
|
||||||
return item.getSearchSummary();
|
return item.getSearchSummary();
|
||||||
} else {
|
} else {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
@ -72,11 +75,11 @@ public class ContentPageMetadataProvider extends ContentItemMetadataProvider {
|
||||||
public String getContentSection(DomainObject dobj) {
|
public String getContentSection(DomainObject dobj) {
|
||||||
String sectionName = "";
|
String sectionName = "";
|
||||||
if (dobj instanceof ContentPage) {
|
if (dobj instanceof ContentPage) {
|
||||||
ContentPage item = (ContentPage)dobj;
|
ContentPage item = (ContentPage) dobj;
|
||||||
ContentSection section = item.getContentSection();
|
ContentSection section = item.getContentSection();
|
||||||
if (section != null) {
|
if (section != null) {
|
||||||
sectionName = section.getName();
|
sectionName = section.getName();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return sectionName;
|
return sectionName;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -104,21 +104,39 @@ public class SimpleDomainObjectTraversalAdapter
|
||||||
/**
|
/**
|
||||||
* Add a property to the attribute property set.
|
* Add a property to the attribute property set.
|
||||||
*
|
*
|
||||||
* @param path the full path to the property
|
* @param prop the full path to the property
|
||||||
*/
|
*/
|
||||||
public void addAttributeProperty(String prop) {
|
public void addAttributeProperty(String prop) {
|
||||||
m_attr.add(prop);
|
m_attr.add(prop);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes a property from the attribute property set.
|
||||||
|
*
|
||||||
|
* @param prop full path of the property to remove
|
||||||
|
*/
|
||||||
|
public void removeAttributeProperty(String prop) {
|
||||||
|
m_attr.remove(prop);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a property to the association property set.
|
* Add a property to the association property set.
|
||||||
*
|
*
|
||||||
* @param path the full path to the property
|
* @param prop the full path to the property
|
||||||
*/
|
*/
|
||||||
public void addAssociationProperty(String prop) {
|
public void addAssociationProperty(String prop) {
|
||||||
m_assoc.add(prop);
|
m_assoc.add(prop);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes a association property from the association property set.
|
||||||
|
*
|
||||||
|
* @param prop full path of the property to remove
|
||||||
|
*/
|
||||||
|
public void removeAssociationProperty(String prop) {
|
||||||
|
m_assoc.remove(prop);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determines whether or not to allow processing
|
* Determines whether or not to allow processing
|
||||||
* of a property, based on the property set and
|
* of a property, based on the property set and
|
||||||
|
|
|
||||||
|
|
@ -59,32 +59,28 @@ public class OID {
|
||||||
|
|
||||||
private ObjectType m_type;
|
private ObjectType m_type;
|
||||||
private Map m_values = new HashMap();
|
private Map m_values = new HashMap();
|
||||||
|
|
||||||
/** some shorthand names for common content-types */
|
/** some shorthand names for common content-types */
|
||||||
private final static String[][] TYPE_SHORTHAND = {
|
private final static String[][] TYPE_SHORTHAND = {
|
||||||
{"Article", "com.arsdigita.cms.contenttypes.Article"},
|
{"Article", "com.arsdigita.cms.contenttypes.Article"},
|
||||||
{"MultiPartArticle", "com.arsdigita.cms.contenttypes.MultiPartArticle"},
|
{"MultiPartArticle", "com.arsdigita.cms.contenttypes.MultiPartArticle"},
|
||||||
{"PressRelease", "com.arsdigita.cms.contenttypes.PressRelease"},
|
{"PressRelease", "com.arsdigita.cms.contenttypes.PressRelease"},
|
||||||
{"NewsItem", "com.arsdigita.cms.contenttypes.NewsItem"},
|
{"NewsItem", "com.arsdigita.cms.contenttypes.NewsItem"},
|
||||||
{"Bookmark", "com.arsdigita.cms.contenttypes.Bookmark"},
|
{"Bookmark", "com.arsdigita.cms.contenttypes.Bookmark"},
|
||||||
{"ESDService", "com.arsdigita.cms.contenttypes.ESDService"},
|
{"ESDService", "com.arsdigita.cms.contenttypes.ESDService"},
|
||||||
{"SiteProxy", "com.arsdigita.cms.contenttypes.SiteProxy"},
|
{"SiteProxy", "com.arsdigita.cms.contenttypes.SiteProxy"},
|
||||||
{"RelatedLink", "com.arsdigita.cms.contentassets.RelatedLink"},
|
{"RelatedLink", "com.arsdigita.cms.contentassets.RelatedLink"},
|
||||||
{"FileAttachment", "com.arsdigita.cms.contentassets.FileAttachment"},
|
{"FileAttachment", "com.arsdigita.cms.contentassets.FileAttachment"},
|
||||||
{"Category", "com.arsdigita.categorization.Category"},
|
{"Category", "com.arsdigita.categorization.Category"},};
|
||||||
};
|
|
||||||
|
|
||||||
/** the separator character to be used in the new OID formatting scheme */
|
/** the separator character to be used in the new OID formatting scheme */
|
||||||
private final static char OID_SEPARATOR_CHAR = '-';
|
private final static char OID_SEPARATOR_CHAR = '-';
|
||||||
|
|
||||||
/** A Format used for formatting/parsing OIDs */
|
/** A Format used for formatting/parsing OIDs */
|
||||||
private static MessageFormat m_format_old = new MessageFormat("[{0}:{1}]");
|
private static MessageFormat m_format_old = new MessageFormat("[{0}:{1}]");
|
||||||
private static MessageFormat m_format_new = new MessageFormat("{0}" + OID_SEPARATOR_CHAR + "{1}");
|
private static MessageFormat m_format_new = new MessageFormat("{0}"
|
||||||
|
+ OID_SEPARATOR_CHAR
|
||||||
|
+ "{1}");
|
||||||
/** used to log errors */
|
/** used to log errors */
|
||||||
private static final Logger m_log = Logger.getLogger(OID.class);
|
private static final Logger m_log = Logger.getLogger(OID.class);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an OID for the Object type. An example of an object
|
* Creates an OID for the Object type. An example of an object
|
||||||
* type would be "com.arsdigita.kernel.ACSObject." Using this
|
* type would be "com.arsdigita.kernel.ACSObject." Using this
|
||||||
|
|
@ -148,8 +144,7 @@ public class OID {
|
||||||
|
|
||||||
if (it.hasNext()) {
|
if (it.hasNext()) {
|
||||||
throw new PersistenceException(
|
throw new PersistenceException(
|
||||||
"This object type has a compound key."
|
"This object type has a compound key.");
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
String attr = prop.getName();
|
String attr = prop.getName();
|
||||||
|
|
@ -165,14 +160,13 @@ public class OID {
|
||||||
*/
|
*/
|
||||||
private static final ObjectType lookup(String typeName) {
|
private static final ObjectType lookup(String typeName) {
|
||||||
ObjectType type =
|
ObjectType type =
|
||||||
MetadataRoot.getMetadataRoot().getObjectType(typeName);
|
MetadataRoot.getMetadataRoot().getObjectType(typeName);
|
||||||
if (type == null) {
|
if (type == null) {
|
||||||
throw new PersistenceException("No such type " + typeName);
|
throw new PersistenceException("No such type " + typeName);
|
||||||
}
|
}
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an OID for the named ObjectType. The typename of the
|
* Creates an OID for the named ObjectType. The typename of the
|
||||||
* ObjectType must be defined in the MetadataRoot. An example
|
* ObjectType must be defined in the MetadataRoot. An example
|
||||||
|
|
@ -197,7 +191,6 @@ public class OID {
|
||||||
this(lookup(typeName));
|
this(lookup(typeName));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an OID with a single attribute for the key. To create a
|
* Creates an OID with a single attribute for the key. To create a
|
||||||
* multi-valued OID, use a single arg OID constructor, and add
|
* multi-valued OID, use a single arg OID constructor, and add
|
||||||
|
|
@ -229,7 +222,6 @@ public class OID {
|
||||||
this(lookup(typeName), value);
|
this(lookup(typeName), value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an OID with a single attribute for the key. To create a
|
* Creates an OID with a single attribute for the key. To create a
|
||||||
* multi-valued OID, use a single arg OID constructor, and add
|
* multi-valued OID, use a single arg OID constructor, and add
|
||||||
|
|
@ -258,7 +250,6 @@ public class OID {
|
||||||
this(typeName, new BigDecimal(value));
|
this(typeName, new BigDecimal(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an OID with a single attribute for the key. To create a
|
* Creates an OID with a single attribute for the key. To create a
|
||||||
* multi-valued OID, use a single arg OID constructor, and add
|
* multi-valued OID, use a single arg OID constructor, and add
|
||||||
|
|
@ -300,9 +291,8 @@ public class OID {
|
||||||
// We do some type-checking here, to ensure that OIDs are being
|
// We do some type-checking here, to ensure that OIDs are being
|
||||||
// created with legit types of values.
|
// created with legit types of values.
|
||||||
if (prop == null) {
|
if (prop == null) {
|
||||||
throw new PersistenceException
|
throw new PersistenceException("no such property: " + propertyName
|
||||||
("no such property: " + propertyName
|
+ " for type " + m_type.getName());
|
||||||
+ " for type " + m_type.getName());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// null has no type
|
// null has no type
|
||||||
|
|
@ -310,12 +300,12 @@ public class OID {
|
||||||
if (prop.isAttribute() && value != null) {
|
if (prop.isAttribute() && value != null) {
|
||||||
// we can be sure this is a simpletype because
|
// we can be sure this is a simpletype because
|
||||||
// isAttribute was true.
|
// isAttribute was true.
|
||||||
SimpleType expectedType = (SimpleType)prop.getType();
|
SimpleType expectedType = (SimpleType) prop.getType();
|
||||||
if (!expectedType.getJavaClass()
|
if (!expectedType.getJavaClass().isAssignableFrom(value.getClass())) {
|
||||||
.isAssignableFrom(value.getClass())) {
|
throw new PersistenceException("expected " + expectedType.
|
||||||
throw new PersistenceException
|
getJavaClass()
|
||||||
("expected " + expectedType.getJavaClass()
|
+ "actual type "
|
||||||
+ "actual type " + value.getClass());
|
+ value.getClass());
|
||||||
}
|
}
|
||||||
} else if (value != null) {
|
} else if (value != null) {
|
||||||
if (value instanceof DataObject) {
|
if (value instanceof DataObject) {
|
||||||
|
|
@ -323,15 +313,15 @@ public class OID {
|
||||||
DataObject dobj = (DataObject) value;
|
DataObject dobj = (DataObject) value;
|
||||||
ObjectType.verifySubtype(ot, dobj.getObjectType());
|
ObjectType.verifySubtype(ot, dobj.getObjectType());
|
||||||
} else {
|
} else {
|
||||||
throw new PersistenceException
|
throw new PersistenceException("expected DataObject for property "
|
||||||
("expected DataObject for property " + propertyName
|
+ propertyName
|
||||||
+ " but got " + value.getClass());
|
+ " but got " + value.getClass());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasProperty(propertyName)) {
|
if (hasProperty(propertyName)) {
|
||||||
throw new PersistenceException
|
throw new PersistenceException(propertyName + " is already set to " + get(
|
||||||
(propertyName + " is already set to " + get(propertyName));
|
propertyName));
|
||||||
}
|
}
|
||||||
|
|
||||||
m_values.put(propertyName, value);
|
m_values.put(propertyName, value);
|
||||||
|
|
@ -365,7 +355,7 @@ public class OID {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isInitialized() {
|
public boolean isInitialized() {
|
||||||
for (Iterator it = m_type.getKeyProperties(); it.hasNext(); ) {
|
for (Iterator it = m_type.getKeyProperties(); it.hasNext();) {
|
||||||
if (!m_values.containsKey(((Property) it.next()).getName())) {
|
if (!m_values.containsKey(((Property) it.next()).getName())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -405,7 +395,6 @@ public class OID {
|
||||||
return getObjectType();
|
return getObjectType();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The ObjectType.
|
* @return The ObjectType.
|
||||||
**/
|
**/
|
||||||
|
|
@ -418,7 +407,6 @@ public class OID {
|
||||||
m_type = subtype;
|
m_type = subtype;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Serializes the OID.
|
* Serializes the OID.
|
||||||
*/
|
*/
|
||||||
|
|
@ -426,60 +414,60 @@ public class OID {
|
||||||
String fullType = m_type.getQualifiedName();
|
String fullType = m_type.getQualifiedName();
|
||||||
Map props = getProperties();
|
Map props = getProperties();
|
||||||
StringBuffer sb = new StringBuffer();
|
StringBuffer sb = new StringBuffer();
|
||||||
for(Iterator it = props.keySet().iterator(); it.hasNext(); ) {
|
for (Iterator it = props.keySet().iterator(); it.hasNext();) {
|
||||||
Object key = it.next();
|
Object key = it.next();
|
||||||
Object value = props.get(key);
|
Object value = props.get(key);
|
||||||
/*if ((key == null) || (value == null)) {
|
/*if ((key == null) || (value == null)) {
|
||||||
m_log.warn("key or value in OID.toString() are null");
|
m_log.warn("key or value in OID.toString() are null");
|
||||||
m_log.warn(String.format("key = %s", key));
|
m_log.warn(String.format("key = %s", key));
|
||||||
m_log.warn(String.format("value = %s", value));
|
m_log.warn(String.format("value = %s", value));
|
||||||
}*/
|
}*/
|
||||||
/*
|
/*
|
||||||
* Changed by Jens Pelzetter 2010-09-14. For unknown reasons
|
* Changed by Jens Pelzetter 2010-09-14. For unknown reasons
|
||||||
* the value is null for some properties, which causes
|
* the value is null for some properties, which causes
|
||||||
* a NPE in the line below the if.
|
* a NPE in the line below the if.
|
||||||
*/
|
*/
|
||||||
if (null == value) {
|
if (null == value) {
|
||||||
m_log.info(String.format("The value for prop \"%s\" " +
|
m_log.info(String.format("The value for prop \"%s\" "
|
||||||
"is null. Ignoring.", key));
|
+ "is null. Ignoring.", key));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* Changed by Jens Pelzetter 2010-09-14.
|
* Changed by Jens Pelzetter 2010-09-14.
|
||||||
*
|
*
|
||||||
* The old method (see below) is very slow, because of this
|
* The old method (see below) is very slow, because of this
|
||||||
* has been changed.
|
* has been changed.
|
||||||
*/
|
*/
|
||||||
sb.append(key.toString());
|
sb.append(key.toString());
|
||||||
|
sb.append(OID_SEPARATOR_CHAR);
|
||||||
|
sb.append(value.toString());
|
||||||
|
//sb.append(key.toString() + OID_SEPARATOR_CHAR + value.toString());
|
||||||
|
if (it.hasNext()) {
|
||||||
sb.append(OID_SEPARATOR_CHAR);
|
sb.append(OID_SEPARATOR_CHAR);
|
||||||
sb.append(value.toString());
|
}
|
||||||
//sb.append(key.toString() + OID_SEPARATOR_CHAR + value.toString());
|
|
||||||
if (it.hasNext()) {
|
|
||||||
sb.append(OID_SEPARATOR_CHAR);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Object[] args = {convertTypeShorthand(fullType), sb.toString()};
|
Object[] args = {convertTypeShorthand(fullType), sb.toString()};
|
||||||
return m_format_new.format(args);
|
return m_format_new.format(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Parse the oid string. If it contains a left-square-bracket,
|
/** Parse the oid string. If it contains a left-square-bracket,
|
||||||
* use the old parsing scheme. Otherwise, use the new parser.
|
* use the old parsing scheme. Otherwise, use the new parser.
|
||||||
*/
|
*/
|
||||||
public static OID valueOf(String s) throws IllegalArgumentException {
|
public static OID valueOf(String s) throws IllegalArgumentException {
|
||||||
if (s.indexOf("[") >= 0 || s.indexOf("%5B") >= 0) {
|
if (s.indexOf("[") >= 0 || s.indexOf("%5B") >= 0) {
|
||||||
return valueOfOld(s);
|
return valueOfOld(s);
|
||||||
} else {
|
} else {
|
||||||
return valueOfNew(s);
|
return valueOfNew(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** new way to parse the OID string */
|
/** new way to parse the OID string */
|
||||||
public static OID valueOfNew(String s) throws IllegalArgumentException {
|
public static OID valueOfNew(String s) throws IllegalArgumentException {
|
||||||
StringTokenizer st = new StringTokenizer(s, "" + OID_SEPARATOR_CHAR);
|
StringTokenizer st = new StringTokenizer(s, "" + OID_SEPARATOR_CHAR);
|
||||||
if (st.countTokens() < 2) {
|
if (st.countTokens() < 2) {
|
||||||
throw new IllegalArgumentException
|
throw new IllegalArgumentException(
|
||||||
("Invalid OID '" + s + "'. It must have at least the object type and the value");
|
"Invalid OID '" + s
|
||||||
|
+ "'. It must have at least the object type and the value");
|
||||||
// } else if (st.countTokens() % 2 != 1) {
|
// } else if (st.countTokens() % 2 != 1) {
|
||||||
// throw new IllegalArgumentException
|
// throw new IllegalArgumentException
|
||||||
// ("Invalid OID '" + s + "'. It must have type followed by name-value pairs");
|
// ("Invalid OID '" + s + "'. It must have type followed by name-value pairs");
|
||||||
|
|
@ -488,49 +476,50 @@ public class OID {
|
||||||
String type = convertTypeLonghand(st.nextToken());
|
String type = convertTypeLonghand(st.nextToken());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
OID oid = new OID(type);
|
OID oid = new OID(type);
|
||||||
|
|
||||||
if (st.hasMoreTokens()) {
|
if (st.hasMoreTokens()) {
|
||||||
String key = st.nextToken();
|
String key = st.nextToken();
|
||||||
String value = st.nextToken();
|
String value = st.nextToken();
|
||||||
while (st.hasMoreTokens()) {
|
while (st.hasMoreTokens()) {
|
||||||
value = value + OID_SEPARATOR_CHAR + st.nextToken();
|
value = value + OID_SEPARATOR_CHAR + st.nextToken();
|
||||||
}
|
}
|
||||||
|
|
||||||
// if it can be a BigDecimal, that is what we make it
|
// if it can be a BigDecimal, that is what we make it
|
||||||
boolean bigDecimal = true;
|
boolean bigDecimal = true;
|
||||||
for (int i = 0; i < value.length(); i++) {
|
for (int i = 0; i < value.length(); i++) {
|
||||||
char c = value.charAt(i);
|
char c = value.charAt(i);
|
||||||
if (!('0' <= c && c <= '9') && !((i == 0) && (c == '-'))) {
|
if (!('0' <= c && c <= '9') && !((i == 0) && (c == '-'))) {
|
||||||
bigDecimal = false;
|
bigDecimal = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bigDecimal) {
|
if (bigDecimal) {
|
||||||
oid.set(key, new BigDecimal(value));
|
oid.set(key, new BigDecimal(value));
|
||||||
} else {
|
} else {
|
||||||
oid.set(key, value);
|
oid.set(key, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return oid;
|
return oid;
|
||||||
} catch (PersistenceException e) {
|
} catch (PersistenceException e) {
|
||||||
throw new IllegalArgumentException
|
throw new IllegalArgumentException("Invalid OID '" + s
|
||||||
("Invalid OID '" + s + "'. The type specified [" + type +
|
+ "'. The type specified ["
|
||||||
"] is not defined");
|
+ type + "] is not defined");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Couldn't get MessageFormat to work, so I cheated
|
// Couldn't get MessageFormat to work, so I cheated
|
||||||
public static OID valueOfOld(String s) throws IllegalArgumentException {
|
public static OID valueOfOld(String s) throws IllegalArgumentException {
|
||||||
|
m_log.debug(String.format("Trying to parse OID '%s'...", s));
|
||||||
StringTokenizer st = new StringTokenizer(s, "[:{}],");
|
StringTokenizer st = new StringTokenizer(s, "[:{}],");
|
||||||
if (st.countTokens() < 2) {
|
if (st.countTokens() < 2) {
|
||||||
st = new StringTokenizer(java.net.URLDecoder.decode(s), "[:{}],");
|
st = new StringTokenizer(java.net.URLDecoder.decode(s), "[:{}],");
|
||||||
|
|
||||||
if (st.countTokens() < 2) {
|
if (st.countTokens() < 2) {
|
||||||
throw new IllegalArgumentException
|
throw new IllegalArgumentException("Invalid OID '" + s
|
||||||
("Invalid OID '" + s + "'. It must have at least the object " +
|
+ "'. It must have at least the object "
|
||||||
"type and the value");
|
+ "type and the value");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -547,6 +536,15 @@ public class OID {
|
||||||
while (st.hasMoreTokens()) {
|
while (st.hasMoreTokens()) {
|
||||||
String nextToken = st.nextToken();
|
String nextToken = st.nextToken();
|
||||||
int index = nextToken.indexOf("=");
|
int index = nextToken.indexOf("=");
|
||||||
|
/**
|
||||||
|
* jensp 2010-11-03: If next token is an empty string, or there
|
||||||
|
* no '=', throw an exeception.
|
||||||
|
*/
|
||||||
|
if ((nextToken.length() < 1) || (index < 0)) {
|
||||||
|
throw new IllegalArgumentException("Invalid OID '" + s
|
||||||
|
+ "'. It must have at least the object "
|
||||||
|
+ "type and the value");
|
||||||
|
}
|
||||||
String key = (nextToken.substring(0, index));
|
String key = (nextToken.substring(0, index));
|
||||||
String value = nextToken.substring(index + 1);
|
String value = nextToken.substring(index + 1);
|
||||||
|
|
||||||
|
|
@ -561,8 +559,7 @@ public class OID {
|
||||||
boolean bigDecimal = true;
|
boolean bigDecimal = true;
|
||||||
for (int i = 0; i < value.length(); i++) {
|
for (int i = 0; i < value.length(); i++) {
|
||||||
char c = value.charAt(i);
|
char c = value.charAt(i);
|
||||||
if (!('0' <= c && c <= '9') &&
|
if (!('0' <= c && c <= '9') && !((i == 0) && (c == '-'))) {
|
||||||
!((i == 0) && (c == '-'))) {
|
|
||||||
bigDecimal = false;
|
bigDecimal = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -577,9 +574,9 @@ public class OID {
|
||||||
}
|
}
|
||||||
return oid;
|
return oid;
|
||||||
} catch (PersistenceException e) {
|
} catch (PersistenceException e) {
|
||||||
throw new IllegalArgumentException
|
throw new IllegalArgumentException("Invalid OID '" + s
|
||||||
("Invalid OID '" + s + "'. The type specified [" + type +
|
+ "'. The type specified ["
|
||||||
"] is not defined");
|
+ type + "] is not defined");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -591,11 +588,11 @@ public class OID {
|
||||||
* for an example). */
|
* for an example). */
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if (obj instanceof OID) {
|
if (obj instanceof OID) {
|
||||||
OID oid = (OID)obj;
|
OID oid = (OID) obj;
|
||||||
// we rely on the toString ecause the HashMap.equals does not
|
// we rely on the toString ecause the HashMap.equals does not
|
||||||
// give us what we need
|
// give us what we need
|
||||||
return m_type.getBasetype().equals(oid.m_type.getBasetype()) &&
|
return m_type.getBasetype().equals(oid.m_type.getBasetype()) && m_values.
|
||||||
m_values.equals(oid.m_values);
|
equals(oid.m_values);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -613,21 +610,21 @@ public class OID {
|
||||||
|
|
||||||
/** create shorthand names for some common types */
|
/** create shorthand names for some common types */
|
||||||
private static String convertTypeShorthand(String name) {
|
private static String convertTypeShorthand(String name) {
|
||||||
for (int i=0; i<TYPE_SHORTHAND.length; ++i) {
|
for (int i = 0; i < TYPE_SHORTHAND.length; ++i) {
|
||||||
if (name.equals(TYPE_SHORTHAND[i][1])) {
|
if (name.equals(TYPE_SHORTHAND[i][1])) {
|
||||||
return TYPE_SHORTHAND[i][0];
|
return TYPE_SHORTHAND[i][0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** create longhand name for some common types */
|
/** create longhand name for some common types */
|
||||||
private static String convertTypeLonghand(String name) {
|
private static String convertTypeLonghand(String name) {
|
||||||
for (int i=0; i<TYPE_SHORTHAND.length; ++i) {
|
for (int i = 0; i < TYPE_SHORTHAND.length; ++i) {
|
||||||
if (name.equals(TYPE_SHORTHAND[i][0])) {
|
if (name.equals(TYPE_SHORTHAND[i][0])) {
|
||||||
return TYPE_SHORTHAND[i][1];
|
return TYPE_SHORTHAND[i][1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -61,3 +61,5 @@ log4j.logger.com.arsdigita.packaging.Loader=INFO
|
||||||
# For debugging all queries run by persistence
|
# For debugging all queries run by persistence
|
||||||
#log4j.logger.com.redhat.persistence.engine.rdbms.RDBMSEngine=INFO
|
#log4j.logger.com.redhat.persistence.engine.rdbms.RDBMSEngine=INFO
|
||||||
|
|
||||||
|
log4j.logger.com.arsdigita.cms.search.ContentPageMetadataProvider=DEBUG
|
||||||
|
log4j.logger.com.arsdigita.london.importer=DEBUG
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ import org.apache.log4j.Logger;
|
||||||
|
|
||||||
import com.arsdigita.cms.ContentBundle;
|
import com.arsdigita.cms.ContentBundle;
|
||||||
import com.arsdigita.cms.ContentItem;
|
import com.arsdigita.cms.ContentItem;
|
||||||
|
import com.arsdigita.cms.ContentPage;
|
||||||
import com.arsdigita.cms.ContentSection;
|
import com.arsdigita.cms.ContentSection;
|
||||||
import com.arsdigita.cms.Folder;
|
import com.arsdigita.cms.Folder;
|
||||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||||
|
|
@ -152,6 +153,17 @@ public class ItemImportTool extends Program {
|
||||||
|
|
||||||
ContentItem item =
|
ContentItem item =
|
||||||
(ContentItem) itemParser.getDomainObject();
|
(ContentItem) itemParser.getDomainObject();
|
||||||
|
if (item == null) {
|
||||||
|
s_log.warn("item is null.Igoring...");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
s_log.debug(String.format("Got item from ItemParser:"));
|
||||||
|
s_log.debug(String.format("OID : %s", item.getOID()));
|
||||||
|
s_log.debug(String.format("Name : %s", item.getName()));
|
||||||
|
s_log.debug(String.format("Title: %s", item.get("title")));
|
||||||
|
if (item instanceof ContentPage) {
|
||||||
|
s_log.debug("Item is a content page...");
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
* Multi lang extension begin
|
* Multi lang extension begin
|
||||||
*/
|
*/
|
||||||
|
|
@ -160,8 +172,15 @@ public class ItemImportTool extends Program {
|
||||||
if (itemName.lastIndexOf('-') == -1) {
|
if (itemName.lastIndexOf('-') == -1) {
|
||||||
bundleName = itemName;
|
bundleName = itemName;
|
||||||
} else {
|
} else {
|
||||||
bundleName = itemName.substring(0, itemName.
|
if (itemName.substring((itemName.lastIndexOf('-') + 1)).
|
||||||
lastIndexOf('-'));
|
equals("de")
|
||||||
|
|| itemName.substring((itemName.lastIndexOf('-') + 1)).
|
||||||
|
equals("en")) {
|
||||||
|
bundleName = itemName.substring(0, itemName.
|
||||||
|
lastIndexOf('-'));
|
||||||
|
} else {
|
||||||
|
bundleName = itemName;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* Multi lang extension end
|
* Multi lang extension end
|
||||||
|
|
@ -177,19 +196,25 @@ public class ItemImportTool extends Program {
|
||||||
* Multi lang extension start
|
* Multi lang extension start
|
||||||
*/
|
*/
|
||||||
ContentBundle bundle;
|
ContentBundle bundle;
|
||||||
|
s_log.debug(String.format("Bundle name: %s",
|
||||||
|
bundleName));
|
||||||
if (itemName.lastIndexOf('-') == -1) {
|
if (itemName.lastIndexOf('-') == -1) {
|
||||||
|
s_log.debug("Item is not localized...");
|
||||||
bundle = new ContentBundle(item);
|
bundle = new ContentBundle(item);
|
||||||
bundle.setParent(folder);
|
bundle.setParent(folder);
|
||||||
bundle.setName(bundleName);
|
bundle.setName(bundleName);
|
||||||
bundles.put(bundleName, bundle);
|
bundles.put(bundleName, bundle);
|
||||||
} else {
|
} else {
|
||||||
|
s_log.debug("Item is localized...");
|
||||||
bundle = bundles.get(bundleName);
|
bundle = bundles.get(bundleName);
|
||||||
if (bundle == null) {
|
if (bundle == null) {
|
||||||
|
s_log.debug("No content bundle found for item, creating new.");
|
||||||
bundle = new ContentBundle(item);
|
bundle = new ContentBundle(item);
|
||||||
bundle.setParent(folder);
|
bundle.setParent(folder);
|
||||||
bundle.setName(bundleName);
|
bundle.setName(bundleName);
|
||||||
bundles.put(bundleName, bundle);
|
bundles.put(bundleName, bundle);
|
||||||
} else {
|
} else {
|
||||||
|
s_log.debug("Found content bundle for item, adding item as instance.");
|
||||||
bundle.addInstance(item);
|
bundle.addInstance(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,20 @@
|
||||||
<xrd:associations rule="include">
|
<xrd:associations rule="include">
|
||||||
<xrd:property name="/object/addendum"/>
|
<xrd:property name="/object/addendum"/>
|
||||||
<xrd:property name="/object/contacts"/>
|
<xrd:property name="/object/contacts"/>
|
||||||
<xrd:property name="/object/orgaunit_children"/>
|
<xrd:property name="/object/contacts/person"/>
|
||||||
|
<xrd:property name="/object/contacts/address"/>
|
||||||
|
<xrd:property name="/object/contacts/contactentries"/>
|
||||||
|
<xrd:property name="/object/subDepartments"/>
|
||||||
|
<xrd:property name="/object/subDepartments/projects"/>
|
||||||
|
<xrd:property name="/object/subDepartments/contacts"/>
|
||||||
|
<xrd:property name="/object/subDepartments/contacts/address"/>
|
||||||
|
<xrd:property name="/object/subDepartments/contacts/contactentries"/>
|
||||||
|
<xrd:property name="/object/projects"/>
|
||||||
|
<xrd:property name="/object/projects/persons"/>
|
||||||
<xrd:property name="/object/persons"/>
|
<xrd:property name="/object/persons"/>
|
||||||
|
<xrd:property name="/object/persons/contacts"/>
|
||||||
|
<xrd:property name="/object/persons/contacts/address"/>
|
||||||
|
<xrd:property name="/object/persons/contacts/contactentries"/>
|
||||||
</xrd:associations>
|
</xrd:associations>
|
||||||
</xrd:adapter>
|
</xrd:adapter>
|
||||||
</xrd:context>
|
</xrd:context>
|
||||||
|
|
|
||||||
|
|
@ -16,12 +16,17 @@
|
||||||
<xrd:property name="/object/contacts/person"/>
|
<xrd:property name="/object/contacts/person"/>
|
||||||
<xrd:property name="/object/contacts/address"/>
|
<xrd:property name="/object/contacts/address"/>
|
||||||
<xrd:property name="/object/contacts/contactentries"/>
|
<xrd:property name="/object/contacts/contactentries"/>
|
||||||
<xrd:property name="/object/contacts/person"/>
|
|
||||||
<xrd:property name="/object/departments"/>
|
<xrd:property name="/object/departments"/>
|
||||||
<xrd:property name="/object/departments/persons"/>
|
<xrd:property name="/object/departments/persons"/>
|
||||||
|
<xrd:property name="/object/departments/persons/contacts"/>
|
||||||
|
<xrd:property name="/object/departments/persons/contacts/address"/>
|
||||||
|
<xrd:property name="/object/departments/persons/contacts/contactentries"/>
|
||||||
<xrd:property name="/object/projects"/>
|
<xrd:property name="/object/projects"/>
|
||||||
<xrd:property name="/object/projects/persons"/>
|
<xrd:property name="/object/projects/persons"/>
|
||||||
<xrd:property name="/object/persons"/>
|
<xrd:property name="/object/persons"/>
|
||||||
|
<xrd:property name="/object/persons/contacts"/>
|
||||||
|
<xrd:property name="/object/persons/contacts/address"/>
|
||||||
|
<xrd:property name="/object/persons/contacts/contactentries"/>
|
||||||
</xrd:associations>
|
</xrd:associations>
|
||||||
</xrd:adapter>
|
</xrd:adapter>
|
||||||
</xrd:context>
|
</xrd:context>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue