cancel
Showing results for 
Search instead for 
Did you mean: 

Adding aspects to Records Management

juha
Champ in-the-making
Champ in-the-making
HI

we would like to add automatically Classifiable and Taggable Aspects to all records in our 3.3 Alfresco RM.

Rules to the File Plan should do it, however, the Metadata editor for the records does not seem to pick this. Ie. the controls for Classifiable and Taggable Aspects do not appear in the metadata? Is there a way to do this?
13 REPLIES 13

erajmehra
Champ in-the-making
Champ in-the-making
Hi Juha,

I am not sure - if this is strictly the best practice. But to make custom aspects visible in the edit metadata page - you would need to edit the share config file (I assume you are using share with 3.3).

The only way I could get them to appear was to edit the "dod-5015-form-config.xml" file placed inside the C:\Alfresco\tomcat\webapps\share\WEB-INF\classes\alfresco (assuming you have installed alfresco inside C:\Alfresco).

Depending on what level you want to add the custom metadata - series, category, folder or file level - add following in appropriate node-type.

So for example if you want to add taggable aspect to the file level metadata - just add the following inside the  <field-visibility> for <config evaluator="node-type" condition="cm:content">

<show id="cm:taggable" />

And same for any other aspect you want to make visible. Now if you want to add a custom type to the metadata. You will also need to modify the dod-5015-evaluator.lib.js - just look for it.

You will need to add the case for your custom type.

         case "my:customtype":
            // Fall-through
         case "rma:nonElectronicDocument":
            // Fall-through
         case "cm:content":

Again, I am not sure if this is strictly the best practice and adding custom config files in the alfresco extension folder would be the right way to go. Just not sure of the process.

Hope this helps.

juha
Champ in-the-making
Champ in-the-making
HI,

thanks for the tip, I tried it as follows:
editing /usr/local/Alfresco/tomcat/webapps/share/WEB-INF/classes/alfresco/dod-5015-form-config.xml (running on Mac OsX SL server):

   <config evaluator="node-type" condition="cm:content">
      <forms>
         <form id="rm">
            <view-form template="record-metadata.ftl" />
            <edit-form template="record-metadata.ftl" />

            <field-visibility>
               <!– explicitly hide mandatory fields we don't want in edit mode –>
               <hide id="cm:automaticUpdate" />
               <hide id="sys:node-dbid" />
               <hide id="size" for-mode="edit" />
               <hide id="rma:dateFiled" for-mode="edit" />
               <hide id="rma:cutOffDate" for-mode="edit" />
               <hide id="rma:frozenBy" />
               <hide id="rma:frozenAt" />
              <!– tags added 17082010 –>
               <show id="cm:taggable" />

            </field-visibility>



However, this generates the following error when editing the metadata in a record in RM:

An error has occured in the Share component: /share/service/components/form.
It responded with a status of 500 - Internal Error.
Error Code Information: 500 - An error inside the HTTP server which prevented it from fulfilling the request.
Error Message: 07170000 Failed to process template org/alfresco/components/form/form.get.html.ftl
Server: Alfresco Spring WebScripts - v1.0.0 (Milestone 3 357) schema 1,000
Time: Aug 17, 2010 2:43:21 PM
Click here to view full technical information on the error.
Exception: freemarker.template.TemplateException - Error executing macro: renderField required parameter: field is not specified.
freemarker.core.Macro$Context.sanityCheck(Macro.java:181)
freemarker.core.Macro$Context.runMacro(Macro.java:161)
freemarker.core.Environment.visit(Environment.java:601)
freemarker.core.UnifiedCall.accept(UnifiedCall.java:106)
freemarker.core.Environment.visit(Environment.java:208)
freemarker.core.MixedContent.accept(MixedContent.java:92)
freemarker.core.Environment.visit(Environment.java:208)
freemarker.core.Environment.include(Environment.java:1477)
freemarker.core.Include.accept(Include.java:169)
freemarker.core.Environment.visit(Environment.java:208)
freemarker.core.IfBlock.accept(IfBlock.java:82)
freemarker.core.Environment.visit(Environment.java:208)
freemarker.core.MixedContent.accept(MixedContent.java:92)
freemarker.core.Environment.visit(Environment.java:208)
freemarker.core.IfBlock.accept(IfBlock.java:82)
freemarker.core.Environment.visit(Environment.java:208)
freemarker.core.MixedContent.accept(MixedContent.java:92)
freemarker.core.Environment.visit(Environment.java:208)
freemarker.core.Environment.process(Environment.java:188)
freemarker.template.Template.process(Template.java:237)
org.springframework.extensions.webscripts.processor.FTLTemplateProcessor.process(FTLTemplateProcessor.java:156)
org.springframework.extensions.webscripts.AbstractWebScript.renderTemplate(AbstractWebScript.java:578)
org.springframework.extensions.webscripts.DeclarativeWebScript.renderFormatTemplate(DeclarativeWebScript.java:263)
org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:143)
org.springframework.extensions.webscripts.PresentationContainer.executeScript(PresentationContainer.java:69)
org.springframework.extensions.webscripts.LocalWebScriptRuntimeContainer.executeScript(LocalWebScriptRuntimeContainer.java:203)
org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:319)
org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:177)
org.springframework.extensions.webscripts.WebScriptProcessor.executeBody(WebScriptProcessor.java:275)
org.springframework.extensions.surf.render.AbstractProcessor.execute(AbstractProcessor.java:79)
org.springframework.extensions.surf.render.RenderService.processComponent(RenderService.java:468)
org.springframework.extensions.surf.render.RenderService.renderRawComponent(RenderService.java:970)
org.springframework.extensions.surf.render.bean.ComponentRenderer.body(ComponentRenderer.java:113)
org.springframework.extensions.surf.render.RenderService.renderRegionComponents(RenderService.java:827)
org.springframework.extensions.surf.taglib.RegionIncludeTag.doStartTag(RegionIncludeTag.java:36)
org.springframework.extensions.surf.render.TagService.execute(TagService.java:213)
org.springframework.extensions.surf.render.TagService.execute(TagService.java:148)
org.springframework.extensions.webscripts.FreemarkerTagSupportDirective.executeTag(FreemarkerTagSupportDirective.java:92)
org.springframework.extensions.webscripts.GenericFreemarkerTagDirective.execute(GenericFreemarkerTagDirective.java:121)
freemarker.core.Environment.visit(Environment.java:261)
freemarker.core.UnifiedCall.accept(UnifiedCall.java:126)
freemarker.core.Environment.visit(Environment.java:208)
freemarker.core.MixedContent.accept(MixedContent.java:92)
freemarker.core.Environment.visit(Environment.java:208)
freemarker.core.Environment.process(Environment.java:188)
freemarker.template.Template.process(Template.java:237)
org.springframework.extensions.webscripts.processor.FTLTemplateProcessor.process(FTLTemplateProcessor.java:156)
org.springframework.extensions.webscripts.WebTemplateProcessor.executeBody(WebTemplateProcessor.java:328)
org.springframework.extensions.surf.render.AbstractProcessor.execute(AbstractProcessor.java:79)
org.springframework.extensions.surf.render.RenderService.processRenderable(RenderService.java:390)
org.springframework.extensions.surf.render.bean.ChromeRenderer.body(ChromeRenderer.java:49)
org.springframework.extensions.surf.render.AbstractRenderer.render(AbstractRenderer.java:131)
org.springframework.extensions.surf.render.bean.RegionRenderer.body(RegionRenderer.java:114)
org.springframework.extensions.surf.render.AbstractRenderer.render(AbstractRenderer.java:131)
org.springframework.extensions.surf.render.RenderService.startRegionRenderer(RenderService.java:779)
org.springframework.extensions.surf.render.RenderService.renderRegion(RenderService.java:723)
org.springframework.extensions.surf.render.PresentationUtil.renderRegion(PresentationUtil.java:134)
org.springframework.extensions.surf.taglib.RegionTag.doStartTag(RegionTag.java:101)
org.springframework.extensions.surf.render.TagService.execute(TagService.java:213)
org.springframework.extensions.surf.render.TagService.execute(TagService.java:148)
org.springframework.extensions.webscripts.FreemarkerTagSupportDirective.executeTag(FreemarkerTagSupportDirective.java:92)
org.springframework.extensions.webscripts.RegionFreemarkerTagDirective.execute(RegionFreemarkerTagDirective.java:122)
freemarker.core.Environment.visit(Environment.java:261)
freemarker.core.UnifiedCall.accept(UnifiedCall.java:126)
freemarker.core.Environment.visit(Environment.java:208)
freemarker.core.MixedContent.accept(MixedContent.java:92)
freemarker.core.Environment.visit(Environment.java:208)
freemarker.core.Environment.visit(Environment.java:393)
freemarker.core.BodyInstruction.accept(BodyInstruction.java:93)
freemarker.core.Environment.visit(Environment.java:208)
freemarker.core.MixedContent.accept(MixedContent.java:92)
freemarker.core.Environment.visit(Environment.java:208)
freemarker.core.Macro$Context.runMacro(Macro.java:164)
freemarker.core.Environment.visit(Environment.java:601)
freemarker.core.UnifiedCall.accept(UnifiedCall.java:106)
freemarker.core.Environment.visit(Environment.java:208)
freemarker.core.MixedContent.accept(MixedContent.java:92)
freemarker.core.Environment.visit(Environment.java:208)
freemarker.core.Environment.process(Environment.java:188)
freemarker.template.Template.process(Template.java:237)
org.springframework.extensions.webscripts.processor.FTLTemplateProcessor.process(FTLTemplateProcessor.java:156)
org.springframework.extensions.webscripts.WebTemplateProcessor.executeBody(WebTemplateProcessor.java:328)
org.springframework.extensions.surf.render.AbstractProcessor.execute(AbstractProcessor.java:79)
org.springframework.extensions.surf.render.RenderService.processTemplate(RenderService.java:582)
org.springframework.extensions.surf.render.bean.TemplateInstanceRenderer.body(TemplateInstanceRenderer.java:124)
org.springframework.extensions.surf.render.AbstractRenderer.render(AbstractRenderer.java:131)
org.springframework.extensions.surf.render.bean.PageRenderer.body(PageRenderer.java:70)
org.springframework.extensions.surf.render.AbstractRenderer.render(AbstractRenderer.java:131)
org.springframework.extensions.surf.render.RenderService.startPageRenderer(RenderService.java:664)
org.springframework.extensions.surf.render.RenderService.renderPage(RenderService.java:641)
org.springframework.extensions.surf.render.PresentationUtil.renderPage(PresentationUtil.java:95)
org.springframework.extensions.surf.mvc.PageView.dispatchPage(PageView.java:349)
org.springframework.extensions.surf.mvc.PageView.renderView(PageView.java:290)
org.springframework.extensions.surf.mvc.AbstractWebFrameworkView.renderMergedOutputModel(AbstractWebFrameworkView.java:136)
org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1060)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:798)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:647)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:552)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.alfresco.web.site.servlet.MTAuthenticationFilter.doFilter(MTAuthenticationFilter.java:67)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
java.lang.Thread.run(Thread.java:637)
Exception: org.springframework.extensions.webscripts.WebScriptException - 07170000 Failed to process template org/alfresco/components/form/form.get.html.ftl
org.springframework.extensions.webscripts.processor.FTLTemplateProcessor.process(FTLTemplateProcessor.java:160)

Any suggestions (I'm a bit novel on Alfresco)

jperilla
Champ in-the-making
Champ in-the-making
I had the same problem with my custom document type. I have added my custom content type to this switch statement like stated below…

And same for any other aspect you want to make visible. Now if you want to add a custom type to the metadata. You will also need to modify the dod-5015-evaluator.lib.js - just look for it.

You will need to add the case for your custom type.

case "my:customtype":
// Fall-through
case "rma:nonElectronicDocument":
// Fall-through
case "cm:content":

And my document actions now show up. I can click on Edit Metadata but now I only see my custom properties and non of the RM properties. Therefore, I cannot edit the required metadata and I cannot declare the document a record.

This does seem like it is against best practice, does the RM module not already have support for custom types? Is there a way to do it without modifying the RM files?

anik
Champ in-the-making
Champ in-the-making
In Enterprise 3.4.7 i couldn't find this "dod-5015-evaluator.lib.js"
Is there any other file corresponding to evalutor.lib.js in enterprise 3.4.7version ?? ?
Please help. Smiley Happy

mrogers
Star Contributor
Star Contributor
You would need to install RM.     Its an addition to Alfresco Enterprise.

anik
Champ in-the-making
Champ in-the-making
i have record management … actually i am not using exe installable
i have installed alfresco enterprise on JBoss using zip
I am able to create Record management site in share,creating file plan etc
BUt the problem is after adding custom aspect to dod-5015-form-config.xml as mention in the post
i am also getting same exception so only thing is file is missing
please help

mrogers
Star Contributor
Star Contributor
The dod5015-evaluator.lib.js file should be in

DOD5015 Module  alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary

anik
Champ in-the-making
Champ in-the-making
That path is not there for me.. i have already verified.. thats why i have posted on forum :shock:
but still thanks… Smiley Happy  I really appreciate your team timely response. 😎
Tell me one thing if i create the same folder structure and download .js file in that location .. will it work?? Smiley Surprised

anik
Champ in-the-making
Champ in-the-making
Hi,
I want to add Store Selector aspect to records. I have added this aspect in share but i am not able to associate the same with records. I tried the steps given above. But whenever i try to create a folder in file plan i get an error: Internal Form error: form with the id 'template_x002e-dod5015-toolbar_x002e_documentlibrary-createdFolder-form' could not be located, ensure the form is created after the form element is available.

Any pointers to solve this?

Thanks