cancel
Showing results for 
Search instead for 
Did you mean: 

How to use RecordsManagementActionService in action class?

hanscrg
Champ in-the-making
Champ in-the-making
I need to file/declare record in a java action class. How to get the reference to RecordsManagementActionService? It seems simply configure it in spring context xml to injection like nodeservice does not work.

Thanks advance.
5 REPLIES 5

csabee
Champ in-the-making
Champ in-the-making
Look at this .java source:
http://svn.alfresco.com/repos/alfresco-open-mirror/alfresco/HEAD/root/modules/dod-5015/source/java/o...

This java class is referenced in rm-service-context.xml

hanscrg
Champ in-the-making
Champ in-the-making
In rm-service-context.xml, there is an instance ,

<bean id="recordsManagementActionService" class="org.alfresco.module.org_alfresco_module_dod5015.action.RecordsManagementActionServiceImpl" init-method="init" lazy-init="default" autowire="default" dependency-check="default">
  <property name="policyComponent" ref="policyComponent" />
  <property name="nodeService" ref="NodeService" />
</bean>

where is the place to define policyComponent? I did not find it in rm-service-context.xml.

Thanks in advance.

rwetherall
Confirmed Champ
Confirmed Champ
Can you explain a little more about what you are trying to do here?

Do you want to inject the RecordsManagementActionService onto your own bean?

What errors are you seeing?

hanscrg
Champ in-the-making
Champ in-the-making
Roy,

here is my scenario, I create a record folder in file plan. That seems works fine. Now I need to move a file (content type) into the new record folder. I use the node service to do the move and add record aspect and set the mandatory properties. Then use record management action service to declare it as record. But the file still looks as the normal content file. There is no error logged.

All those logic happend in an action class. I configured context xml to inject RecordsManagementActionService class. But I beleive there is still some trick I do not know. My code is based on the unit testing code in dod5015 module in svn.

Hopefully you can post some working example to show us how to use record service api. The existing Alfresco Record Management book does not talk about this. This is really a missing part.

Thank you so much for the help.

davidcancool
Champ in-the-making
Champ in-the-making
Yes, I think these all we need to learn!Thank you for your words