Examples of SubjectNode


Examples of org.apache.slide.structure.SubjectNode

                    String dir = pathBuffer.toString();
                    try {
                        structure.retrieve(sToken, dir);
                    } catch (ObjectNotFoundException onfe) {
                        try {
                            structure.create(sToken, new SubjectNode(), dir);
                            content.create(sToken, dir, new NodeRevisionDescriptor(0), null);
                        } catch (ObjectAlreadyExistsException oae) {
                            Domain.warn("Object " + dir + " already exists.");
                        } catch (RevisionAlreadyExistException rae) {
                            Domain.warn("Revision " + dir + " already exists.");
                        }
                    }
                }

                // make hpath/1/2/3/h4 out of 1234
                pathBuffer.append("/h").append(nextHnStr.charAt(nextHnStr.length() - 1));
                String fullPath = pathBuffer.toString();
               
                return new UriHandler(fullPath);
               
            } else {
                return new UriHandler(uniqueUri);
            }
        } else {

            NodeRevisionDescriptors hpathNrds = content.retrieve(sToken, hpath);
            NodeRevisionDescriptor hpathNrd = content.retrieve(sToken, hpathNrds);
            NodeProperty nextHnProp = hpathNrd.getProperty(I_NEXT_HISTORY_NAME, NamespaceCache.SLIDE_URI);

            if (UriHandler.useHistoryCollectionHack) {

                if (nextHnProp == null || nextHnProp.getValue() == null) {
                    // XXX start with historyCollectionHackChildren to assure no
                    // resources are created directly in history folder
                    nextHnProp = new NodeProperty(I_NEXT_HISTORY_NAME, "10", NamespaceCache.SLIDE_URI);
                    nextHnProp.setKind(NodeProperty.Kind.PROTECTED);
                    hpathNrd.setProperty(nextHnProp);
                }

                String nextHnStr = (String) nextHnProp.getValue();
                long nextHnLong = Long.parseLong(nextHnStr);

                if (nextHnLong % 10 == 0) {
                    // create parent collection
                    long dirNum = nextHnLong / 10;
                    char dirChar[] = Long.toString(dirNum).toCharArray();
                    StringBuffer buf = new StringBuffer();
                    for (int i = 0; i < dirChar.length - 1; i++) {
                        buf.append(dirChar[i]);
                        buf.append('/');
                    }
                    buf.append(dirChar[dirChar.length - 1]);
                    String dirPath = hpath + "/" + buf.toString();

                    try {
                        structure.create(sToken, new SubjectNode(), dirPath);
                        //content.create(sToken,dirPath,true);
                        //NodeRevisionDescriptors dnrds =
                        // structure.retrieve(stoken,dirPath);
                        content.create(sToken, dirPath, new NodeRevisionDescriptor(0), null);
                    } catch (ObjectAlreadyExistsException oae) {
View Full Code Here

Examples of org.apache.slide.structure.SubjectNode

                if (object instanceof LinkNode) {
                    String linkedUri =
                         objectDefinition.getAttribute("linkedUri");
                    accessToken.getStructureHelper().createLink
                            (token, (LinkNode) object, uri,
                             new SubjectNode(linkedUri));
                } else {
                     accessToken.getStructureHelper().create
                            (token, object, uri);
                }
            } catch (ObjectAlreadyExistsException e) {
View Full Code Here

Examples of org.apache.slide.structure.SubjectNode

            } catch (LinkedObjectNotFoundException e) {
                int statusCode = getErrorCode( e );
                sendError( statusCode, e );
                throw new WebdavException( statusCode );
            } catch (ObjectNotFoundException e) {
                SubjectNode subject = new SubjectNode();
                // Creating an object
                structure.create(slideToken, subject, resourcePath);
               
                NodeRevisionDescriptor revisionDescriptor =
                    new NodeRevisionDescriptor(req.getContentLength());
View Full Code Here

Examples of org.apache.slide.structure.SubjectNode

  protected void executeRequest() throws WebdavException {

    // Prevent dirty reads
    slideToken.setForceStoreEnlistment(true);

    SubjectNode toLockSubject = null;
    boolean isCollection = isCollection(lockInfo_lockSubject);
    boolean inheritance = false;
    Date lockDate = null;

       
    switch (lockType) {

    case LOCK_CREATION:
      if (lockInfo_lockType.equals(E_TRANSACTION)) {
        try {
          NamespaceConfig namespaceConfig = token
          .getNamespaceConfig();
                    toLockSubject = getToLockSubject();
                    if (lockDate == null)
                        lockDate = new Date((new Date()).getTime()
                                + ((long) lockDuration * 1000L));
          NodeLock lockToken = new NodeLock(toLockSubject.getUri(),((SubjectNode)security.getPrincipal(slideToken)).getUri(),
              namespaceConfig.getCreateObjectAction().getUri(), lockDate,
              inheritance, NodeLock.LOCAL, lockInfo_lockOwner);
                    token.setTransactionTimeout(lockDuration * 1000);
          Transaction transaction = token.getTransactionManager().suspend();
                    //String txId = lockToken.getLockId();
View Full Code Here

Examples of org.apache.slide.structure.SubjectNode

    protected SubjectNode getToLockSubject() throws ObjectAlreadyExistsException, ObjectNotFoundException,
            AccessDeniedException, RevisionAlreadyExistException, LinkedObjectNotFoundException, ObjectLockedException,
            ServiceAccessException, VetoException {
       
        SubjectNode toLockSubject;
        try {
            toLockSubject = (SubjectNode) structure.retrieve(slideToken, lockInfo_lockSubject);
        } catch (ObjectNotFoundException ex) {

            // Creating a lock null resource
            toLockSubject = new SubjectNode();

            // Creating new subject
            structure.create(slideToken, toLockSubject, lockInfo_lockSubject);

            NodeRevisionDescriptor revisionDescriptor = new NodeRevisionDescriptor(0);
View Full Code Here

Examples of org.apache.slide.structure.SubjectNode

    }

    getLogger().log( name + ": Creating SubjectNode for \"" + uri.toString() + "\".",
      LOG_CHANNEL, Logger.DEBUG );
   
    SubjectNode node = new SubjectNode(
      uri.toString(), childBindings, parentBindings, new Vector() );
    // Workaround for bug in ObjectNode.validate()
    node.setUri( uri.toString() );

    if ( cache != null ) {
      getLogger().log(
        name + ": Putting ObjectNode for " + uri.toString() + " to cache.",
        LOG_CHANNEL,
View Full Code Here

Examples of org.apache.slide.structure.SubjectNode

            if( !rNrd.exists(p.getName()) )
                rNrd.setProperty( p );
        }
       
        // Create VHR/VR
        SubjectNode vhrNode = new SubjectNode();
        structure.create( sToken, vhrNode, String.valueOf(vhrUh) );
        content.create( sToken, vhrUri, true ); //isVersioned=true
        content.create( sToken, vhrUri, vrNrd, rNrc );
        //NodeRevisionDescriptors vhrNrds = content.retrieve( sToken, vhrUri );
        content.create(
            sToken, vhrUri, null, vhrNrd, null ); //branch=null, revisionContent=null
       
        // Create VR node
        NodeRevisionNumber vrVersion = vrNrd.getRevisionNumber();
        SubjectNode vrNode = new SubjectNode();
        UriHandler vrUh =
            UriHandler.createVersionUri( vhrUh, String.valueOf(vrVersion) );
        String vrUri = String.valueOf( vrUh );
        structure.create( sToken, vrNode, String.valueOf(vrUh) );
       
View Full Code Here

Examples of org.apache.slide.structure.SubjectNode

                                             pHelp.createHrefValue(evUri)) );
        // set workspace
        setWorkspaceProperty( vcrUri, vcrNrd );
       
        // store
        SubjectNode vcrNode = new SubjectNode();
        structure.create( sToken, vcrNode, vcrUri );
        NodeRevisionContent evContent =
            content.retrieve( sToken, evNrds, evNrd );
        content.create( sToken, vcrUri, vcrNrd, evContent );
       
View Full Code Here

Examples of org.apache.slide.structure.SubjectNode

        }
        wsNrd.setCreationDate( new Date() ); // P_CREATIONDATE
        setCreationUser(wsNrd);
       
        // Create the ws resource
        SubjectNode wsNode = new SubjectNode();
        structure.create( sToken, wsNode, wsUri );
        content.create( sToken, wsUri, wsNrd, null ); // revisionContent = null
       
        // Set status created
        resp.setStatus( WebdavStatus.SC_CREATED );
View Full Code Here

Examples of org.apache.slide.structure.SubjectNode

            //NodeRevisionDescriptors vhrNrds = content.retrieve(sToken, vhUri);
           
            // create the workingresource
            UriHandler wrUh = UriHandler.createNextWorkingresourceUri( sToken, nsaToken, rUh );
            String wrUri = String.valueOf( wrUh );
            SubjectNode wrNode = new SubjectNode();
            structure.create( sToken, wrNode, String.valueOf(wrUh) );
           
            // set WR props
            NodeRevisionDescriptor wrNrd = new NodeRevisionDescriptor();
            i = pHelp.createInitialProperties(WorkingImpl.getInstance(), wrUri).iterator();
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.