AnsweredAssumed Answered

How to get the values from properties file in xml files while bootstraped that properties file.

Question asked by brahmaiah926 on Dec 26, 2018

I am trying to bootstrap the creation of group in alfresco and bootstraps the properties file which stores the values of group name. 

the handle for the custom property value in properties file is

custom.alfresco.create-site.group=CUSTOM_SITE_CREATORS.

and accessing that value in xml bootstrap in below mentioned way.

 

 

 

<view:reference view:pathref="${system.authorities_container.childname}">
<view:associations>
<sys:children>
<cm:authorityContainer view:childName="cm:${custom.alfresco.create-site.group}">
<view:aspects>
<sys:referenceable />
</view:aspects>
<view:properties>
<sys:node-uuid>1b48452f-cef9-43ec-bdbe-90b3dd5c9876</sys:node-uuid>
<cm:name>${custom.alfresco.create-site.group}</cm:name>
<cm:authorityName>${custom.alfresco.create-site.group}</cm:authorityName>
</view:properties>
</cm:authorityContainer>
</sys:children>
</view:associations>
</view:reference>

 

 

 

and I am getting below error

 

Caused by: org.alfresco.service.cmr.view.ImporterException: Failed to import package at line 18; column 41 due to error: Local name cannot be null or empty.
at org.alfresco.repo.importer.view.ViewParser.parse(ViewParser.java:201)
at org.alfresco.repo.importer.ImporterComponent.parserImport(ImporterComponent.java:430)
at org.alfresco.repo.importer.ImporterComponent.importView(ImporterComponent.java:268)
at org.alfresco.repo.importer.ImporterBootstrap.doImport(ImporterBootstrap.java:481)
at org.alfresco.repo.importer.ImporterBootstrap.access$0(ImporterBootstrap.java:374)
at org.alfresco.repo.importer.ImporterBootstrap$1$1.execute(ImporterBootstrap.java:356)
at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:464)
at org.alfresco.repo.importer.ImporterBootstrap$1.doWork(ImporterBootstrap.java:360)
at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:555)
at org.alfresco.repo.importer.ImporterBootstrap.bootstrap(ImporterBootstrap.java:363)
... 53 more
Caused by: java.lang.IllegalArgumentException: Local name cannot be null or empty.
at org.alfresco.service.namespace.QName.createValidLocalName(QName.java:209)
at org.alfresco.repo.importer.ImporterComponent$NodeImporter.getChildName(ImporterComponent.java:965)
at org.alfresco.repo.importer.ImporterComponent$NodeImporter.access$1(ImporterComponent.java:947)
at org.alfresco.repo.importer.ImporterComponent$NodeImporter$CreateNewNodeImporterStrategy.importNode(ImporterComponent.java:1415)
at org.alfresco.repo.importer.ImporterComponent$NodeImporter.importNode(ImporterComponent.java:633)
at org.alfresco.repo.importer.view.ViewParser.importNode(ViewParser.java:925)
at org.alfresco.repo.importer.view.ViewParser.processEndType(ViewParser.java:888)
at org.alfresco.repo.importer.view.ViewParser.processEndElement(ViewParser.java:868)
at org.alfresco.repo.importer.view.ViewParser.parse(ViewParser.java:189)
... 62 more

Outcomes