本文整理匯總了Java中org.alfresco.service.namespace.QName.createQName方法的典型用法代碼示例。如果您正苦於以下問題:Java QName.createQName方法的具體用法?Java QName.createQName怎麽用?Java QName.createQName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.alfresco.service.namespace.QName
的用法示例。
在下文中一共展示了QName.createQName方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testCreateRenditionThumbnailFromPdf
import org.alfresco.service.namespace.QName; //導入方法依賴的package包/類
public void testCreateRenditionThumbnailFromPdf() throws Exception
{
QName qname = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "doclib");
ThumbnailDefinition details = thumbnailService.getThumbnailRegistry().getThumbnailDefinition(
qname.getLocalName());
assertEquals("doclib", details.getName());
assertEquals("image/png", details.getMimetype());
assertEquals("alfresco/thumbnail/thumbnail_placeholder_doclib.png", details.getPlaceHolderResourcePath());
checkTransformer();
NodeRef pdfOrig = createOriginalContent(this.folder, MimetypeMap.MIMETYPE_PDF);
NodeRef thumbnail0 = this.thumbnailService.createThumbnail(pdfOrig, ContentModel.PROP_CONTENT,
MimetypeMap.MIMETYPE_IMAGE_JPEG, details.getTransformationOptions(), "doclib");
assertNotNull(thumbnail0);
checkRenditioned(pdfOrig, Collections.singletonList(new ExpectedAssoc(RegexQNamePattern.MATCH_ALL, "doclib", 1)));
checkRendition("doclib", thumbnail0);
outputThumbnailTempContentLocation(thumbnail0, "jpg", "doclib test");
}
示例2: AssociationRef
import org.alfresco.service.namespace.QName; //導入方法依賴的package包/類
/**
* @param assocRefStr a string of the form <b>id|sourceNodeRef|targetNodeRef|assocTypeQName</b>.
*/
public AssociationRef(String assocRefStr)
{
StringTokenizer tokenizer = new StringTokenizer(assocRefStr, FILLER);
if (tokenizer.countTokens() != 3 && tokenizer.countTokens() != 4)
{
throw new AlfrescoRuntimeException("Unable to parse association string: " + assocRefStr);
}
String idStr = "0";
if (tokenizer.countTokens() == 4)
{
idStr = tokenizer.nextToken();
}
String sourceNodeRefStr = tokenizer.nextToken();
String targetNodeRefStr = tokenizer.nextToken();
String assocTypeQNameStr = tokenizer.nextToken();
this.id = new Long(idStr);
this.sourceRef = new NodeRef(sourceNodeRefStr);
this.targetRef = new NodeRef(targetNodeRefStr);
this.assocTypeQName = QName.createQName(assocTypeQNameStr);
}
示例3: register
import org.alfresco.service.namespace.QName; //導入方法依賴的package包/類
/**
* Register the deployment target with the deployment target registry
*/
public void register()
{
PropertyCheck.mandatory(this, "typeQName", typeQName);
PropertyCheck.mandatory(this, "versionService", getVersionService());
PropertyCheck.mandatory(this, "policy", policy);
PropertyCheck.mandatory(this, "prefixResolver", prefixResolver);
/**
* Go ahead and register the version label policy with the
* versionService
*/
QName qName = QName.createQName(typeQName, prefixResolver);
getVersionService().registerVersionLabelPolicy(qName, policy);
}
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:19,代碼來源:VersionServiceVersionLabelRegistrationBean.java
示例4: makePackageContainer
import org.alfresco.service.namespace.QName; //導入方法依賴的package包/類
private NodeRef makePackageContainer()
{
NodeRef packages = findOrCreatePackagesFolder();
String packageId = "pkg_" + GUID.generate();
QName packageName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, packageId);
try {
policyBehaviourFilter.disableBehaviour(packages, ContentModel.ASPECT_AUDITABLE);
ChildAssociationRef packageAssoc = nodeService.createNode(packages, ContentModel.ASSOC_CONTAINS, packageName,
WorkflowModel.TYPE_PACKAGE);
NodeRef packageContainer = packageAssoc.getChildRef();
// TODO: For now, grant full access to everyone
permissionService.setPermission(packageContainer, PermissionService.ALL_AUTHORITIES,
PermissionService.ALL_PERMISSIONS, true);
return packageContainer;
}
finally
{
policyBehaviourFilter.enableBehaviour(packages, ContentModel.ASPECT_AUDITABLE);
}
}
示例5: checkTaskQueryTaskCompleted
import org.alfresco.service.namespace.QName; //導入方法依賴的package包/類
@Override
protected void checkTaskQueryTaskCompleted(String workflowInstanceId, WorkflowTask theTask, WorkflowTask startTask)
{
List<String> withoutStartTask = Arrays.asList(theTask.getId());
List<String> bothTasks= Arrays.asList(theTask.getId(), startTask.getId());
checkProcessIdQuery(workflowInstanceId, bothTasks, WorkflowTaskState.COMPLETED);
// Adhoc task should only be returned
QName taskName = QName.createQName(NamespaceService.WORKFLOW_MODEL_1_0_URI, "adhocTask");
checkTaskNameQuery(taskName, withoutStartTask, WorkflowTaskState.COMPLETED, null);
// Completed adhocTask is assigned to USER2
checkActorIdQuery(USER2, withoutStartTask, WorkflowTaskState.COMPLETED, null);
checkIsActiveQuery(bothTasks, WorkflowTaskState.COMPLETED, workflowInstanceId);
// Task has custom property set
checkTaskPropsQuery(withoutStartTask, WorkflowTaskState.COMPLETED, null);
// Process properties
checkProcessPropsQuery(withoutStartTask, WorkflowTaskState.COMPLETED);
}
示例6: executeAsynchronously
import org.alfresco.service.namespace.QName; //導入方法依賴的package包/類
public void executeAsynchronously()
{
// Lock the push
QName lockQName = QName.createQName(NamespaceService.SYSTEM_MODEL_1_0_URI, this.getId());
String lockToken = jobLockService.getLock(lockQName, LOCK_TIME_TO_LIVE, 0, 1);
AsyncPatchCallback callback = new AsyncPatchCallback();
jobLockService.refreshLock(lockToken, lockQName, LOCK_REFRESH_TIME, callback);
try
{
if (logger.isDebugEnabled())
{
logger.debug(this.getId() + ": job lock held");
}
applyOutstandingPatch(this);
}
finally
{
if (logger.isTraceEnabled())
{
logger.trace(this.getId() + ": job finished");
}
// Release the locks on the job and stop refreshing
callback.isActive = false;
jobLockService.releaseLock(lockToken, lockQName);
}
}
示例7: getClassQname
import org.alfresco.service.namespace.QName; //導入方法依賴的package包/類
/**
* Override method from AbstractClassGet
*/
@Override
protected QName getClassQname(WebScriptRequest req)
{
String className = req.getServiceMatch().getTemplateVars().get(DICTIONARY_CLASS_NAME);
//validate the classname and throw appropriate error message
if (isValidClassname(className) == false)
{
throw new WebScriptException(Status.STATUS_NOT_FOUND, "Check the classname - " + className + " - parameter in the URL");
}
return QName.createQName(getFullNamespaceURI(className));
}
示例8: getAlfrescoName
import org.alfresco.service.namespace.QName; //導入方法依賴的package包/類
public QName getAlfrescoName(String typeId)
{
// Is it an Alfresco type id?
if (typeId.length() < 4 || typeId.charAt(1) != ':')
{
throw new CmisInvalidArgumentException("Malformed type id '" + typeId + "'");
}
return QName.createQName(typeId.substring(2), namespaceService);
}
示例9: modifyParentNode
import org.alfresco.service.namespace.QName; //導入方法依賴的package包/類
private void modifyParentNode(NodeRef parentFolder, TransferManifestNormalNode nodeToMove ) throws Exception
{
String nodeName = (String)nodeToMove.getProperties().get(ContentModel.PROP_NAME);
List<ChildAssociationRef> parents = new ArrayList<ChildAssociationRef>();
ChildAssociationRef primaryAssoc = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, parentFolder, QName
.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, nodeName), nodeToMove.getNodeRef(), true, -1);
parents.add(primaryAssoc);
nodeToMove.setParentAssocs(parents);
nodeToMove.setParentPath(null);
nodeToMove.setPrimaryParentAssoc(primaryAssoc);
}
示例10: getRollupPropertyNameFor
import org.alfresco.service.namespace.QName; //導入方法依賴的package包/類
/**
* Given a ratingScheme and a rollup name, this method returns the property name
* which would by convention be used to store the given rollup.
*
* @param ratingScheme the ratingScheme.
* @param rollupName the name of the property rollup as given by {@link AbstractRatingRollupAlgorithm#getRollupName()}.
* @return the property name used to persist the given rollup in the given scheme.
*/
public QName getRollupPropertyNameFor(RatingScheme ratingScheme, String rollupName)
{
final String modelPrefix = ratingScheme.getModelPrefix();
final String ratingSchemeName = ratingScheme.getName();
String result = modelPrefix + ":" + ratingSchemeName + rollupName;
return QName.createQName(result, namespaceService);
}
示例11: onSetUpInTransaction
import org.alfresco.service.namespace.QName; //導入方法依賴的package包/類
/**
* Called during the transaction setup
*/
protected void onSetUpInTransaction() throws Exception
{
super.onSetUpInTransaction();
// Get the node service by name
this.versionStoreNodeService = (NodeService)this.applicationContext.getBean("versionNodeService");
// Create some dummy data used during the tests
this.dummyNodeRef = new NodeRef(
this.versionService.getVersionStoreReference(),
"dummy");
this.dummyQName = QName.createQName("{dummy}dummy");
}
示例12: testIfNodesExistsAfterCreateThumbnail
import org.alfresco.service.namespace.QName; //導入方法依賴的package包/類
/**
* See REPO-2519, MNT-17113
*
* @throws IOException
*/
public void testIfNodesExistsAfterCreateThumbnail() throws IOException
{
// Add the log appender to the root logger
LogErrorAppender logErrorAppender = new LogErrorAppender();
Logger.getRootLogger().addAppender(logErrorAppender);
// create content node for thumbnail node
NodeRef pdfOrig = createOriginalContent(folder, MimetypeMap.MIMETYPE_PDF);
QName qname = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "doclib");
ThumbnailDefinition details = thumbnailService.getThumbnailRegistry().getThumbnailDefinition(qname.getLocalName());
setComplete();
endTransaction();
// create thumbnail
transactionService.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionHelper.RetryingTransactionCallback<Void>()
{
public Void execute() throws Throwable
{
// Delete the content node (pdfOrig) before the afterCommit code is executed
TestNodeDeleterListener testNodeDeleterListener = new TestNodeDeleterListener(pdfOrig);
// It needs to have a higher priority as the implemented afterCommit. The priority in order are (0,1,2,3,4)
AlfrescoTransactionSupport.bindListener(testNodeDeleterListener, 1);
thumbnailService.createThumbnail(pdfOrig, ContentModel.PROP_CONTENT, MimetypeMap.MIMETYPE_IMAGE_JPEG, details.getTransformationOptions(), "doclib");
return null;
}
}, false, true);
assertEquals("There should be no error anymore", 0, logErrorAppender.getLog().size());
}
示例13: getTypedItem
import org.alfresco.service.namespace.QName; //導入方法依賴的package包/類
@Override
protected TypeDefinition getTypedItem(Item item)
{
TypeDefinition typeDef = null;
try
{
// the itemId could either be the full form qname i.e. {http://www.alfresco.org/model/content/1.0}content
// or it could be the prefix form i.e. cm:name
QName type = null;
String itemId = item.getId();
if (itemId.startsWith("{"))
{
// item id looks like a full qname
type = QName.createQName(itemId);
}
else
{
// try and create the QName using the item id as is
type = QName.createQName(itemId, this.namespaceService);
}
// retrieve the type from the dictionary
typeDef = this.dictionaryService.getType(type);
if (typeDef == null)
{
throw new FormNotFoundException(item,
new IllegalArgumentException("Type does not exist: " + item.getId()));
}
}
catch (InvalidQNameException iqne)
{
throw new FormNotFoundException(item, iqne);
}
// return the type definition object for the requested type
return typeDef;
}
示例14: getAssociationName
import org.alfresco.service.namespace.QName; //導入方法依賴的package包/類
/**
* @param parentIsSource boolean
* @param renditionName QName
* @return QName
*/
private QName getAssociationName(boolean parentIsSource, QName renditionName)
{
// If the parent is not the source node and the location has a child name then use that name.
QName assocName = renditionName;
String childName = location.getChildName();
if(parentIsSource==false
&& childName!=null
&& childName.length()>0)
{
assocName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, childName);
}
return assocName;
}
示例15: getQNameParam
import org.alfresco.service.namespace.QName; //導入方法依賴的package包/類
private QName getQNameParam(String key, Map<String, Serializable> params)
{
String value = (String) params.get(key);
if (value != null)
{
return QName.createQName(value, namespaceService);
}
return null;
}