cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Document types / Models in RM

fpp
Champ in-the-making
Champ in-the-making
I'm trying to use custom document types / custom models in use within the document management inside the RM module.

Changed the imports in the customRecordsModel.xml and trying to copy the files from the DM to the RM within an existing fileplan (DoD sample).

When copying cm:content document type files to the RM area there is no problem declaring them as record (they show up as undeclared records after the copy).
Using custom type documents - even when these are a 1:1 copy of the cm:content document type - shows the document with all the custom props / aspects in the RM module but no actions / no edit metadata etc is possible. You can not even delete them afterwards.

Anybody having an idea where the problem with this might be.

Many thanks
fpp
13 REPLIES 13

dk1
Champ in-the-making
Champ in-the-making
I was having the same problem with my custom document type. No actions were showing up once I moved the file from DM to RM. I followed the instructions above and added my custom type to the switch statement so that it would fall through. Like this..

case "ciha:doc":
   // Fall-through
case "rma:nonElectronicDocument":
   // Fall-through
case "cm:content":
   if (asset.hasAspect("rma:record"))
   …

now my actions show up, but when I click on Edit Metadata only my custom properties show up for me to edit. I can't edit the required RM properties and therefore can't declare my document a record. It seems as if it is using my custom DM form template instead of using the RM form template (and adding my custom properties, which is what I would expect). Is there a proper way to fix this.

I suppose I could add all of the RM properties to my share-config-custom.xml, so that if it is a record they will show up, but that seems like a hack. Any ideas?

I tried to do this same thing and it didnt work for me

swithun
Champ in-the-making
Champ in-the-making
I'm not having any luck with this either. I have some custom aspects containing various properties and associations with custom types (no properties, just content). These work fine in regular Share. But I can't get this metadata to show up in RM, either to view or to edit.

The aspects look like:

    <aspect name="oais:MODSDigitalObjectAble">
      <title>MODS Digital Object aspect</title>
      <parent>cm:content</parent>
      <properties>
        <property name="mods:modsDigitalObjectIdentifiers">
          <type>d:mltext</type>
        </property>
        … more properties …
      </properties>
      <associations>
        <child-association name="oais:MODSDigitalObjectAssoc">
          <title>Link to MODS Digital Object</title>
          <target>
            <class>oais:MODSDigitalObjectType</class>
            <mandatory>false</mandatory>
            <many>true</many>
          </target>
        </child-association>
      </associations>
    </aspect>

With types like:

    <type name="oais:MODSDigitalObjectType">
      <title>MODS Digital Object</title>
      <parent>cm:content</parent>
    </type>

I've tried adding lines like:

<show id="oais:MODSDigitalObjectAble"/>

to dod-5015-form-config.xml, and lines like:

       case "oais:MODSDigitalObjectType":
         // Fall-through

to dod5015-evaluator.lib.js (both together and modifying just one of the files).

Either nothing changes (if I just modify the Javascript file), or I get the exception below (if I modify the XML file):

Exception: freemarker.template.TemplateException - Error executing macro: renderField required parameter: field is not specified.

as described in this thread.

I just want my aspect properties to be visible and editable inside RM. I thought maybe the exception was caused by my custom type not being recognised, though it has no properties and doesn't need to be visible/editable, so maybe editing the Javascript file was unnecessary (it has no effect anyway).

I'm using 3.4 CE, if it helps.

ericnk
Champ on-the-rise
Champ on-the-rise
The solution presented above works great for me, but I want to get away from modifying one of the core alfresco template scripts.  Where would I place the modified dod5015-evaluator.js file.  Perhaps under alfresco/extension?  Does it follow the original file/folder structure, i.e.


alfresco/extension/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/dod5015-evaluator.js
… ? 

Or, is it placed directly in alfresco/extension ?  I've tried creating a similar file structure under extension, but that doesn't work.  The only way I can get RM to recognize the custom file types is to modify the original core file, which I'm trying to avoid, so that I can retain my customizations when upgrading to a future release of alfresco.  Any suggestions or comments are appreciated and welcome.  Thank you.

Eric

softbless
Champ in-the-making
Champ in-the-making
If you want the RM metadata to be displayed for custom content type, you need to edit file : dod-5015-form-config.xml

Replicate this part :
<config evaluator="node-type" condition="cm:content">
…..
</config>

change the condition into custom content type, for example :
<config evaluator="node-type" condition="custom:invoice">
     <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" />
           </field-visibility>
          
           <appearance>
              <set id="rm-custom" label-id="label.set.customMetadata" appearance="panel" />
             
              <field id="rma:identifier" label-id="label.recordIdentifier" read-only="true" />
              <field id="rmCategoryIdentifier" label-id="label.categoryIdentifier" />
              <field id="rmDeclared" label-id="label.declared" />
              <field id="rmRecordType" label-id="label.recordType" />
              <field id="rmDispositionInstructions" label-id="label.dispositionInstructions" />
              <field id="rma:recordSearchDispositionActionAsOf" label-id="label.dispositionAsOfDate" />
              <field id="cm:title" mandatory="true">
                 <control template="/org/alfresco/components/form/controls/textfield.ftl" />
              </field>
              <field id="cm:description">
                 <control>
                    <control-param name="activateLinks">true</control-param>
                 </control>
              </field>
              <field id="mimetype">
                 <control template="/org/alfresco/components/form/controls/mimetype.ftl" />
              </field>
              <field id="size">
                 <control template="/org/alfresco/components/form/controls/size.ftl" />
              </field>
              <field id="dod:webSiteURL">
                 <control>
                    <control-param name="activateLinks">true</control-param>
                 </control>
              </field>
           </appearance>
        </form>
     </forms>
  </config>

By following the instruction above, and make changes to these files :
- dod5015-evaluator.lib.js
- dod-5015-form-config.xml

I accomplished :
- displaying RM related Action : Declare record, etc
- displaying RM Metadata : Originator, Originating organization, etc

But I haven't accomplished :
- displaying the custom metadata from custom content type

Anyone care to share how to do this?