cancel
Showing results for 
Search instead for 
Did you mean: 

New Custom Evaluator

mrinal3199
Champ in-the-making
Champ in-the-making
Hi,

  What I need to achieve is like below :
- Where ever in document library, I have folder with some specific names eg: flder named as "Extranet" or "Published", I need to show one extra custom action of Bulk operation.
Currently I can see that action to every folders instead specific folder named as such..

I have created an evaluator in my share jar in the package "org.alfresco.web.evaluator.doclib.action" named as NameEqualsEvaluator.java. And in the share cnfig i have defined an action for the folders and evaluator id is given as "evaluator.doclib.action.isInstanceType". So, in Custom-slinshot-applicaton.xml, i have defined this id with parent as "org.alfresco.web.evaluator.doclib.action.NameEqualsEvaluator". I build this jar and laced it in "C:\alfresco\tomcat\webapps\share\WEB-INF\lib". I also have another utils jar which am keeping in "C:\alfresco\tomcat\webapps\alfresco\WEB-INF\lib". The problem is while starting the server, it is giving errr as:

org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'evaluator.doclib.action.isInstanceType' defined in URL [jar:file:/C:/Alfresco/tomcat/webapps/share/WEB-INF/lib/SkandiaShare.jar!/alfresco/web-extension/custom-slingshot-application-context.xml]: Could not resolve parent bean definition 'org.alfresco.web.evaluator.doclib.action.NameEqualsEvaluator'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'org.alfresco.web.evaluator.doclib.action.NameEqualsEvaluator' is defined

I am not getting why this class is not being loaded but every webscripts which i have in utils jar are working fine.

Please suggest me how to reslve this issue.

this way my Evaluator not working.

Anyone have achieved like this in alfresco share 4?

Thanks in advance
13 REPLIES 13

tonyrivet
Champ in-the-making
Champ in-the-making
I think the problem is that you compare the node name (the cm:name property) with childnames (cm:Extranet, cmSmiley Tongueublished, …).
nodeName.contains(name) will allways return false.
name.contains(nodeName) should work…

… but I don't think it's the best way to do this.
As your folder name change, your action won't be shown anymore. I think you should add a custom aspect (custom:exportable for example) to your folders and set a hasAspect evaluator on your bulk-export action…

mrinal3199
Champ in-the-making
Champ in-the-making
Hi Tony,

   No, The flders on which i want these action, those flders name will never change. I mean everytime there will be folder of these names and i want those actions only on these flders. So, this will not be a problem. Anyway with your help i am able to have this action on a folder named as "Extranet". But the problem is if i give more than one value in the list for the bean defined, then it is not displaying these actions on any of them. But my requirement is to show these actions on flders named as "Extranet", "Published" and "Release" i.e. for  more than one value. What changes should i do in the java file..?

Thanks

tonyrivet
Champ in-the-making
Champ in-the-making
Well, then it's pure logic…
You return false as soon as you find one value which doesn't match your folder name (i.e. you always return false if your list contains more than one value) whereas you should return true as soon as one value matches…

mrinal3199
Champ in-the-making
Champ in-the-making
Thanks Tony,

   I could get my requirement now. Many many thanks for all the help. Can you tel me how to resolve the fllowing problem:

I have made an action in alfresco for the folders which displays an UI having browse button for taking files. So, clicking on this action it calls a ftl file which is having html and java script functions. In case of an internet explorer it gives me the real path from where i loaded the file but in chrome it is giving some "C:\fakeath\*…xls". Can any one help me with this on how to solve it and get the real path in chrome also instead of fakeath. I knw there is sme security restrictions in chrome. But is there any other way to make this browse file button browser independent.

Thanks