You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by mr...@apache.org on 2009/11/25 14:50:24 UTC
svn commit: r884096 -
/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/RepositoryConfigurationParser.java
Author: mreutegg
Date: Wed Nov 25 13:50:24 2009
New Revision: 884096
URL: http://svn.apache.org/viewvc?rev=884096&view=rev
Log:
JCR-2404: Return null for optional configuration elements
Modified:
jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/RepositoryConfigurationParser.java
Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/RepositoryConfigurationParser.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/RepositoryConfigurationParser.java?rev=884096&r1=884095&r2=884096&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/RepositoryConfigurationParser.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/RepositoryConfigurationParser.java Wed Nov 25 13:50:24 2009
@@ -186,7 +186,7 @@
* Element specifying the class of principals used to retrieve the userID
* in the 'class' attribute.
*/
- private static final String USERID_CLASS = "UserIdClass";
+ private static final String USERID_CLASS_ELEMENT = "UserIdClass";
/**
* Name of the optional XmlImport config entry inside the workspace configuration.
@@ -370,7 +370,7 @@
}
BeanConfig uidcc = null;
- element = getElement(smElement, USERID_CLASS, false);
+ element = getElement(smElement, USERID_CLASS_ELEMENT, false);
if (element != null) {
uidcc = parseBeanConfig(element);
}
@@ -593,8 +593,8 @@
/**
- * Read the WorkspaceSecurity Element of Workspace's configuration. It uses
- * the following format:
+ * Read the optional WorkspaceSecurity Element of Workspace's configuration.
+ * It uses the following format:
* <pre>
* <WorkspaceSecurity>
* <AccessControlProvider class="..." (optional)>
@@ -602,7 +602,8 @@
* </pre>
*
* @param parent Workspace-Root-Element
- * @return a new <code>WorkspaceSecurityConfig</code>
+ * @return a new <code>WorkspaceSecurityConfig</code> or <code>null</code>
+ * if none is configured.
* @throws ConfigurationException
*/
public WorkspaceSecurityConfig parseWorkspaceSecurityConfig(Element parent)
@@ -616,29 +617,31 @@
acProviderConfig = parseBeanConfig(element, AC_PROVIDER_ELEMENT);
acProviderConfig.setValidate(false); // JCR-1920
}
+ return new WorkspaceSecurityConfig(acProviderConfig);
}
- return new WorkspaceSecurityConfig(acProviderConfig);
+ return null;
}
/**
- * Read the optional XmlImport Element of Workspace's configuration. It uses
+ * Read the optional Import Element of Workspace's configuration. It uses
* the following format:
* <pre>
- * <XmlImport>
+ * <Import>
* <ProtectedNodeImporter class="..." (optional)>
* <ProtectedNodeImporter class="..." (optional)>
* ...
* <ProtectedPropertyImporter class="..." (optional)>
- * </XmlImport>
+ * </Import>
* </pre>
*
* @param parent Workspace-Root-Element
- * @return a new <code>XmlImportConfig</code>
+ * @return a new <code>ImportConfig</code> or <code>null</code> if none is
+ * configured.
* @throws ConfigurationException
*/
public ImportConfig parseImportConfig(Element parent) throws ConfigurationException {
- List<BeanConfig> protectedNodeImporters = new ArrayList();
- List<BeanConfig> protectedPropertyImporters = new ArrayList();
+ List<BeanConfig> protectedNodeImporters = new ArrayList<BeanConfig>();
+ List<BeanConfig> protectedPropertyImporters = new ArrayList<BeanConfig>();
Element element = getElement(parent, IMPORT_ELEMENT, false);
if (element != null) {
@@ -659,8 +662,9 @@
} // else: some other entry -> ignore.
}
}
+ return new ImportConfig(protectedNodeImporters, protectedPropertyImporters);
}
- return new ImportConfig(protectedNodeImporters, protectedPropertyImporters);
+ return null;
}
/**