Package org.exoplatform.services.jcr.datamodel

Examples of org.exoplatform.services.jcr.datamodel.Identifier


            return pvd;
         case PropertyType.NAME :
            InternalQName nameValue = locationFactory.parseJCRName(value.getString()).getInternalName();
            return new TransientValueData(nameValue);
         case PropertyType.REFERENCE :
            Identifier identifier = new Identifier(value.getString());
            return new TransientValueData(identifier);
         case ExtendedPropertyType.PERMISSION :
            PermissionValue permValue = (PermissionValue)value;
            AccessControlEntry ace = new AccessControlEntry(permValue.getIdentity(), permValue.getPermission());
            return new TransientValueData(ace);
View Full Code Here


      changesLog.add(ItemState.createUpdatedState(updatePropertyData(Constants.JCR_ISCHECKEDOUT,
         new TransientValueData(false))));

      changesLog.add(ItemState.createUpdatedState(updatePropertyData(Constants.JCR_BASEVERSION, new TransientValueData(
         new Identifier(verIdentifier)))));

      changesLog.add(ItemState.createUpdatedState(updatePropertyData(Constants.JCR_PREDECESSORS,
         new ArrayList<ValueData>())));

      dataManager.getTransactManager().save(changesLog);
View Full Code Here

      changesLog.add(ItemState.createUpdatedState(updatePropertyData(Constants.JCR_ISCHECKEDOUT,
         new TransientValueData(false))));

      changesLog.add(ItemState.createUpdatedState(updatePropertyData(Constants.JCR_BASEVERSION, new TransientValueData(
         new Identifier(verIdentifier)))));

      changesLog.add(ItemState.createUpdatedState(updatePropertyData(Constants.JCR_PREDECESSORS,
         new ArrayList<ValueData>())));

      dataManager.getTransactManager().save(changesLog);
View Full Code Here

            return pvd;
         case PropertyType.NAME :
            InternalQName nameValue = locationFactory.parseJCRName(value.getString()).getInternalName();
            return new TransientValueData(nameValue);
         case PropertyType.REFERENCE :
            Identifier identifier = new Identifier(value.getString());
            return new TransientValueData(identifier);
         case ExtendedPropertyType.PERMISSION :
            PermissionValue permValue = (PermissionValue)value;
            AccessControlEntry ace = new AccessControlEntry(permValue.getIdentity(), permValue.getPermission());
            return new TransientValueData(ace);
View Full Code Here

      changesLog.add(ItemState.createUpdatedState(updatePropertyData(Constants.JCR_ISCHECKEDOUT,
         new TransientValueData(false))));

      changesLog.add(ItemState.createUpdatedState(updatePropertyData(Constants.JCR_BASEVERSION, new TransientValueData(
         new Identifier(verIdentifier)))));

      changesLog.add(ItemState.createUpdatedState(updatePropertyData(Constants.JCR_PREDECESSORS,
         new ArrayList<ValueData>())));

      dataManager.getTransactManager().save(changesLog);
View Full Code Here

            return pvd;
         case PropertyType.NAME :
            InternalQName nameValue = locationFactory.parseJCRName(value.getString()).getInternalName();
            return new TransientValueData(nameValue);
         case PropertyType.REFERENCE :
            Identifier identifier = new Identifier(value.getString());
            return new TransientValueData(identifier);
         case ExtendedPropertyType.PERMISSION :
            PermissionValue permValue = (PermissionValue)value;
            AccessControlEntry ace = new AccessControlEntry(permValue.getIdentity(), permValue.getPermission());
            return new TransientValueData(ace);
View Full Code Here

      NodeData versionable = (NodeData)versionableNode.getData();
      // ----- VERSIONABLE properties -----
      // jcr:versionHistory
      TransientPropertyData vh =
         TransientPropertyData.createPropertyData(versionable, Constants.JCR_VERSIONHISTORY, PropertyType.REFERENCE,
            false, new TransientValueData(new Identifier(versionHistory)));

      // jcr:baseVersion
      TransientPropertyData bv =
         TransientPropertyData.createPropertyData(versionable, Constants.JCR_BASEVERSION, PropertyType.REFERENCE,
            false, new TransientValueData(new Identifier(baseVersionUuid)));

      // jcr:predecessors
      List<ValueData> values = new ArrayList<ValueData>();
      for (int i = 0; i < predecessors.length; i++)
      {
         values.add(new TransientValueData(new Identifier(predecessors[i])));
      }
      TransientPropertyData pd =
         TransientPropertyData.createPropertyData(versionable, Constants.JCR_PREDECESSORS, PropertyType.REFERENCE,
            true, values);
View Full Code Here

      // jcr:versionableUuid
      TransientPropertyData vhVersionableUuid = TransientPropertyData
      // [PN] 10.04.07 VERSIONABLEUUID isn't referenceable!!!
               .createPropertyData(versionHistory, Constants.JCR_VERSIONABLEUUID, PropertyType.STRING, false);
      vhVersionableUuid.setValue(new TransientValueData(new Identifier(versionable.getIdentifier())));

      // ------ jcr:versionLabels ------
      NodeData vhVersionLabels =
               TransientNodeData
                        .createNodeData(versionHistory, Constants.JCR_VERSIONLABELS, Constants.NT_VERSIONLABELS);

      // jcr:primaryType
      TransientPropertyData vlPrimaryType =
               TransientPropertyData.createPropertyData(vhVersionLabels, Constants.JCR_PRIMARYTYPE, PropertyType.NAME,
                        false);
      vlPrimaryType.setValue(new TransientValueData(vhVersionLabels.getPrimaryTypeName()));

      // ------ jcr:rootVersion ------
      NodeData rootVersionData =
               TransientNodeData.createNodeData(versionHistory, Constants.JCR_ROOTVERSION, Constants.NT_VERSION,
                        baseVersionIdentifier);

      // jcr:primaryType
      TransientPropertyData rvPrimaryType =
               TransientPropertyData.createPropertyData(rootVersionData, Constants.JCR_PRIMARYTYPE, PropertyType.NAME,
                        false);
      rvPrimaryType.setValue(new TransientValueData(rootVersionData.getPrimaryTypeName()));

      // jcr:uuid
      TransientPropertyData rvUuid =
               TransientPropertyData
                        .createPropertyData(rootVersionData, Constants.JCR_UUID, PropertyType.STRING, false);
      rvUuid.setValue(new TransientValueData(baseVersionIdentifier));

      // jcr:mixinTypes
      TransientPropertyData rvMixinTypes =
               TransientPropertyData.createPropertyData(rootVersionData, Constants.JCR_MIXINTYPES, PropertyType.NAME,
                        true);
      rvMixinTypes.setValue(new TransientValueData(Constants.MIX_REFERENCEABLE));

      // jcr:created
      TransientPropertyData rvCreated =
               TransientPropertyData.createPropertyData(rootVersionData, Constants.JCR_CREATED, PropertyType.DATE,
                        false);

      // TODO Current time source was
      // rvCreated.setValue(new
      // TransientValueData(dataManager.getTransactManager().getStorageDataManager
      // ().getCurrentTime()));
      rvCreated.setValue(new TransientValueData(Calendar.getInstance()));

      // ----- VERSIONABLE properties -----
      // jcr:versionHistory
      TransientPropertyData vh =
               TransientPropertyData.createPropertyData(versionable, Constants.JCR_VERSIONHISTORY,
                        PropertyType.REFERENCE, false);
      vh.setValue(new TransientValueData(new Identifier(versionHistoryIdentifier)));

      // jcr:baseVersion
      TransientPropertyData bv =
               TransientPropertyData.createPropertyData(versionable, Constants.JCR_BASEVERSION, PropertyType.REFERENCE,
                        false);
      bv.setValue(new TransientValueData(new Identifier(baseVersionIdentifier)));

      // jcr:predecessors
      TransientPropertyData pd =
               TransientPropertyData.createPropertyData(versionable, Constants.JCR_PREDECESSORS,
                        PropertyType.REFERENCE, true);
      pd.setValue(new TransientValueData(new Identifier(baseVersionIdentifier)));

      // update all
      QPath vpath = versionable.getQPath();
      changes.add(new ItemState(versionHistory, ItemState.ADDED, true, vpath));
      changes.add(new ItemState(vhPrimaryType, ItemState.ADDED, true, vpath));
View Full Code Here

   }

   public ReferenceValue(TransientValueData data) throws IOException, RepositoryException
   {
      super(TYPE, data);
      this.identifier = new Identifier(getInternalString());
   }
View Full Code Here

               catch (RepositoryException e)
               {
                  throw new ValueFormatException("Name '" + value + "' is invalid", e);
               }
            case PropertyType.REFERENCE :
               return createValue(new Identifier(value));
            case ExtendedPropertyType.PERMISSION :
               try
               {
                  return PermissionValue.parseValue(value);
               }
View Full Code Here

TOP

Related Classes of org.exoplatform.services.jcr.datamodel.Identifier

Copyright © 2018 www.massapicom. 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.