本文整理汇总了Java中org.alfresco.service.cmr.dictionary.InvalidAspectException类的典型用法代码示例。如果您正苦于以下问题:Java InvalidAspectException类的具体用法?Java InvalidAspectException怎么用?Java InvalidAspectException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InvalidAspectException类属于org.alfresco.service.cmr.dictionary包,在下文中一共展示了InvalidAspectException类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testResidual
import org.alfresco.service.cmr.dictionary.InvalidAspectException; //导入依赖的package包/类
public void testResidual() throws Exception
{
// Add the residual aspect
Map<QName, Serializable> props = new HashMap<QName, Serializable>(5);
props.put(PROP_QNAME_RESIDUAL_STRING, "ABC");
props.put(PROP_QNAME_RESIDUAL_LONG, Long.valueOf(123));
try
{
nodeService.addAspect(rootNodeRef, ASPECT_RESIDUAL, props);
}
catch (InvalidAspectException e)
{
// Expected
}
//
// // Get the values back
// Map<QName, Serializable> propsCheck = nodeService.getProperties(rootNodeRef);
// assertEquals("Residual properties not present and equal. ", props, propsCheck);
// assertTrue("Expect residual aspect to be present.", nodeService.hasAspect(rootNodeRef, ASPECT_RESIDUAL));
//
// setComplete();
// endTransaction();
}
示例2: addAspect
import org.alfresco.service.cmr.dictionary.InvalidAspectException; //导入依赖的package包/类
@Override
public void addAspect(NodeRef nodeRef, QName aspectTypeQName, Map<QName, Serializable> aspectProperties)
throws InvalidNodeRefException, InvalidAspectException
{
apiFacet.getNodeService().addAspect(nodeRef,
aspectTypeQName,
aspectProperties);
}
示例3: addAspect
import org.alfresco.service.cmr.dictionary.InvalidAspectException; //导入依赖的package包/类
@Override
public void addAspect(NodeRef nodeRef, QName aspectTypeQName, Map<QName, Serializable> aspectProperties)
throws InvalidNodeRefException, InvalidAspectException
{
getTrait().addAspect(materializeIfPossible(nodeRef),
aspectTypeQName,
aspectProperties);
}
示例4: removeAspect
import org.alfresco.service.cmr.dictionary.InvalidAspectException; //导入依赖的package包/类
@Override
public void removeAspect(NodeRef nodeRef, QName aspectTypeQName)
throws InvalidNodeRefException, InvalidAspectException
{
getTrait().removeAspect(materializeIfPossible(nodeRef),
aspectTypeQName);
}
示例5: hasAspect
import org.alfresco.service.cmr.dictionary.InvalidAspectException; //导入依赖的package包/类
/**
* Performs a check on the set of node aspects
*/
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public boolean hasAspect(NodeRef nodeRef, QName aspectQName) throws InvalidNodeRefException, InvalidAspectException
{
if (aspectQName.equals(ContentModel.ASPECT_PENDING_DELETE))
{
return isPendingDelete(nodeRef);
}
Pair<Long, NodeRef> nodePair = getNodePairNotNull(nodeRef);
return nodeDAO.hasNodeAspect(nodePair.getFirst(), aspectQName);
}
示例6: addAspect
import org.alfresco.service.cmr.dictionary.InvalidAspectException; //导入依赖的package包/类
/**
* @throws UnsupportedOperationException always
*/
public void addAspect(NodeRef nodeRef, QName aspectRef, Map<QName, Serializable> aspectProperties) throws InvalidNodeRefException, InvalidAspectException
{
// This operation is not supported for a version store
throw new UnsupportedOperationException(MSG_UNSUPPORTED);
}
示例7: hasAspect
import org.alfresco.service.cmr.dictionary.InvalidAspectException; //导入依赖的package包/类
/**
* Translation for version store
*/
public boolean hasAspect(NodeRef nodeRef, QName aspectRef) throws InvalidNodeRefException, InvalidAspectException
{
return getAspects(nodeRef).contains(aspectRef);
}
示例8: removeAspect
import org.alfresco.service.cmr.dictionary.InvalidAspectException; //导入依赖的package包/类
/**
* @throws UnsupportedOperationException always
*/
public void removeAspect(NodeRef nodeRef, QName aspectRef) throws InvalidNodeRefException, InvalidAspectException
{
// This operation is not supported for a version store
throw new UnsupportedOperationException(MSG_UNSUPPORTED);
}
示例9: addAspect
import org.alfresco.service.cmr.dictionary.InvalidAspectException; //导入依赖的package包/类
void addAspect(NodeRef nodeRef, QName aspectTypeQName, Map<QName, Serializable> aspectProperties)
throws InvalidNodeRefException, InvalidAspectException;
示例10: addAspect
import org.alfresco.service.cmr.dictionary.InvalidAspectException; //导入依赖的package包/类
@Override
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public void addAspect(
NodeRef nodeRef,
QName aspectTypeQName,
Map<QName, Serializable> aspectProperties)
throws InvalidNodeRefException, InvalidAspectException
{
// check that the aspect is legal
AspectDefinition aspectDef = dictionaryService.getAspect(aspectTypeQName);
if (aspectDef == null)
{
throw new InvalidAspectException("The aspect is invalid: " + aspectTypeQName, aspectTypeQName);
}
// Don't allow spoofed aspect(s) to be added
if (aspectTypeQName.equals(ContentModel.ASPECT_PENDING_DELETE))
{
throw new IllegalArgumentException("The aspect is reserved for system use: " + aspectTypeQName);
}
// Check the properties
if (aspectProperties == null)
{
// Make a map
aspectProperties = Collections.emptyMap();
}
// Make the properties immutable to be sure that they are not used incorrectly
aspectProperties = Collections.unmodifiableMap(aspectProperties);
// Invoke policy behaviours
invokeBeforeUpdateNode(nodeRef);
// Add aspect and defaults
Pair<Long, NodeRef> nodePair = getNodePairNotNull(nodeRef);
// SetProperties common tasks
setPropertiesCommonWork(nodePair, aspectProperties);
boolean modified = addAspectsAndProperties(
nodePair,
aspectTypeQName,
null,
null,
Collections.singleton(aspectTypeQName),
aspectProperties,
false);
if (modified)
{
// Invoke policy behaviours
invokeOnUpdateNode(nodeRef);
// Index
nodeIndexer.indexUpdateNode(nodeRef);
}
}
示例11: addAspect
import org.alfresco.service.cmr.dictionary.InvalidAspectException; //导入依赖的package包/类
/**
* Applies an aspect to the given node. After this method has been called,
* the node with have all the aspect-related properties present
*
* @param nodeRef NodeRef
* @param aspectTypeQName the aspect to apply to the node
* @param aspectProperties a minimum of the mandatory properties required for
* the aspect
* @throws InvalidNodeRefException
* @throws InvalidAspectException if the class reference is not to a valid aspect
*
* @see org.alfresco.service.cmr.dictionary.DictionaryService#getAspect(QName)
* @see org.alfresco.service.cmr.dictionary.ClassDefinition#getProperties()
*/
@Auditable(parameters = {"nodeRef", "aspectTypeQName", "aspectProperties"})
public void addAspect(
NodeRef nodeRef,
QName aspectTypeQName,
Map<QName, Serializable> aspectProperties)
throws InvalidNodeRefException, InvalidAspectException;
示例12: removeAspect
import org.alfresco.service.cmr.dictionary.InvalidAspectException; //导入依赖的package包/类
/**
* Remove an aspect and all related properties from a node
*
* @param nodeRef NodeRef
* @param aspectTypeQName the type of aspect to remove
* @throws InvalidNodeRefException if the node could not be found
* @throws InvalidAspectException if the the aspect is unknown or if the
* aspect is mandatory for the <b>class</b> of the <b>node</b>
*/
@Auditable(parameters = {"nodeRef", "aspectTypeQName"})
public void removeAspect(NodeRef nodeRef, QName aspectTypeQName)
throws InvalidNodeRefException, InvalidAspectException;
示例13: hasAspect
import org.alfresco.service.cmr.dictionary.InvalidAspectException; //导入依赖的package包/类
/**
* Determines if a given aspect is present on a node. Aspects may only be
* removed if they are <b>NOT</b> mandatory.
*
* @param nodeRef NodeRef
* @param aspectTypeQName QName
* @return Returns true if the aspect has been applied to the given node,
* otherwise false
* @throws InvalidNodeRefException if the node could not be found
* @throws InvalidAspectException if the aspect reference is invalid
*/
@Auditable(parameters = {"nodeRef", "aspectTypeQName"})
public boolean hasAspect(NodeRef nodeRef, QName aspectTypeQName)
throws InvalidNodeRefException, InvalidAspectException;