cancel
Showing results for 
Search instead for 
Did you mean: 

How do I create custom record types?

beavis74
Champ in-the-making
Champ in-the-making
Hi, this is my first post to this forum.

Can anyone tell me how to create new types of record in the Alfresco RM fileplan?

Currently it has "Default" plus 4 others…PDF Record, Digital Photograph, etc. How do I add to this list?

What we want to do is have different meta data fields for different records/folders. Currently it seems that when you add custom meta data it shows for EVERYTHING.

For example…

A folder called "Invoices" would have an "Invoice Number" field, but you wouldn't want this showing for records in the "Board Minutes" folder.

I've looked at editing the xml files, surely there is an easier way?

Regards
Scott
10 REPLIES 10

rwetherall
Confirmed Champ
Confirmed Champ
Hi,

Unfortunately there isn't yet an easy way to do this.  The best approach would be to edit/extend the DOD5015 content model to add the additional record information you want.

Longer term we would definitely like to make it easy for people to define custom record types and extend this area of the product.

Cheers,
Roy

beavis74
Champ in-the-making
Champ in-the-making
Thanks for your reply Roy.

Could you possibly be so kind as to give me some pointers on how to "edit the content model". I have the Professional Alfresco book, and followed the 'knowledge base' example on how to modify DOCUMENT management, but doing this in the records management module has stumped me. I tried editing some of the XML files but this seemed to break it! I got an error when trying to set the Record Type. Also, I read somewhere on this forum that doing this is not supported by Alfresco, is that correct?

Many thanks
Scott

croc
Champ in-the-making
Champ in-the-making
Hi,
I am not sure if you talk about a type which is part of [dod:filePlan, dod:recordSeries, dod:recordCategory, ….]
Or you talking about type, like when you click on File in a folder level. We have a Record Types that you select. And if it's those on Upload files window.
Here is the possible solution
START
There is couple of files that you'll need to check. But the most important are: dod5015-flash-upload.get.js and dod5015Model.xml

dod5015-flash-upload.get.js

/**
* Custom content types
*/
function getContentTypes()
{
   // TODO: Data webscript call to return list of available types
   var contentTypes = [
   {
      id: "cm:content",
      value: "cm_content"
   }];

   return contentTypes;
}

/**
* Record types
*/
function getRecordTypes()
{
   var recordTypes = [
   {
      id: "-",
      value: "default"
   },
   {
      id: "dod:scannedRecord",
      value: "scannedRecord"
   },
   {
      id: "dod:pdfRecord",
      value: "pdfRecord"
   },
   {
      id: "dod:digitalPhotographRecord",
      value: "digitalPhotographRecord"
   },
   {
      id: "dod:webRecord",
      value: "webRecord"
   }];
  
   return recordTypes;
}

model.contentTypes = getContentTypes();
model.recordTypes = getRecordTypes();

If you check the code above you'll realise that all the types that you have in RM, are there. and for testing you can add a new the code below:

   {
      id: "dod:testingType",
      value: "Testing Type"
   }

After restarting the application you will be able to see the new type added.

Though the name won't be correct because you'll have to add labels in your properties file.

I am sure you know that, the file/content you add, if it's of a certain type, it will have different fields to others if they aren't of the same type.
So you now need to have those fields declared somewhere, and that when dod5015Model.xml
I won't paste it here.

All those types are also there, and their fields.

They are declared in the form of aspects.
END

beavis74
Champ in-the-making
Champ in-the-making
Thank you croc. I'll give this a go and report back.

Regards
Scott

croc
Champ in-the-making
Champ in-the-making
Good luck!

rascio
Champ in-the-making
Champ in-the-making
Hi! I've a similary problem but i want to create a custom type instead of rma:recordFolder i've to create a custom folder. I've seen how it creates the folder and change with my custom type in dod5015-toolbar.js all functions, but when i try to click the button to create the folder a javascript exception is thrown and i can't see the dialog with the form. I've check the XHR request and all seems function correctly.

I think that there are some other files that i've to customize…someone has already made it?

vytbr2
Champ in-the-making
Champ in-the-making
Hello,
  I have one more question about integrating the new record type.
  I tried to add a new record type as described above, that is:
    - modified the model file dod5015Model.xml adding new aspect with properties
    - modified the dod5015-flash-upload.get.js to display this new type
    - modified the record-metadata.ftl template file to display the newly added properties

  After restarting the application and trying to File new record - the new document type appeared in the drop-down list of record types.
  But, when I file the record and select the Default type, then on the actions menu select 'Set Record Type' - the custom type doesn't show up in the drop-down list. It seemes that there is yet another file which needs to be modified… Is there another file or am i doing something wrong ?

thanks,
Vytas

luisfernando
Champ in-the-making
Champ in-the-making
Hi guys,

I followed the steps and it worked, only now to create the fields for this new type created I have to go in file dod5015Model.xml and add aspect, but when I add it gives an error.
 
  <aspect name=""dod:testingType">
            <title>Testing Type</title>     
            <properties>      
                <property name="dod:webFileName">
                    <title>Web File Name</title>
                    <type>d:text</type>
                    <mandatory>true</mandatory>
                    <index enabled="true">
                     <atomic>true</atomic>
                     <stored>false</stored>
                     <tokenised>false</tokenised>
                 </index>
                </property>
            </properties>
            <mandatory-aspects>
                <aspect>rma:filePlanComponent</aspect>
            </mandatory-aspects>
          </aspect>
could someone help me?

And another question, because when I add only that the file-flash-dod5015 upload.get.js
   
{
          id: "dod:testingType",
          value: "Testing Type"
    }
and run the alfresco and I will do in the Records Management and upload a new file with the new record type created it gives error and do not let upload file?

Thank you in advance

Luis Fernando

mautidavis
Champ in-the-making
Champ in-the-making
Hi,

Thanks for the provided guidance.

I've just added the necessary record types and it is working okay but when I go to the metadata I cannot see the fields which I added. What might be the issue?

Any ideas most welcome.

Davis