/** * This methods checks whether the specified nodeRef instance is a version nodeRef (ie. in the 'version' store) * * @param nodeRef - version nodeRef * @return <b>true</b> if version nodeRef <b>false</b> otherwise */ protected boolean isVersionNodeRef(NodeRef nodeRef) { return nodeRef.getStoreRef().getProtocol().equals(VersionModel.STORE_PROTOCOL) || nodeRef.getStoreRef().getIdentifier().equals(Version2Model.STORE_ID); }
/** * Construct * * @param nodeRef NodeRef */ public Location(NodeRef nodeRef) { ParameterCheck.mandatory("Node Ref", nodeRef); this.storeRef = nodeRef.getStoreRef(); this.nodeRef = nodeRef; }
public NodeRef getArchivedNode(NodeRef originalNodeRef) { StoreRef orginalStoreRef = originalNodeRef.getStoreRef(); NodeRef archiveRootNodeRef = nodeService.getStoreArchiveNode(orginalStoreRef); // create the likely location of the archived node NodeRef archivedNodeRef = new NodeRef( archiveRootNodeRef.getStoreRef(), originalNodeRef.getId()); return archivedNodeRef; }
public void detectNodeChanges(NodeRef nodeRef, SearchService searcher, Collection<ChildAssociationRef> addedParents, Collection<ChildAssociationRef> deletedParents, Collection<ChildAssociationRef> createdNodes, Collection<NodeRef> updatedNodes) { Indexer indexer = getIndexer(nodeRef.getStoreRef()); indexer.detectNodeChanges(nodeRef, searcher, addedParents, deletedParents, createdNodes, updatedNodes); }
public boolean contains(NodeRef nodeRef, QName propertyQName, String googleLikePattern, SearchParameters.Operator defaultOperator) throws InvalidNodeRefException { SearchService searcher = indexerAndSearcherFactory.getSearcher(nodeRef.getStoreRef(), true); return searcher.contains(nodeRef, propertyQName, googleLikePattern); }
public List<Serializable> selectProperties(NodeRef contextNodeRef, String xpath, QueryParameterDefinition[] parameters, NamespacePrefixResolver namespacePrefixResolver, boolean followAllParentLinks, String language) throws InvalidNodeRefException, XPathException { SearchService searcher = indexerAndSearcherFactory.getSearcher(contextNodeRef.getStoreRef(), true); return searcher.selectProperties(contextNodeRef, xpath, parameters, namespacePrefixResolver, followAllParentLinks, language); } }
@Override public NodeRef getName(NodeRef nodeRef) { if (nodeRef == null) { return null; } return new NodeRef(nodeRef.getStoreRef().getProtocol(), getName(nodeRef.getStoreRef().getIdentifier()), nodeRef.getId()); }
@Override public NodeRef getBaseName(NodeRef nodeRef, boolean forceForNonTenant) { if (nodeRef == null) { return null; } return new NodeRef(nodeRef.getStoreRef().getProtocol(), getBaseName(nodeRef.getStoreRef().getIdentifier(), forceForNonTenant), nodeRef.getId()); }
public void deleteNode(ChildAssociationRef relationshipRef) { Indexer indexer = getIndexer(relationshipRef.getChildRef().getStoreRef()); indexer.deleteNode(relationshipRef); }
public void createChildRelationship(ChildAssociationRef relationshipRef) { Indexer indexer = getIndexer(relationshipRef.getChildRef().getStoreRef()); indexer.createChildRelationship(relationshipRef); }
public void updateChildRelationship(ChildAssociationRef relationshipBeforeRef, ChildAssociationRef relationshipAfterRef) { Indexer indexer = getIndexer(relationshipBeforeRef.getChildRef().getStoreRef()); indexer.updateChildRelationship(relationshipBeforeRef, relationshipAfterRef); }
/** * Convert the incomming node ref (with the version store protocol specified) * to the internal representation with the workspace protocol. * * @param nodeRef the incomming verison protocol node reference * @return the internal version node reference */ public static NodeRef convertNodeRef(NodeRef nodeRef) { return new NodeRef(convertStoreRef(nodeRef.getStoreRef()), nodeRef.getId()); }
private boolean isNodeVersioned(NodeRef nodeRef) { if(nodeRef.getStoreRef().getProtocol().equals(VersionBaseModel.STORE_PROTOCOL)) { NodeRef realNodeRef = VersionUtil.convertNodeRef(nodeRef); return connector.getVersionService().isVersioned(realNodeRef); } return getNodeAspects().contains(ContentModel.ASPECT_VERSIONABLE); }
public void deleteChildRelationship(ChildAssociationRef relationshipRef) { Indexer indexer = getIndexer(relationshipRef.getChildRef().getStoreRef()); indexer.deleteChildRelationship(relationshipRef); }
private String buildUrl(String format) { return MessageFormat.format(format, new Object[] { getNodeRef().getStoreRef().getProtocol(), getNodeRef().getStoreRef().getIdentifier(), getNodeRef().getId(), URLEncoder.encode(getName()) } ); }
/** * {@inheritDoc} */ public void onCreateNode(ChildAssociationRef childAssocRef) { if (! storesToIgnore.contains(childAssocRef.getChildRef().getStoreRef().toString())) { NodeRef nodeRef = childAssocRef.getChildRef(); save(nodeRef); saveAssoc(nodeRef, null); } }
/** * {@inheritDoc} */ public void onDeleteChildAssociation(ChildAssociationRef childAssocRef) { if (! storesToIgnore.contains(childAssocRef.getChildRef().getStoreRef().toString())) { saveAssoc(childAssocRef.getParentRef(), childAssocRef.getTypeQName()); } }
@Override public String stringifyRepositoryLocation(RepositoryNodeRef repositoryNodeRef) throws ReferenceEncodingException { NodeRef nodeRef = repositoryNodeRef.getNodeRef(); StoreRef storeRef = nodeRef.getStoreRef(); return NODE + DELIMITER + storeRef.getProtocol() + DELIMITER + storeRef.getIdentifier() + DELIMITER + nodeRef.getId(); }
@Override public String stringifyRepositoryLocation(RepositoryNodeRef repositoryNodeRef) throws ReferenceEncodingException { NodeRef nodeRef = repositoryNodeRef.getNodeRef(); StoreRef storeRef = nodeRef.getStoreRef(); return NODE + DELIMITER + storeRef.getProtocol() + DELIMITER + storeRef.getIdentifier() + DELIMITER + nodeRef.getId(); }
private String buildPropUrl(String pformat) { return MessageFormat.format(pformat, new Object[] { getNodeRef().getStoreRef().getProtocol(), getNodeRef().getStoreRef().getIdentifier(), getNodeRef().getId(), URLEncoder.encode(getName()), URLEncoder.encode(property.toString()) } ); }