Examples of HrefProperty


Examples of org.apache.jackrabbit.webdav.property.HrefProperty

            List<HrefProperty> changeList = new ArrayList<HrefProperty>();
            String[] mergeFailedHref = new String[mergeFailedIds.length];
            for (int i = 0; i < mergeFailedIds.length; i++) {
                mergeFailedHref[i] = getItemUri(mergeFailedIds[i], sessionInfo);
            }
            changeList.add(new HrefProperty(VersionControlledResource.AUTO_MERGE_SET, mergeFailedHref, false));

            if (predecessorIds != null && predecessorIds.length > 0) {
                String[] pdcHrefs = new String[predecessorIds.length];
                for (int i = 0; i < predecessorIds.length; i++) {
                    pdcHrefs[i] = getItemUri(predecessorIds[i], sessionInfo);
                }
                changeList.add(new HrefProperty(VersionControlledResource.PREDECESSOR_SET, pdcHrefs, false));
            }

            PropPatchMethod method = new PropPatchMethod(getItemUri(nodeId, sessionInfo), changeList);
            execute(method, sessionInfo);
        } catch (IOException e) {
View Full Code Here

Examples of org.apache.jackrabbit.webdav.property.HrefProperty

            // Windows XP support
            properties.add(new DefaultDavProperty<String>(DavPropertyName.ISCOLLECTION, "0"));
        }

        if (rfc4122Uri != null) {
            properties.add(new HrefProperty(BindConstants.RESOURCEID, rfc4122Uri, true));
        }

        Set<ParentElement> parentElements = getParentElements();
        if (!parentElements.isEmpty()) {
            properties.add(new ParentSet(parentElements));
View Full Code Here

Examples of org.apache.jackrabbit.webdav.property.HrefProperty

     */
    public DavResource[] getReferenceResources(DavPropertyName hrefPropertyName) throws DavException {
        DavProperty<?> prop = getProperty(hrefPropertyName);
        List<DavResource> resources = new ArrayList<DavResource>();
        if (prop != null && prop instanceof HrefProperty) {
            HrefProperty hp = (HrefProperty)prop;
            // process list of hrefs
            for (String href : hp.getHrefs()) {
                DavResourceLocator locator = getLocator().getFactory().createResourceLocator(getLocator().getPrefix(), href);
                resources.add(createResourceFromLocator(locator));
            }
        } else {
            throw new DavException(DavServletResponse.SC_INTERNAL_SERVER_ERROR);
View Full Code Here

Examples of org.apache.jackrabbit.webdav.property.HrefProperty

        }
        String[] pHref = new String[values.length];
        for (int i = 0; i < values.length; i++) {
            pHref[i] = getLocatorFromNode(values[i]).getHref(isCollection);
        }
        return new HrefProperty(name, pHref, isProtected);
    }
View Full Code Here

Examples of org.apache.jackrabbit.webdav.property.HrefProperty

        properties.add(new DefaultDavProperty<String>(DeltaVConstants.COMMENT, null, true));

        // 'workspace' property as defined by RFC 3253
        String workspaceHref = getWorkspaceHref();
        if (workspaceHref != null) {
            properties.add(new HrefProperty(DeltaVConstants.WORKSPACE, workspaceHref, true));
        }
        // name of the jcr workspace
        properties.add(new DefaultDavProperty<String>(ItemResourceConstants.JCR_WORKSPACE_NAME,
                getRepositorySession().getWorkspace().getName()));
View Full Code Here

Examples of org.apache.jackrabbit.webdav.property.HrefProperty

                // retrieve the current jcr:mergeFailed property values
                if (!n.hasProperty(JcrConstants.JCR_MERGEFAILED)) {
                    throw new DavException(DavServletResponse.SC_CONFLICT, "Attempt to resolve non-existing merge conflicts.");
                }

                List<String> mergeset = new HrefProperty(autoMergeSet).getHrefs();
                List<String> predecL;
                if (predecessorSet == null) {
                    predecL = Collections.emptyList();
                } else {
                    predecL = new HrefProperty(predecessorSet).getHrefs();
                }

                Session session = getRepositorySession();
                // loop over the mergeFailed values (versions) and test whether they are
                // removed from the DAV:auto-merge-set thus indicating resolution.
View Full Code Here

Examples of org.apache.jackrabbit.webdav.property.HrefProperty

            if (isVersionControlled()) {
                // workspace property already set in AbstractResource.initProperties()
                try {
                    // DAV:version-history (computed)
                    String vhHref = getLocatorFromItem(n.getVersionHistory()).getHref(true);
                    properties.add(new HrefProperty(VERSION_HISTORY, vhHref, true));

                    // DAV:auto-version property: there is no auto version, explicit CHECKOUT is required.
                    properties.add(new DefaultDavProperty<String>(AUTO_VERSION, null, false));

                    String baseVHref = getLocatorFromItem(n.getBaseVersion()).getHref(true);
                    if (n.isCheckedOut()) {
                        // DAV:checked-out property (protected)
                        properties.add(new HrefProperty(CHECKED_OUT, baseVHref, true));

                        // DAV:predecessors property
                        if (n.hasProperty(JcrConstants.JCR_PREDECESSORS)) {
                            Value[] predec = n.getProperty(JcrConstants.JCR_PREDECESSORS).getValues();
                            addHrefProperty(PREDECESSOR_SET, predec, false);
                        }
                        // DAV:auto-merge-set property. NOTE: the DAV:merge-set
                        // never occurs, because merging without bestEffort flag
                        // being set results in an exception on failure.
                        if (n.hasProperty(JcrConstants.JCR_MERGEFAILED)) {
                            Value[] mergeFailed = n.getProperty(JcrConstants.JCR_MERGEFAILED).getValues();
                            addHrefProperty(AUTO_MERGE_SET, mergeFailed, false);
                        }
                        // todo: checkout-fork, checkin-fork
                    } else {
                        // DAV:checked-in property (protected)
                        properties.add(new HrefProperty(CHECKED_IN, baseVHref, true));
                    }
                } catch (RepositoryException e) {
                    log.error(e.getMessage());
                }
            }
View Full Code Here

Examples of org.apache.jackrabbit.webdav.property.HrefProperty

            // Windows XP support
            properties.add(new DefaultDavProperty(DavPropertyName.ISCOLLECTION, "0"));
        }

        if (rfc4122Uri != null) {
            properties.add(new HrefProperty(BindConstants.RESOURCEID, rfc4122Uri, true));
        }

        Set parentElements = getParentElements();
        if (!parentElements.isEmpty()) {
            properties.add(new ParentSet(parentElements));
View Full Code Here

Examples of org.apache.jackrabbit.webdav.property.HrefProperty

    private NodeId getParentId(DavPropertySet propSet, SessionInfo sessionInfo)
        throws RepositoryException {
        NodeId parentId = null;
        if (propSet.contains(ItemResourceConstants.JCR_PARENT)) {
            HrefProperty parentProp = new HrefProperty(propSet.get(ItemResourceConstants.JCR_PARENT));
            String parentHref = parentProp.getHrefs().get(0).toString();
            if (parentHref != null && parentHref.length() > 0) {
                parentId = uriResolver.getNodeId(parentHref, sessionInfo);
            }
        }
        return parentId;
View Full Code Here

Examples of org.apache.jackrabbit.webdav.property.HrefProperty

                    sessionInfo = new SessionInfoImpl(credentials, wspName);
                } else if (!wspName.equals(workspaceName)) {
                    throw new LoginException("Login failed: Invalid workspace name '" + workspaceName + "'.");
                }
            } else if (props.contains(DeltaVConstants.WORKSPACE)) {
                String wspHref = new HrefProperty(props.get(DeltaVConstants.WORKSPACE)).getHrefs().get(0).toString();
                String wspName = Text.unescape(Text.getName(wspHref, true));
                if (!wspName.equals(workspaceName)) {
                    throw new LoginException("Login failed: Invalid workspace name " + workspaceName);
                }
            } else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.