Package org.exoplatform.services.jcr.datamodel

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


                  int orderNum = resultSet.getInt(COLUMN_VORDERNUM);
                  // check is there value columns
                  if (!resultSet.wasNull())
                  {
                     final String storageId = resultSet.getString(COLUMN_VSTORAGE_DESC);
                     ValueData vdata =
                        resultSet.wasNull() ? readValueData(cid, orderNum, cversion, resultSet
                           .getBinaryStream(COLUMN_VDATA)) : readValueData(identifier, orderNum, storageId);
                     data.add(vdata);
                  }
View Full Code Here


      switch (type)
      {
         case PropertyType.STRING :
            return new TransientValueData(value.getString());
         case PropertyType.BINARY :
            ValueData vd;
            if (value instanceof BaseValue || value instanceof ExtendedValue)
            {
               // create Transient copy
               vd = ((BaseValue)getSession().getValueFactory().createValue(value.getStream())).getInternalData();
            }
            else
            {
               // third part value impl, convert via String
               vd =
                  ((BaseValue)getSession().getValueFactory().createValue(value.getString(), PropertyType.BINARY))
                     .getInternalData();
            }
            return vd;
         case PropertyType.BOOLEAN :
            return new TransientValueData(value.getBoolean());
         case PropertyType.LONG :
            return new TransientValueData(value.getLong());
         case PropertyType.DOUBLE :
            return new TransientValueData(value.getDouble());
         case PropertyType.DATE :
            return new TransientValueData(value.getDate());
         case PropertyType.PATH :
            ValueData pvd;
            if (value instanceof PathValue)
            {
               pvd = ((PathValue)value).getInternalData();
            }
            else
View Full Code Here

      ArrayList<PropertyData> refs = new ArrayList<PropertyData>();
      Iterator it = items.values().iterator();
      while (it.hasNext())
      {
         ItemData itemData = (ItemData)it.next();
         ValueData identifierVal = ((PropertyData)itemData).getValues().get(0);
         try
         {
            if ((itemData instanceof PropertyData) && ((PropertyData)itemData).getType() == PropertyType.REFERENCE
               && new String(identifierVal.getAsByteArray()).equals(identifier))
            {

               refs.add((PropertyData)itemData);
            }
         }
View Full Code Here

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

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

      ValueData baseVersion =
         ((PropertyData)dataManager.getItemData(nodeData(), new QPathEntry(Constants.JCR_BASEVERSION, 0),
            ItemType.PROPERTY)).getValues().get(0);

      changesLog.add(ItemState.createUpdatedState(updatePropertyData(Constants.JCR_PREDECESSORS, baseVersion)));
View Full Code Here

   protected void fixPropertyValues(PropertyData prop) throws RepositoryException
   {
      final List<ValueData> vals = prop.getValues();
      for (int i = 0; i < vals.size(); i++)
      {
         ValueData vd = vals.get(i);
         if (!vd.isByteArray())
         {
            // check if file is correct
            FilePersistedValueData fpvd = (FilePersistedValueData)vd;
            if (fpvd.getFile() == null)
            {
               // need read from storage
               ValueData svd = getPropertyValue(prop.getIdentifier(), vd.getOrderNumber(), prop.getPersistedVersion());

               if (svd == null)
               {
                  // error, value not found
                  throw new RepositoryException("Value cannot be found in storage for cached Property "
View Full Code Here

                  if (prevData.getValues() != null) // null if it's DELETE state
                  {
                     List<ValueData> values = new ArrayList<ValueData>();
                     for (int i = 0; i < prevData.getValues().size(); i++)
                     {
                        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);
View Full Code Here

   protected void fixPropertyValues(PropertyData prop) throws RepositoryException
   {
      final List<ValueData> vals = prop.getValues();
      for (int i = 0; i < vals.size(); i++)
      {
         ValueData vd = vals.get(i);
         if (!vd.isByteArray())
         {
            // check if file is correct
            FilePersistedValueData fpvd = (FilePersistedValueData)vd;
            if (fpvd.getFile() == null)
            {
               // need read from storage
               ValueData svd = getPropertyValue(prop.getIdentifier(), vd.getOrderNumber(), prop.getPersistedVersion());

               if (svd == null)
               {
                  // error, value not found
                  throw new RepositoryException("Value cannot be found in storage for cached Property "
View Full Code Here

         {
            List<ValueData> mvs = frozenMixinTypes.getValues();
            mixins = new InternalQName[mvs.size()];
            for (int i = 0; i < mvs.size(); i++)
            {
               ValueData mvd = mvs.get(i);
               mixins[i] = InternalQName.parse(new String(mvd.getAsByteArray()));
            }
         }
         catch (IllegalNameException e)
         {
            throw new RepositoryException("jcr:frozenMixinTypes, error of data read "
View Full Code Here

   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));

      if (successorsProp == null)
View Full Code Here

   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));

      if (predeccessorsProp == null)
View Full Code Here

TOP

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

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.