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

carlos_miguens
Champ on-the-rise
Champ on-the-rise
You should be able to edit the metadata on an undeclared record. If you declare the record first then you'll need a capability to edit metadata and so the action won't be present.

fpp
Champ in-the-making
Champ in-the-making
Carlos,

not being able to edit the meta data for documents with custom types (/ ? custom aspects) together with not being recognized as undeclared record is the problem here. You can do all what you describe when the document is of cm:content i.e. the built-in document type.

Documents that are copied into RM with a custom type from DM are not even recognized as undeclared records. The custom properties etc are nevertheless displayed on the document detail page.

Guess there's another day of debugging ahead of me to find out where the problem needs to be tweaked out so that this work. My current guessing is that I might have to tell the record management module "a bit more" about the document types than just importing the model (as mentioned in my earlier posting)

fpp

mikeh
Star Contributor
Star Contributor
It's likely the evaluator function getAssetType() in config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/dod5015-evaluator.lib.js

You can either add your custom type just above cm:content so the code falls through, or add some logic to the default case to check the node is a subtype of cm:content
if (asset.isSubType("cm:content")) …
and calculate the assetType in the same way as is currently done for cm:content.

Would be interested to hear what results you get.

Thanks,
Mike

fpp
Champ in-the-making
Champ in-the-making
Many thanks for the tip Mike, try that tonight - keep you posted.

fpp

fpp
Champ in-the-making
Champ in-the-making
Update:

Mike, right on the spot.

When adding cases for each of the custom document types within the asset type switch, copying documents from DM to RM works for these types as well.

I've just duplicated the cm:content case for each of the custom types and now dod5015-doclist.get.js (where the dod5015-evaluator.lib.js is imported) does not fall back to the general "document" asset type anymore which it can not process further.

         case "xx:CustomDocType":
            if (asset.hasAspect("rma:record"))
            {
               assetType = "undeclared-record";
               if (asset.hasAspect("rma:declaredRecord"))
               {
                  assetType = "record";
                  if (asset.hasAspect("dod:ghosted"))
                  {
                     assetType = "metadata-stub";
                  }
               }
            }
            break;

Editing Meta Data as well as declaring the document a record works fine. All properties from the document management seem to be preserved including DM tags and DM categories. Based on the node browser it looks like there is a 1:1 copy created with the RM. There is no reference back to the DM node (good). Deleted the original node within the DM without a problem so far.

Now I just have to create another set of document detail forms to display the properties & aspects as the DoD5015 document details falls back to a default form (all node properties displayed).

fpp

mikeh
Star Contributor
Star Contributor
Thanks for the feedback. By the way, no need to duplicate the code for your custom type, just follow the "rma:nonElectronicDocument" example:
case "xx:CustomDocType":
   // Fall-through
case "rma:nonElectronicDocument":
   // Fall-through
case "cm:content":
   if (asset.hasAspect("rma:record"))
   …

Thanks,
Mike

fpp
Champ in-the-making
Champ in-the-making
Used the cm:content as base to be able to declare the document as record and later use it like other records. Might work otherwise as well but have not tried it.

So by that you get one case switch for all similar custom document types (based on cm:content)

case "xx:CustomDocType1": "xx:CustomDocType2": "xx:CustomDocType3":
            if (asset.hasAspect("rma:record"))
            {
….

fpp

f_tasso
Champ in-the-making
Champ in-the-making
Hi,

I wanted to ask if you can explain in more detail the process to import documents of type "custom content" from the Alfresco Repository to RM.
I have created a custom content in this way:

<!– Definition of new Content Type: Fattura vendita –>
      <type name="my:fv">
         <title>Fattura vendita</title>
         <parent>cm:content</parent>
         <properties>
         <property name="my:NomeCliente">
            <type>d:text</type>
            <mandatory>true</mandatory>
         </property>
         <property name="mySmiley TongueIVA">
            <type>d:text</type>
            <mandatory>true</mandatory>
         </property>
         <property name="my:CF">
            <type>d:text</type>
            <mandatory>true</mandatory>
         </property>
         <property name="my:Numero">
            <type>d:text</type>
            <mandatory>true</mandatory>
         </property>
            <property name="mySmiley Very Happyata">
               <type>d:datetime</type>
            <mandatory>true</mandatory>
            </property>
         <property name="my:Importo">
            <type>d:int</type>
            <mandatory>true</mandatory>
         </property>
         <property name="my:Record">
            <mandatory-aspects>
            <aspect>rma:record</aspect>
            </mandatory-aspects>
         </properties>
         <associations>
         </associations>
      </type>


Then, when i import a content (in Alfresco DM, not in RM), i can choose this content type, and correctly i must insert the necessary info. If i import this content in "My Alfresco > Sites > rm > documentLibrary > … (from DM), i can't see this content as a Record from Share RM.
This is the problem that you've been resolving?
Can you help me? I'm new with Alfresco but this is the most important point to resolve for using this CMS.

Thank you so much.
Fabio

jperilla
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?