Adding Custom Action in Share Using Predefined Evaluators

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2012 09:15 AM
I'm adding a custom action in share based on its mimetype. Can I use the IsMimetype evaluator directly or do I have to make a child of that declared in another bean?
I'd like this action to only show on zip files. In my Share config, I'm trying to use IsMimetype directly by feeding it a mimetypes list. I can't get this working and I'm not sure if it's my configuration that's wrong or if you can't use IsMimetype directly within the Share config as I am trying to do.
I'd like this action to only show on zip files. In my Share config, I'm trying to use IsMimetype directly by feeding it a mimetypes list. I can't get this working and I'm not sure if it's my configuration that's wrong or if you can't use IsMimetype directly within the Share config as I am trying to do.
<action id="aeroCOMPASS.doclib.action.ZipImport" label="message.ZipImport.label" type="javascript" > <param name="function">onActionZipImport</param> <param name="successMessage">message.ZipImport.success</param> <param name="failureMessage">message.ZipImport.failure</param> <evaluator id="evaluator.doclib.action.isMimetype"> <property name="mimetypes"> <list> <value>ZIP</value> </list> </property> </evaluator> </action>
Labels:
- Labels:
-
Archive
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2012 09:33 AM
One obvious problem is that the mimetype for zip files is actually application/zip, not ZIP.
Thanks,
Mike
Thanks,
Mike
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2012 09:34 AM
'ZIP' is not a valid MIME type, as Mike says. See http://en.wikipedia.org/wiki/Internet_media_type for background reading.
But to answer your main question, you do need to declare your Spring bean (for the evaluator) in a separate file to your action declaration, since the latter is Alfresco-specific rather than Spring config.
You don't mention which file you have placed the config above in, but the simplest approach is normally to place custom Alfresco config in share-config-custom.xml and custom Spring config in a *-context.xml file, both under tomcat/shared/alfresco/web-extension.
Cheers,
Will
But to answer your main question, you do need to declare your Spring bean (for the evaluator) in a separate file to your action declaration, since the latter is Alfresco-specific rather than Spring config.
You don't mention which file you have placed the config above in, but the simplest approach is normally to place custom Alfresco config in share-config-custom.xml and custom Spring config in a *-context.xml file, both under tomcat/shared/alfresco/web-extension.
Cheers,
Will

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2012 09:45 AM
Got it. Thanks guys.
