############################################################################################# # SELECTOR CONFIGURATION FILE # # Selectors are used when building packages to filter assets based on arbitrary criteria. # Selectors can either be a class that implements the AssetSelector interface, or a path to a drl file with # rules as to what is to be included (the rule file must be on the class path as indicated by that path). # ############################################################################################# #= OR ############################################################################################# #example: #testServer=com.yourcompany.YourSelector #prodServer=/SomeRules.drl # #You then use the above by name "testServer" in the package builder GUI. #Note "SomeRules.drl" would be in the classes folder under the WEB-INF folder (root of the classpath). ############################################################################################# ############################################################################################# #it knows its a rule file if it ends in .drl #the names are what you use in the GUI when building a package. ############################################################################################# ############################################################################################# #The contents of SomeRules.drl should follow the pattern of: #package org.drools.guvnor.server.selector # #dialect "mvel" # #import org.drools.repository.AssetItem #import org.drools.guvnor.server.selector.Allow # #rule "rule1" # when # AssetItem() # then # insert(new Allow()) #end #NOTE: to allow an asset, use "insert (new Allow())" # the fields that are available are the properties of AssetItem - # eg, statusDescription, lastModified, creator etc etc... #EXAMPLE: how to filter by status: #package org.drools.guvnor.server.selector # #dialect "mvel" # #import org.drools.repository.AssetItem #import org.drools.guvnor.server.selector.Allow # #rule "rule1" # when # AssetItem(statusDescription!="Draft") # then # insert(new Allow()) #end #the above will only allow non draft items. You put this drl in a file called "NonDraft.drl", and then #add an entry to this file: nonDraft=/path/to/NonDraft.drl, then use "nonDraft" as the selector name #in the package builder GUI. #############################################################################################