cancel
Showing results for 
Search instead for 
Did you mean: 

How to fill custom prop with DocId like unique identifier?

alexr
Champ in-the-making
Champ in-the-making
We are in the process of migrating from Stellent/Intradoc to Alfresco.
One of the features of Intradoc is having a simple document Id as a read-only field that will be used by end-users to refer to in business communications (email, other documents etc.).
The DocId has the following format: AA006001, AA006002 etc. Since it's an simple number to communicate and not a cryptic number like for instance a Documentum Document Id starting with 09…….. etc.
I know a unique record identifier is something that is touched upon by record management, but I am only looking for this specific feature.

Then I came across the Action "Increment Counter"  as a create rule feature.

What counter is this and can it be read/manipulated from within a JavaScript.

The node-id of documents is quite cryptic, so I can't see how I can convert this to a simple but Unique doc identifier.  Haven't found a JavaScript method to retrieve node-id's.


I have to be sure that there is a automatic mechanism that generates a unique number each time content is added (either through a rule or otherwise).

What would be the simplest approach? I want to keep things as default and simple as possible. At the moment there is no need for implementing a Records Management solution.

Kind regards,

Alex
37 REPLIES 37

kevinr
Star Contributor
Star Contributor
As well as the nodeid - which is globally unique - each node in the repository has a db-nodeid, this is much simpler value (a long int) which increments with each new objects added to the repository. The value for a node can be accessed from the property:

sys:node-dbid

This value is only unique within a specific repository. So as long as you know which store you are looking at, this is unique.

The Increment Counter action is an action that can be used to log counts to a document. It increments a counter value against a node with every execution.

Hope this helps,

Kevin

alexr
Champ in-the-making
Champ in-the-making
Thanks Kevin.

I created a JavaScript to generate a unique Document Id  based on the property you mentioned and it works Smiley Happy
Added this to an inbound rule, so now every new document created has a identifier DD00xxxx.


Regards,

Alex

revnouz
Champ in-the-making
Champ in-the-making
Kevin,
So where do you see that document log count? or how do you get to it?

Thanks

gavinc
Champ in-the-making
Champ in-the-making
Add the following to your web-client-config-custom.xml file:

   <config evaluator="aspect-name" condition="countable">
      <property-sheet>
         <show-property name="counter" read-only="true" />
      </property-sheet>
   </config>

revnouz
Champ in-the-making
Champ in-the-making
Thank you Kevin.

snowch
Champ in-the-making
Champ in-the-making
Alex,

Would you be happy to post your javascript?  I'm a newbie to Alfresco, so it would save me a lot of time!

Many thanks,

Chris

orion
Champ in-the-making
Champ in-the-making
Good day,

This is a good tip, i make the change and the result is good. I have one answer, we use the spanish version and at the metadata appears counter.

What must we do to translate the word counter. We try to make that at the custommodel.xml but does not work.

Thanks for your help…

stebans
Champ in-the-making
Champ in-the-making
Hi all,

For some reasons, the counter is not incremented (it remains at value 1).  So maybe, I don't understand what it's intended for…  As I need to add an ordering number to each document uploaded to a space, I thought this could be achieved through the counter.

Maybe I'm in the wrong topics for asking this question, but what would be the best way to get this number and then write it back into the document (say a MSWord or OpenOffice document?).  Would it be with a Custom Action using POI?

Thanks for your help,
Regards
Stéphane

mrosado
Champ in-the-making
Champ in-the-making
Thanks Kevin.

I created a JavaScript to generate a unique Document Id  based on the property you mentioned and it works Smiley Happy
Added this to an inbound rule, so now every new document created has a identifier DD00xxxx.


Regards,

Alex

Hi, I have the some problem that you have mentioned earlier …
“I have to be sure that there is a automatic mechanism that generates a unique number each time content is added (either through a rule or otherwise).”
… and I need to make visible that number to the end-users. Can you help me? Or someone else?