How define spring bean for creating a custom action (Problem with attribute parent="action-executer") ??

cancel
Showing results for 
Search instead for 
Did you mean: 
lina
Active Member

How define spring bean for creating a custom action (Problem with attribute parent="action-executer") ??

I create a custom action using an extension under site-data folder, I create a custom model and i the action executer class, but when i define it under the file XXX-context.xml like :

<bean id='doc-tagging' class='com.capgemini.TagActionExecuter' parent='action-executer'>

........

</bean>

I had the following EXCEPTION !!!!!

Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'action-executer' is defined
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:575)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1111)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedBeanDefinition(AbstractBeanFactory.java:892)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedBeanDefinition(AbstractBeanFactory.java:1166)
... 17 more

S.O. can help me please !!!

7 Replies
afaust
Master

Re: How define spring bean for creating a custom action (Problem with attribute parent="action-executer") ??

Where did you place that configuration file? The bean exists and any such error could simply be caused by putting that configuration file in the wrong location (e.g. Share instead of Repository). I would expect that file to be located in an alfresco/extension/ path.

lina
Active Member

Re: How define spring bean for creating a custom action (Problem with attribute parent="action-executer") ??

Hello,

I placed it under src\main\amp\config\alfresco\web-extension in the file of config internship-share-slingshot-application-context.xml.

I think that it need to configure the pom.xml by adding dependencies about alfresco repos ?? No??

Have you any idea ?

afaust
Master

Re: How define spring bean for creating a custom action (Problem with attribute parent="action-executer") ??

That path is the wrong one for a Repository-tier action bean. If you are developing a customisation for the Alfresco Share user interface you should have (at least) two separate module projects - one for Share and one for Repository. If you are using the AIO archetype from Alfresco SDK these would be sub-modules of the project you generated. The Java-based action implementation will always be part of the Repository project and its Spring configuration should be placed in the src\main\amp\config\alfresco\extension\.

This has nothing to do with dependencies in any POM, only with your project setup. The Share-tier project will typically only contain the share-config-custom.xml file where you define the action to be shown in the Share UI.

lina
Active Member

Re: How define spring bean for creating a custom action (Problem with attribute parent="action-executer") ??

yes i have 2 separate projects, i create a custom module extension for actions under src\main\amp\config\alfresco\web-extension\site-data\extensions\customAction-extension-modules.xml in the share project and i have the config file in the same project inder src\main\amp\config\alfresco\web-extension\site-data\extensions\internship-share-slingshot-application-context.xml to config beans , So added the bean in this file to refer my action executer class that situated under src/main/java in the share project .

I DON't manage the repository project 

afaust
Master

Re: How define spring bean for creating a custom action (Problem with attribute parent="action-executer") ??

Again, you have to put the *-context.xml with your bean that has the parent="action-executer" into the Repository project in the path src\main\amp\config\alfresco\extension.Everything else will not work... It has not place being in any web-extension or site-data path... The src\main\amp\config\alfresco\web-extension\site-data\extensions path is only meant for Surf extension modules, not for Spring configuration files.

I can only recommend working through Jeff Potts‌'s tutorial on custom actions.

lina
Active Member

Re: How define spring bean for creating a custom action (Problem with attribute parent="action-executer") ??

Thank you !!!! I resolved it, but now i want to add content (folder or file ) when i create folder with a custom type "kb:folder". I add extension in share project, in the balise <create-content> i added this code: <content id="kbFolder" label="My Kb Folder" itemid="kb:folder"
icon="kbfolder" /> 

It added to the list of content type in document library with the icon ==> OK, the form of differents properties of my model is showen but now i want to customise the create button to create under this custom folder another folder or file in the same time (to create a node and child of this node in the same time)

Have you any idea about this? THANK YOU !!!!

lina
Active Member

Re: How define spring bean for creating a custom action (Problem with attribute parent="action-executer") ??

hi,

when can i place an xml file config for auditing content, i have 2 project (alfresco et share).

content of the file is:

<?xml version='1.0' encoding='UTF-8'?>
<Audit xmlns="http://www.alfresco.org/repo/audit/model/3.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.alfresco.org/repo/audit/model/3.2 alfresco-audit-3.2.xsd">
<DataExtractors>
<DataExtractor name="simpleValue" registeredName="auditModel.extractor.simpleValue" />
<DataExtractor name="nodeName" registeredName="auditModel.extractor.nodeName" />
<DataExtractor name="nodeType" registeredName="auditModel.extractor.nodeType" />

<!-- Custom data extractor -->
<DataExtractor name="siteName"
class="org.alfresco.tutorial.audit.dataextractor.SiteNameDataExtractor" />
</DataExtractors>

.......

Thks