Package org.exoplatform.services.jcr.dataflow.persistent

Examples of org.exoplatform.services.jcr.dataflow.persistent.PersistedPropertyData


         QPath qpath =
            QPath.makeChildPath(parentPath == null ? traverseQPath(cpid) : parentPath, InternalQName.parse(cname));

         String identifier = getIdentifier(cid);
         List<ValueData> values = readValues(cid, identifier, cversion);
         PersistedPropertyData pdata =
            new PersistedPropertyData(identifier, qpath, getIdentifier(cpid), cversion, cptype, cpmultivalued, values);

         return pdata;
      }
      catch (IllegalNameException e)
      {
View Full Code Here


            }
         }

         // build property data
         PropertyData pdata =
            new PersistedPropertyData(identifier, qpath, tempNode.cid, prop.version, prop.type, prop.multi,
               valueData);

         childProps.put(propName, pdata);
      }
View Full Code Here

      {
         InternalQName qname = InternalQName.parse(cname);

         QPath qpath = QPath.makeChildPath(parentPath == null ? traverseQPath(cpid) : parentPath, qname);

         PersistedPropertyData pdata =
            new PersistedPropertyData(getIdentifier(cid), qpath, getIdentifier(cpid), cversion, cptype, cpmultivalued,
               new ArrayList<ValueData>());

         return pdata;
      }
      catch (InvalidItemStateException e)
View Full Code Here

         QPath qpath =
            QPath.makeChildPath(parentPath == null ? traverseQPath(cpid) : parentPath, InternalQName.parse(cname));

         String identifier = getIdentifier(cid);
         List<ValueData> values = readValues(cid, identifier, cversion);
         PersistedPropertyData pdata =
            new PersistedPropertyData(identifier, qpath, getIdentifier(cpid), cversion, cptype, cpmultivalued, values);

         return pdata;
      }
      catch (IllegalNameException e)
      {
View Full Code Here

                           values.add(vd);
                        }
                     }

                     newData =
                        new PersistedPropertyData(prevData.getIdentifier(), prevData.getQPath(), prevData
                           .getParentIdentifier(), prevData.getPersistedVersion() + 1, prevData.getType(), prevData
                           .isMultiValued(), values);
                  }
                  else
                  {
                     newData =
                        new PersistedPropertyData(prevData.getIdentifier(), prevData.getQPath(), prevData
                           .getParentIdentifier(), prevData.getPersistedVersion() + 1, prevData.getType(), prevData
                           .isMultiValued(), null);
                  }
               }
            }
View Full Code Here

            String identifier = getIdentifier(cid);

            int cversion = resultSet.getInt(COLUMN_VERSION);

            int valueOrderNum = resultSet.getInt(COLUMN_VORDERNUM);
            PersistedPropertyData prop = propertyBuffer.get(identifier);

            if (prop == null)
            {
               // make temporary PropertyData without values
               String cname = resultSet.getString(COLUMN_NAME);

               String cpid = resultSet.getString(COLUMN_PARENTID);
               int cptype = resultSet.getInt(COLUMN_PTYPE);
               boolean cpmultivalued = resultSet.getBoolean(COLUMN_PMULTIVALUED);
               QPath qpath = QPath.makeChildPath(traverseQPath(cpid), InternalQName.parse(cname));

               prop =
                  new PersistedPropertyData(identifier, qpath, getIdentifier(cpid), cversion, cptype, cpmultivalued,
                     null); // null values!
               propertyBuffer.put(identifier, prop);
               valuesBuffer.put(identifier, new ArrayList<ValueData>());
               dublicatedProps.put(identifier, new Integer(1));
            }

            List<ValueData> values = valuesBuffer.get(identifier);
            if (valueOrderNum == 0 && values.size() > 0)
            {
               // ignore it, this is a new copy
               Integer copies = dublicatedProps.get(identifier);
               copies++;
               dublicatedProps.put(identifier, copies);
            }
            else if (values.size() <= valueOrderNum)
            {
               // read value and put into values buffer
               final String storageId = resultSet.getString(COLUMN_VSTORAGE_DESC);
               ValueData vdata =
                  resultSet.wasNull() ? readValueData(cid, valueOrderNum, cversion, resultSet
                     .getBinaryStream(COLUMN_VDATA)) : readValueData(identifier, valueOrderNum, storageId);

               values.add(vdata);
               valuesBuffer.put(identifier, values);
            }
         }

         for (String id : propertyBuffer.keySet())
         {

            PersistedPropertyData prop = propertyBuffer.get(id);
            List<ValueData> values = valuesBuffer.get(id);
            int count = dublicatedProps.get(id).intValue();

            for (int i = 0; i < count; i++)
            {
               //make a copy
               List<ValueData> newValues = new ArrayList<ValueData>();
               for (ValueData vd : values)
               {
                  newValues.add(new ByteArrayPersistedValueData(vd.getOrderNumber(), vd.getAsByteArray()));
               }

               PersistedPropertyData pdata =
                  new PersistedPropertyData(prop.getIdentifier(), prop.getQPath(), prop.getParentIdentifier(), prop
                     .getPersistedVersion(), prop.getType(), prop.isMultiValued(), newValues);
               resultProps.add(pdata);
            }
            values.clear();
         }
View Full Code Here

               data.add(vdata);
            }
         }
         while (resultSet.next() && resultSet.getString(COLUMN_ID).equals(cid));

         PersistedPropertyData pdata =
            new PersistedPropertyData(identifier, qpath, getIdentifier(cpid), cversion, cptype, cpmultivalued, data);

         return pdata;
      }
      catch (IllegalNameException e)
      {
View Full Code Here

      {
         ItemData itemData = itemState.getData();

         if (itemData instanceof PersistedPropertyData)
         {
            PersistedPropertyData propertyData = (PersistedPropertyData)itemData;
            if ((propertyData.getValues() != null))
               for (int j = 0; j < propertyData.getValues().size(); j++)
                  if (!(propertyData.getValues().get(j).isByteArray()))
                  {
                     listFixupStream.add(new FixupStream(i, j));

                     InputStream inputStream;
                     if (itemState.isDeleted())
                        inputStream = new ByteArrayInputStream("".getBytes());
                     else
                        inputStream = propertyData.getValues().get(j).getAsStream();

                     listInputStream.add(inputStream);
                     itemDataChangesLogType = PendingChangesLog.Type.CHANGESLOG_WITH_STREAM;
                  }
         }
View Full Code Here

      for (int i = 0; i < this.listFixupStream.size(); i++)
      {
         ItemState itemState = listItemState.get(listFixupStream.get(i).getItemSateId());
         ItemData itemData = itemState.getData();

         PersistedPropertyData propertyData = (PersistedPropertyData)itemData;
         ValueData vd = (propertyData.getValues().get(listFixupStream.get(i).getValueDataId()));

         // re-init the value
         propertyData.getValues().set(
            listFixupStream.get(i).getValueDataId(),
                  new StreamPersistedValueData(vd.getOrderNumber(), new SpoolFile(listFile.get(i).getAbsolutePath())));
      }

      if (listRandomAccessFile != null)
View Full Code Here

            }
         }

         // build property data
         PropertyData pdata =
            new PersistedPropertyData(identifier, qpath, tempNode.cid, prop.version, prop.type, prop.multi, valueData);

         childProps.put(propName, pdata);
      }

      return new NodeDataIndexing(nodeData, childProps);
View Full Code Here

TOP

Related Classes of org.exoplatform.services.jcr.dataflow.persistent.PersistedPropertyData

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.