本文整理汇总了Java中org.alfresco.service.cmr.dictionary.InvalidTypeException类的典型用法代码示例。如果您正苦于以下问题:Java InvalidTypeException类的具体用法?Java InvalidTypeException怎么用?Java InvalidTypeException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
InvalidTypeException类属于org.alfresco.service.cmr.dictionary包,在下文中一共展示了InvalidTypeException类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getWriter
import org.alfresco.service.cmr.dictionary.InvalidTypeException; //导入依赖的package包/类
@Override
public ContentWriter getWriter(NodeRef nodeRef, QName propertyQName, boolean update)
throws InvalidNodeRefException, InvalidTypeException
{
return apiFacet.getContentService().getWriter(nodeRef,
propertyQName,
update);
}
示例2: setType
import org.alfresco.service.cmr.dictionary.InvalidTypeException; //导入依赖的package包/类
/**
* @see org.alfresco.service.cmr.repository.NodeService#setType(org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.namespace.QName)
*/
@Extend(traitAPI=NodeServiceTrait.class,extensionAPI=NodeServiceExtension.class)
public void setType(NodeRef nodeRef, QName typeQName) throws InvalidNodeRefException
{
// The node(s) involved may not be pending deletion
checkPendingDelete(nodeRef);
// check the node type
TypeDefinition nodeTypeDef = dictionaryService.getType(typeQName);
if (nodeTypeDef == null)
{
throw new InvalidTypeException(typeQName);
}
Pair<Long, NodeRef> nodePair = getNodePairNotNull(nodeRef);
// Invoke policies
invokeBeforeUpdateNode(nodeRef);
QName oldType = nodeDAO.getNodeType(nodePair.getFirst());
invokeBeforeSetType(nodeRef, oldType, typeQName);
// Set the type
boolean updatedNode = nodeDAO.updateNode(nodePair.getFirst(), typeQName, null);
// Add the default aspects and properties required for the given type. Existing values will not be overridden.
boolean updatedProps = addAspectsAndProperties(nodePair, typeQName, null, null, null, null, false);
// Invoke policies
if (updatedNode || updatedProps)
{
// Invoke policies
invokeOnUpdateNode(nodeRef);
invokeOnSetType(nodeRef, oldType, typeQName);
// Index
nodeIndexer.indexUpdateNode(nodeRef);
}
}
示例3: createNode
import org.alfresco.service.cmr.dictionary.InvalidTypeException; //导入依赖的package包/类
/**
* @see #createNode(NodeRef, QName, QName, QName, Map)
*/
@Auditable(parameters = {"parentRef", "assocTypeQName", "assocQName", "nodeTypeQName"})
public ChildAssociationRef createNode(
NodeRef parentRef,
QName assocTypeQName,
QName assocQName,
QName nodeTypeQName)
throws InvalidNodeRefException, InvalidTypeException;
示例4: executeListAction
import org.alfresco.service.cmr.dictionary.InvalidTypeException; //导入依赖的package包/类
/**
* Adds the new list
*/
@Override
protected ListInfoBean executeListAction(VtiSoapRequest soapRequest,
String dws, String listName, String description, int templateID) throws Exception
{
// We require a template ID parameter
if(templateID < 0)
{
throw new VtiSoapException("Invalid Template ID", -1);
}
// Have the List Created
ListInfoBean list;
try
{
list = handler.createList(listName, description, dws, templateID);
}
catch(SiteDoesNotExistException se)
{
throw new VtiSoapException("No site found with name '" + dws + "'", 0x81020012l, se);
}
catch(DuplicateChildNodeNameException dcnne)
{
throw new VtiSoapException("List name already in use", 0x81020012l, dcnne);
}
catch(InvalidTypeException ite)
{
throw new VtiSoapException("Template ID not known", 0x8102007bl, ite);
}
// Return the list details
return list;
}
示例5: createList
import org.alfresco.service.cmr.dictionary.InvalidTypeException; //导入依赖的package包/类
@Override
public ListInfoBean createList(String listName, String description, String dws, int templateId)
throws SiteDoesNotExistException, DuplicateChildNodeNameException, InvalidTypeException
{
// Check we can find the type
ListTypeBean type = listTypes.get(templateId);
if (type == null)
{
throw new InvalidTypeException(QName.createQName(Integer.toString(templateId)));
}
// Get the site
String siteName = dwsToSiteShortName(dws);
SiteInfo site = siteService.getSite(siteName);
if(site == null)
{
throw new SiteDoesNotExistException(siteName);
}
// Is it a Container or a DataList?
ListInfoBean list;
if(type.isDataList())
{
list = createDataList(site, listName, description, type);
}
else
{
list = createComponentList(site, listName, description, type);
}
// Attach additional information to it
populateListInfo(list);
// All done
return list;
}
示例6: getWriter
import org.alfresco.service.cmr.dictionary.InvalidTypeException; //导入依赖的package包/类
ContentWriter getWriter(NodeRef nodeRef, QName propertyQName, boolean update) throws InvalidNodeRefException,
InvalidTypeException;
示例7: getReader
import org.alfresco.service.cmr.dictionary.InvalidTypeException; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private ContentReader getReader(NodeRef nodeRef, QName propertyQName, boolean fireContentReadPolicy)
{
ContentData contentData = null;
Serializable propValue = nodeService.getProperty(nodeRef, propertyQName);
if (propValue instanceof Collection)
{
Collection<Serializable> colPropValue = (Collection<Serializable>)propValue;
if (colPropValue.size() > 0)
{
propValue = colPropValue.iterator().next();
}
}
if (propValue instanceof ContentData)
{
contentData = (ContentData)propValue;
}
if (contentData == null)
{
PropertyDefinition contentPropDef = dictionaryService.getProperty(propertyQName);
// if no value or a value other content, and a property definition has been provided, ensure that it's CONTENT or ANY
if (contentPropDef != null &&
(!(contentPropDef.getDataType().getName().equals(DataTypeDefinition.CONTENT) ||
contentPropDef.getDataType().getName().equals(DataTypeDefinition.ANY))))
{
throw new InvalidTypeException("The node property must be of type content: \n" +
" node: " + nodeRef + "\n" +
" property name: " + propertyQName + "\n" +
" property type: " + ((contentPropDef == null) ? "unknown" : contentPropDef.getDataType()),
propertyQName);
}
}
// check that the URL is available
if (contentData == null || contentData.getContentUrl() == null)
{
// there is no URL - the interface specifies that this is not an error condition
return null;
}
String contentUrl = contentData.getContentUrl();
// The context of the read is entirely described by the URL
ContentReader reader = store.getReader(contentUrl);
if (reader == null)
{
throw new AlfrescoRuntimeException("ContentStore implementations may not return null ContentReaders");
}
// set extra data on the reader
reader.setMimetype(contentData.getMimetype());
reader.setEncoding(contentData.getEncoding());
reader.setLocale(contentData.getLocale());
// Fire the content read policy
if (reader != null && fireContentReadPolicy == true)
{
// Fire the content update policy
Set<QName> types = new HashSet<QName>(this.nodeService.getAspects(nodeRef));
types.add(this.nodeService.getType(nodeRef));
OnContentReadPolicy policy = this.onContentReadDelegate.get(nodeRef, types);
policy.onContentRead(nodeRef);
}
// we don't listen for anything
// result may be null - but interface contract says we may return null
return reader;
}
示例8: newNode
import org.alfresco.service.cmr.dictionary.InvalidTypeException; //导入依赖的package包/类
/**
* Create a new node. Note that allowing the <b>uuid</b> to be assigned by passing in a <tt>null</tt>
* is more efficient.
*
* @param parentNodeId the ID of the parent node (may not be <tt>null</tt>)
* @param assocTypeQName the primary association (may not be <tt>null</tt>)
* @param assocQName the association path (may not be <tt>null</tt>)
* @param storeRef the store to which the node must belong
* @param uuid the node store-unique identifier, or <tt>null</tt> to assign a GUID
* @param nodeTypeQName the type of the node
* @param nodeLocale the locale of the node
* @param childNodeName the <b>cm:name</b> of the child node or <tt>null</tt> to use the node's UUID
* @param auditableProperties a map containing any <b>cm:auditable</b> properties for the node
* @return Returns the details of the child association created
* @throws InvalidTypeException if the node type is invalid or if the node type
* is not a valid real node
* @throws NodeExistsException if the target reference is already taken by a live node
*/
public ChildAssocEntity newNode(
Long parentNodeId,
QName assocTypeQName,
QName assocQName,
StoreRef storeRef,
String uuid,
QName nodeTypeQName,
Locale nodeLocale,
String childNodeName,
Map<QName, Serializable> auditableProperties) throws InvalidTypeException;
示例9: getReader
import org.alfresco.service.cmr.dictionary.InvalidTypeException; //导入依赖的package包/类
/**
* Gets a reader for the content associated with the given node property.
* <p>
* If a content URL is present for the given node then a reader <b>must</b>
* be returned. The {@link ContentReader#exists() exists} method should then
* be used to detect 'missing' content.
*
* @param nodeRef a reference to a node having a content property
* @param propertyQName the name of the property, which must be of type <b>content</b>
* @return Returns a reader for the content associated with the node property,
* or null if no content has been written for the property
* @throws InvalidNodeRefException if the node doesn't exist
* @throws InvalidTypeException if the node is not of type <b>content</b>
*
* @see org.alfresco.repo.content.filestore.FileContentReader#getSafeContentReader(ContentReader, String, Object[])
*/
@Auditable(parameters = {"nodeRef", "propertyQName"})
public ContentReader getReader(NodeRef nodeRef, QName propertyQName)
throws InvalidNodeRefException, InvalidTypeException;
示例10: getWriter
import org.alfresco.service.cmr.dictionary.InvalidTypeException; //导入依赖的package包/类
/**
* Get a content writer for the given node property, choosing to optionally have
* the node property updated automatically when the content stream closes.
* <p>
* If the update flag is off, then the state of the node property will remain unchanged
* regardless of the state of the written binary data. If the flag is on, then the node
* property will be updated on the same thread as the code that closed the write
* channel.
* <p>
* If no node is supplied, then the writer will provide a stream into the backing content
* store, but will not be associated with any new or previous content.
* <p/>
* <b>NOTE: </b>The content URL provided will be registered for automatic cleanup in the event
* that the transaction, in which this method was called, rolls back. If the transaction
* is successful, the writer may still be open and available for use but the underlying binary
* will not be cleaned up subsequently. The recommended pattern is to group calls to retrieve
* the writer in the same transaction as the calls to subsequently update and close the
* write stream - including setting of the related content properties.
*
* @param nodeRef a reference to a node having a content property, or <tt>null</tt>
* to just get a valid writer into a backing content store.
* @param propertyQName the name of the property, which must be of type <b>content</b>
* @param update true if the property must be updated atomically when the content write
* stream is closed (attaches a listener to the stream); false if the client code
* will perform the updates itself.
* @return Returns a writer for the content associated with the node property
* @throws InvalidNodeRefException if the node doesn't exist
* @throws InvalidTypeException if the node property is not of type <b>content</b>
*/
@Auditable(parameters = {"nodeRef", "propertyQName", "update"})
public ContentWriter getWriter(NodeRef nodeRef, QName propertyQName, boolean update)
throws InvalidNodeRefException, InvalidTypeException;
示例11: createList
import org.alfresco.service.cmr.dictionary.InvalidTypeException; //导入依赖的package包/类
/**
* Creates a Data List of the given type
*/
public ListInfoBean createList(String listName, String description, String dws, int templateId)
throws SiteDoesNotExistException, DuplicateChildNodeNameException, InvalidTypeException;