本文整理汇总了Java中org.alfresco.service.namespace.RegexQNamePattern类的典型用法代码示例。如果您正苦于以下问题:Java RegexQNamePattern类的具体用法?Java RegexQNamePattern怎么用?Java RegexQNamePattern使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RegexQNamePattern类属于org.alfresco.service.namespace包,在下文中一共展示了RegexQNamePattern类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: readAll
import org.alfresco.service.namespace.RegexQNamePattern; //导入依赖的package包/类
/**
* List secondary children only
*
* @param parentNodeId String id of parent node
*/
@Override
@WebApiDescription(title = "Return a paged list of secondary child nodes based on child assocs")
public CollectionWithPagingInfo<Node> readAll(String parentNodeId, Parameters parameters)
{
NodeRef parentNodeRef = nodes.validateOrLookupNode(parentNodeId, null);
QNamePattern assocTypeQNameParam = getAssocTypeFromWhereElseAll(parameters);
List<ChildAssociationRef> childAssocRefs = null;
if (assocTypeQNameParam.equals(RegexQNamePattern.MATCH_ALL))
{
childAssocRefs = nodeService.getChildAssocs(parentNodeRef);
}
else
{
childAssocRefs = nodeService.getChildAssocs(parentNodeRef, assocTypeQNameParam, RegexQNamePattern.MATCH_ALL);
}
return listNodeChildAssocs(childAssocRefs, parameters, false, true);
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:26,代码来源:NodeSecondaryChildrenRelation.java
示例2: getSystemContainer
import org.alfresco.service.namespace.RegexQNamePattern; //导入依赖的package包/类
/**
* Return the system container for the specified assoc name.
* The containers are cached in a thread safe Tenant aware cache.
*
* @return System container, <b>which must exist</b>
*/
private NodeRef getSystemContainer(QName assocQName)
{
final String cacheKey = KEY_SYSTEMCONTAINER_NODEREF + "." + assocQName.toString();
NodeRef systemContainerRef = (NodeRef)singletonCache.get(cacheKey);
if (systemContainerRef == null)
{
NodeRef rootNodeRef = nodeService.getRootNode(this.storeRef);
List<ChildAssociationRef> results = nodeService.getChildAssocs(rootNodeRef, RegexQNamePattern.MATCH_ALL, qnameAssocSystem, false);
if (results.size() == 0)
{
throw new AlfrescoRuntimeException("Required system path not found: " + qnameAssocSystem);
}
NodeRef sysNodeRef = results.get(0).getChildRef();
results = nodeService.getChildAssocs(sysNodeRef, RegexQNamePattern.MATCH_ALL, assocQName, false);
if (results.size() == 0)
{
throw new AlfrescoRuntimeException("Required path not found: " + assocQName);
}
systemContainerRef = results.get(0).getChildRef();
singletonCache.put(cacheKey, systemContainerRef);
}
return systemContainerRef;
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:30,代码来源:AuthorityDAOImpl.java
示例3: removeAuthorityFromZones
import org.alfresco.service.namespace.RegexQNamePattern; //导入依赖的package包/类
public void removeAuthorityFromZones(String authorityName, Set<String> zones)
{
if ((zones != null) && (zones.size() > 0))
{
NodeRef authRef = getAuthorityOrNull(authorityName);
List<ChildAssociationRef> results = nodeService.getParentAssocs(authRef, ContentModel.ASSOC_IN_ZONE, RegexQNamePattern.MATCH_ALL);
for (ChildAssociationRef current : results)
{
NodeRef zoneRef = current.getParentRef();
Serializable value = nodeService.getProperty(zoneRef, ContentModel.PROP_NAME);
if (value == null)
{
continue;
}
else
{
String testZone = DefaultTypeConverter.INSTANCE.convert(String.class, value);
if (zones.contains(testZone))
{
nodeService.removeChildAssociation(current);
}
}
}
}
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:26,代码来源:AuthorityDAOImpl.java
示例4: getSourceAssocs
import org.alfresco.service.namespace.RegexQNamePattern; //导入依赖的package包/类
/**
* Gets the current source associations
*
* @return associations
*/
public List<PeerAssociation> getSourceAssocs(NodeRef nodeRef)
{
List<AssociationRef> refs = null;
try
{
refs = getNodeService().getSourceAssocs(nodeRef, RegexQNamePattern.MATCH_ALL);
}
catch (UnsupportedOperationException err)
{
// some stores do not support associations
// but we doesn't want NPE in code below
refs = new ArrayList<AssociationRef>();
}
List<PeerAssociation> assocs = new ArrayList<PeerAssociation>(refs.size());
for (AssociationRef ref : refs)
{
assocs.add(new PeerAssociation(ref.getTypeQName(), ref.getSourceRef(), ref.getTargetRef()));
}
return assocs;
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:26,代码来源:NodeBrowserPost.java
示例5: update
import org.alfresco.service.namespace.RegexQNamePattern; //导入依赖的package包/类
/**
* Updates the thumbnails content
*/
public void update()
{
List<ChildAssociationRef> parentRefs = services.getNodeService().getParentAssocs(nodeRef, RenditionModel.ASSOC_RENDITION, RegexQNamePattern.MATCH_ALL);
// There should in fact only ever be one parent association of type rendition on any rendition node.
if (parentRefs.size() != 1)
{
StringBuilder msg = new StringBuilder();
msg.append("Node ")
.append(nodeRef)
.append(" has ")
.append(parentRefs.size())
.append(" rendition parents. Unable to update.");
if (logger.isWarnEnabled())
{
logger.warn(msg.toString());
}
throw new AlfrescoRuntimeException(msg.toString());
}
String name = parentRefs.get(0).getQName().getLocalName();
ThumbnailDefinition def = services.getThumbnailService().getThumbnailRegistry().getThumbnailDefinition(name);
services.getThumbnailService().updateThumbnail(this.nodeRef, def.getTransformationOptions());
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:28,代码来源:ScriptThumbnail.java
示例6: getPersonCredentials
import org.alfresco.service.namespace.RegexQNamePattern; //导入依赖的package包/类
@Override
public BaseCredentialsInfo getPersonCredentials(String remoteSystem)
{
NodeRef personContainer = getPersonContainer(remoteSystem, false);
if (personContainer == null) return null;
// Grab the children
List<ChildAssociationRef> credentials =
nodeService.getChildAssocs(personContainer, RemoteCredentialsModel.ASSOC_CREDENTIALS, RegexQNamePattern.MATCH_ALL);
if (credentials.size() > 0)
{
NodeRef nodeRef = credentials.get(0).getChildRef();
return loadCredentials(remoteSystem, personContainer, nodeRef);
}
return null;
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:17,代码来源:RemoteCredentialsServiceImpl.java
示例7: getForum
import org.alfresco.service.namespace.RegexQNamePattern; //导入依赖的package包/类
/**
* Retrieves the forum node the the given discussable
*
* @return Returns the <b>fm:forum</b> node or <tt>null</tt>
*/
private NodeRef getForum(NodeRef discussableNodeRef)
{
List<ChildAssociationRef> destChildren = nodeService.getChildAssocs(
discussableNodeRef,
ForumModel.ASSOC_DISCUSSION,
RegexQNamePattern.MATCH_ALL);
// Take the first one
if (destChildren.size() == 0)
{
return null;
}
else
{
// We just take the first one
ChildAssociationRef discussionAssoc = destChildren.get(0);
return discussionAssoc.getChildRef();
}
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:24,代码来源:DiscussableAspect.java
示例8: getVersionMetaData
import org.alfresco.service.namespace.RegexQNamePattern; //导入依赖的package包/类
protected Map<String, Serializable> getVersionMetaData(NodeRef versionNodeRef)
{
// Get the meta data
List<ChildAssociationRef> metaData = this.dbNodeService.getChildAssocs(
versionNodeRef,
RegexQNamePattern.MATCH_ALL,
CHILD_QNAME_VERSION_META_DATA);
Map<String, Serializable> versionProperties = new HashMap<String, Serializable>(metaData.size());
for (ChildAssociationRef ref : metaData)
{
NodeRef metaDataValue = (NodeRef)ref.getChildRef();
String name = (String)this.dbNodeService.getProperty(metaDataValue, PROP_QNAME_META_DATA_NAME);
Serializable value = this.dbNodeService.getProperty(metaDataValue, PROP_QNAME_META_DATA_VALUE);
versionProperties.put(name, value);
}
return versionProperties;
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:21,代码来源:VersionServiceImpl.java
示例9: getAssocTypeFromWhereElseAll
import org.alfresco.service.namespace.RegexQNamePattern; //导入依赖的package包/类
protected QNamePattern getAssocTypeFromWhereElseAll(Parameters parameters)
{
QNamePattern assocTypeQNamePattern = RegexQNamePattern.MATCH_ALL;
Query q = parameters.getQuery();
if (q != null)
{
MapBasedQueryWalker propertyWalker = new MapBasedQueryWalker(WHERE_PARAMS_ASSOC_TYPE, null);
QueryHelper.walk(q, propertyWalker);
String assocTypeQNameStr = propertyWalker.getProperty(Nodes.PARAM_ASSOC_TYPE, WhereClauseParser.EQUALS, String.class);
if (assocTypeQNameStr != null)
{
assocTypeQNamePattern = nodes.getAssocType(assocTypeQNameStr);
}
}
return assocTypeQNamePattern;
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:20,代码来源:AbstractNodeRelation.java
示例10: getComments
import org.alfresco.service.namespace.RegexQNamePattern; //导入依赖的package包/类
/**
* Returns all comment nodes for a given node.
* @return an array of comments.
*/
public static List<ChildAssociationRef> getComments(NodeRef node, ServiceRegistry services)
{
List<ChildAssociationRef> result = new ArrayList<ChildAssociationRef>();
NodeRef commentsFolder = getCommentsFolder(node, services);
if (commentsFolder != null)
{
List<ChildAssociationRef> children = services.getNodeService().getChildAssocs(commentsFolder, ContentModel.ASSOC_CONTAINS, RegexQNamePattern.MATCH_ALL);
if (!children.isEmpty())
{
result = children;
}
}
return result;
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:21,代码来源:CommentsLibJs.java
示例11: processExcludedSet
import org.alfresco.service.namespace.RegexQNamePattern; //导入依赖的package包/类
/**
* @param thisNode NodeRef
* @return Set<NodeRef>
*/
private Set<NodeRef> processExcludedSet(NodeRef thisNode)
{
Set<NodeRef> results = new HashSet<NodeRef>(89);
NodeService nodeService = serviceRegistry.getNodeService();
// Find any peer nodes (filtering as necessary)
List<AssociationRef> targets = nodeService.getTargetAssocs(thisNode, RegexQNamePattern.MATCH_ALL);
boolean filterPeers = !peerAssociationTypes.isEmpty();
for (AssociationRef target : targets)
{
if (!filterPeers || !peerAssociationTypes.contains(target.getTypeQName()))
{
results.add(target.getTargetRef());
}
}
return results;
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:22,代码来源:PeerAssociatedNodeFinder.java
示例12: getTransferTargets
import org.alfresco.service.namespace.RegexQNamePattern; //导入依赖的package包/类
/**
* Given the noderef of a group of transfer targets, return all the contained transfer targets.
* @param groupNode NodeRef
* @return Set<TransferTarget>
*/
private Set<TransferTarget> getTransferTargets(NodeRef groupNode)
{
Set<TransferTarget> result = new HashSet<TransferTarget>();
List<ChildAssociationRef>children = nodeService.getChildAssocs(groupNode, ContentModel.ASSOC_CONTAINS, RegexQNamePattern.MATCH_ALL);
for(ChildAssociationRef child : children)
{
if(nodeService.getType(child.getChildRef()).equals(TransferModel.TYPE_TRANSFER_TARGET))
{
TransferTargetImpl newTarget = new TransferTargetImpl();
mapTransferTarget(child.getChildRef(), newTarget);
result.add(newTarget);
}
}
return result;
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:22,代码来源:TransferServiceImpl2.java
示例13: getMLContainer
import org.alfresco.service.namespace.RegexQNamePattern; //导入依赖的package包/类
/**
* Get the ML Container of the given node, allowing null
* @param mlDocumentNodeRef the translation
* @param allowNull true if a null value may be returned
* @return Returns the <b>cm:mlContainer</b> or null if there isn't one
* @throws AlfrescoRuntimeException if there is no container
*/
private NodeRef getMLContainer(NodeRef mlDocumentNodeRef, boolean allowNull)
{
NodeRef mlContainerNodeRef = null;
List<ChildAssociationRef> parentAssocRefs = nodeService.getParentAssocs(
mlDocumentNodeRef,
ContentModel.ASSOC_MULTILINGUAL_CHILD,
RegexQNamePattern.MATCH_ALL);
if (parentAssocRefs.size() == 0)
{
if (!allowNull)
{
throw new AlfrescoRuntimeException(
"No multilingual container exists for document node: " + mlDocumentNodeRef);
}
mlContainerNodeRef = null;
}
else if (parentAssocRefs.size() >= 1)
{
// Just get it
ChildAssociationRef toKeepAssocRef = parentAssocRefs.get(0);
mlContainerNodeRef = toKeepAssocRef.getParentRef();
}
// Done
return mlContainerNodeRef;
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:33,代码来源:MultilingualContentServiceImpl.java
示例14: getSourceNode
import org.alfresco.service.namespace.RegexQNamePattern; //导入依赖的package包/类
public ChildAssociationRef getSourceNode(NodeRef renditionNode)
{
// In normal circumstances only a node which is itself a rendition can have
// a source node - as linked by the rn:rendition association.
//
// However there are some circumstances where a node which is not
// technically a rendition can still have a source. One such example is the case
// of thumbnail nodes created in a pre-3.3 Alfresco which have not been patched
// to have the correct rendition aspect applied.
// This will also occur *during* execution of the webscript patch and so the
// decision was made not to throw an exception or log a warning if such a
// situation is encountered.
// A rendition node should have 1 and only 1 source node.
List<ChildAssociationRef> parents = nodeService.getParentAssocs(renditionNode,
RenditionModel.ASSOC_RENDITION, RegexQNamePattern.MATCH_ALL);
if (parents.size() > 1)
{
StringBuilder msg = new StringBuilder();
msg.append("NodeRef ")
.append(renditionNode)
.append(" unexpectedly has ")
.append(parents.size())
.append(" rendition parents.");
if (log.isWarnEnabled())
{
log.warn(msg.toString());
}
throw new RenditionServiceException(msg.toString());
}
else
{
return parents.isEmpty() ? null : parents.get(0);
}
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:36,代码来源:RenditionServiceImpl.java
示例15: countRules
import org.alfresco.service.namespace.RegexQNamePattern; //导入依赖的package包/类
@Override
public int countRules(NodeRef nodeRef)
{
int ruleCount = 0;
if (this.runtimeNodeService.exists(nodeRef) == true && checkNodeType(nodeRef) == true)
{
if (this.runtimeNodeService.hasAspect(nodeRef, RuleModel.ASPECT_RULES) == true)
{
NodeRef ruleFolder = getSavedRuleFolderRef(nodeRef);
if (ruleFolder != null)
{
// Get the rules for this node
List<ChildAssociationRef> ruleChildAssocRefs =
this.runtimeNodeService.getChildAssocs(ruleFolder, RegexQNamePattern.MATCH_ALL, ASSOC_NAME_RULES_REGEX);
ruleCount = ruleChildAssocRefs.size();
}
}
}
return ruleCount;
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:24,代码来源:RuleServiceImpl.java
示例16: getChildAssocs
import org.alfresco.service.namespace.RegexQNamePattern; //导入依赖的package包/类
@Override
public List<ChildAssociationRef> getChildAssocs(Reference parentReference, Set<QName> childNodeTypeQNames)
{
List<ChildAssociationRef> allAssociations = getChildAssocs(parentReference,
RegexQNamePattern.MATCH_ALL,
RegexQNamePattern.MATCH_ALL,
Integer.MAX_VALUE,
false);
List<ChildAssociationRef> associations = new LinkedList<>();
for (ChildAssociationRef childAssociationRef : allAssociations)
{
QName childType = environment.getType(childAssociationRef.getChildRef());
if (childNodeTypeQNames.contains(childType))
{
associations.add(childAssociationRef);
}
}
return associations;
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:23,代码来源:VirtualStoreImpl.java
示例17: getCommentsFolder
import org.alfresco.service.namespace.RegexQNamePattern; //导入依赖的package包/类
/**
* Returns the folder that contains all the comments.
*
* We currently use the fm:discussable aspect where we
* add a "Comments" topic to it.
*/
public static NodeRef getCommentsFolder(NodeRef node, ServiceRegistry services)
{
//FIXME These methods are from the original JavaScript. Should use the (soon to arrive) CommentService.
NodeRef result = null;
if (services.getNodeService().hasAspect(node, ForumModel.ASPECT_DISCUSSABLE))
{
List<ChildAssociationRef> forumFolders = services.getNodeService().getChildAssocs(node, ForumModel.ASSOC_DISCUSSION, RegexQNamePattern.MATCH_ALL);
// The JavaScript was retrieving the first child under this child-assoc so we'll do the same.
NodeRef forumFolder = forumFolders.get(0).getChildRef();
List<ChildAssociationRef> topicFolder = services.getNodeService().getChildAssocs(forumFolder, ContentModel.ASSOC_CONTAINS, QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, COMMENTS_TOPIC_NAME));
result = topicFolder.isEmpty() ? null : topicFolder.get(0).getChildRef();
}
return result;
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:22,代码来源:CommentsLibJs.java
示例18: getConfigurationFolder
import org.alfresco.service.namespace.RegexQNamePattern; //导入依赖的package包/类
public NodeRef getConfigurationFolder(NodeRef nodeRef)
{
NodeRef result = null;
if (isConfigurable(nodeRef) == true)
{
List<ChildAssociationRef> assocs = this.nodeService.getChildAssocs(
nodeRef,
RegexQNamePattern.MATCH_ALL,
ApplicationModel.ASSOC_CONFIGURATIONS);
if (assocs.size() != 0)
{
ChildAssociationRef assoc = assocs.get(0);
result = assoc.getChildRef();
}
}
return result;
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:18,代码来源:ConfigurableServiceImpl.java
示例19: getAssocs
import org.alfresco.service.namespace.RegexQNamePattern; //导入依赖的package包/类
/**
* @return Target associations for this Node. As a Map of assoc name to a List of TemplateNodes.
*/
public Map<String, List<TemplateNode>> getAssocs()
{
if (this.targetAssocs == null)
{
List<AssociationRef> refs = this.services.getNodeService().getTargetAssocs(this.nodeRef, RegexQNamePattern.MATCH_ALL);
this.targetAssocs = new QNameMap<String, List<TemplateNode>>(this);
for (AssociationRef ref : refs)
{
String qname = ref.getTypeQName().toString();
List<TemplateNode> nodes = this.targetAssocs.get(qname);
if (nodes == null)
{
// first access for the list for this qname
nodes = new ArrayList<TemplateNode>(4);
this.targetAssocs.put(ref.getTypeQName().toString(), nodes);
}
nodes.add( new TemplateNode(ref.getTargetRef(), this.services, this.imageResolver) );
}
}
return this.targetAssocs;
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:26,代码来源:TemplateNode.java
示例20: getSourceAssocs
import org.alfresco.service.namespace.RegexQNamePattern; //导入依赖的package包/类
/**
* @return Source associations for this Node. As a Map of assoc name to a List of TemplateNodes.
*/
public Map<String, List<TemplateNode>> getSourceAssocs()
{
if (this.sourceAssocs == null)
{
List<AssociationRef> refs = this.services.getNodeService().getSourceAssocs(this.nodeRef, RegexQNamePattern.MATCH_ALL);
this.sourceAssocs = new QNameMap<String, List<TemplateNode>>(this);
for (AssociationRef ref : refs)
{
String qname = ref.getTypeQName().toString();
List<TemplateNode> nodes = this.sourceAssocs.get(qname);
if (nodes == null)
{
// first access for the list for this qname
nodes = new ArrayList<TemplateNode>(4);
this.sourceAssocs.put(ref.getTypeQName().toString(), nodes);
}
nodes.add( new TemplateNode(ref.getSourceRef(), this.services, this.imageResolver) );
}
}
return this.sourceAssocs;
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:26,代码来源:TemplateNode.java
注:本文中的org.alfresco.service.namespace.RegexQNamePattern类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论