本文整理匯總了Java中org.alfresco.repo.action.ActionConditionImpl.setParameterValue方法的典型用法代碼示例。如果您正苦於以下問題:Java ActionConditionImpl.setParameterValue方法的具體用法?Java ActionConditionImpl.setParameterValue怎麽用?Java ActionConditionImpl.setParameterValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.alfresco.repo.action.ActionConditionImpl
的用法示例。
在下文中一共展示了ActionConditionImpl.setParameterValue方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testContentPropertyComparisons
import org.alfresco.repo.action.ActionConditionImpl; //導入方法依賴的package包/類
public void testContentPropertyComparisons()
{
ActionConditionImpl condition = new ActionConditionImpl(GUID.generate(), ComparePropertyValueEvaluator.NAME);
// What happens if you do this and the node has no content set yet !!
// Add some content to the node reference
ContentWriter contentWriter = this.contentService.getWriter(this.nodeRef, ContentModel.PROP_CONTENT, true);
contentWriter.setEncoding("UTF-8");
contentWriter.setMimetype(MimetypeMap.MIMETYPE_TEXT_PLAIN);
contentWriter.putContent("This is some test content.");
// Test matching the mimetype
condition.setParameterValue(ComparePropertyValueEvaluator.PARAM_VALUE, MimetypeMap.MIMETYPE_TEXT_PLAIN);
assertTrue(this.evaluator.evaluate(condition, this.nodeRef));
condition.setParameterValue(ComparePropertyValueEvaluator.PARAM_VALUE, MimetypeMap.MIMETYPE_HTML);
assertFalse(this.evaluator.evaluate(condition, this.nodeRef));
}
示例2: testTempFileNames
import org.alfresco.repo.action.ActionConditionImpl; //導入方法依賴的package包/類
/**
* Test some combinations of test file names that had been failing
*/
public void testTempFileNames()
{
ActionConditionImpl condition = new ActionConditionImpl(GUID.generate(), ComparePropertyValueEvaluator.NAME);
condition.setParameterValue(ComparePropertyValueEvaluator.PARAM_PROPERTY, PROP_TEXT);
condition.setParameterValue(ComparePropertyValueEvaluator.PARAM_VALUE, "~*.doc");
this.nodeService.setProperty(this.nodeRef, PROP_TEXT, "~1234.doc");
assertTrue(this.evaluator.evaluate(condition, this.nodeRef));
}
示例3: testContentPropertyComparisons
import org.alfresco.repo.action.ActionConditionImpl; //導入方法依賴的package包/類
public void testContentPropertyComparisons()
{
ActionConditionImpl condition = new ActionConditionImpl(GUID.generate(), ComparePropertyValueEvaluator.NAME);
condition.setParameterValue(ComparePropertyValueEvaluator.PARAM_PROPERTY, ContentModel.PROP_CONTENT);
// What happens if you do this and the node has no content set yet !!
// Add some content to the node reference
ContentWriter contentWriter = this.contentService.getWriter(this.nodeRef, ContentModel.PROP_CONTENT, true);
contentWriter.setEncoding("UTF-8");
contentWriter.setMimetype(MimetypeMap.MIMETYPE_TEXT_PLAIN);
contentWriter.putContent("This is some test content.");
// Test matching the mimetype
condition.setParameterValue(ComparePropertyValueEvaluator.PARAM_CONTENT_PROPERTY, ContentPropertyName.MIME_TYPE.toString());
condition.setParameterValue(ComparePropertyValueEvaluator.PARAM_VALUE, MimetypeMap.MIMETYPE_TEXT_PLAIN);
assertTrue(this.evaluator.evaluate(condition, this.nodeRef));
condition.setParameterValue(ComparePropertyValueEvaluator.PARAM_VALUE, MimetypeMap.MIMETYPE_HTML);
assertFalse(this.evaluator.evaluate(condition, this.nodeRef));
// Test matching the encoding
condition.setParameterValue(ComparePropertyValueEvaluator.PARAM_CONTENT_PROPERTY, ContentPropertyName.ENCODING.toString());
condition.setParameterValue(ComparePropertyValueEvaluator.PARAM_VALUE, "UTF-8");
assertTrue(this.evaluator.evaluate(condition, this.nodeRef));
condition.setParameterValue(ComparePropertyValueEvaluator.PARAM_VALUE, "UTF-16");
assertFalse(this.evaluator.evaluate(condition, this.nodeRef));
// Test comparision to the size of the content
condition.setParameterValue(ComparePropertyValueEvaluator.PARAM_CONTENT_PROPERTY, ContentPropertyName.SIZE.toString());
condition.setParameterValue(ComparePropertyValueEvaluator.PARAM_OPERATION, ComparePropertyValueOperation.LESS_THAN.toString());
condition.setParameterValue(ComparePropertyValueEvaluator.PARAM_VALUE, 50);
assertTrue(this.evaluator.evaluate(condition, this.nodeRef));
condition.setParameterValue(ComparePropertyValueEvaluator.PARAM_VALUE, 2);
assertFalse(this.evaluator.evaluate(condition, this.nodeRef));
}
示例4: testMultiValuedPropertyComparisons
import org.alfresco.repo.action.ActionConditionImpl; //導入方法依賴的package包/類
public void testMultiValuedPropertyComparisons()
{
ActionConditionImpl condition = new ActionConditionImpl(GUID.generate(), ComparePropertyValueEvaluator.NAME);
condition.setParameterValue(ComparePropertyValueEvaluator.PARAM_PROPERTY, PROP_MULTI_VALUE);
condition.setParameterValue(ComparePropertyValueEvaluator.PARAM_OPERATION, ComparePropertyValueOperation.CONTAINS.toString());
condition.setParameterValue(ComparePropertyValueEvaluator.PARAM_VALUE, "Document");
assertTrue(this.evaluator.evaluate(condition, this.nodeRef));
condition.setParameterValue(ComparePropertyValueEvaluator.PARAM_VALUE, "bobbins");
assertFalse(this.evaluator.evaluate(condition, this.nodeRef));
}