23rd Jan, 2012

Alfresco Tutorial: Custom actions including Share configuration

I’ve published a revision of my original Alfresco custom actions tutorial. The second edition greatly expands on the first by adding a UI action example. The original included only a rule action example. Just like the second edition of the content types tutorial, I’ve added instructions on how to configure the actions in Alfresco Share. The Alfresco Explorer steps are still there–they’ve been moved to the Appendix.

The code that accompanies the tutorial builds on the content types tutorial, so it includes the SomeCo content model and the user interface configuration needed to expose that to the Alfresco Share and Alfresco Explorer user interface.

This should be helpful to anyone who read the first edition who now wants to learn how to do the same thing using Alfresco Share, including some of the new extension points available in Alfresco 4.

Take a look and tell me what you think.

Responses

[...] by Jeff’s post the other day on developing custom actions for Share, I’ve spent a small amount of time this week revisiting the custom Document Library actions [...]

I’m using alfresco commubity 4.0.d

I have download alfresco-community-sdk-4.0.d.

I try to use Tagging sample in alfresco sdk.

I have do following step to deploy and test. But It doesn’t work:

build step

1/ cp /usr/local/tomcat/apache-tomcat-6.0.33/webapps/alfresco.war /root/alfresco-sdk4.0.a/samples/TaggingSample

in folder: /root/alfresco-sdk4.0.a/samples/TaggingSample:

2/ ant compile

3/ ant integrate-extension

4/ stop tomcat. ( killall -9 java )

5/ rm -rf /usr/local/tomcat/apache-tomcat-6.0.33/webapps/alfresco

6/ cp alfresco.war /usr/local/tomcat/apache-tomcat-6.0.33/webapps/

7/ restart tomcat: /usr/local/tomcat/apache-tomcat-6.0.33/bin/startup.sh

Test result:

login alresco.
in Company Home. click: More Actions
–> chose Manage Content Rules
–> click create rule.
–> Select Condition , chose all Items
–> click add to list.
–> click next.

In select action list: I donot see option: Add tags to an item.
Are there any thing wrong?

Please help me.

Or please tell me the way to build alfresco sdk samples.

I have try to post this questin to alfresco forum.
But no one answer my question.

So please help me.

htk_tset,

I’ve updated the thread you started in the forums with a reply:
https://forums.alfresco.com/en/viewtopic.php?f=14&t=42915

Jeff

Hi jeff,

Your tutorial is very clear, in fact I figured out how to create a new action that affects only folders.

I want to do a javascript action not java. The thing that is clear to me is:

what form should I write the controller? and where should I put my js files?

thanks jeff

Glad the tutorial is working for you. If you want to use JavaScript for actions, you have two choices. You can either use the “execute-script” action that already exists, and point it to your JavaScript file that lives in Data Dictionary/Scripts (this is what you’d do for a rule, for example), or you can write a custom Java class that implements ActionExecuter, and have it load and execute JavaScript from the classpath. You could then re-use that Java class for all of your JavaScript-based actions.

Jeff

Hi Jeff,

thanks for the reply, Now I have a problem I can not deploy your code because when I deploy with ant on eclipse returned this error:

Error running javac.exe compiler on line 56 of file build.xml.

This is the offending line:
javac srcdir=”${src.dir}” destdir=”${bin.dir}” source=”1.6″ target=”1.6″ debug=”on” fork=”yes”

Leave a response

Your response:

Categories