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.
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”
Hi Jeff,
Very nice tutorial, but funny enough in CE 4.0.d I have to include again the type of sub-type in share-config-custom.xml in order to make it appear in Drawing 2. For example, with your definition I have to do this:
<type name="cm:content" >
<sub-type name="sc:doc" />
<sub-type name="sc:whitepaper" />
</type>
<type: name="sc:doc">
<sub-type name="sc:whitepaper" />
</type>
<!-- I have to add this in order to see "whitepaper" type in
"criteria" dropdown -->
<type name="sc:whitepaper" >
</type>
I can’t see it on Drawing 4. yet though.
Any clue?
Thanks
Hi Jeff,
I have the same problem of Cheers when I try to deploy actions-article-repo project, but not for the others. I tried to fit it but ant said the same things of Cheers.
Cheers got his working, so it isn’t a problem with the Ant script. Can you check to make sure you have JDK 1.6 by doing a java -version?
Jeff
Luis,
That should not be the case. I just re-confirmed that the form config works with no additional type element needed. One thing to note is that it matters what the type of the document currently is. For example, using my configuration, you will only see “doc” and “whitepaper” in the dropdown if the current type of the document is “cm:content” and you will only see “whitepaper” in the dropdown if the current type is “sc:doc”. If the current type is anything else you will not see either.
Maybe you are testing with a document that is currently set to a different type?
Jeff
Jeff,
You are right, my mistake, I overlooked some code in config file, it’s working now pretty nice I even use your directions and add my types to “create content” menu item.
Thanks for your help.
Luis
Hi Jeff,
java -version output is right.
I edited build.xml and now Ant can compile.
I added /java in javac source dir (line 56) as below:
Now I can deploy and all work fine.
Hacking with code in order to fit it to my custom action, I got a strange beahviour, I see the “out of the box” form instead of my custom one.
My custom action name is “param-rendition” and I have replaced all “MoveReplaced” with “ParamRendition” in rule-config-action.get.config.xml, rule-config-action-custom.js and rule-config-action-custom-min.js .
If I go back it works fine.
Where I wrong?
Thanks for your help,
Daniele
Jeff,
after many clean, all work fine!
Thanks for your help!
Daniele
Jeff,
Is it possible for me to know the link download address of Alfresco 4.0 d Community source code ?
If yes, I would be glad if you pass me the info.
Thanks
Sure, the source code lives here:
http://svn.alfresco.com/repos/alfresco-open-mirror/alfresco/HEAD
We don’t currently tag Alfresco Community releases, so you have to know the SVN revision number if you want the source as it existed when Alfresco 4.0.d was distributed. Luckily, that is usually documented in the release notes. To save you a search, the revision number for 4.0.d is 33365.
Also, if you are just trying to associate the source with some of the JARs for debugging purposes, note that the SDK ships with source for the classes distributed with it. So you may not necessarily need the full source tree, depending on what you’re trying to do.
Jeff
Jeff,
Thank you for your prompt respond, I will look into it.
Thanks
mdarmaone
Dear all,
Alfresco 4.0 aren”t find files names correctly, in the search, like the version 3.4. I think that the search engine is with a little bit trouble. Someone, here, have the same perception? and any clue to solve this? Please share…Many Thanks
Hi there,
I want to tell you that maybe this is not the appropiate blog to ask something referent to dashlets. But I can not find nothing about my requirement. I need to show in a dashlet the workflows history of the user. I found that there is a my tasks dashlet. But I guess that I have to build my own service to retrieve data from activiti history processes table. But, How do I can build something like that? I hope you can help me. Thanks for all your support.
Hi, very nice tutorial as usual. I’m havin a problem though, when extending ActionExecuterAbstractBase I’m getting a “The type org.springframework.beans.factory.BeanNameAware cannot be resolved. It is indirectly referenced from required .class files” error. I’m using maven and STS. I was able to extend/implement other Alfresco API classes/interfaces before. Any help would be much appreciated. Thanks.
Jeff Potts:I want to remove RSS feed icon from the repository page. So can you tell me in which file I need to remove it.I searched using SurfBug.But i am not able to find that Rss feed. I have Checked repo-toolbar.get.html.ftl file. I tried removing entire repo-toolbar.get.html.ftl file, Then entire toolbar was removed. I want just Rss Feed Icon to be removed. Can you tell me which file i need to cahnge?
Please take a look see if you can help give me some advice on customize my tasks dashlet:
https://forums.alfresco.com/en/viewtopic.php?f=48&t=47616
I have updated this tutorial. The new version uses the Alfresco Maven SDK and produces AMPs. The tutorial no longer includes instructions or source code for creating custom actions in Alfresco Explorer. It is entirely focused on Alfresco Share.
The new version of the tutorial is in HTML and lives here: https://ecmarchitect.com/alfresco-developer-series-tutorials/actions/tutorial/tutorial.html
Jeff