cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco 4.0c Modules Evaluators

m_scapoli
Champ in-the-making
Champ in-the-making
Hello, it's not so clear on how we can use Evaluators in Extensibility Module Deployment; can we use the "out of the box" evaluators also in module configuration file in the subcomponent evauation?
Like:
<module>
    <id>Blog Module (Conditionally Hide Title)</id>
    <components>
        <component>
            <scope>page</scope>
            <region-id>title</region-id>
            <source-id>site/{site}/dashboard</source-id>
            <sub-components>
                <sub-component id="default">
                    <evaluations>
                        <evaluation id="HideIfBlogDemoSite">
                            <evaluators>
                                <evaluator type="evaluator.doclib.action.isMimetype"></evaluator>
                            </evaluators>
                            <render>false</render>
                        </evaluation>
                    </evaluations>
                </sub-component>
            </sub-components>
        </component>
    </components>
</module>

or it's only possible to implements a new evaluator writing it in Java?

Thanks
4 REPLIES 4

afaust
Legendary Innovator
Legendary Innovator
Hello,

you can use doclib evaluators only for Share Document List or Document Details functionality. They are to be considered separate from the Surf Extensibility Module evaluators as they have a very different interface. You can reuse the existing evaluators, but only those that are actually meant for the Surf Extensibility feature, i.e. those with names like "site.component.evaluator" or "site.module.evaluator". Have a look inside the slingshot-application-context.xml for some out-of-the-box evaluators.

Regards
Axel

m_scapoli
Champ in-the-making
Champ in-the-making
Ok now, you think it's possible to create an Evaluator that load a subcomponent checking on the mimetype of the document opened in the Document Library?

I have roughly understand the basics on the module and subcomponent evaluators but in the examples they shows only RequestContext context "tricks", and I can't imagine where i can grab the mimetype reference for doing the check

Thanks again

afaust
Legendary Innovator
Legendary Innovator
Hello,

For the document details page, this would be possible: extract the nodeRef URL parameter and check the node metadata through a data web script call.

Regards
Axel

m_scapoli
Champ in-the-making
Champ in-the-making
With little modifications of that example I was able to code a Mimetype based sub-component Evaluator, I hope this will be helpful.

http://experiencewithalfresco.blogspot.dk/2012/06/type-subcomponent-evaluator.html

Regards