exo-jcr SVN: r4691 - in jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules: jcr and 1 other directories.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2011-08-02 09:01:46 -0400 (Tue, 02 Aug 2011)
New Revision: 4691
Added:
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/api-extensions.xml
Modified:
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr.xml
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/workspace-persistence-storage.xml
Log:
EXOJCR-267 : documentation added
Added: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/api-extensions.xml
===================================================================
--- jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/api-extensions.xml (rev 0)
+++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/api-extensions.xml 2011-08-02 13:01:46 UTC (rev 4691)
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<chapter id="JCR.APIExtensions">
+ <?dbhtml filename="ch-api-extensions.html"?>
+
+ <title>JCR API Extensions</title>
+
+ <section>
+ <title>"Lazy" child nodes iteration</title>
+
+ <section>
+ <title>Concept</title>
+
+ <para>eXo JCR implementation offers new extended feature beyond JCR
+ specification. Sometimes it happens that one JCR Node has hundreds or
+ even thousands of child nodes. This situation is highly not recommended
+ for content repository data storage, but some times it occurs. JCR Team
+ is pleased to announce new feature that will help to have a deal with
+ huge child lists. They can be iterated in a "lazy" manner now giving
+ improvement in term of performance and RAM usage.</para>
+ </section>
+
+ <section>
+ <title>API and usage</title>
+
+ <para>Lazy child nodes iteration feature is accessible via extended
+ interface org.exoplatform.services.jcr.core.ExtendedNode, the inheritor
+ of javax.jcr.Node. It provides a new single method shown below:</para>
+
+ <programlisting language="java"> /**
+ * Returns a NodeIterator over all child Nodes of this Node. Does not include properties
+ * of this Node. If this node has no child nodes, then an empty iterator is returned.
+ *
+ * @return A NodeIterator over all child Nodes of this <code>Node</code>.
+ * @throws RepositoryException If an error occurs.
+ */
+ public NodeIterator getNodesLazily() throws RepositoryException;
+</programlisting>
+
+ <para>From the view of end-user or client application, getNodesLazily()
+ works similar to JCR specified getNodes() returning NodeIterator. "Lazy"
+ iterator supports the same set of features as an ordinary NodeIterator,
+ including skip() and excluding remove() features. "Lazy" implementation
+ performs reading from DB by pages. Each time when it has no more
+ elements stored in memory, it reads next set of items from persistent
+ layer. This set is called "page". Must admit that getNodesLazily feature
+ fully supports session and transaction changes log, so it's a
+ functionally-full analogue of specified getNodes() operation. So when
+ having a deal with huge list of child nodes, getNodes() can be simply
+ and safely substituted with getNodesLazily().</para>
+ </section>
+
+ <section>
+ <title>Configuration</title>
+
+ <para>"Lazy" iterator makes ahead reading into memory, though reading
+ the "page". "Page" is a set of nodes read at once. Size of the page by
+ default is 100 nodes and can be configured though workspace container
+ configuration using "lazy-node-iterator-page-size" parameter.
+ I.e.:</para>
+
+ <programlisting language="xml"><container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcr" />
+ <property name="multi-db" value="true" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="target/temp/swap/ws" />
+ <property name="lazy-node-iterator-page-size" value="50" />
+ ...
+ </properties></programlisting>
+
+ <para>But it's not recommended to set huge page size</para>
+ </section>
+
+ <section>
+ <title>Implementation notices</title>
+
+ <para>Current "lazy" child nodes iterator supports caching, when pages
+ are cached atomically in safe and optimized way. Cache is always kept in
+ consistent state using invalidation if child list changed. Take in
+ account the following difference in getNodes and getNodesLazily.
+ Specification defined getNodes method reads whole list of nodes, so
+ child items added after invocation will never be in results.
+ GetNodesLazily doesn't acquire full list of nodes, so child items added
+ after iterator creation can be found in result. So getNodesLazily can
+ represent some kind of "real-time" results. But it is highly depend on
+ numerous conditions and should not be used as a feature, it more likely
+ implementation specific issue typical for "lazy-pattern".</para>
+ </section>
+ </section>
+</chapter>
Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/workspace-persistence-storage.xml
===================================================================
--- jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/workspace-persistence-storage.xml 2011-08-02 08:38:59 UTC (rev 4690)
+++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/workspace-persistence-storage.xml 2011-08-02 13:01:46 UTC (rev 4691)
@@ -23,6 +23,7 @@
<property name="multi-db" value="true"/>
<property name="max-buffer-size" value="200K"/>
<property name="swap-directory" value="target/temp/swap/ws"/>
+ <property name="lazy-node-iterator-page-size" value="50"/>
</properties></programlisting>
<para>Properties are Container specific parameters:</para>
@@ -46,6 +47,10 @@
value will be spooled if no value storage is configured but a
max-buffer-size is exceeded.</para>
+ <para><emphasis role="bold">lazy-node-iterator-page-size</emphasis>: "Lazy"
+ child nodes iterator settings. Defines size of page, the number of nodes
+ that are retrieved from persistent storage at once.</para>
+
<para>eXo JCR has an RDB (JDBC) based, production ready <emphasis
role="bold">Workspace Data Container</emphasis>.</para>
Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr.xml
===================================================================
--- jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr.xml 2011-08-02 08:38:59 UTC (rev 4690)
+++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr.xml 2011-08-02 13:01:46 UTC (rev 4691)
@@ -103,7 +103,12 @@
xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="jcr/searching/fulltext-search-and-settings.xml"
- xmlns:xi="http://www.w3.org/2001/XInclude" />
+ xmlns:xi="http://www.w3.org/2001/XInclude" />
+
+ <!-- api extensions -->
+
+ <xi:include href="jcr/api-extensions.xml"
+ xmlns:xi="http://www.w3.org/2001/XInclude" />
<!-- protocols -->
12 years, 9 months
exo-jcr SVN: r4690 - in ws/trunk/exo.ws.frameworks.json/src: test/java/org/exoplatform/ws/frameworks/json and 1 other directories.
by do-not-reply@jboss.org
Author: aparfonov
Date: 2011-08-02 04:38:59 -0400 (Tue, 02 Aug 2011)
New Revision: 4690
Added:
ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/ClassTransfBean.java
Modified:
ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/frameworks/json/impl/JsonGeneratorImpl.java
ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/frameworks/json/impl/JsonUtils.java
ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/frameworks/json/impl/ObjectBuilder.java
ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/impl/JsonGeneratorTest.java
ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/impl/ObjectBuilderTest.java
Log:
EXOJCR-1459 : Add java.lang.Class to set of 'known types' for java to JSON transformation
Modified: ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/frameworks/json/impl/JsonGeneratorImpl.java
===================================================================
--- ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/frameworks/json/impl/JsonGeneratorImpl.java 2011-08-01 13:48:28 UTC (rev 4689)
+++ ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/frameworks/json/impl/JsonGeneratorImpl.java 2011-08-02 08:38:59 UTC (rev 4690)
@@ -210,7 +210,7 @@
* @return JsonValue.
* @throws JsonException if any errors occurs.
*/
- @SuppressWarnings("unchecked")
+ @SuppressWarnings({"unchecked", "rawtypes"})
private JsonValue createJsonValue(Object object) throws JsonException
{
Types type = JsonUtils.getType(object);
@@ -238,6 +238,8 @@
return new StringValue((String)object);
case ENUM :
return new StringValue(((Enum)object).name());
+ case CLASS :
+ return new StringValue(((Class)object).getName());
case ARRAY_BOOLEAN : {
JsonValue jsonArray = new ArrayValue();
int length = Array.getLength(object);
@@ -385,7 +387,7 @@
private static Set<String> getTransientFields(final Class<?> clazz)
{
Set<String> set = new HashSet<String>();
-
+
Field[] fields = SecurityHelper.doPrivilegedAction(new PrivilegedAction<Field[]>()
{
public Field[] run()
Modified: ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/frameworks/json/impl/JsonUtils.java
===================================================================
--- ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/frameworks/json/impl/JsonUtils.java 2011-08-01 13:48:28 UTC (rev 4689)
+++ ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/frameworks/json/impl/JsonUtils.java 2011-08-02 08:38:59 UTC (rev 4690)
@@ -106,7 +106,10 @@
MAP,
/** Enum. */
- ENUM
+ ENUM,
+
+ /** java.lang.Class */
+ CLASS
}
/**
@@ -145,6 +148,8 @@
KNOWN_TYPES.put(Character.class.getName(), Types.CHAR);
KNOWN_TYPES.put(String.class.getName(), Types.STRING);
+
+ KNOWN_TYPES.put(Class.class.getName(), Types.CLASS);
// primitive types
KNOWN_TYPES.put("boolean", Types.BOOLEAN);
@@ -172,7 +177,6 @@
KNOWN_TYPES.put(new char[0].getClass().getName(), Types.ARRAY_CHAR);
KNOWN_TYPES.put(new String[0].getClass().getName(), Types.ARRAY_STRING);
-
}
/**
@@ -280,7 +284,6 @@
* @return {@link Types} or <code>null</code> (see above)
* @see {@link KNOWN_TYPES}.
*/
- @SuppressWarnings("unchecked")
public static Types getType(Object o)
{
if (o == null)
Modified: ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/frameworks/json/impl/ObjectBuilder.java
===================================================================
--- ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/frameworks/json/impl/ObjectBuilder.java 2011-08-01 13:48:28 UTC (rev 4689)
+++ ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/frameworks/json/impl/ObjectBuilder.java 2011-08-02 08:38:59 UTC (rev 4690)
@@ -339,7 +339,7 @@
* @return Object.
* @throws JsonException if any errors occurs.
*/
- @SuppressWarnings("unchecked")
+ @SuppressWarnings({"unchecked", "rawtypes"})
public static <T> T createObject(Class<T> clazz, JsonValue jsonValue) throws JsonException
{
if (jsonValue == null || jsonValue.isNull())
@@ -485,6 +485,15 @@
return jsonValue.getStringValue().charAt(0);
case STRING :
return jsonValue.getStringValue();
+ case CLASS :
+ try
+ {
+ return Class.forName(jsonValue.getStringValue());
+ }
+ catch (ClassNotFoundException e)
+ {
+ return null;
+ }
case ARRAY_BOOLEAN : {
boolean[] params = new boolean[jsonValue.size()];
Iterator<JsonValue> values = jsonValue.getElements();
Added: ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/ClassTransfBean.java
===================================================================
--- ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/ClassTransfBean.java (rev 0)
+++ ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/ClassTransfBean.java 2011-08-02 08:38:59 UTC (rev 4690)
@@ -0,0 +1,35 @@
+/**
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.exoplatform.ws.frameworks.json;
+
+@SuppressWarnings("rawtypes")
+public class ClassTransfBean
+{
+ private Class klass;
+
+ public Class getKlass()
+ {
+ return klass;
+ }
+
+ public void setKlass(Class klass)
+ {
+ this.klass = klass;
+ }
+}
Property changes on: ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/ClassTransfBean.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/impl/JsonGeneratorTest.java
===================================================================
--- ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/impl/JsonGeneratorTest.java 2011-08-01 13:48:28 UTC (rev 4689)
+++ ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/impl/JsonGeneratorTest.java 2011-08-02 08:38:59 UTC (rev 4690)
@@ -25,6 +25,7 @@
import org.exoplatform.ws.frameworks.json.BookEnum;
import org.exoplatform.ws.frameworks.json.BookStorage;
import org.exoplatform.ws.frameworks.json.BookWrapper;
+import org.exoplatform.ws.frameworks.json.ClassTransfBean;
import org.exoplatform.ws.frameworks.json.JavaMapBean;
import org.exoplatform.ws.frameworks.json.StringEnum;
import org.exoplatform.ws.frameworks.json.value.JsonValue;
@@ -242,4 +243,16 @@
assertEquals(BookEnum.JUNIT_IN_ACTION.name(), jsonValue.getElement("book").getStringValue());
}
+ public void testBeanClassTransf() throws Exception
+ {
+ ClassTransfBean be = new ClassTransfBean();
+ be.setKlass(ForTestClass000.class);
+ JsonValue jsonValue = new JsonGeneratorImpl().createJsonObject(be);
+ //System.out.println(jsonValue);
+ assertEquals(ForTestClass000.class.getName(), jsonValue.getElement("klass").getStringValue());
+ }
+
+ public static class ForTestClass000
+ {
+ }
}
Modified: ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/impl/ObjectBuilderTest.java
===================================================================
--- ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/impl/ObjectBuilderTest.java 2011-08-01 13:48:28 UTC (rev 4689)
+++ ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/impl/ObjectBuilderTest.java 2011-08-02 08:38:59 UTC (rev 4690)
@@ -23,6 +23,7 @@
import org.exoplatform.ws.frameworks.json.Book;
import org.exoplatform.ws.frameworks.json.BookEnum;
import org.exoplatform.ws.frameworks.json.BookStorage;
+import org.exoplatform.ws.frameworks.json.ClassTransfBean;
import org.exoplatform.ws.frameworks.json.JavaCollectionBean;
import org.exoplatform.ws.frameworks.json.JavaMapBean;
import org.exoplatform.ws.frameworks.json.JsonParser;
@@ -360,4 +361,20 @@
BeanWithBookEnum o = ObjectBuilder.createObject(BeanWithBookEnum.class, jsonValue);
assertEquals(BookEnum.BEGINNING_C, o.getBook());
}
+
+ public void testClass() throws Exception
+ {
+ String source = "{\"klass\":\"" + ForTestClass001.class.getName() + "\"}";
+ JsonParser jsonParser = new JsonParserImpl();
+ JsonDefaultHandler handler = new JsonDefaultHandler();
+ jsonParser.parse(new ByteArrayInputStream(source.getBytes()), handler);
+ JsonValue jsonValue = handler.getJsonObject();
+ //System.out.println(jsonValue);
+ ClassTransfBean o = ObjectBuilder.createObject(ClassTransfBean.class, jsonValue);
+ assertEquals(ForTestClass001.class, o.getKlass());
+ }
+
+ public static class ForTestClass001
+ {
+ }
}
12 years, 9 months
exo-jcr SVN: r4689 - in jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc: optimisation and 1 other directory.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2011-08-01 09:48:28 -0400 (Mon, 01 Aug 2011)
New Revision: 4689
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java
Log:
EXOJCR-1442: ExtendedTempPropertyData and TempPropertyData refactoring - duplicate readData() avoid
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2011-07-29 14:37:45 UTC (rev 4688)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2011-08-01 13:48:28 UTC (rev 4689)
@@ -2692,7 +2692,7 @@
SortedSet<TempPropertyData> ptTempProp = tempNode.properties.get(Constants.JCR_PRIMARYTYPE.getAsString());
if (ptTempProp != null)
{
- ptValue = ((ExtendedTempPropertyData)ptTempProp.first()).vdata;
+ ptValue = ptTempProp.first().getValueData();
ptName = InternalQName.parse(new String(ptValue.getAsByteArray(), Constants.DEFAULT_ENCODING));
}
@@ -2705,7 +2705,7 @@
{
for (TempPropertyData mxnb : mixinsTempProps)
{
- ValueData vdata = ((ExtendedTempPropertyData)mxnb).vdata;
+ ValueData vdata = mxnb.getValueData();
mixinsData.add(vdata);
mixins.add(InternalQName.parse(new String(vdata.getAsByteArray(), Constants.DEFAULT_ENCODING)));
@@ -2714,8 +2714,8 @@
// build node data. No need to load ACL. The node will be pushed directly for reindexing.
NodeData nodeData =
- new PersistedNodeData(getIdentifier(tempNode.cid), parentPath, getIdentifier(parentCid),
- tempNode.cversion, tempNode.cnordernumb, ptName, mixins.toArray(new InternalQName[mixins.size()]), null);
+ new PersistedNodeData(getIdentifier(tempNode.cid), parentPath, getIdentifier(parentCid), tempNode.cversion,
+ tempNode.cnordernumb, ptName, mixins.toArray(new InternalQName[mixins.size()]), null);
Map<String, PropertyData> childProps = new HashMap<String, PropertyData>();
for (String propName : tempNode.properties.keySet())
@@ -2741,7 +2741,7 @@
{
ExtendedTempPropertyData exTempProp = (ExtendedTempPropertyData)tempProp;
- valueData.add(exTempProp.vdata);
+ valueData.add(exTempProp.getValueData());
}
}
@@ -2791,14 +2791,19 @@
*/
protected class TempPropertyData implements Comparable<TempPropertyData>
{
- public int orderNum;
+ protected final int orderNum;
- public byte[] data;
+ protected ValueData data;
public TempPropertyData(ResultSet item) throws SQLException
{
+ this(item, true);
+ }
+
+ public TempPropertyData(ResultSet item, boolean readValue) throws SQLException
+ {
orderNum = item.getInt(COLUMN_VORDERNUM);
- readData(item);
+ data = readValue ? new ByteArrayPersistedValueData(orderNum, item.getBytes(COLUMN_VDATA)) : null;
}
public int compareTo(TempPropertyData o)
@@ -2806,9 +2811,9 @@
return orderNum - o.orderNum;
}
- protected void readData(ResultSet item) throws SQLException
+ public ValueData getValueData()
{
- data = item.getBytes(COLUMN_VDATA);
+ return data;
}
}
@@ -2817,53 +2822,32 @@
*/
protected class ExtendedTempPropertyData extends TempPropertyData
{
- public String id;
+ protected final String id;
- public String name;
+ protected final String name;
- public int version;
+ protected final int version;
- public int type;
+ protected final int type;
- public boolean multi;
+ protected final boolean multi;
- public String storage_desc;
+ protected final String storage_desc;
- public ValueData vdata;
-
public ExtendedTempPropertyData(ResultSet item) throws SQLException, ValueStorageNotFoundException, IOException
{
- super(item);
-
+ super(item, false);
id = item.getString("P_ID");
name = item.getString("P_NAME");
version = item.getInt("P_VERSION");
type = item.getInt("P_TYPE");
multi = item.getBoolean("P_MULTIVALUED");
storage_desc = item.getString(COLUMN_VSTORAGE_DESC);
-
- readData(item);
+ InputStream is = item.getBinaryStream(COLUMN_VDATA);
+ data =
+ storage_desc == null ? readValueData(id, orderNum, version, is) : readValueData(getIdentifier(id),
+ orderNum, storage_desc);
}
-
- @Override
- protected void readData(ResultSet item) throws SQLException
- {
- InputStream data = item.getBinaryStream(COLUMN_VDATA);
- try
- {
- vdata =
- storage_desc == null ? readValueData(id, orderNum, version, data) : readValueData(getIdentifier(id),
- orderNum, storage_desc);
- }
- catch (ValueStorageNotFoundException e)
- {
- throw new SQLException(e);
- }
- catch (IOException e)
- {
- throw new SQLException(e);
- }
- }
}
/**
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java 2011-07-29 14:37:45 UTC (rev 4688)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java 2011-08-01 13:48:28 UTC (rev 4689)
@@ -736,7 +736,8 @@
{
for (TempPropertyData value : permValues)
{
- StringTokenizer parser = new StringTokenizer(new String(value.data), AccessControlEntry.DELIMITER);
+ StringTokenizer parser =
+ new StringTokenizer(new String(value.getValueData().getAsByteArray()), AccessControlEntry.DELIMITER);
naPermissions.add(new AccessControlEntry(parser.nextToken(), parser.nextToken()));
}
@@ -763,7 +764,7 @@
SortedSet<TempPropertyData> ownerValues = properties.get(Constants.EXO_OWNER.getAsString());
if (ownerValues != null)
{
- return new String(ownerValues.first().data);
+ return new String(ownerValues.first().getValueData().getAsByteArray());
}
else
{
@@ -875,7 +876,7 @@
+ qpath.getAsString() + ", id " + cid + ", container " + this.containerName, null);
}
- byte[] data = primaryType.first().data;
+ byte[] data = primaryType.first().getValueData().getAsByteArray();
InternalQName ptName = InternalQName.parse(new String((data != null ? data : new byte[]{})));
// MIXIN
@@ -888,7 +889,7 @@
List<InternalQName> mNames = new ArrayList<InternalQName>();
for (TempPropertyData mxnb : mixTypes)
{
- InternalQName mxn = InternalQName.parse(new String(mxnb.data));
+ InternalQName mxn = InternalQName.parse(new String(mxnb.getValueData().getAsByteArray()));
mNames.add(mxn);
if (!privilegeable && Constants.EXO_PRIVILEGEABLE.equals(mxn))
12 years, 9 months