cancel
Showing results for 
Search instead for 
Did you mean: 

Declare records via foundation API

gernot
Champ in-the-making
Champ in-the-making
Hi,

Is it possible to declare a record via the alfresco repository API?
Adding the aspect rma:declaredRecord + properties rma:declaredBy and rma:declaredAt does not seem to work…
Any ideas?

Regards,
Gernot
9 REPLIES 9

derek
Star Contributor
Star Contributor
Hi,
The RM application uses the RM services in very specific ways - it is inadvisable to attempt to reproduce the behaviour using anything but these services, which themselves have not been written for anything other than the RM application.

gernot
Champ in-the-making
Champ in-the-making
Thanks Derek.

frandepau
Champ in-the-making
Champ in-the-making
hello,

i have the same problem, so can i use the RM services out of the RM module?? can i only modify records and folders via share, imap or cifs or there is another way??

Thanks

mrogers
Star Contributor
Star Contributor
Yes you can use the RM services.   But you will run into difficulty if, like the first post in this thread, you only do part of the required action.

Under the covers RM works via a set of "RMActions" and you can call those.   Its exactly how the RM Share interface works.

agovikar
Champ in-the-making
Champ in-the-making
Hi mrogers,
I am trying to declare a document as record programatically using below code but its throwing ModelAccessDeniedException, even though the user has sufficient permissions to file records through UI.

Map<QName, Serializable> declaredProps = new HashMap<QName, Serializable>(2);
declaredProps.put(RecordsManagementModel.PROP_DECLARED_AT, new Date());
declaredProps.put(RecordsManagementModel.PROP_DECLARED_BY, "ABC);
System.out.println("before declaring record");
registry.getNodeService().addAspect(pdfNodeRef, RecordsManagementModel.ASPECT_DECLARED_RECORD, declaredProps);

I have even tried to call the rest api http://localhost:8080/alfresco/service/api/rma/actions/ExecutionQueue?alf_ticket=TICKET_XXXX
by passing below params but no luck.
{
"name":"declareRecord",
"nodeRef":"workspace://SpacesStore/9418526e-496c-4789-8d4a-2002d66c8ed3"
}

Could you please tell me what is the right way to declare the records.

frandepau
Champ in-the-making
Champ in-the-making
hi,

is it possible to download the RM services source or the javadoc from anywhere? i get only the *.classes from the alfresco-dod5015.jar

thanks

derek
Star Contributor
Star Contributor

frandepau
Champ in-the-making
Champ in-the-making
Thank a lot

gernot
Champ in-the-making
Champ in-the-making
Yes you can use the RM services.   But you will run into difficulty if, like the first post in this thread, you only do part of the required action.

Under the covers RM works via a set of "RMActions" and you can call those.   Its exactly how the RM Share interface works.

I am currently trying to declare a record by reproducing the exact same steps as in org.alfresco.module.org_alfresco_module_dod5015.DeclareRecordAction:


// Add the declared aspect
Map<QName, Serializable> declaredProps = new HashMap<QName, Serializable>(2);
declaredProps.put(PROP_DECLARED_AT, new Date());
declaredProps.put(PROP_DECLARED_BY, AuthenticationUtil.getRunAsUser());
this.nodeService.addAspect(actionedUponNodeRef, ASPECT_DECLARED_RECORD, declaredProps);
                   
// remove all owner related rights
this.ownableService.setOwner(actionedUponNodeRef, OwnableService.NO_OWNER);

Unfortunately, the item is not updated with the rma:declaredRecord and stays in the undeclared state.
Does anyone have an idea?