26 Sep 2007

New Alfresco tutorial on implementing custom behaviors

Posted by jpotts

I’ve written a follow-on article to “Alfresco Developer: Working with Custom Types”. This one is on implementing custom behavior. In the new article (with accompanying source code), I build on the SomeCo Whitepapers example by adding support to the content model for user-contributed ratings of whitepapers. The custom behavior is used to calculate the average rating for each piece of rated content.

My plan is to follow on shortly with an article that shows how to use Alfresco’s new REST-based Web Script framework to enable the front-end to rate (and get the rating of) content in the Alfresco repository.

So take a look and let me know what you think.

More about the Alfresco Developer Series.

Subscribe to Comments

15 Responses to “New Alfresco tutorial on implementing custom behaviors”

  1. [...] Jeff Potts from Optaros has published another excellent tutorial, this time on adding custom behaviors to Alfresco to support “rating/scoring” of content. [...]

     
  2. Hi Jeff,
    Thanks a lot for such great article.
    I like to have useful samples of Alfresco usage and customization.
    I would ask you how the performance of the rating sample would be improve, if the sc:rateable aspect stores the current sum and count of existing sc:ratings children ?
    The computeAverage() method won’t have to rescan all the children and will update the rating more efficiently.
    Hope to see your next article soon :-)
    Cordialement,
    David

     

    David Rideau

  3. @David…Agreed. Storing the sum and count as well as the average as part of the aspect would be an improvement. Thanks for the feedback. Glad the article was valuable.

     

    jpotts

  4. Jeff, superb article, thank you for taking the time to put things in a way we could learn more about Alfresco and its features.

    Regarding the webscripts tutorial, my question is when ?. Please deliver it as soon as you can.

    Thank you !

     

    Luis Sanchez

  5. @Luis — I’m glad you have found it valuable. I’m hoping to post it by the end of this week. After that, I’m thinking of doing one on advanced workflow with JBPM but I’m open to suggestions.

     

    jpotts

  6. Got it. Advanced workflow was in my wishlist. Thank you.

     

    Luis Sanchez

  7. Hi Jeff, When is your article on advanced workflow with JBPM coming!! I’m waiting for that!!!

    Thanks,
    Ven

     

    Ven

  8. [...] Implementing Custom Behaviors [...]

     
  9. Where could I find-out online tutorial related “Rating/Scoring” the documents or Most viewed or downloaded documents ???

    Any link / Any Help ?

     

    Ghanshyam

  10. Hi Jeff,

    Is it possible to achieve internationalization(i18n) to my web application through alfresco.If so kindly explain me in detail

     

    Stephen

  11. [...] functionality to the built-in category browsing for my custom categories: I implemented a Behavior that creates respectively removes links in the linked to custom category folder. This allows to [...]

     
  12. [...] developing a behavior I continually reference Jeff Potts’s tutorial on implementing behaviors. His table of available policies is a great quick reference.  Of course the definitive source is [...]

     
  13. [...] Alfresco behaviors can be very useful when you need to perform some system-level action as part of an operation on a node. For example, let’s say whenever an instance of my custom type is created, I want to generate a unique id value and record it in a custom attribute on the new node. I can register a behavior that handles the onCreateNode event, bind it to my custom type, and then I can provide a simple Java method to do the work of generating the id value and setting the property. If you’re new to behaviors, Jeff Potts provides an in-depth discussion and tutorial. [...]

     
  14. [...] I`m trying to make my own custom behaviour in alfresco 3.4.4 This led me to a great example from the ECMArchitect – Jeff Potts. [...]

     

    Custom Behaviour | alfresco123

  15. Hello Jeff and thanks for that wonderful tutorial!

    I’m trying to implement the javascript one. Since you stated “In this example the scripts are going to reside as part of the web application rather than being uploaded
    to the repository. Nothing requires that this be the case” I tried to remake it with the scripts in the repository.
    I guess I have to modify the “location” property but I couldn’t find how. Do I have to write my own java class extending org.alfresco.service.cmr.repository.ScriptLocation ?

     

    Lucas

Leave a Reply

Message: