Examples of TransientValueData


Examples of org.exoplatform.services.jcr.impl.dataflow.TransientValueData

         try
         {
            byte[] mfb = mfvd.getAsByteArray();
            if (!version.getUUID().equals(new String(mfb)))
            {
               mf.add(new TransientValueData(mfb));
            }
         }
         catch (IOException e)
         {
            throw new RepositoryException("Remove jcr:mergeFailed error " + e, e);
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.dataflow.TransientValueData

      List<ValueData> permValues = new ArrayList<ValueData>();

      List<AccessControlEntry> aces = acl.getPermissionEntries(); // new
      for (AccessControlEntry ace : aces)
      {
         permValues.add(new TransientValueData(ace));
      }

      PropertyData permProp =
         (PropertyData)dataManager.getItemData(nodeData(), new QPathEntry(Constants.EXO_PERMISSIONS, 0),
            ItemType.PROPERTY);
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.dataflow.TransientValueData

      SessionChangesLog changesLog = new SessionChangesLog(session.getId());

      PropertyData labelData =
         TransientPropertyData.createPropertyData(labels, labelQName, PropertyType.REFERENCE, false,
            new TransientValueData(versionData.getIdentifier()));
      changesLog.add(ItemState.createAddedState(labelData));

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

Examples of org.exoplatform.services.jcr.impl.dataflow.TransientValueData

      changesLog.add(ItemState.createAddedState(versionData));

      // jcr:primaryType
      TransientPropertyData propData =
         TransientPropertyData.createPropertyData(versionData, Constants.JCR_PRIMARYTYPE, PropertyType.NAME, false,
            new TransientValueData(Constants.NT_VERSION));
      changesLog.add(ItemState.createAddedState(propData));

      // jcr:mixinTypes
      propData =
         TransientPropertyData.createPropertyData(versionData, Constants.JCR_MIXINTYPES, PropertyType.NAME, true,
            new TransientValueData(Constants.MIX_REFERENCEABLE));
      changesLog.add(ItemState.createAddedState(propData));

      // jcr:uuid
      propData =
         TransientPropertyData.createPropertyData(versionData, Constants.JCR_UUID, PropertyType.STRING, false,
            new TransientValueData(uuid));
      changesLog.add(ItemState.createAddedState(propData));

      // jcr:created
      propData =
         TransientPropertyData.createPropertyData(versionData, Constants.JCR_CREATED, PropertyType.DATE, false,
            new TransientValueData(session.getTransientNodesManager().getWorkspaceDataManager().getCurrentTime()));
      changesLog.add(ItemState.createAddedState(propData));

      // A reference to V is added to the jcr:successors property of
      // each of the versions identified in Vs jcr:predecessors property.
      List<ValueData> predecessors =
         ((PropertyData)dataManager.getItemData(versionableNodeData, new QPathEntry(Constants.JCR_PREDECESSORS, 0),
            ItemType.PROPERTY)).getValues();
      List<ValueData> predecessorsNew = new ArrayList<ValueData>();
      for (ValueData predecessorValue : predecessors)
      {
         byte[] pib;
         try
         {
            pib = predecessorValue.getAsByteArray();
         }
         catch (IOException e)
         {
            throw new RepositoryException(e);
         }
         VersionImpl predecessor = (VersionImpl)dataManager.getItemByIdentifier(new String(pib), false);
         predecessor.addSuccessor(versionData.getIdentifier(), changesLog);

         predecessorsNew.add(new TransientValueData(pib));
      }

      // jcr:predecessors
      propData =
         TransientPropertyData.createPropertyData(versionData, Constants.JCR_PREDECESSORS, PropertyType.REFERENCE,
            true, predecessorsNew);
      changesLog.add(ItemState.createAddedState(propData));

      // jcr:frozenNode
      NodeData frozenData =
         TransientNodeData.createNodeData(versionData, Constants.JCR_FROZENNODE, Constants.NT_FROZENNODE);
      changesLog.add(ItemState.createAddedState(frozenData));

      propData =
         TransientPropertyData.createPropertyData(frozenData, Constants.JCR_PRIMARYTYPE, PropertyType.NAME, false,
            new TransientValueData(Constants.NT_FROZENNODE));
      changesLog.add(ItemState.createAddedState(propData));

      propData =
         TransientPropertyData.createPropertyData(frozenData, Constants.JCR_MIXINTYPES, PropertyType.NAME, true,
            new TransientValueData(Constants.MIX_REFERENCEABLE));
      changesLog.add(ItemState.createAddedState(propData));

      propData =
         TransientPropertyData.createPropertyData(frozenData, Constants.JCR_UUID, PropertyType.STRING, false,
            new TransientValueData(frozenData.getIdentifier()));
      changesLog.add(ItemState.createAddedState(propData));

      FrozenNodeInitializer visitor =
         new FrozenNodeInitializer(frozenData, session.getTransientNodesManager(), session.getWorkspace()
            .getNodeTypesHolder(), changesLog, session.getValueFactory());
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.dataflow.TransientValueData

         String value = propertyInfo.getValues().get(i).toString();

         mixinNames[i] = locationFactory.parseJCRName(value).getInternalName();
         currentNodeInfo.addNodeType((nodeTypeDataManager.getNodeType(mixinNames[i])));
         values.add(new TransientValueData(value.toString()));
      }

      currentNodeInfo.setMixinTypeNames(mixinNames);

      propertyData =
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.dataflow.TransientValueData

         new ImportPropertyData(QPath.makeChildPath(currentNodeInfo.getQPath(), propertyInfo.getName()), propertyInfo
            .getIndentifer(), 0, propertyInfo.getType(), currentNodeInfo.getIdentifier(), false);
     
      if (currentNodeInfo.getQPath().isDescendantOf(Constants.JCR_VERSION_STORAGE_PATH))
      {
         propertyData.setValue(new TransientValueData(propertyInfo.getValues().get(0).toString()));
      }
      else
      {
         propertyData.setValue(new TransientValueData(currentNodeInfo.getIdentifier()));
      }

      tree.push(currentNodeInfo);
     
      mapNodePropertiesInfo.put(currentNodeInfo.getQPath().getAsString(), new NodePropertiesInfo(currentNodeInfo));
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.dataflow.TransientValueData

            {
               InputStream vStream = propertyInfo.getValues().get(k).getInputStream();

               // TODO cleanup
               // TransientValueData binaryValue = new TransientValueData(vStream);
               TransientValueData binaryValue =
                  new TransientValueData(k, null, vStream, null, valueFactory.getFileCleaner(), valueFactory
                     .getMaxBufferSize(), null, true);
               // Call to spool file into tmp
               binaryValue.getAsStream().close();
               vStream.close();
               propertyInfo.getValues().get(k).remove();
               values.add(binaryValue);
            }
            catch (IOException e)
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.dataflow.TransientValueData

                     {
                        ValueData vd = prevData.getValues().get(i);

                        if (vd instanceof TransientValueData)
                        {
                           TransientValueData tvd = (TransientValueData)vd;
                           ValueData pvd;

                           if (vd.isByteArray())
                           {
                              pvd = new ByteArrayPersistedValueData(i, vd.getAsByteArray());
                              values.add(pvd);
                           }
                           else
                           {
                              // TODO ask dest file from VS provider, can be null after
                              // TODO for JBC case, the storage connection will evict the replicated Value to read it from the DB
                              File destFile = null;

                              if (tvd.getSpoolFile() != null)
                              {
                                 // spooled to temp file
                                 pvd = new StreamPersistedValueData(i, tvd.getSpoolFile(), destFile);
                              }
                              else
                              {
                                 // with original stream
                                 pvd = new StreamPersistedValueData(i, tvd.getOriginalStream(), destFile);
                              }

                              values.add(pvd);
                           }

                           tvd.delegate(pvd);
                        }
                        else
                        {
                           values.add(vd);
                        }
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.dataflow.TransientValueData

   public void addSuccessor(String successorIdentifier, PlainChangesLog changesLog) throws RepositoryException
   {
      checkValid();

      ValueData successorRef = new TransientValueData(new Identifier(successorIdentifier));

      PropertyData successorsProp =
         (PropertyData)dataManager.getItemData(nodeData(), new QPathEntry(Constants.JCR_SUCCESSORS, 0),
            ItemType.PROPERTY);

      if (successorsProp == null)
      {
         // create a property now
         List<ValueData> successors = new ArrayList<ValueData>();
         successors.add(successorRef);
         successorsProp =
            TransientPropertyData.createPropertyData(nodeData(), Constants.JCR_SUCCESSORS, PropertyType.REFERENCE,
               true, successors);
         changesLog.add(ItemState.createAddedState(successorsProp));
      }
      else
      {
         // add successor
         List<ValueData> newSuccessorsValue = new ArrayList<ValueData>();
         try
         {
            for (ValueData svd : successorsProp.getValues())
            {
               newSuccessorsValue.add(new TransientValueData(svd.getAsByteArray()));
            }
         }
         catch (IOException e)
         {
            throw new RepositoryException("jcr:successors read error " + e, e);
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.dataflow.TransientValueData

   public void addPredecessor(String predeccessorIdentifier, PlainChangesLog changesLog) throws RepositoryException
   {
      checkValid();

      ValueData predeccessorRef = new TransientValueData(new Identifier(predeccessorIdentifier));

      PropertyData predeccessorsProp =
         (PropertyData)dataManager.getItemData(nodeData(), new QPathEntry(Constants.JCR_PREDECESSORS, 0),
            ItemType.PROPERTY);

      if (predeccessorsProp == null)
      {
         List<ValueData> predeccessors = new ArrayList<ValueData>();
         predeccessors.add(predeccessorRef);
         predeccessorsProp =
            TransientPropertyData.createPropertyData(nodeData(), Constants.JCR_PREDECESSORS, PropertyType.REFERENCE,
               true, predeccessors);
         changesLog.add(ItemState.createAddedState(predeccessorsProp));
      }
      else
      {
         // add predeccessor
         List<ValueData> newPredeccessorValue = new ArrayList<ValueData>();
         try
         {
            for (ValueData svd : predeccessorsProp.getValues())
            {
               newPredeccessorValue.add(new TransientValueData(svd.getAsByteArray()));
            }
         }
         catch (IOException e)
         {
            throw new RepositoryException("jcr:predecessors read error " + e, e);
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.