File prototypeNuxeoConfigFile =\r
new File(getNuxeoConfigDir() + File.separator + getNuxeoProtoConfigFilename());\r
logger.warn("Prototype Nuxeo config file path=" + prototypeNuxeoConfigFile.getCanonicalPath());\r
- if (! prototypeNuxeoConfigFile.canRead()) {\r
- // FIXME: Handle this error appropriately here.\r
- }\r
- logger.warn("Can read prototype Nuxeo config file.");\r
- Document prototypeDoc = XmlTools.fileToXMLDocument(prototypeNuxeoConfigFile);\r
- // FIXME: Can the variable below reasonably be made a class variable? Its value\r
- // is used in at least one other method in this class.\r
- Hashtable<String, TenantBindingType> tenantBindingTypeMap = tenantBindingConfigReader.getTenantBindings();\r
- for (TenantBindingType tbt : tenantBindingTypeMap.values()) {\r
- List<String> repositoryNameList = ConfigUtils.getRepositoryNameList(tbt);\r
- if (repositoryNameList != null && repositoryNameList.isEmpty() == false) {\r
- Document repoDoc = null;\r
- for (String repositoryName : repositoryNameList) {\r
- logger.warn("Repository name=" + repositoryName);\r
- repoDoc = (Document) prototypeDoc.clone();\r
- logger.warn("Before attribute edits=\n" + repoDoc.asXML());\r
- // FIXME: Set up constants and/or methods for XPath expressions, element and attribute names\r
- repoDoc = XmlTools.setAttributeValue(repoDoc, "/component/extension[@point='repository']/repository", "name", repositoryName);\r
- logger.warn("After first attribute edit=\n" + repoDoc.asXML());\r
- repoDoc = XmlTools.setAttributeValue(repoDoc, "/component/extension[@point='repository']/repository/repository", "name", repositoryName);\r
- logger.warn("After second attribute edit=\n" + repoDoc.asXML());\r
- repoDoc = XmlTools.setAttributeValue(repoDoc, "/component/extension[@point='repositories']/repository", "name", repositoryName);\r
- logger.warn("After third attribute edit=\n" + repoDoc.asXML());\r
- // FIXME: Edit additional element and/or attribute values.\r
- // FIXME: Emit serialized XML and write it to an appropriately named file\r
- // in the Nuxeo server config directory.\r
- repoDoc = null;\r
+ if (prototypeNuxeoConfigFile.canRead()) {\r
+ logger.warn("Can read prototype Nuxeo config file.");\r
+ Document prototypeDoc = XmlTools.fileToXMLDocument(prototypeNuxeoConfigFile);\r
+ // FIXME: Can the variable below reasonably be made a class variable? Its value\r
+ // is used in at least one other method in this class.\r
+ Hashtable<String, TenantBindingType> tenantBindingTypeMap = tenantBindingConfigReader.getTenantBindings();\r
+ for (TenantBindingType tbt : tenantBindingTypeMap.values()) {\r
+ List<String> repositoryNameList = ConfigUtils.getRepositoryNameList(tbt);\r
+ if (repositoryNameList != null && repositoryNameList.isEmpty() == false) {\r
+ Document repoDoc = null;\r
+ for (String repositoryName : repositoryNameList) {\r
+ logger.warn("Repository name=" + repositoryName);\r
+ repoDoc = (Document) prototypeDoc.clone();\r
+ logger.warn("Before attribute edits=\n" + repoDoc.asXML());\r
+ // FIXME: Set up constants and/or methods for XPath expressions, element and attribute names\r
+ repoDoc = XmlTools.setAttributeValue(repoDoc, "/component/extension[@point='repository']/repository", "name", repositoryName);\r
+ logger.warn("After first attribute edit=\n" + repoDoc.asXML());\r
+ repoDoc = XmlTools.setAttributeValue(repoDoc, "/component/extension[@point='repository']/repository/repository", "name", repositoryName);\r
+ logger.warn("After second attribute edit=\n" + repoDoc.asXML());\r
+ repoDoc = XmlTools.setAttributeValue(repoDoc, "/component/extension[@point='repositories']/repository", "name", repositoryName);\r
+ logger.warn("After third attribute edit=\n" + repoDoc.asXML());\r
+ // FIXME: Edit additional element and/or attribute values.\r
+ // FIXME: Emit serialized XML and write it to an appropriately named file\r
+ // in the Nuxeo server config directory.\r
+ repoDoc = null;\r
+ }\r
}\r
}\r
}\r
}\r
\r
public String getNuxeoConfigDir() {\r
- return getServerRootDir() + JEEServerDeployment.NUXEO_SERVER_CONFIG_DIR;\r
+ return getServerRootDir() + File.separator + JEEServerDeployment.NUXEO_SERVER_CONFIG_DIR;\r
}\r
\r
public String getNuxeoProtoConfigFilename() {\r