/** * @param node the node to check * @return whether the node is virtual * @throws RepositoryException */ public static boolean isVirtual(Node node) throws RepositoryException { return node instanceof HippoNode && ((HippoNode) node).isVirtual(); }
/** * Extended classes <b>must</b> honor this constructor! * @param node the backing {@link javax.jcr.Node} in the repository that this document instance represents. */ public Document(Node node) throws RepositoryException { initialize(node); }
/** * @inheritDoc */ public NodeIterator pendingChanges() throws RepositoryException { return session.pendingChanges(this, null); }
private Node getCanonicalNode(final Node node) throws RepositoryException { if (node instanceof HippoNode) { return ((HippoNode) node).getCanonicalNode(); } else { return node; } }
@Override public boolean isModified() throws WorkflowException, MappingException, RepositoryException, RemoteException { final HippoSession session = (HippoSession) context.getUserSession(); final Node node = document.getNode(session); return session.pendingChanges(node, "nt:base", true).hasNext(); }
/** * <p>Encode the name to a valid JCR name. If the name is prefixed with a * namespace, the prefix is not encoded but returned as-is.</p> * <p>Calling encode multiple times on the same string will return * the same result as encoding the string once.</p> * <p>An IllegalArgumentException is thrown when the name is empty or null.</p> * @param name the name to encode * @return the encoded name */ public static final String encode(final String name) { return encode(name, false); }
@Override public void invokeWorkflow() throws Exception { throw new WorkflowException("unsupported operation"); } }
/** * Requests which encoder to use for the given symbolic name. * @param encoding the symbolic name of the encoder that is requested * @return the {@link StringCodec} to use, which might be a fall-back encoder or null if non was defined. */ public StringCodec getStringCodec(String encoding) { return getStringCodec(encoding, null); }
/** * @see StringCodec#encode(String) */ public static String encodeLocalName(String name) { return encodeColon(encodeImpl(name)); }
/** * @return the current invoking workflow user */ public final String getUser() { return workflowContext.getUserIdentity(); }
private static final String encodeTwoCharSimpleName(final char first, final char second) { if (first == '.') { return "." + encodeOneCharSimpleName(second); } else if (second == '.') { return encodeOneCharSimpleName(first) + "."; } else { return encodeOneCharSimpleName(first) + encodeOneCharSimpleName(second); } }
/** * <p>Encode the char to a valid JCR string.</p> * <p>Calling encode multiple times on the same string will return * the same result as encoding the string once.</p> * @param c the char to encode * @return the encoded char as string */ public final String encode(final char c) { return encodeOneCharSimpleName(c); }
@Override public Object clone() throws CloneNotSupportedException { PublishableDocument clonedDocument = (PublishableDocument) super.clone(); clonedDocument.creationDate = creationDate; clonedDocument.createdBy = createdBy; clonedDocument.lastModificationDate = lastModificationDate; clonedDocument.lastModifiedBy = lastModifiedBy; clonedDocument.publicationDate = null; clonedDocument.availability = new String[0]; return clonedDocument; }
/** * @see StringCodec#decode(String) */ public static String decodeLocalName(String name) { return decodeImpl(name); }
private Node getCanonicalNode(final Node node) throws RepositoryException { if (node instanceof HippoNode) { return ((HippoNode) node).getCanonicalNode(); } else { return node; } } }
/** * @inheritDoc */ public NodeIterator pendingChanges(String nodeType, boolean prune) throws RepositoryException { return session.pendingChanges(this, nodeType, prune); }
/** * Determine whether node in question is a virtual node. * * @param node the node to check for virtuality * @return whether the node is a virtual node or not */ public static boolean isVirtualNode(Node node) throws RepositoryException { return node instanceof HippoNode && ((HippoNode) node).isVirtual(); }
/** * <p>Encode the char to a valid JCR string.</p> * <p>Calling encode multiple times on the same string will return * the same result as encoding the string once.</p> * @param c the char to encode * @return the encoded char as string */ public static final String encode(final char c) { return encodeOneCharSimpleName(c); }
private static final String encodeTwoCharSimpleName(final char first, final char second) { if (first == '.') { return "." + encodeOneCharSimpleName(second); } else if (second == '.') { return encodeOneCharSimpleName(first) + "."; } else { return encodeOneCharSimpleName(first) + encodeOneCharSimpleName(second); } }
/** * @inheritDoc */ public NodeIterator pendingChanges(String nodeType) throws RepositoryException { return session.pendingChanges(this, nodeType); }