I have a problem with bootstraping rule by module SDK 4.5. The rule have referance to the script. I bootstrap the script and the rule in one module. The script imports sucsessfuly, but rule geting empty refferance instead refferance to this script. The rule became wrong and can't be edited in UI. But if the script already present in the Data Dictionary/Scripts folder, then bootstrap makes a proper refferance in the rule.
bootstrap-context.xml
<!-- Import smart folder templates and javascripts --> <bean id="customSpacesBootstrap" parent="spacesStoreImporter" > <property name="useExistingStore"> <value>true</value> </property> <property name="bootstrapViews"> <list> ... <props> <prop key='uuidBinding'>UPDATE_EXISTING</prop> <prop key="path">/${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.scripts.childname}</prop> <prop key="location">alfresco/module/${project.artifactId}/bootstrap/import-scripts.xml</prop> </props> </list> </property> </bean> <!-- Import rule to manage files --> <bean id="MyModule.bootstrap" class="org.alfresco.repo.module.ImporterModuleComponent" parent="module.baseComponent"> <property name="moduleId" value="${project.artifactId}" /> <property name="name" value="${project.name}" /> <property name="description" value="My Modules initial data requirements" /> <property name="sinceVersion" value="1.0-SNAPSHOT" /> <property name="appliesFromVersion" value="1.0-SNAPSHOT" /> <property name="importer" ref="spacesBootstrap"/> <property name="bootstrapViews"> <list> <props> <prop key='uuidBinding'>UPDATE_EXISTING</prop> <prop key="path">/${spaces.company_home.childname}/${spaces.sites.childname}/cm:products</prop> <prop key="location">alfresco/module/${project.artifactId}/bootstrap/documentLibrary.xml</prop> </props> <props> <prop key='uuidBinding'>UPDATE_EXISTING</prop> <prop key="path">/${spaces.company_home.childname}/${spaces.sites.childname}/cm:products/cm:documentLibrary/rule:ruleFolder</prop> <prop key="location">alfresco/module/${project.artifactId}/bootstrap/rule.xml</prop> </props> </list> </property> </bean>
The documentLibrary.xml just add rule:rules aspect
The rule.xml file have refferance to the script imported by the import-scripts.xml in the first bean.
<view:value view:datatype="d:category">/app:company_home/app:dictionary/app:scripts/update-doc-file.js</view:value>
It works only if update-doc-file.js script already in the /Scripts folder. Is it posible to manage the bootstrap order?
How to import rule and script in one module?
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.