diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ContentItemTraversalAdapter.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ContentItemTraversalAdapter.java index 73e76efc1..61cf0a849 100755 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ContentItemTraversalAdapter.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ContentItemTraversalAdapter.java @@ -69,6 +69,7 @@ public class ContentItemTraversalAdapter * to the asset's adapter, otherwise delegates to * the content item's primary adapter */ + @Override public boolean processProperty(DomainObject obj, String path, Property prop, diff --git a/ccm-cms/src/com/arsdigita/cms/dispatcher/SimpleXMLGenerator.java b/ccm-cms/src/com/arsdigita/cms/dispatcher/SimpleXMLGenerator.java index cbb75a117..ca12b77ce 100755 --- a/ccm-cms/src/com/arsdigita/cms/dispatcher/SimpleXMLGenerator.java +++ b/ccm-cms/src/com/arsdigita/cms/dispatcher/SimpleXMLGenerator.java @@ -18,7 +18,6 @@ */ package com.arsdigita.cms.dispatcher; - import com.arsdigita.bebop.PageState; import com.arsdigita.cms.CMS; import com.arsdigita.cms.ContentItem; @@ -45,7 +44,6 @@ import org.apache.log4j.Logger; import java.util.Iterator; - /** *

The default XMLGenerator implementation.

* @@ -56,25 +54,25 @@ import java.util.Iterator; public class SimpleXMLGenerator implements XMLGenerator { private static Logger s_log = - Logger.getLogger(SimpleXMLGenerator.class); - - public static final String ADAPTER_CONTEXT = SimpleXMLGenerator.class.getName(); + Logger.getLogger(SimpleXMLGenerator.class); + public static final String ADAPTER_CONTEXT = SimpleXMLGenerator.class. + getName(); // Register general purpose adaptor for all content items static { SimpleDomainObjectTraversalAdapter adapter = - new SimpleDomainObjectTraversalAdapter(); + new SimpleDomainObjectTraversalAdapter(); adapter.addAssociationProperty("/object/type"); adapter.addAssociationProperty("/object/categories"); DomainObjectTraversal.registerAdapter( - ContentItem.BASE_DATA_OBJECT_TYPE, - adapter, - ADAPTER_CONTEXT - ); + ContentItem.BASE_DATA_OBJECT_TYPE, + adapter, + ADAPTER_CONTEXT); } - public SimpleXMLGenerator() {} + public SimpleXMLGenerator() { + } /** * Generates the XML to render the content panel. @@ -90,61 +88,65 @@ public class SimpleXMLGenerator implements XMLGenerator { s_log.info("Generate XML for item " + item.getOID()); - - Party currentParty = Kernel.getContext().getParty(); - if (currentParty == null) { - currentParty = Kernel.getPublicUser(); - } - // 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 - // - // Note that the xml that is generated is only of use if you DO NOT CACHE content pages. - // cg. - PermissionDescriptor edit = new PermissionDescriptor(PrivilegeDescriptor.get(SecurityManager.CMS_EDIT_ITEM), item, currentParty); - if (PermissionService.checkPermission(edit)) { - parent.addAttribute("canEdit", "true"); - } - PermissionDescriptor publish = new PermissionDescriptor(PrivilegeDescriptor.get(SecurityManager.CMS_PUBLISH), item, currentParty); - if (PermissionService.checkPermission(publish)) { - parent.addAttribute("canPublish", "true"); - } + Party currentParty = Kernel.getContext().getParty(); + if (currentParty == null) { + currentParty = Kernel.getPublicUser(); + } + // 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 + // + // Note that the xml that is generated is only of use if you DO NOT CACHE content pages. + // cg. + + PermissionDescriptor edit = new PermissionDescriptor(PrivilegeDescriptor. + get(SecurityManager.CMS_EDIT_ITEM), item, currentParty); + if (PermissionService.checkPermission(edit)) { + parent.addAttribute("canEdit", "true"); + } + PermissionDescriptor publish = new PermissionDescriptor(PrivilegeDescriptor. + get(SecurityManager.CMS_PUBLISH), item, currentParty); + if (PermissionService.checkPermission(publish)) { + parent.addAttribute("canPublish", "true"); + } String className = item.getDefaultDomainClass(); // Ensure correct subtype of ContentItem is instantiated if (!item.getClass().getName().equals(className)) { s_log.info("Specializing item"); try { - item = (ContentItem)DomainObjectFactory - .newInstance(new OID(item.getObjectType().getQualifiedName(), - item.getID())); + item = (ContentItem) DomainObjectFactory.newInstance(new OID(item. + getObjectType().getQualifiedName(), + item. + getID())); } catch (DataObjectNotFoundException ex) { - throw new UncheckedWrapperException( - (String)GlobalizationUtil.globalize( - "cms.dispatcher.cannot_find_domain_object" - ).localize(), ex); + throw new UncheckedWrapperException( + (String) GlobalizationUtil.globalize( + "cms.dispatcher.cannot_find_domain_object").localize(), + ex); } } // Implementing XMLGenerator directly is now deprecated - if ( item instanceof XMLGenerator) { + if (item instanceof XMLGenerator) { s_log.info("Item implements XMLGenerator interface"); - XMLGenerator xitem = (XMLGenerator)item; + XMLGenerator xitem = (XMLGenerator) item; 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"); - UserDefinedContentItem UDItem = (UserDefinedContentItem)item; + UserDefinedContentItem UDItem = (UserDefinedContentItem) item; generateUDItemXML(UDItem, state, parent, useContext); } else { s_log.info("Item is using DomainObjectXMLRenderer"); - + // This is the preferred method Element content = startElement(useContext); ContentItemXMLRenderer renderer = - new ContentItemXMLRenderer(content); + new ContentItemXMLRenderer(content); renderer.setWrapAttributes(true); renderer.setWrapRoot(false); @@ -157,7 +159,6 @@ public class SimpleXMLGenerator implements XMLGenerator { } } - /** * Fetches the current content item. This method can be overidden to * 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()); DynamicObjectType dot = new DynamicObjectType( - UDItem.getSpecificObjectType() - ); - Iterator declaredProperties = dot.getObjectType() - .getDeclaredProperties(); + UDItem.getSpecificObjectType()); + Iterator declaredProperties = + dot.getObjectType().getDeclaredProperties(); Property currentProperty = null; Object value = null; while (declaredProperties.hasNext()) { @@ -202,12 +202,12 @@ public class SimpleXMLGenerator implements XMLGenerator { value = (Object) UDItem.get(currentProperty.getName()); if (value != null) { element.addContent( - UDItemAttrElement(currentProperty.getName(), - value.toString())); + UDItemAttrElement(currentProperty.getName(), + value.toString())); } else { element.addContent( - UDItemAttrElement(currentProperty.getName(), - "none specified")); + UDItemAttrElement(currentProperty.getName(), + "none specified")); } } @@ -216,11 +216,9 @@ public class SimpleXMLGenerator implements XMLGenerator { } - - private Element startElement(String useContext) { Element element = new Element("cms:item", CMS.CMS_XML_NS); - if ( useContext != null ) { + if (useContext != null) { element.addAttribute("useContext", useContext); } return element; @@ -229,10 +227,10 @@ public class SimpleXMLGenerator implements XMLGenerator { private Element UDItemElement(String useContext) { Element element = new Element("cms:UDItemAttributes", CMS.CMS_XML_NS); /* - if ( useContext != null ) { - element.addAttribute("useContext", useContext); - } - */ + if ( useContext != null ) { + element.addAttribute("useContext", useContext); + } + */ return element; } @@ -242,5 +240,4 @@ public class SimpleXMLGenerator implements XMLGenerator { element.addAttribute("UDItemAttrValue", value); return element; } - } diff --git a/ccm-cms/src/com/arsdigita/cms/search/ContentPageMetadataProvider.java b/ccm-cms/src/com/arsdigita/cms/search/ContentPageMetadataProvider.java index 4f9995f93..83c6e5d1e 100755 --- a/ccm-cms/src/com/arsdigita/cms/search/ContentPageMetadataProvider.java +++ b/ccm-cms/src/com/arsdigita/cms/search/ContentPageMetadataProvider.java @@ -37,33 +37,36 @@ import org.apache.log4j.Logger; public class ContentPageMetadataProvider extends ContentItemMetadataProvider { public static final String ADAPTER_CONTEXT = - ContentPageMetadataProvider.class.getName(); - - private static final Logger s_log = - Logger.getLogger(ContentPageMetadataProvider.class); + ContentPageMetadataProvider.class.getName(); + private static final Logger s_log = + Logger.getLogger( + ContentPageMetadataProvider.class); public String getTitle(DomainObject dobj) { if (dobj instanceof ContentPage) { - ContentPage item = (ContentPage)dobj; - String title = item.getTitle(); - if (StringUtils.emptyString(title)) { - throw new IllegalArgumentException( - "ContentPage must have non-blank title!" - ); - } - return title; + ContentPage item = (ContentPage) dobj; + s_log.debug(String.format("getting title of item with oid '%s'", + item.getOID().toString())); + s_log.debug(String.format("and name '%s'", item.getName())); + s_log.debug(String.format("and title '%s'", item.getTitle())); + String title = item.getTitle(); + if (StringUtils.emptyString(title)) { + throw new IllegalArgumentException( + "ContentPage must have non-blank title!"); + } + return title; } else { // this is not pretty, // 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"; } } public String getSummary(DomainObject dobj) { if (dobj instanceof ContentPage) { - ContentPage item = (ContentPage)dobj; - return item.getSearchSummary(); + ContentPage item = (ContentPage) dobj; + return item.getSearchSummary(); } else { return ""; } @@ -72,11 +75,11 @@ public class ContentPageMetadataProvider extends ContentItemMetadataProvider { public String getContentSection(DomainObject dobj) { String sectionName = ""; if (dobj instanceof ContentPage) { - ContentPage item = (ContentPage)dobj; - ContentSection section = item.getContentSection(); - if (section != null) { - sectionName = section.getName(); - } + ContentPage item = (ContentPage) dobj; + ContentSection section = item.getContentSection(); + if (section != null) { + sectionName = section.getName(); + } } return sectionName; } diff --git a/ccm-core/src/com/arsdigita/domain/SimpleDomainObjectTraversalAdapter.java b/ccm-core/src/com/arsdigita/domain/SimpleDomainObjectTraversalAdapter.java index 96ffd1c65..c24a42db2 100755 --- a/ccm-core/src/com/arsdigita/domain/SimpleDomainObjectTraversalAdapter.java +++ b/ccm-core/src/com/arsdigita/domain/SimpleDomainObjectTraversalAdapter.java @@ -104,21 +104,39 @@ public class SimpleDomainObjectTraversalAdapter /** * 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) { 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. * - * @param path the full path to the property + * @param prop the full path to the property */ public void addAssociationProperty(String 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 * of a property, based on the property set and diff --git a/ccm-core/src/com/arsdigita/persistence/OID.java b/ccm-core/src/com/arsdigita/persistence/OID.java index c65ee5dc1..4bcecaaa9 100755 --- a/ccm-core/src/com/arsdigita/persistence/OID.java +++ b/ccm-core/src/com/arsdigita/persistence/OID.java @@ -59,32 +59,28 @@ public class OID { private ObjectType m_type; private Map m_values = new HashMap(); - /** some shorthand names for common content-types */ private final static String[][] TYPE_SHORTHAND = { - {"Article", "com.arsdigita.cms.contenttypes.Article"}, - {"MultiPartArticle", "com.arsdigita.cms.contenttypes.MultiPartArticle"}, - {"PressRelease", "com.arsdigita.cms.contenttypes.PressRelease"}, - {"NewsItem", "com.arsdigita.cms.contenttypes.NewsItem"}, - {"Bookmark", "com.arsdigita.cms.contenttypes.Bookmark"}, - {"ESDService", "com.arsdigita.cms.contenttypes.ESDService"}, - {"SiteProxy", "com.arsdigita.cms.contenttypes.SiteProxy"}, - {"RelatedLink", "com.arsdigita.cms.contentassets.RelatedLink"}, - {"FileAttachment", "com.arsdigita.cms.contentassets.FileAttachment"}, - {"Category", "com.arsdigita.categorization.Category"}, - }; - + {"Article", "com.arsdigita.cms.contenttypes.Article"}, + {"MultiPartArticle", "com.arsdigita.cms.contenttypes.MultiPartArticle"}, + {"PressRelease", "com.arsdigita.cms.contenttypes.PressRelease"}, + {"NewsItem", "com.arsdigita.cms.contenttypes.NewsItem"}, + {"Bookmark", "com.arsdigita.cms.contenttypes.Bookmark"}, + {"ESDService", "com.arsdigita.cms.contenttypes.ESDService"}, + {"SiteProxy", "com.arsdigita.cms.contenttypes.SiteProxy"}, + {"RelatedLink", "com.arsdigita.cms.contentassets.RelatedLink"}, + {"FileAttachment", "com.arsdigita.cms.contentassets.FileAttachment"}, + {"Category", "com.arsdigita.categorization.Category"},}; /** the separator character to be used in the new OID formatting scheme */ private final static char OID_SEPARATOR_CHAR = '-'; - /** A Format used for formatting/parsing OIDs */ 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 */ private static final Logger m_log = Logger.getLogger(OID.class); - /** * Creates an OID for the Object type. An example of an object * type would be "com.arsdigita.kernel.ACSObject." Using this @@ -148,8 +144,7 @@ public class OID { if (it.hasNext()) { throw new PersistenceException( - "This object type has a compound key." - ); + "This object type has a compound key."); } String attr = prop.getName(); @@ -165,14 +160,13 @@ public class OID { */ private static final ObjectType lookup(String typeName) { ObjectType type = - MetadataRoot.getMetadataRoot().getObjectType(typeName); + MetadataRoot.getMetadataRoot().getObjectType(typeName); if (type == null) { throw new PersistenceException("No such type " + typeName); } return type; } - /** * Creates an OID for the named ObjectType. The typename of the * ObjectType must be defined in the MetadataRoot. An example @@ -197,7 +191,6 @@ public class OID { this(lookup(typeName)); } - /** * Creates an OID with a single attribute for the key. To create a * multi-valued OID, use a single arg OID constructor, and add @@ -229,7 +222,6 @@ public class OID { this(lookup(typeName), value); } - /** * Creates an OID with a single attribute for the key. To create a * multi-valued OID, use a single arg OID constructor, and add @@ -258,7 +250,6 @@ public class OID { this(typeName, new BigDecimal(value)); } - /** * Creates an OID with a single attribute for the key. To create a * 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 // created with legit types of values. if (prop == null) { - throw new PersistenceException - ("no such property: " + propertyName - + " for type " + m_type.getName()); + throw new PersistenceException("no such property: " + propertyName + + " for type " + m_type.getName()); } // null has no type @@ -310,12 +300,12 @@ public class OID { if (prop.isAttribute() && value != null) { // we can be sure this is a simpletype because // isAttribute was true. - SimpleType expectedType = (SimpleType)prop.getType(); - if (!expectedType.getJavaClass() - .isAssignableFrom(value.getClass())) { - throw new PersistenceException - ("expected " + expectedType.getJavaClass() - + "actual type " + value.getClass()); + SimpleType expectedType = (SimpleType) prop.getType(); + if (!expectedType.getJavaClass().isAssignableFrom(value.getClass())) { + throw new PersistenceException("expected " + expectedType. + getJavaClass() + + "actual type " + + value.getClass()); } } else if (value != null) { if (value instanceof DataObject) { @@ -323,15 +313,15 @@ public class OID { DataObject dobj = (DataObject) value; ObjectType.verifySubtype(ot, dobj.getObjectType()); } else { - throw new PersistenceException - ("expected DataObject for property " + propertyName - + " but got " + value.getClass()); + throw new PersistenceException("expected DataObject for property " + + propertyName + + " but got " + value.getClass()); } } if (hasProperty(propertyName)) { - throw new PersistenceException - (propertyName + " is already set to " + get(propertyName)); + throw new PersistenceException(propertyName + " is already set to " + get( + propertyName)); } m_values.put(propertyName, value); @@ -365,7 +355,7 @@ public class OID { } 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())) { return false; } @@ -405,7 +395,6 @@ public class OID { return getObjectType(); } - /** * @return The ObjectType. **/ @@ -418,7 +407,6 @@ public class OID { m_type = subtype; } - /** * Serializes the OID. */ @@ -426,60 +414,60 @@ public class OID { String fullType = m_type.getQualifiedName(); Map props = getProperties(); StringBuffer sb = new StringBuffer(); - for(Iterator it = props.keySet().iterator(); it.hasNext(); ) { - Object key = it.next(); - Object value = props.get(key); - /*if ((key == null) || (value == 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("value = %s", value)); - }*/ - /* - * Changed by Jens Pelzetter 2010-09-14. For unknown reasons - * the value is null for some properties, which causes - * a NPE in the line below the if. - */ - if (null == value) { - m_log.info(String.format("The value for prop \"%s\" " + - "is null. Ignoring.", key)); - continue; - } - /* - * Changed by Jens Pelzetter 2010-09-14. - * - * The old method (see below) is very slow, because of this - * has been changed. - */ - sb.append(key.toString()); + for (Iterator it = props.keySet().iterator(); it.hasNext();) { + Object key = it.next(); + Object value = props.get(key); + /*if ((key == null) || (value == 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("value = %s", value)); + }*/ + /* + * Changed by Jens Pelzetter 2010-09-14. For unknown reasons + * the value is null for some properties, which causes + * a NPE in the line below the if. + */ + if (null == value) { + m_log.info(String.format("The value for prop \"%s\" " + + "is null. Ignoring.", key)); + continue; + } + /* + * Changed by Jens Pelzetter 2010-09-14. + * + * The old method (see below) is very slow, because of this + * has been changed. + */ + 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(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()}; return m_format_new.format(args); } - /** Parse the oid string. If it contains a left-square-bracket, * use the old parsing scheme. Otherwise, use the new parser. */ public static OID valueOf(String s) throws IllegalArgumentException { - if (s.indexOf("[") >= 0 || s.indexOf("%5B") >= 0) { - return valueOfOld(s); - } else { - return valueOfNew(s); - } + if (s.indexOf("[") >= 0 || s.indexOf("%5B") >= 0) { + return valueOfOld(s); + } else { + return valueOfNew(s); + } } /** new way to parse the OID string */ public static OID valueOfNew(String s) throws IllegalArgumentException { StringTokenizer st = new StringTokenizer(s, "" + OID_SEPARATOR_CHAR); if (st.countTokens() < 2) { - throw new IllegalArgumentException - ("Invalid OID '" + s + "'. It must have at least the object type and the value"); + throw new IllegalArgumentException( + "Invalid OID '" + s + + "'. It must have at least the object type and the value"); // } else if (st.countTokens() % 2 != 1) { // throw new IllegalArgumentException // ("Invalid OID '" + s + "'. It must have type followed by name-value pairs"); @@ -488,49 +476,50 @@ public class OID { String type = convertTypeLonghand(st.nextToken()); try { - OID oid = new OID(type); + OID oid = new OID(type); - if (st.hasMoreTokens()) { - String key = st.nextToken(); - String value = st.nextToken(); - while (st.hasMoreTokens()) { - value = value + OID_SEPARATOR_CHAR + st.nextToken(); - } - - // if it can be a BigDecimal, that is what we make it - boolean bigDecimal = true; - for (int i = 0; i < value.length(); i++) { - char c = value.charAt(i); - if (!('0' <= c && c <= '9') && !((i == 0) && (c == '-'))) { - bigDecimal = false; - break; - } - } - - if (bigDecimal) { - oid.set(key, new BigDecimal(value)); - } else { - oid.set(key, value); - } - } + if (st.hasMoreTokens()) { + String key = st.nextToken(); + String value = st.nextToken(); + while (st.hasMoreTokens()) { + value = value + OID_SEPARATOR_CHAR + st.nextToken(); + } + + // if it can be a BigDecimal, that is what we make it + boolean bigDecimal = true; + for (int i = 0; i < value.length(); i++) { + char c = value.charAt(i); + if (!('0' <= c && c <= '9') && !((i == 0) && (c == '-'))) { + bigDecimal = false; + break; + } + } + + if (bigDecimal) { + oid.set(key, new BigDecimal(value)); + } else { + oid.set(key, value); + } + } return oid; - } catch (PersistenceException e) { - throw new IllegalArgumentException - ("Invalid OID '" + s + "'. The type specified [" + type + - "] is not defined"); - } + } catch (PersistenceException e) { + throw new IllegalArgumentException("Invalid OID '" + s + + "'. The type specified [" + + type + "] is not defined"); + } } // Couldn't get MessageFormat to work, so I cheated public static OID valueOfOld(String s) throws IllegalArgumentException { + m_log.debug(String.format("Trying to parse OID '%s'...", s)); StringTokenizer st = new StringTokenizer(s, "[:{}],"); if (st.countTokens() < 2) { st = new StringTokenizer(java.net.URLDecoder.decode(s), "[:{}],"); if (st.countTokens() < 2) { - throw new IllegalArgumentException - ("Invalid OID '" + s + "'. It must have at least the object " + - "type and the value"); + throw new IllegalArgumentException("Invalid OID '" + s + + "'. It must have at least the object " + + "type and the value"); } } @@ -547,6 +536,15 @@ public class OID { while (st.hasMoreTokens()) { String nextToken = st.nextToken(); 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 value = nextToken.substring(index + 1); @@ -561,8 +559,7 @@ public class OID { boolean bigDecimal = true; for (int i = 0; i < value.length(); i++) { char c = value.charAt(i); - if (!('0' <= c && c <= '9') && - !((i == 0) && (c == '-'))) { + if (!('0' <= c && c <= '9') && !((i == 0) && (c == '-'))) { bigDecimal = false; break; } @@ -577,9 +574,9 @@ public class OID { } return oid; } catch (PersistenceException e) { - throw new IllegalArgumentException - ("Invalid OID '" + s + "'. The type specified [" + type + - "] is not defined"); + throw new IllegalArgumentException("Invalid OID '" + s + + "'. The type specified [" + + type + "] is not defined"); } } @@ -591,11 +588,11 @@ public class OID { * for an example). */ public boolean equals(Object obj) { if (obj instanceof OID) { - OID oid = (OID)obj; + OID oid = (OID) obj; // we rely on the toString ecause the HashMap.equals does not // give us what we need - return m_type.getBasetype().equals(oid.m_type.getBasetype()) && - m_values.equals(oid.m_values); + return m_type.getBasetype().equals(oid.m_type.getBasetype()) && m_values. + equals(oid.m_values); } return false; } @@ -610,24 +607,24 @@ public class OID { // to base its hashcode on the hashcodes of the contained values. return (m_type.getBasetype().hashCode() + m_values.hashCode()); } - + /** create shorthand names for some common types */ private static String convertTypeShorthand(String name) { - for (int i=0; i - - - + + + + + + + + + + + + + + + diff --git a/ccm-sci-types-organization/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciOrganization.xml b/ccm-sci-types-organization/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciOrganization.xml index 28072f23c..52a4e35c4 100644 --- a/ccm-sci-types-organization/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciOrganization.xml +++ b/ccm-sci-types-organization/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciOrganization.xml @@ -16,12 +16,17 @@ - + + + + + +