当前位置: 首页>>代码示例>>Java>>正文


Java InvalidAspectException类代码示例

本文整理汇总了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();
    }
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:24,代码来源:BaseNodeServiceTest.java

示例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);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:9,代码来源:AlfrescoEnviroment.java

示例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);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:9,代码来源:VirtualNodeServiceExtension.java

示例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);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:8,代码来源:VirtualNodeServiceExtension.java

示例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);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:14,代码来源:DbNodeServiceImpl.java

示例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);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:9,代码来源:NodeServiceImpl.java

示例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);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:8,代码来源:NodeServiceImpl.java

示例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);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:9,代码来源:NodeServiceImpl.java

示例9: addAspect

import org.alfresco.service.cmr.dictionary.InvalidAspectException; //导入依赖的package包/类
void addAspect(NodeRef nodeRef, QName aspectTypeQName, Map<QName, Serializable> aspectProperties)
throws InvalidNodeRefException, InvalidAspectException;
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:3,代码来源:ActualEnvironment.java

示例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);
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:55,代码来源:DbNodeServiceImpl.java

示例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;
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:21,代码来源:NodeService.java

示例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;
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:13,代码来源:NodeService.java

示例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;
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:15,代码来源:NodeService.java


注:本文中的org.alfresco.service.cmr.dictionary.InvalidAspectException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。