exo-jcr SVN: r5363 - core/trunk/exo.core.component.organization.ldap/src/main/java/org/exoplatform/services/organization/ldap.
by do-not-reply@jboss.org
Author: andrew.plotnikov
Date: 2011-12-27 05:06:03 -0500 (Tue, 27 Dec 2011)
New Revision: 5363
Modified:
core/trunk/exo.core.component.organization.ldap/src/main/java/org/exoplatform/services/organization/ldap/OrganizationLdapInitializer.java
Log:
EXOJCR-1687: Fixed new sonar violations in project
Modified: core/trunk/exo.core.component.organization.ldap/src/main/java/org/exoplatform/services/organization/ldap/OrganizationLdapInitializer.java
===================================================================
--- core/trunk/exo.core.component.organization.ldap/src/main/java/org/exoplatform/services/organization/ldap/OrganizationLdapInitializer.java 2011-12-27 09:56:52 UTC (rev 5362)
+++ core/trunk/exo.core.component.organization.ldap/src/main/java/org/exoplatform/services/organization/ldap/OrganizationLdapInitializer.java 2011-12-27 10:06:03 UTC (rev 5363)
@@ -189,7 +189,7 @@
else
{
// create RDN elem
- rdn = n + "," + rdn;
+ rdn = n + "," + rdn; //NOSONAR
createDN(rdn, context);
}
}
12 years, 4 months
exo-jcr SVN: r5362 - in core/trunk: exo.core.component.database/src/main/java/org/exoplatform/services/database/impl and 5 other directories.
by do-not-reply@jboss.org
Author: andrew.plotnikov
Date: 2011-12-27 04:56:52 -0500 (Tue, 27 Dec 2011)
New Revision: 5362
Modified:
core/trunk/exo.core.component.database/src/main/java/org/exoplatform/services/database/creator/DBCreator.java
core/trunk/exo.core.component.database/src/main/java/org/exoplatform/services/database/impl/TextClobType.java
core/trunk/exo.core.component.database/src/main/java/org/exoplatform/services/database/utils/ExceptionManagementHelper.java
core/trunk/exo.core.component.ldap/src/main/java/org/exoplatform/services/ldap/impl/LDAPServiceImpl.java
core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/hibernate/UserProfileDAOImpl.java
core/trunk/exo.core.component.organization.ldap/src/main/java/org/exoplatform/services/organization/ldap/BaseDAO.java
core/trunk/exo.core.component.organization.ldap/src/main/java/org/exoplatform/services/organization/ldap/UserDAOImpl.java
core/trunk/exo.core.component.security.core/src/main/java/org/exoplatform/services/security/jaas/IdentitySetLoginModule.java
Log:
EXOJCR-1687: Fixed new sonar violations in project
Modified: core/trunk/exo.core.component.database/src/main/java/org/exoplatform/services/database/creator/DBCreator.java
===================================================================
--- core/trunk/exo.core.component.database/src/main/java/org/exoplatform/services/database/creator/DBCreator.java 2011-12-27 07:31:38 UTC (rev 5361)
+++ core/trunk/exo.core.component.database/src/main/java/org/exoplatform/services/database/creator/DBCreator.java 2011-12-27 09:56:52 UTC (rev 5362)
@@ -329,10 +329,14 @@
*/
private DBConnectionInfo constructDBConnectionInfo(String dbName, String dbProductName)
{
- String dbUrl = serverUrl;
+ StringBuilder dbUrl = new StringBuilder(serverUrl);
+
if (dbProductName.startsWith("Microsoft SQL Server"))
{
- dbUrl = dbUrl + (dbUrl.endsWith(";") ? "" : ";") + "databaseName=" + dbName + ";";
+ dbUrl.append(serverUrl.endsWith(";") ? "" : ";");
+ dbUrl.append("databaseName=");
+ dbUrl.append(dbName);
+ dbUrl.append(";");
}
else if (dbProductName.equals("Oracle"))
{
@@ -340,7 +344,8 @@
}
else
{
- dbUrl = dbUrl + (dbUrl.endsWith("/") ? "" : "/") + dbName;
+ dbUrl.append(serverUrl.endsWith("/") ? "" : "/");
+ dbUrl.append(dbName);
}
// clone connection properties
@@ -352,7 +357,7 @@
}
// add url to database
- connProperties.put(SERVER_URL, dbUrl);
+ connProperties.put(SERVER_URL, dbUrl.toString());
return new DBConnectionInfo(dbName, connProperties);
}
Modified: core/trunk/exo.core.component.database/src/main/java/org/exoplatform/services/database/impl/TextClobType.java
===================================================================
--- core/trunk/exo.core.component.database/src/main/java/org/exoplatform/services/database/impl/TextClobType.java 2011-12-27 07:31:38 UTC (rev 5361)
+++ core/trunk/exo.core.component.database/src/main/java/org/exoplatform/services/database/impl/TextClobType.java 2011-12-27 09:56:52 UTC (rev 5362)
@@ -69,7 +69,7 @@
public boolean equals(Object x, Object y) throws HibernateException
{
- return (x == y) || (x != null && x.equals(y));
+ return (x == y) || (x != null && x.equals(y)); //NOSONAR
}
/**
Modified: core/trunk/exo.core.component.database/src/main/java/org/exoplatform/services/database/utils/ExceptionManagementHelper.java
===================================================================
--- core/trunk/exo.core.component.database/src/main/java/org/exoplatform/services/database/utils/ExceptionManagementHelper.java 2011-12-27 07:31:38 UTC (rev 5361)
+++ core/trunk/exo.core.component.database/src/main/java/org/exoplatform/services/database/utils/ExceptionManagementHelper.java 2011-12-27 09:56:52 UTC (rev 5362)
@@ -39,10 +39,12 @@
public static String getFullSQLExceptionMessage(SQLException e)
{
SQLException next = e.getNextException();
- String errorTrace = "";
+ StringBuilder errorTrace = new StringBuilder();
+
while (next != null)
{
- errorTrace += next.getMessage() + "; ";
+ errorTrace.append(next.getMessage());
+ errorTrace.append("; ");
next = next.getNextException();
}
Modified: core/trunk/exo.core.component.ldap/src/main/java/org/exoplatform/services/ldap/impl/LDAPServiceImpl.java
===================================================================
--- core/trunk/exo.core.component.ldap/src/main/java/org/exoplatform/services/ldap/impl/LDAPServiceImpl.java 2011-12-27 07:31:38 UTC (rev 5361)
+++ core/trunk/exo.core.component.ldap/src/main/java/org/exoplatform/services/ldap/impl/LDAPServiceImpl.java 2011-12-27 09:56:52 UTC (rev 5362)
@@ -74,9 +74,14 @@
boolean ssl = url.toLowerCase().startsWith("ldaps");
if (serverType == ACTIVE_DIRECTORY_SERVER && ssl)
{
- String keystore = System.getProperty("java.home");
- keystore += File.separator + "lib" + File.separator + "security" + File.separator + "cacerts";
- PrivilegedSystemHelper.setProperty("javax.net.ssl.trustStore", keystore);
+ StringBuilder keystore = new StringBuilder(System.getProperty("java.home"));
+ keystore.append(File.separator);
+ keystore.append("lib");
+ keystore.append(File.separator);
+ keystore.append("security");
+ keystore.append(File.separator);
+ keystore.append("cacerts");
+ PrivilegedSystemHelper.setProperty("javax.net.ssl.trustStore", keystore.toString());
}
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
@@ -115,7 +120,7 @@
url = matcher.replaceAll("/ ldaps://");
else
url = matcher.replaceAll("/ ldap://");
- url += "/";
+ url += "/"; //NOSONAR
env.put(Context.PROVIDER_URL, url);
if (serverType == ACTIVE_DIRECTORY_SERVER && ssl)
Modified: core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/hibernate/UserProfileDAOImpl.java
===================================================================
--- core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/hibernate/UserProfileDAOImpl.java 2011-12-27 07:31:38 UTC (rev 5361)
+++ core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/hibernate/UserProfileDAOImpl.java 2011-12-27 09:56:52 UTC (rev 5362)
@@ -167,8 +167,10 @@
UserProfile up = (UserProfile)cache_.get(userName);
if (up != null)
{
- if (NOT_FOUND == up)
+ if (NOT_FOUND == up) //NOSONAR
+ {
return null;
+ }
return up;
}
Session session = service_.openSession();
Modified: core/trunk/exo.core.component.organization.ldap/src/main/java/org/exoplatform/services/organization/ldap/BaseDAO.java
===================================================================
--- core/trunk/exo.core.component.organization.ldap/src/main/java/org/exoplatform/services/organization/ldap/BaseDAO.java 2011-12-27 07:31:38 UTC (rev 5361)
+++ core/trunk/exo.core.component.organization.ldap/src/main/java/org/exoplatform/services/organization/ldap/BaseDAO.java 2011-12-27 09:56:52 UTC (rev 5362)
@@ -706,9 +706,9 @@
if (mbfilter == null)
return null;
if (!mbfilter.startsWith("("))
- mbfilter = "(" + mbfilter;
+ mbfilter = "(" + mbfilter; //NOSONAR
if (!mbfilter.endsWith(")"))
- mbfilter += ")";
+ mbfilter += ")"; //NOSONAR
return mbfilter;
}
Modified: core/trunk/exo.core.component.organization.ldap/src/main/java/org/exoplatform/services/organization/ldap/UserDAOImpl.java
===================================================================
--- core/trunk/exo.core.component.organization.ldap/src/main/java/org/exoplatform/services/organization/ldap/UserDAOImpl.java 2011-12-27 07:31:38 UTC (rev 5361)
+++ core/trunk/exo.core.component.organization.ldap/src/main/java/org/exoplatform/services/organization/ldap/UserDAOImpl.java 2011-12-27 09:56:52 UTC (rev 5362)
@@ -84,8 +84,8 @@
* The Cache Handler
* @throws Exception if any errors occurs
*/
- public UserDAOImpl(LDAPAttributeMapping ldapAttrMapping, LDAPService ldapService, CacheHandler cacheHandler, OrganizationService os)
- throws Exception
+ public UserDAOImpl(LDAPAttributeMapping ldapAttrMapping, LDAPService ldapService, CacheHandler cacheHandler,
+ OrganizationService os) throws Exception
{
this(ldapAttrMapping, ldapService, cacheHandler);
this.os = os;
Modified: core/trunk/exo.core.component.security.core/src/main/java/org/exoplatform/services/security/jaas/IdentitySetLoginModule.java
===================================================================
--- core/trunk/exo.core.component.security.core/src/main/java/org/exoplatform/services/security/jaas/IdentitySetLoginModule.java 2011-12-27 07:31:38 UTC (rev 5361)
+++ core/trunk/exo.core.component.security.core/src/main/java/org/exoplatform/services/security/jaas/IdentitySetLoginModule.java 2011-12-27 09:56:52 UTC (rev 5362)
@@ -24,10 +24,8 @@
import org.exoplatform.services.security.Identity;
import org.exoplatform.services.security.IdentityRegistry;
-import java.util.Map;
-
-import javax.security.auth.Subject;
-import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.Subject; //NOSONAR
+import javax.security.auth.callback.CallbackHandler; //NOSONAR
import javax.security.auth.login.LoginException;
/**
12 years, 4 months
exo-jcr SVN: r5361 - jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-12-27 02:31:38 -0500 (Tue, 27 Dec 2011)
New Revision: 5361
Modified:
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/api-extensions.xml
Log:
EXOJCR-1686: updated documentation about Lazy child nodes iteration
Modified: 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 2011-12-27 07:28:24 UTC (rev 5360)
+++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/api-extensions.xml 2011-12-27 07:31:38 UTC (rev 5361)
@@ -63,12 +63,16 @@
<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>
+ <para>In order to enable add the
+ "-Dorg.exoplatform.jcr.forceUserGetNodesLazily=true" to the java system
+ properties.</para>
+ <para>The "lazy" iterator reads the child nodes "page" after "page" into
+ the memory. In this context, a "page" is a set of nodes that is read at
+ once. The size of the page is by default 100 nodes and can be configured
+ though workspace container configuration using
+ "lazy-node-iterator-page-size" parameter. For example:</para>
+
<programlisting language="xml"><container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
<properties>
<property name="source-name" value="jdbcjcr" />
@@ -79,7 +83,8 @@
...
</properties></programlisting>
- <para>But it's not recommended to set huge page size</para>
+ <para>It's not recommended to configure a large number for the page
+ size.</para>
</section>
<section>
12 years, 4 months
exo-jcr SVN: r5360 - in jcr/trunk: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core and 9 other directories.
by do-not-reply@jboss.org
Author: andrew.plotnikov
Date: 2011-12-27 02:28:24 -0500 (Tue, 27 Dec 2011)
New Revision: 5360
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryServiceImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionDataManager.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/LinkedWorkspaceStorageCacheImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/serialization/ObjectReaderImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/serialization/PersistedValueDataReader.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/version/VersionHistoryDataHelper.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/DialectDetecter.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/DeleteValues.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/VersionHistoryRemover.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/StringNumberParser.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/PendingChangesLog.java
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/WebDavConst.java
Log:
EXOJCR-1687: Fixed new sonar violations in project
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryServiceImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryServiceImpl.java 2011-12-26 15:36:07 UTC (rev 5359)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryServiceImpl.java 2011-12-27 07:28:24 UTC (rev 5360)
@@ -166,8 +166,6 @@
}
catch (Throwable t)
{
- //TODO will be implemented unregistration in managerStartChanges
- //managerStartChanges.removeListeners(repositoryContainer);
repositoryContainers.remove(rEntry.getName());
throw new RepositoryConfigurationException("Repository container " + rEntry.getName() + " was not started.",
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionDataManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionDataManager.java 2011-12-26 15:36:07 UTC (rev 5359)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionDataManager.java 2011-12-27 07:28:24 UTC (rev 5360)
@@ -1340,8 +1340,6 @@
}
}
- // TODO: review. Won't work if renamed states for descendants are not fired
- // Node will be only updated with the same NodeData with same outdated path
void reloadPool(ItemData fromItem) throws RepositoryException
{
Collection<ItemImpl> pooledItems = itemsPool.getAll();
@@ -1536,11 +1534,6 @@
ItemState vhState = changesLog.getItemState(vhID);
if (vhState != null && vhState.isDeleted())
{
- // [PN] TODO check why we here if VH already isn't exists.
- // usecase: child version remove when child versionable node is located
- // as child
- // of its containing history versionable node.
- // We may check this case in ChildVersionRemoveVisitor.
return;
}
@@ -1646,10 +1639,6 @@
ItemState reindexedState = ItemState.createUpdatedState(reindexed);
changes.add(reindexedState);
- // reload pooled implies... it's actual for session and workspace scope
- // operations
- // TODO this operation must respect all sub-tree of reindexed node
- // http://jira.exoplatform.org/browse/JCR-340
itemsPool.reload(reindexed);
// next...
@@ -1788,8 +1777,6 @@
public List<PropertyData> getReferencesData(String identifier, boolean skipVersionStorage)
throws RepositoryException
{
- // simple locate now
- // TODO list copy?
List<PropertyData> persisted = transactionableManager.getReferencesData(identifier, skipVersionStorage);
List<PropertyData> sessionTransient = new ArrayList<PropertyData>();
for (PropertyData p : persisted)
@@ -2627,8 +2614,6 @@
}
else
{
- // TODO if (changesLog.get) check if DELETED!!
-
item = itemFactory.createItem(newData, parent);
items.put(item.getInternalIdentifier(), new WeakReference<ItemImpl>(item));
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/LinkedWorkspaceStorageCacheImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/LinkedWorkspaceStorageCacheImpl.java 2011-12-26 15:36:07 UTC (rev 5359)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/LinkedWorkspaceStorageCacheImpl.java 2011-12-27 07:28:24 UTC (rev 5360)
@@ -93,9 +93,6 @@
*/
public static final int DEF_BLOCKING_USERS_COUNT = 0;
- /**
- * TODO remove it
- */
public static final String DEEP_DELETE_PARAMETER_NAME = "deep-delete";
/**
@@ -1104,9 +1101,7 @@
public void addChildProperties(final NodeData parentData, final List<PropertyData> childItems)
{
if (enabled && parentData != null && childItems != null)
- { // TODO don't check parentData !=
- // null && childItems != null
-
+ {
String logInfo = null;
if (LOG.isDebugEnabled())
{
@@ -1170,9 +1165,7 @@
public void addChildPropertiesList(final NodeData parentData, final List<PropertyData> childItems)
{
if (enabled && parentData != null && childItems != null)
- { // TODO don't check parentData !=
- // null && childItems != null
-
+ {
String logInfo = null;
if (LOG.isDebugEnabled())
{
@@ -1223,9 +1216,7 @@
public void addChildNodes(final NodeData parentData, final List<NodeData> childItems)
{
if (enabled && parentData != null && childItems != null)
- { // TODO don't check parentData !=
- // null && childItems != null
-
+ {
String logInfo = null;
if (LOG.isDebugEnabled())
{
@@ -1736,10 +1727,6 @@
*/
public void setMaxSize(int maxSize)
{
- // TODO not supported now, but it's possible as an option
- // e.g. we will create new cache instance with new size and fill it with
- // current cache size.
- // it's fully synchronized operation, i.e. method
LOG.warn("setMaxSize not supported now");
}
@@ -1968,9 +1955,7 @@
}
else if (item.getQPath().getName().equals(Constants.EXO_PERMISSIONS))
{
- // TODO EXOJCR-12 place to put workaround for JCR cache exo:permissions updated
// get parent Node
-
// check if parent is mix:privilegeable
ItemData parent = get(item.getParentIdentifier());
// delete parent
@@ -2138,19 +2123,16 @@
public void beginTransaction()
{
- // TODO Auto-generated method stub
}
public void commitTransaction()
{
- // TODO Auto-generated method stub
}
public void rollbackTransaction()
{
- // TODO Auto-generated method stub
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/serialization/ObjectReaderImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/serialization/ObjectReaderImpl.java 2011-12-26 15:36:07 UTC (rev 5359)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/serialization/ObjectReaderImpl.java 2011-12-27 07:28:24 UTC (rev 5360)
@@ -119,10 +119,8 @@
{
if (true)
throw new IOException("Not implemented");
- // TODO this is not a workable code due to buffered stream reads!!!
boolean recreateBuffer = true;
- // TODO use FileChannel for buffered read???
try
{
if (fileIn != null && stream instanceof FileOutputStream)
@@ -171,11 +169,6 @@
}
}
- // TODO can be useful to flag read
- // public byte readByte() throws IOException {
- // return (byte)in.read();
- // }
-
/**
* {@inheritDoc}
*/
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/serialization/PersistedValueDataReader.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/serialization/PersistedValueDataReader.java 2011-12-26 15:36:07 UTC (rev 5359)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/serialization/PersistedValueDataReader.java 2011-12-27 07:28:24 UTC (rev 5360)
@@ -129,7 +129,7 @@
}
else
{
- sf.acquire(this); // TODO workaround for AsyncReplication test
+ sf.acquire(this); // workaround for AsyncReplication test
try
{
AbstractPersistedValueData vd = new StreamPersistedValueData(orderNumber, sf);
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/version/VersionHistoryDataHelper.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/version/VersionHistoryDataHelper.java 2011-12-26 15:36:07 UTC (rev 5359)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/version/VersionHistoryDataHelper.java 2011-12-27 07:28:24 UTC (rev 5360)
@@ -308,11 +308,7 @@
TransientPropertyData.createPropertyData(rootVersionData, Constants.JCR_MIXINTYPES, PropertyType.NAME, true,
new TransientValueData(Constants.MIX_REFERENCEABLE));
- // jcr:created
- // TODO Current time source was
- // rvCreated.setValue(new
- // TransientValueData(dataManager.getTransactManager().getStorageDataManager
- // ().getCurrentTime()));
+ // jcr:created
TransientPropertyData rvCreated =
TransientPropertyData.createPropertyData(rootVersionData, Constants.JCR_CREATED, PropertyType.DATE, false,
new TransientValueData(Calendar.getInstance()));
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/DialectDetecter.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/DialectDetecter.java 2011-12-26 15:36:07 UTC (rev 5359)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/DialectDetecter.java 2011-12-27 07:28:24 UTC (rev 5360)
@@ -66,7 +66,6 @@
if ("MySQL".equals(databaseName))
{
- // TODO doesn't detect MySQL_UTF8
return DBConstants.DB_DIALECT_MYSQL;
}
@@ -97,24 +96,16 @@
if (databaseName.startsWith("Adaptive Server Anywhere"))
{
- // TODO not implemented anything special for
return DBConstants.DB_DIALECT_SYBASE;
}
- // TODO Informix not supported now
- //if ( "Informix Dynamic Server".equals( databaseName ) ) {
- // return new InformixDialect();
- //}
-
if (databaseName.startsWith("DB2/"))
{
- // TODO doesn't detect DB2 v8
return DBConstants.DB_DIALECT_DB2;
}
if ("Oracle".equals(databaseName))
{
- // TODO doesn't detect Oracle OCI (experimental support still)
return DBConstants.DB_DIALECT_ORACLE;
// int databaseMajorVersion = metaData.getDatabaseMajorVersion();
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/DeleteValues.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/DeleteValues.java 2011-12-26 15:36:07 UTC (rev 5359)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/DeleteValues.java 2011-12-27 07:28:24 UTC (rev 5360)
@@ -101,7 +101,7 @@
for (File f : files)
{
if (!f.delete())
- // TODO possible place of error: FileNotFoundException when we delete/update existing
+ // Possible place of error: FileNotFoundException when we delete/update existing
// Value and then add/update again.
// After the time the Cleaner will delete the file which is mapped to the Value.
// Don't use cleaner! Care about transaction-style files isolation per-user etc.
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/VersionHistoryRemover.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/VersionHistoryRemover.java 2011-12-26 15:36:07 UTC (rev 5359)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/VersionHistoryRemover.java 2011-12-27 07:28:24 UTC (rev 5360)
@@ -153,12 +153,9 @@
vhState = state;
}
if (vhState != null && vhState.isDeleted())
- // [PN] TODO check why we here if VH already isn't exists.
- // usecase: child version remove when child versionable node is located
- // as child
- // of its containing history versionable node.
- // We may check this case in ChildVersionRemoveVisitor.
+ {
return;
+ }
throw new RepositoryException("Version history is not found. UUID: " + vhID
+ ". Context item (ancestor to save) " + ancestorToSave.getAsString());
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/StringNumberParser.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/StringNumberParser.java 2011-12-26 15:36:07 UTC (rev 5359)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/StringNumberParser.java 2011-12-27 07:28:24 UTC (rev 5360)
@@ -224,8 +224,6 @@
* supported: <br/>milliseconds - ms <br/>seconds - without sufix <br/>minutes - m <br/>hours - h
* <br/>days - d <br/>weeks - w
*
- * <br/>TODO handle strings like 2d+4h, 2h+30m+15s+500 etc.
- *
* @param timeText
* - String
* @return time in milliseconds
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/PendingChangesLog.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/PendingChangesLog.java 2011-12-26 15:36:07 UTC (rev 5359)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/PendingChangesLog.java 2011-12-27 07:28:24 UTC (rev 5360)
@@ -483,8 +483,6 @@
*/
public void restore() throws IOException
{
- // TODO same code as in BackupWorkspaceInitializer?
-
List<ItemState> listItemState = itemDataChangesLog.getAllStates();
for (int i = 0; i < this.listFixupStream.size(); i++)
{
Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/WebDavConst.java
===================================================================
--- jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/WebDavConst.java 2011-12-26 15:36:07 UTC (rev 5359)
+++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/WebDavConst.java 2011-12-27 07:28:24 UTC (rev 5360)
@@ -18,10 +18,10 @@
*/
package org.exoplatform.services.jcr.webdav;
+import org.exoplatform.common.http.HTTPStatus;
+
import java.util.Hashtable;
-import org.exoplatform.common.http.HTTPStatus;
-
/**
* Constants used for webdav service implemetation.
*
@@ -115,7 +115,7 @@
/**
* Private constructor.
*/
- private DavDocument()
+ private DavDocument() //NOSONAR
{
}
@@ -199,7 +199,7 @@
/**
* Private constructor.
*/
- private DavProperty()
+ private DavProperty() //NOSONAR
{
}
@@ -244,7 +244,7 @@
/**
* Private constructor.
*/
- private ResourceType()
+ private ResourceType() //NOSONAR
{
}
@@ -271,7 +271,7 @@
/**
* Private constructor.
*/
- private CacheConstants()
+ private CacheConstants() //NOSONAR
{
}
@@ -293,7 +293,7 @@
/**
* Private constructor.
*/
- private Lock()
+ private Lock() //NOSONAR
{
}
@@ -329,7 +329,7 @@
/**
* Private constructor.
*/
- private NodeTypes()
+ private NodeTypes() //NOSONAR
{
}
@@ -450,7 +450,7 @@
/**
* Private constructor.
*/
- private DateFormat()
+ private DateFormat() //NOSONAR
{
}
12 years, 4 months
exo-jcr SVN: r5359 - in jcr/trunk: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow and 35 other directories.
by do-not-reply@jboss.org
Author: andrew.plotnikov
Date: 2011-12-26 10:36:07 -0500 (Mon, 26 Dec 2011)
New Revision: 5359
Modified:
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/ISPNCacheWorkspaceStorageCache.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/nodetype/ExtendedItemDefinition.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/TransactionChangesLog.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/RepositoryServiceConfigurationImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/ScratchWorkspaceInitializer.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/access/JAASAuthenticator.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/LockImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/LockManagerImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/cacheable/AbstractCacheableLockManager.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/ItemAutocreator.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/NodeTypeDataHierarchyHolder.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/NodeTypeImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration/NodeDefinitionComparator.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration/NodeTypeDataValidator.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration/NodeTypeDefinitionAccessProvider.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration/PropertyDefinitionAccessProvider.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration/PropertyDefinitionComparator.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration/XmlNodeTypeDataPersister.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/AdditionalNamespaceResolver.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexRecoveryImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/LocationStepQueryNode.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiColumnQueryResult.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/QueryHitsQuery.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/QueryResultImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/RowIteratorImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/Util.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/sql/JCRSQLQueryBuilder.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/ValueFactoryImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/ItemDataRestoreVisitor.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/EditableValueData.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientItemData.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientValueData.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CleanableFilePersistedValueData.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/FilePersistedValueData.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/StreamPersistedValueData.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/serialization/FileObjectReaderImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/serialization/ObjectWriterImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/LocalWorkspaceStorageDataManagerProxy.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/ext/action/SessionEventMatcher.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/cas/JDBCValueContentAddressStorageImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableSimpleFileIOChannel.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableTreeFileIOChannel.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileIOHelper.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileOperation.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/exporting/BaseXmlExporter.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/SystemViewImporter.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/storage/value/ValueStoragePluginProvider.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/AbstractIncrementalBackupJob.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupMessage.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/registry/RegistryService.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/replication/WorkspaceDataTransmitter.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/replication/test/BaseReplicationTestCase.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/replication/transport/ChannelManager.java
jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdStor.java
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/AclCommand.java
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/LockCommand.java
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/acl/ACLProperties.java
jcr/trunk/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/cli/ParameterNotFoundException.java
jcr/trunk/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/command/web/fckeditor/CreateFolderCommand.java
jcr/trunk/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/command/web/fckeditor/UploadFileCommand.java
Log:
EXOJCR-1687: Fixed new sonar violations in project
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/nodetype/ExtendedItemDefinition.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/nodetype/ExtendedItemDefinition.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/nodetype/ExtendedItemDefinition.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -29,11 +29,5 @@
public interface ExtendedItemDefinition extends ItemDefinition
{
-
- /**
- * TODO Remove it from NodeImpl.findNodeType, BaseXmlExporter.findNodeType, tests
- */
- // @Deprecated
- // public static String RESIDUAL_SET = "*";
public boolean isResidualSet();
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/TransactionChangesLog.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/TransactionChangesLog.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/TransactionChangesLog.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -89,10 +89,6 @@
*/
public List<ItemState> getAllStates()
{
- // TODO [PN] use a wrapping List/Iterator for all changes logs instead of
- // putting all logs
- // content into one list
- // will increase a performance of tx-related operations
List<ItemState> states = new ArrayList<ItemState>();
for (PlainChangesLog changesLog : changesLogs)
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/RepositoryServiceConfigurationImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/RepositoryServiceConfigurationImpl.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/RepositoryServiceConfigurationImpl.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -225,7 +225,6 @@
// writing configuration in to the persister
if (configurationPersister != null)
{
- // TODO file output stream
configurationPersister.write(new ByteArrayInputStream(((ByteArrayOutputStream)saveStream).toByteArray()));
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -920,7 +920,6 @@
throw new ConstraintViolationException("Node definition not found for " + getPath());
}
- // TODO same functionality in NodeTypeImpl
InternalQName[] rnames = definition.getRequiredPrimaryTypes();
NodeType[] rnts = new NodeType[rnames.length];
for (int j = 0; j < rnames.length; j++)
@@ -1559,7 +1558,7 @@
/**
* Indicates whether this node is of the specified node type. Returns true if this node is of the
* specified node type or a subtype of the specified node type. Returns false otherwise. <br/>
- * Nodetype name asked in for mof internal QName. TODO have it private.
+ * Nodetype name asked in for mof internal QName.
*
* @param qName
* InternalQName
@@ -1605,7 +1604,6 @@
{
NodeData nodeData = (NodeData)data;
- // TODO do we need this three checks here?
if (nodeData.getPrimaryTypeName() == null)
{
throw new RepositoryException("Load data: NodeData has no primaryTypeName. Null value found. "
@@ -2963,7 +2961,6 @@
List<PropertyData> storedProps = new ArrayList<PropertyData>(dataManager.getChildPropertiesData(nodeData()));
- // TODO we should not sort here!
Collections.sort(storedProps, new PropertiesDataOrderComparator<PropertyData>());
return storedProps;
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/ScratchWorkspaceInitializer.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/ScratchWorkspaceInitializer.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/ScratchWorkspaceInitializer.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -103,7 +103,6 @@
rootNodeType = config.getInitializer().getParameterValue(WorkspaceInitializer.ROOT_NODETYPE_PARAMETER, null);
}
- // use deprecated params if found, temporary TODO
if (config.getAutoInitializedRootNt() != null)
{
if (rootNodeType == null)
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/access/JAASAuthenticator.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/access/JAASAuthenticator.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/access/JAASAuthenticator.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -76,7 +76,6 @@
"Credentials for the authentication should be CredentialsImpl or SimpleCredentials type");
// SYSTEM
- // TODO do we need to cache system state (identity) in registry?
if (thisCredentials.getUserID().equals(SystemIdentity.SYSTEM))
{
Identity sid = new Identity(SystemIdentity.SYSTEM, new HashSet<MembershipEntry>());
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/LockImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/LockImpl.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/LockImpl.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -45,7 +45,6 @@
private SessionImpl session;
- // TODO remove this constructor, need refactor lock classes ierarchy
public LockImpl()
{
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/LockManagerImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/LockManagerImpl.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/LockManagerImpl.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -282,18 +282,6 @@
// if no session currently holds lock except this
try
{
- // TODO it's possible to have next error
- // java.lang.NullPointerException
- // at
- // org.exoplatform.services.jcr.impl.core.lock.LockManagerImpl.onCloseSession(LockManagerImpl.java:312)
- // at org.exoplatform.services.jcr.impl.core.SessionImpl.logout(SessionImpl.java:794)
- // at
- // org.exoplatform.services.jcr.impl.core.XASessionImpl.logout(XASessionImpl.java:254)
- // at
- // org.exoplatform.services.jcr.impl.core.SessionRegistry
- // $SessionCleaner.callPeriodically(SessionRegistry.java:165)
- // at
- // org.exoplatform.services.jcr.impl.proccess.WorkerThread.run(WorkerThread.java:46)
((NodeImpl)sessionImpl.getTransientNodesManager().getItemByIdentifier(
lockData.getNodeIdentifier(), false)).unlock();
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/cacheable/AbstractCacheableLockManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/cacheable/AbstractCacheableLockManager.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/cacheable/AbstractCacheableLockManager.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -703,7 +703,6 @@
{
NodeData nData = (NodeData)dataManager.getItemData(nodeIdentifier);
- //TODO EXOJCR-412, should be refactored in future.
//Skip removing, because that node was removed in other node of cluster.
if (nData == null)
{
@@ -717,7 +716,6 @@
copyItemData((PropertyData)dataManager.getItemData(nData, new QPathEntry(Constants.JCR_LOCKOWNER, 1),
ItemType.PROPERTY));
- //TODO EXOJCR-412, should be refactored in future.
//Skip removing, because that lock was removed in other node of cluster.
if (lockOwner == null)
{
@@ -730,7 +728,6 @@
copyItemData((PropertyData)dataManager.getItemData(nData, new QPathEntry(Constants.JCR_LOCKISDEEP, 1),
ItemType.PROPERTY));
- //TODO EXOJCR-412, should be refactored in future.
//Skip removing, because that lock was removed in other node of cluster.
if (lockIsDeep == null)
{
@@ -749,7 +746,6 @@
}
catch (JCRInvalidItemStateException e)
{
- //TODO EXOJCR-412, should be refactored in future.
//Skip property not found in DB, because that lock property was removed in other node of cluster.
if (LOG.isDebugEnabled())
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/ItemAutocreator.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/ItemAutocreator.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/ItemAutocreator.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -180,8 +180,6 @@
}
else
{
- // TODO if autocreated property exists it's has wrong data (e.g. ACL)
- // - throw an exception
if (this.log.isDebugEnabled())
{
this.log.debug("Skipping existed property " + pdef.getName() + " in "
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/NodeTypeDataHierarchyHolder.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/NodeTypeDataHierarchyHolder.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/NodeTypeDataHierarchyHolder.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -87,7 +87,6 @@
*/
public Set<InternalQName> getDeclaredSubtypes(final InternalQName nodeTypeName)
{
- // TODO Speed up this method
Set<InternalQName> resultSet = new HashSet<InternalQName>();
for (Map.Entry<InternalQName, NodeTypeHolder> entry : nodeTypes.entrySet())
{
@@ -141,7 +140,6 @@
*/
public Set<InternalQName> getSubtypes(final InternalQName nodeTypeName)
{
- // TODO Speed up this method
Set<InternalQName> resultSet = new HashSet<InternalQName>();
for (InternalQName ntName : nodeTypes.keySet())
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/NodeTypeImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/NodeTypeImpl.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/NodeTypeImpl.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -319,7 +319,6 @@
}
catch (RepositoryException e)
{
- // TODO
throw new RuntimeException("Wrong name in nodeTypeData " + e, e);
}
}
@@ -338,7 +337,6 @@
}
catch (RepositoryException e)
{
- // TODO
throw new RuntimeException("Wrong primary item name in nodeTypeData " + e, e);
}
}
@@ -736,29 +734,6 @@
{
return false;
}
-
- // TODO old code
- // if (constraints != null && constraints.length > 0)
- // {
- // for (int i = 0; i < constraints.length; i++)
- // {
- // try
- // {
- // if (constraints[i].equals(value.getString()))
- // {
- // return true;
- // }
- // }
- // catch (RepositoryException e)
- // {
- // LOG.error("Can't get value's string value " + e, e);
- // }
- // }
- // }
- // else
- // return true;
- //
- // return false;
}
private String getCharsetString(String source, String charSetName)
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration/NodeDefinitionComparator.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration/NodeDefinitionComparator.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration/NodeDefinitionComparator.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -384,7 +384,6 @@
NodeDefinitionData ancestorDefinitionData = changedDefinitions.getAncestorDefinition();
NodeDefinitionData recipientDefinitionData = changedDefinitions.getRecepientDefinition();
// change from mandatory=false to mandatory = true
- // TODO residual
if (!ancestorDefinitionData.isMandatory() && recipientDefinitionData.isMandatory())
{
for (NodeData nodeData : nodesData)
@@ -409,7 +408,6 @@
// change from Protected=false to Protected = true
if (!ancestorDefinitionData.isProtected() && recipientDefinitionData.isProtected())
{
- // TODO residual
for (NodeData nodeData : nodesData)
{
@@ -463,7 +461,6 @@
{
List<NodeData> childs = dataConsumer.getChildNodesData(nodeData);
// more then mixin and primary type
- // TODO it could be possible, check add definitions
if (childs.size() > 0)
{
for (NodeData nodeData2 : childs)
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration/NodeTypeDataValidator.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration/NodeTypeDataValidator.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration/NodeTypeDataValidator.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -226,7 +226,6 @@
+ " in nodetype " + nodeType.getName().getAsString(), e);
}
- // TODO validate constraints, we have issue with TCK nodetype tests:canSetProperty
try
{
validateValueConstraints(pdef.getRequiredType(), pdef.getValueConstraints());
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration/NodeTypeDefinitionAccessProvider.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration/NodeTypeDefinitionAccessProvider.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration/NodeTypeDefinitionAccessProvider.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -88,10 +88,6 @@
boolean mixin = readMandatoryBoolean(nodeData, Constants.JCR_ISMIXIN);
boolean hasOrderableChildNodes = readMandatoryBoolean(nodeData, Constants.JCR_HASORDERABLECHILDNODES);
- // TODO fix to mandatory
- // boolean isAbstract = readMandatoryBoolean(nodeData, Constants.JCR_ISABSTRACT);
- //
- // boolean isQueryable = readBoolean(nodeData, Constants.JCR_ISQUERYABLE);
InternalQName[] declaredSupertypeNames = readNames(nodeData, Constants.JCR_SUPERTYPES);
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration/PropertyDefinitionAccessProvider.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration/PropertyDefinitionAccessProvider.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration/PropertyDefinitionAccessProvider.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -63,11 +63,6 @@
boolean multiple = readMandatoryBoolean(nodeData, Constants.JCR_MULTIPLE);
- // TODO 3 Query atributes
- // boolean isQueryOrderable = readMandatoryBoolean(nodeData, Constants.JCR_QUERYORDERABLE);
- // String[] availableQueryOperators = readMandatoryStrings(nodeData, Constants.JCR_AVAILABLEQUERYOPERATORS);
- // boolean isFullTextSearchable = readMandatoryBoolean(nodeData, Constants.JCR_ISFULLTEXTSEARCHABLE);
-
String[] valueConstraints = readStrings(nodeData, Constants.JCR_VALUECONSTRAINTS);
String[] defaultValues = readStrings(nodeData, Constants.JCR_DEFAULTVALUES);
@@ -94,7 +89,6 @@
writeBoolean(changesLog, propertyDefinition, Constants.JCR_MULTIPLE, propertyDefinitionData.isMultiple());
- //TODO 3 Query atributes
// writeBoolean(changesLog, propertyDefinition, Constants.JCR_QUERYORDERABLE, propertyDefinitionData
// .isQueryOrderable());
// writeStrings(changesLog, propertyDefinition, Constants.JCR_AVAILABLEQUERYOPERATORS, propertyDefinitionData
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration/PropertyDefinitionComparator.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration/PropertyDefinitionComparator.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration/PropertyDefinitionComparator.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -559,7 +559,6 @@
{
List<PropertyData> childs = dataConsumer.getChildPropertiesData(nodeData);
// more then mixin and primary type
- // TODO it could be possible, check add definitions
for (PropertyData propertyData : childs)
{
if (!isNonResidualMatch(propertyData.getQPath().getName(), recipientDefinition))
@@ -574,7 +573,6 @@
}
else if (!isResidualMatch(removePropertyDefinitionData.getName(), recipientDefinition))
{
- // TODO more complex exception
List<NodeData> nodes =
getNodes(nodesData, new InternalQName[]{removePropertyDefinitionData.getName()}, new InternalQName[]{});
if (nodes.size() > 0)
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration/XmlNodeTypeDataPersister.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration/XmlNodeTypeDataPersister.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration/XmlNodeTypeDataPersister.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -188,7 +188,6 @@
*/
public NodeTypeData getNodeType(InternalQName nodeTypeName) throws RepositoryException
{
- // TODO Auto-generated method stub
return null;
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/AdditionalNamespaceResolver.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/AdditionalNamespaceResolver.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/AdditionalNamespaceResolver.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -18,17 +18,16 @@
-import javax.jcr.NamespaceException;
-import javax.jcr.NamespaceRegistry;
-import javax.jcr.RepositoryException;
-
import org.exoplatform.services.jcr.core.NamespaceAccessor;
-import org.exoplatform.services.jcr.impl.core.query.lucene.NamespaceMappings;
import java.util.Enumeration;
import java.util.Properties;
import java.util.Set;
+import javax.jcr.NamespaceException;
+import javax.jcr.NamespaceRegistry;
+import javax.jcr.RepositoryException;
+
/**
* A simple namespace resolver implementation, that uses the additional
* namespaces declared in an XML element.
@@ -106,20 +105,17 @@
public String[] getAllNamespacePrefixes() throws RepositoryException
{
- // TODO Auto-generated method stub
Set keySet = prefixToURI.keySet();
return (String[])keySet.toArray();
}
public String getNamespacePrefixByURI(String uri) throws NamespaceException, RepositoryException
{
- // TODO Auto-generated method stub
return getPrefix(uri);
}
public String getNamespaceURIByPrefix(String prefix) throws NamespaceException, RepositoryException
{
- // TODO Auto-generated method stub
return getURI(prefix);
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexRecoveryImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexRecoveryImpl.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexRecoveryImpl.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -148,7 +148,6 @@
if (!file.isDirectory())
{
// if parent directory is not "offline" then add this file. Otherwise skip it.
- // TODO implement list retrieval via index state manager
if (!file.getParent().endsWith(OfflinePersistentIndex.NAME))
{
result.add(PrivilegedFileHelper.getAbsolutePath(file).substring(indexDirLen));
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/LocationStepQueryNode.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/LocationStepQueryNode.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/LocationStepQueryNode.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -16,12 +16,12 @@
*/
package org.exoplatform.services.jcr.impl.core.query;
-import javax.jcr.RepositoryException;
-
import org.exoplatform.services.jcr.datamodel.InternalQName;
+import javax.jcr.RepositoryException;
+
/**
* Defines a location step for querying the path of a node.
* <p/>
@@ -44,7 +44,6 @@
/**
* The empty name used in matching the root node. This is an implementation
* specific constant as the empty name is not a valid JCR name.
- * TODO: The root location step should be refactored somehow
*/
public static final InternalQName EMPTY_NAME = new InternalQName("", "");
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiColumnQueryResult.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiColumnQueryResult.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiColumnQueryResult.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -65,7 +65,6 @@
*/
protected ExcerptProvider createExcerptProvider() throws IOException
{
- // TODO
return null;
}
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -3323,7 +3323,6 @@
*/
public void refreshIndexList() throws IOException
{
- // TODO: re-study synchronization here.
synchronized (updateMonitor)
{
// release reader if any
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/QueryHitsQuery.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/QueryHitsQuery.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/QueryHitsQuery.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -151,7 +151,6 @@
*/
@Override
public Scorer scorer(IndexReader reader, boolean scoreDocsInOrder, boolean topScorer) throws IOException {
- // TODO: use arguments!
return new QueryHitsQueryScorer(reader, similarity);
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/QueryResultImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/QueryResultImpl.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/QueryResultImpl.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -430,7 +430,6 @@
{
try
{
- // TODO: rather use AccessManager.canRead(Path)
//if (nodes[i] != null && !accessMgr.isGranted(nodes[i].getNodeId(), PermissionType.READ)) {
if (nodes[i] != null)
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/RowIteratorImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/RowIteratorImpl.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/RowIteratorImpl.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -503,7 +503,6 @@
ScoreNode s = sn[getSelectorIndex(selectorName)];
if (s == null)
{
- // TODO correct?
return null;
}
return (Node)itemMgr.getItemByIdentifier(s.getNodeId(), true);
@@ -613,7 +612,6 @@
ScoreNode s = sn[getSelectorIndex(selectorName)];
if (s == null)
{
- // TODO correct?
return Double.NaN;
}
return s.getScore();
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/Util.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/Util.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/Util.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -226,7 +226,6 @@
case PropertyType.REFERENCE :
case PropertyType.STRING :
return value.getString();
- // TODO: JSR 283 now node types
default :
throw new RepositoryException("Unsupported type: " + PropertyType.nameFromValue(value.getType()));
}
@@ -313,7 +312,6 @@
case PropertyType.STRING :
c2 = v2.getString();
break;
- // TODO: JSR 283 now node types
default :
throw new RepositoryException("Unsupported type: " + PropertyType.nameFromValue(v2.getType()));
}
@@ -398,7 +396,6 @@
*/
public static long getLength(ValueData value, int propType)
{
- // TODO: support new JSR 283 property types
if (propType == PropertyType.BINARY)
{
return value.getLength();
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/sql/JCRSQLQueryBuilder.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/sql/JCRSQLQueryBuilder.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/sql/JCRSQLQueryBuilder.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -152,7 +152,6 @@
{
parser = new JCRSQLParser(new StringReader(statement));
//parser.setNameResolver(resolver);
- //TODO FIX ME!!!
parser.setLocationfactory(resolver);
parsers.put(resolver, parser);
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/ValueFactoryImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/ValueFactoryImpl.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/ValueFactoryImpl.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -79,7 +79,6 @@
this.fileCleaner = cleanerHolder.getFileCleaner();
this.tempDirectory = new File(PrivilegedSystemHelper.getProperty("java.io.tmpdir"));
- // TODO we use WorkspaceDataContainer constants but is it ok?
this.maxBufferSize =
workspaceConfig.getContainer().getParameterInteger(WorkspaceDataContainer.MAXBUFFERSIZE_PROP,
WorkspaceDataContainer.DEF_MAXBUFFERSIZE);
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/ItemDataRestoreVisitor.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/ItemDataRestoreVisitor.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/ItemDataRestoreVisitor.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -842,8 +842,6 @@
@Override
protected void entering(PropertyData property, int level) throws RepositoryException
{
-
- // TODO what to do if REFERENCE property target doesn't exists in workspace
if (currentNode() != null)
{
NodeData frozenParent = (NodeData)dataManager.getItemData(property.getParentIdentifier());
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/EditableValueData.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/EditableValueData.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/EditableValueData.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -58,7 +58,6 @@
this.spooled = true;
}
- // TODO use InputStream instead of spoolFile and use Channel.transferFrom.
public NewEditableValueData(SpoolFile spoolFile, int orderNumber, FileCleaner fileCleaner, int maxBufferSize,
File tempDirectory) throws IOException
{
@@ -280,7 +279,6 @@
}
// write update data
- // TODO don't use Channels.newChannel in Java5
ReadableByteChannel sch = Channels.newChannel(stream);
chch.transferFrom(sch, newIndex, length);
sch.close();
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientItemData.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientItemData.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientItemData.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -97,7 +97,6 @@
if (obj instanceof ItemData)
{
- // TODO use String.equals, but check performance!
return getIdentifier().hashCode() == ((ItemData)obj).getIdentifier().hashCode();
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientValueData.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientValueData.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientValueData.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -252,7 +252,6 @@
*/
public long getLength()
{
- // TODO try ask on FileChannel (via FileInputStream if have such stream).
if (isByteArrayAfterSpool())
{
return data.length;
@@ -354,7 +353,7 @@
MappedByteBuffer bb = spoolChannel.map(FileChannel.MapMode.READ_ONLY, position, length);
- WritableByteChannel ch = Channels.newChannel(stream); // TODO don't use Channels.newChannel on java5
+ WritableByteChannel ch = Channels.newChannel(stream);
ch.write(bb);
ch.close();
@@ -653,7 +652,6 @@
try
{
- //TODO do refactor of work with NIO and java6
ByteBuffer bb = ByteBuffer.allocate((int)fch.size());
fch.read(bb);
if (bb.hasArray())
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -1509,7 +1509,7 @@
{
List<PropertyData> childProperties =
CacheableWorkspaceDataManager.super.getChildPropertiesData(nodeData);
- // TODO childProperties.size() > 0 for SDB
+
if (childProperties.size() > 0 && cache.isEnabled())
{
cache.addChildProperties(nodeData, childProperties);
@@ -1866,7 +1866,7 @@
{
List<PropertyData> propertiesList =
CacheableWorkspaceDataManager.super.listChildPropertiesData(nodeData);
- // TODO propertiesList.size() > 0 for SDB
+
if (propertiesList.size() > 0 && cache.isEnabled())
{
cache.addChildPropertiesList(nodeData, propertiesList);
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CleanableFilePersistedValueData.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CleanableFilePersistedValueData.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CleanableFilePersistedValueData.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -83,7 +83,6 @@
if (!PrivilegedFileHelper.delete(file))
{
- //TODO FileCleaner maybe null.
if (cleaner != null)
{
cleaner.addFile(file);
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/FilePersistedValueData.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/FilePersistedValueData.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/FilePersistedValueData.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -196,7 +196,6 @@
*/
private byte[] fileToByteArray() throws IOException
{
- // TODO do refactor of work with NIO and java6
FileChannel fch = PrivilegedFileHelper.fileInputStream(file).getChannel();
try
@@ -263,7 +262,6 @@
// write canonical file path
if (file != null)
{
- // TODO for tests byte[] buf = file.getPath().getBytes("UTF-8");
byte[] buf = PrivilegedFileHelper.getCanonicalPath(file).getBytes("UTF-8");
out.writeInt(buf.length);
out.write(buf);
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/StreamPersistedValueData.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/StreamPersistedValueData.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/StreamPersistedValueData.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -173,7 +173,6 @@
@Override
public InputStream getAsStream() throws IOException
{
- // TODO check if file exists, wait a bit (for replication etc.)
return super.getAsStream();
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -464,8 +464,6 @@
}
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)
@@ -841,7 +839,7 @@
* connection
* @throws RepositoryException
* @throws InvalidItemStateException
- * if the item not found TODO compare persistedVersion number
+ * if the item not found
*/
protected void doUpdate(final ItemData item, final WorkspaceStorageConnection con) throws RepositoryException,
InvalidItemStateException
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -1101,7 +1101,7 @@
*/
public void addChildPropertiesList(NodeData parent, List<PropertyData> childProperties)
{
- // TODO not implemented, will force read from DB
+
}
/**
@@ -1830,9 +1830,9 @@
NodeData prevNode = (NodeData)data;
TransientNodeData newNode =
- new TransientNodeData(newPath, prevNode.getIdentifier(), prevNode.getPersistedVersion(), prevNode
- .getPrimaryTypeName(), prevNode.getMixinTypeNames(), prevNode.getOrderNumber(), prevNode
- .getParentIdentifier(), inheritACL ? acl : prevNode.getACL()); // TODO check ACL
+ new TransientNodeData(newPath, prevNode.getIdentifier(), prevNode.getPersistedVersion(),
+ prevNode.getPrimaryTypeName(), prevNode.getMixinTypeNames(), prevNode.getOrderNumber(),
+ prevNode.getParentIdentifier(), inheritACL ? acl : prevNode.getACL());
// update this node
cache.put(makeItemFqn(newNode.getIdentifier()), ITEM_DATA, newNode);
}
@@ -1899,9 +1899,9 @@
QPath
.makeChildPath(rootPath, prevNode.getQPath().getEntries()[prevNode.getQPath().getEntries().length - 1]);
TransientNodeData newNode =
- new TransientNodeData(newPath, prevNode.getIdentifier(), prevNode.getPersistedVersion(), prevNode
- .getPrimaryTypeName(), prevNode.getMixinTypeNames(), prevNode.getOrderNumber(), prevNode
- .getParentIdentifier(), inheritACL ? acl : prevNode.getACL()); // TODO check ACL
+ new TransientNodeData(newPath, prevNode.getIdentifier(), prevNode.getPersistedVersion(),
+ prevNode.getPrimaryTypeName(), prevNode.getMixinTypeNames(), prevNode.getOrderNumber(),
+ prevNode.getParentIdentifier(), inheritACL ? acl : prevNode.getACL());
// update this node
cache.put(makeItemFqn(newNode.getIdentifier()), ITEM_DATA, newNode);
// update childs recursive
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/serialization/FileObjectReaderImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/serialization/FileObjectReaderImpl.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/serialization/FileObjectReaderImpl.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -25,7 +25,6 @@
import java.io.EOFException;
import java.io.File;
-import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
@@ -94,7 +93,7 @@
public boolean readBoolean() throws IOException
{
int v = readInt();
- if (v < 0) // TODO ?
+ if (v < 0)
throw new EOFException();
return v != 0;
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/serialization/ObjectWriterImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/serialization/ObjectWriterImpl.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/serialization/ObjectWriterImpl.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -107,7 +107,6 @@
out.write(v ? 1 : 0);
}
- // TODO can be useful to flag write
/**
* {@inheritDoc}
*/
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/LocalWorkspaceStorageDataManagerProxy.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/LocalWorkspaceStorageDataManagerProxy.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/LocalWorkspaceStorageDataManagerProxy.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -55,8 +55,6 @@
* applied (for ex RMI) this implementation is responsible for making copy of persisted (shared)
* data objects for session data manager and pass it on top (to TransactionableDM) (and vice versa?)
*
- * <p>TODO not used since optimization EXOJCR-272.</p>
- *
* @author Gennady Azarenkov
* @version $Id: LocalWorkspaceStorageDataManagerProxy.java 11907 2008-03-13 15:36:21Z ksm $
*/
@@ -284,7 +282,7 @@
private List<NodeData> copyNodes(final List<NodeData> childNodes) throws RepositoryException
{
final List<NodeData> copyOfChildsNodes = new LinkedList<NodeData>();
- synchronized (childNodes) // TODO EXOJCR-273
+ synchronized (childNodes)
{
for (NodeData nodeData : childNodes)
{
@@ -298,7 +296,7 @@
private List<PropertyData> copyProperties(final List<PropertyData> traverseProperties) throws RepositoryException
{
final List<PropertyData> copyOfChildsProperties = new LinkedList<PropertyData>();
- synchronized (traverseProperties) // TODO EXOJCR-273
+ synchronized (traverseProperties)
{
for (PropertyData nodeProperty : traverseProperties)
{
@@ -313,7 +311,7 @@
throws RepositoryException
{
final List<PropertyData> copyOfChildsProperties = new LinkedList<PropertyData>();
- synchronized (traverseProperties) // TODO EXOJCR-273
+ synchronized (traverseProperties)
{
for (PropertyData nodeProperty : traverseProperties)
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/ext/action/SessionEventMatcher.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/ext/action/SessionEventMatcher.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/ext/action/SessionEventMatcher.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -167,8 +167,7 @@
for (QPath p : paths)
{
- if (itemPath.equals(p) || itemPath.isDescendantOf(p, !isDeep))// TODO is
- // Child
+ if (itemPath.equals(p) || itemPath.isDescendantOf(p, !isDeep))
return true;
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/cas/JDBCValueContentAddressStorageImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/cas/JDBCValueContentAddressStorageImpl.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/cas/JDBCValueContentAddressStorageImpl.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -537,7 +537,6 @@
}
else
{
- // TODO unused externaly feature (except tests)
ps = con.prepareStatement(sqlSelectRecords);
ps.setString(1, propertyId);
rs = ps.executeQuery();
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableSimpleFileIOChannel.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableSimpleFileIOChannel.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableSimpleFileIOChannel.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -93,7 +93,6 @@
// CASableDeleteValues saves VCAS record on commit, but it's possible the Property just
// added in this transaction and not commited.
- // TODO 08.04.2009 Skip error now
files = new File[0];
}
CASableDeleteValues o = new CASableDeleteValues(files, resources, cleaner, tempDir, propertyId, vcas);
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableTreeFileIOChannel.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableTreeFileIOChannel.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableTreeFileIOChannel.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -69,7 +69,6 @@
// own ids
File[] files = new File[hids.size()];
for (int i = 0; i < hids.size(); i++)
- // TODO super.getFile calls mkdirs(tfile.getParentFile())
files[i] = super.getFile(hids.get(i), CASableIOSupport.HASHFILE_ORDERNUMBER);
return files;
@@ -99,7 +98,6 @@
// CASableDeleteValues saves VCAS record on commit, but it's possible the Property just
// added in this transaction and not commited.
- // TODO 08.04.2009 Skip error now
files = new File[0];
}
CASableDeleteValues o = new CASableDeleteValues(files, resources, cleaner, tempDir, propertyId, vcas);
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileIOHelper.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileIOHelper.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileIOHelper.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -301,8 +301,6 @@
ReadableByteChannel inch = inFile ? ((FileInputStream)in).getChannel() : Channels.newChannel(in);
WritableByteChannel outch = outFile ? ((FileOutputStream)out).getChannel() : Channels.newChannel(out);
- // TODO buffers show same perfomance as bytes copy via Input/Output streams
- // NIO buffers article http://www.odi.ch/weblog/posting.php?posting=371
long size = 0;
int r = 0;
ByteBuffer buff = ByteBuffer.allocate(IOBUFFER_SIZE);
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileOperation.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileOperation.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileOperation.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -64,7 +64,6 @@
private static String LOCAL_ADDRESS;
static
{
- // TODO this info may be is not necessary
try
{
// get the inet address
@@ -145,7 +144,7 @@
lockFile = new File(tempDir, targetFile.getName() + LOCK_FILE_EXTENSION);
FileOutputStream lout = new FileOutputStream(lockFile, true);
- lout.write(operationInfo.getBytes()); // TODO write info
+ lout.write(operationInfo.getBytes());
lout.getChannel().lock(); // wait for unlock (on Windows will wait for this JVM too)
lockFileStream = lout;
@@ -175,7 +174,7 @@
lockFileStream.close();
if (!lockFile.delete())
- { // TODO don't use FileCleaner, delete should be enough
+ {
LOG.warn("Cannot delete lock file " + lockFile.getAbsolutePath() + ". Add to the FileCleaner");
cleaner.addFile(lockFile);
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/exporting/BaseXmlExporter.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/exporting/BaseXmlExporter.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/exporting/BaseXmlExporter.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -267,7 +267,6 @@
case PropertyType.NAME :
case PropertyType.DATE :
case PropertyType.PATH :
- // TODO namespace mapping for values
try
{
charValue = systemValueFactory.loadValue(data, type).getString();
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/SystemViewImporter.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/SystemViewImporter.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/SystemViewImporter.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -685,7 +685,6 @@
{
InputStream vStream = propertyInfo.getValues().get(k).getInputStream();
- // TODO cleanup
// TransientValueData binaryValue = new TransientValueData(vStream);
TransientValueData binaryValue =
new TransientValueData(k, null, vStream, null, valueFactory.getFileCleaner(),
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/storage/value/ValueStoragePluginProvider.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/storage/value/ValueStoragePluginProvider.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/storage/value/ValueStoragePluginProvider.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -62,8 +62,6 @@
/**
* Run consistency check operation on each plugin registered.
*
- * TODO: NOT USED yet (empty implementations).
- *
* @param dataConnection
* WorkspaceStorageConnection persistent connection
*/
Modified: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/ISPNCacheWorkspaceStorageCache.java
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/ISPNCacheWorkspaceStorageCache.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/ISPNCacheWorkspaceStorageCache.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -820,7 +820,7 @@
*/
public void addChildPropertiesList(NodeData parent, List<PropertyData> childProperties)
{
- // TODO not implemented, will force read from DB
+
}
/**
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/AbstractIncrementalBackupJob.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/AbstractIncrementalBackupJob.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/AbstractIncrementalBackupJob.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -119,7 +119,6 @@
*/
public final void run()
{
- // TODO [PN] listener was added but never will be removed
repository.addItemPersistenceListener(workspaceName, this);
state = WORKING;
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -673,8 +673,6 @@
}
else
{
- // TODO do we not restoring same content few times, i.e. on STARTING, WAITIG, FINISHED
- // events which are logged in chan log one after another
try
{
incrementalRestore(list.get(i).getURL().getPath(), reposytoryName, workspaceName);
@@ -765,8 +763,6 @@
}
else
{
- // TODO do we not restoring same content few times, i.e. on STARTING, WAITIG, FINISHED
- // events which are logged in chan log one after another
try
{
incrementalRestore(list.get(i).getURL().getPath(), reposytoryName, workspaceName);
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupMessage.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupMessage.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupMessage.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -25,9 +25,6 @@
* Created by The eXo Platform SAS Author : Peter Nedonosko peter.nedonosko(a)exoplatform.com.ua
* 15.01.2008
*
- * TODO message may be associated with chain, i.e. it's will be possible to select only given chain
- * messages in BackupMessagesLog
- *
* @author <a href="mailto:peter.nedonosko@exoplatform.com.ua">Peter Nedonosko</a>
* @version $Id: BackupMessage.java 760 2008-02-07 15:08:07Z pnedonosko $
*/
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/registry/RegistryService.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/registry/RegistryService.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/registry/RegistryService.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -114,7 +114,6 @@
protected final List<String> mixinNames;
- // TODO temporary flag to have start() run once
protected boolean started = false;
/**
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/replication/WorkspaceDataTransmitter.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/replication/WorkspaceDataTransmitter.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/replication/WorkspaceDataTransmitter.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -86,7 +86,7 @@
public WorkspaceDataTransmitter(CacheableWorkspaceDataManager dataManager) throws RepositoryConfigurationException
{
dataManager.addItemPersistenceListener(this);
- // TODO: need to use FileCleaner from FileCleanerHolder
+ // need to use FileCleaner from FileCleanerHolder
this.fileCleaner = new FileCleaner(ReplicationService.FILE_CLEANRE_TIMEOUT);
}
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/replication/test/BaseReplicationTestCase.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/replication/test/BaseReplicationTestCase.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/replication/test/BaseReplicationTestCase.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -154,7 +154,6 @@
protected String getNormalizePath(String repoPath)
{
// return repoPath;
- // TODO remove it ?
return repoPath.replaceAll("[:][:]", "/");
}
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/replication/transport/ChannelManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/replication/transport/ChannelManager.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/replication/transport/ChannelManager.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -613,14 +613,19 @@
if (channel.getView() != null)
{
if (channel.getView().getMembers().size() == confMembersCount)
- // TODO run without one (few) members will not work, see LastMemberWaiter in initializer
+ {
packetsHandler.handle();
+ }
else
+ {
LOG.warn("Not all members connected to the channel " + +channel.getView().getMembers().size()
+ " != " + confMembersCount + ", queue message " + message);
+ }
}
else
+ {
LOG.warn("No members found or channel closed, queue message " + message);
+ }
return new String("Success");
}
Modified: jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdStor.java
===================================================================
--- jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdStor.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/command/CmdStor.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -66,7 +66,6 @@
try
{
- // TODO: Add TimeOut here
while (!clientSession().getDataTransiver().isConnected())
{
Thread.sleep(100);
Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/AclCommand.java
===================================================================
--- jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/AclCommand.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/AclCommand.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -34,8 +34,8 @@
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
-import java.util.Set;
import java.util.Map.Entry;
+import java.util.Set;
import javax.jcr.PathNotFoundException;
import javax.jcr.RepositoryException;
@@ -161,7 +161,6 @@
HierarchicalProperty principalProperty = ace.getChild(ACLProperties.PRINCIPAL);
// each ace element must contain principal element
- // TODO invert element is not implemented
// <!ELEMENT ace ((principal | invert), (grant|deny), protected?, inherited?)>
if (principalProperty == null)
{
@@ -180,7 +179,6 @@
}
// each principal must contain either href or all element
- // TODO authenticated, unauthenticated, property, self are not implemented
// <!ELEMENT principal (href | all | authenticated | unauthenticated | property | self)>
else
{
Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/LockCommand.java
===================================================================
--- jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/LockCommand.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/LockCommand.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -146,8 +146,6 @@
.ok(body(nsContext, requestEntity, depth, lockToken, requestEntity.getOwner(), timeout), "text/xml")
.header("Lock-Token", "<" + lockToken + ">").build();
}
-
- // TODO 412 Precondition Failed ?
}
catch (LockException exc)
{
Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/acl/ACLProperties.java
===================================================================
--- jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/acl/ACLProperties.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/acl/ACLProperties.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -185,13 +185,6 @@
return ownerProperty;
}
- // TODO support for DAV:supported-privilege-set property
- // specified here: http://www.webdav.org/specs/rfc3744.html#PROPERTY_supported-privilege-set
- // TODO support for DAV:acl-restrictions property
- // specified here: http://www.webdav.org/specs/rfc3744.html#PROPERTY_acl-restrictions
- // TODO support for DAV:current-user-privilege-set property
- // specified here: http://www.webdav.org/specs/rfc3744.html#PROPERTY_current-user-privilege-set
-
private static HierarchicalProperty getPrincipalProperty(String principal)
{
HierarchicalProperty principalProperty = new HierarchicalProperty(PRINCIPAL);
Modified: jcr/trunk/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/cli/ParameterNotFoundException.java
===================================================================
--- jcr/trunk/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/cli/ParameterNotFoundException.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/cli/ParameterNotFoundException.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -31,25 +31,21 @@
public ParameterNotFoundException()
{
super();
- // TODO Auto-generated constructor stub
}
public ParameterNotFoundException(String arg0, Throwable arg1)
{
super(arg0, arg1);
- // TODO Auto-generated constructor stub
}
public ParameterNotFoundException(String arg0)
{
super(arg0);
- // TODO Auto-generated constructor stub
}
public ParameterNotFoundException(Throwable arg0)
{
super(arg0);
- // TODO Auto-generated constructor stub
}
}
Modified: jcr/trunk/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/command/web/fckeditor/CreateFolderCommand.java
===================================================================
--- jcr/trunk/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/command/web/fckeditor/CreateFolderCommand.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/command/web/fckeditor/CreateFolderCommand.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -111,7 +111,6 @@
Document doc = rootElement.getOwnerDocument();
- // TODO
String retVal = "0";
Element errElement = doc.createElement("Error");
Modified: jcr/trunk/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/command/web/fckeditor/UploadFileCommand.java
===================================================================
--- jcr/trunk/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/command/web/fckeditor/UploadFileCommand.java 2011-12-26 14:21:05 UTC (rev 5358)
+++ jcr/trunk/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/command/web/fckeditor/UploadFileCommand.java 2011-12-26 15:36:07 UTC (rev 5359)
@@ -134,7 +134,6 @@
parentFolder.save();
- // TODO
int retVal = 0;
out.println("<script type=\"text/javascript\">");
12 years, 4 months
exo-jcr SVN: r5358 - jcr/trunk/exo.jcr.component.core/src/main/resources/conf/storage.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-12-26 09:21:05 -0500 (Mon, 26 Dec 2011)
New Revision: 5358
Modified:
jcr/trunk/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.ora-analyze.sql
jcr/trunk/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.ora-analyze.sql
Log:
EXOJCR-1511: fixed scripts for oracle
Modified: jcr/trunk/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.ora-analyze.sql
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.ora-analyze.sql 2011-12-26 13:49:42 UTC (rev 5357)
+++ jcr/trunk/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjdbc.ora-analyze.sql 2011-12-26 14:21:05 UTC (rev 5358)
@@ -64,24 +64,20 @@
-ANALYZE INDEX JCR_PK_SITEM COMPUTE STATISTICS
+ANALYZE INDEX JCR_PK_MITEM COMPUTE STATISTICS
/
ANALYZE INDEX JCR_IDX_MITEM_ID COMPUTE STATISTICS
/
ANALYZE INDEX JCR_IDX_MITEM_PATH COMPUTE STATISTICS
/
-ANALYZE INDEX JCR_PK_MNODE COMPUTE STATISTICS
+ANALYZE INDEX JCR_IDX_MITEM_PARENT COMPUTE STATISTICS
/
-ANALYZE INDEX JCR_IDX_MNODE_PARENT COMPUTE STATISTICS
+ANALYZE INDEX JCR_IDX_MITEM_N_ORDER_NUM COMPUTE STATISTICS
/
-ANALYZE INDEX JCR_IDX_MNODE_PARENTID COMPUTE STATISTICS
+ANALYZE INDEX JCR_IDX_MITEM_PARENTID COMPUTE STATISTICS
/
-ANALYZE INDEX JCR_PK_MPROPERTY COMPUTE STATISTICS
+ANALYZE INDEX JCR_PK_MITEM COMPUTE STATISTICS
/
-ANALYZE INDEX JCR_IDX_MPROPERTY_PARENT COMPUTE STATISTICS
-/
-ANALYZE INDEX JCR_IDX_MPROPERTY_PARENTID COMPUTE STATISTICS
-/
ANALYZE INDEX JCR_PK_MVALUE COMPUTE STATISTICS
/
ANALYZE INDEX JCR_IDX_MVALUE_PROPERTY COMPUTE STATISTICS
Modified: jcr/trunk/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.ora-analyze.sql
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.ora-analyze.sql 2011-12-26 13:49:42 UTC (rev 5357)
+++ jcr/trunk/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjdbc.ora-analyze.sql 2011-12-26 14:21:05 UTC (rev 5358)
@@ -66,6 +66,8 @@
/
ANALYZE INDEX JCR_IDX_SITEM_PARENT COMPUTE STATISTICS
/
+ANALYZE INDEX JCR_IDX_SITEM_N_ORDER_NUM COMPUTE STATISTICS
+/
ANALYZE INDEX JCR_IDX_SITEM_PARENT_NAME COMPUTE STATISTICS
/
ANALYZE INDEX JCR_IDX_SITEM_PARENT_ID COMPUTE STATISTICS
12 years, 4 months
exo-jcr SVN: r5357 - in jcr/trunk: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db and 1 other directories.
by do-not-reply@jboss.org
Author: andrew.plotnikov
Date: 2011-12-26 08:49:42 -0500 (Mon, 26 Dec 2011)
New Revision: 5357
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainerChecker.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/HSQLDBMultiDbJDBCConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/HSQLDBSingleDbJDBCConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MSSQLMultiDbJDBCConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MSSQLSingleDbJDBCConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/OracleMultiDbJDBCConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/OracleSingleDbJDBCConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SybaseSingleDbJDBCConnection.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/replication/test/ReplicationTestService.java
Log:
EXOJCR-1687: Fixed new sonar violations in project
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainerChecker.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainerChecker.java 2011-12-26 13:01:40 UTC (rev 5356)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainerChecker.java 2011-12-26 13:49:42 UTC (rev 5357)
@@ -128,45 +128,42 @@
+ "' and NOT EXISTS(select * from JCR_SITEM P where P.ID = I.PARENT_ID)", new String[]{
DBConstants.COLUMN_ID, DBConstants.COLUMN_PARENTID, DBConstants.COLUMN_NAME, DBConstants.COLUMN_CLASS},
"Items that do not have parent nodes", InspectionStatus.ERR));
- queries
- .add(new InspectionQuery(
- jdbcDataContainer.multiDb
- ? "select * from JCR_MITEM N where N.I_CLASS=1 and NOT EXISTS (select * from JCR_MITEM P where P.I_CLASS=2 and P.PARENT_ID=N.ID)"
- : "select * from JCR_SITEM N where N.CONTAINER_NAME='"
- + jdbcDataContainer.containerName
- + "' and N.I_CLASS=1 and NOT EXISTS (select * from JCR_SITEM P where P.I_CLASS=2 and P.PARENT_ID=N.ID and P.CONTAINER_NAME='"
- + jdbcDataContainer.containerName + "')",
- new String[]{DBConstants.COLUMN_ID, DBConstants.COLUMN_PARENTID, DBConstants.COLUMN_NAME},
- "Nodes that do not have at least one property", InspectionStatus.ERR));
- queries
- .add(new InspectionQuery(
- jdbcDataContainer.multiDb
- ? "select * from JCR_MVALUE V where NOT EXISTS(select * from JCR_MITEM P where V.PROPERTY_ID = P.ID and P.I_CLASS=2)"
- : "select V.* from JCR_SVALUE V, JCR_SITEM I where V.PROPERTY_ID = I.ID and I.CONTAINER_NAME='"
- + jdbcDataContainer.containerName
- + "' and NOT EXISTS(select * from JCR_SITEM P where P.CONTAINER_NAME='"
- + jdbcDataContainer.containerName + "' and V.PROPERTY_ID = P.ID and P.I_CLASS=2)", new String[]{
- DBConstants.COLUMN_ID, DBConstants.COLUMN_VPROPERTY_ID},
- "All value records that has not owner-property record", InspectionStatus.ERR));
- queries
- .add(new InspectionQuery(
- jdbcDataContainer.multiDb
- ? "select * from JCR_MITEM P where P.I_CLASS=2 and NOT EXISTS( select * from JCR_MVALUE V where V.PROPERTY_ID=P.ID)"
- : "select * from JCR_SITEM P where P.CONTAINER_NAME='" + jdbcDataContainer.containerName
- + "' and P.I_CLASS=2 and NOT EXISTS( select * from JCR_SVALUE V where V.PROPERTY_ID=P.ID)",
- new String[]{DBConstants.COLUMN_ID, DBConstants.COLUMN_PARENTID, DBConstants.COLUMN_NAME},
- "All properties that have not value record.", InspectionStatus.ERR));
+ queries.add(new InspectionQuery(jdbcDataContainer.multiDb
+ ? "select * from JCR_MITEM N where N.I_CLASS=1 and NOT EXISTS "
+ + "(select * from JCR_MITEM P where P.I_CLASS=2 and P.PARENT_ID=N.ID)"
+ : "select * from JCR_SITEM N where N.CONTAINER_NAME='" + jdbcDataContainer.containerName
+ + "' and N.I_CLASS=1 and NOT EXISTS (select * from JCR_SITEM P "
+ + "where P.I_CLASS=2 and P.PARENT_ID=N.ID and P.CONTAINER_NAME='" + jdbcDataContainer.containerName + "')",
+ new String[]{DBConstants.COLUMN_ID, DBConstants.COLUMN_PARENTID, DBConstants.COLUMN_NAME},
+ "Nodes that do not have at least one property", InspectionStatus.ERR));
+ queries.add(new InspectionQuery(jdbcDataContainer.multiDb
+ ? "select * from JCR_MVALUE V where NOT EXISTS(select * from JCR_MITEM P "
+ + "where V.PROPERTY_ID = P.ID and P.I_CLASS=2)"
+ : "select V.* from JCR_SVALUE V, JCR_SITEM I where V.PROPERTY_ID = I.ID and I.CONTAINER_NAME='"
+ + jdbcDataContainer.containerName + "' and NOT EXISTS(select * from JCR_SITEM P where P.CONTAINER_NAME='"
+ + jdbcDataContainer.containerName + "' and V.PROPERTY_ID = P.ID and P.I_CLASS=2)", new String[]{
+ DBConstants.COLUMN_ID, DBConstants.COLUMN_VPROPERTY_ID},
+ "All value records that has not owner-property record", InspectionStatus.ERR));
+ queries.add(new InspectionQuery(jdbcDataContainer.multiDb
+ ? "select * from JCR_MITEM P where P.I_CLASS=2 and NOT EXISTS( select * from JCR_MVALUE V "
+ + "where V.PROPERTY_ID=P.ID)" : "select * from JCR_SITEM P where P.CONTAINER_NAME='"
+ + jdbcDataContainer.containerName
+ + "' and P.I_CLASS=2 and NOT EXISTS( select * from JCR_SVALUE V where V.PROPERTY_ID=P.ID)", new String[]{
+ DBConstants.COLUMN_ID, DBConstants.COLUMN_PARENTID, DBConstants.COLUMN_NAME},
+ "All properties that have not value record.", InspectionStatus.ERR));
// The differences in the queries by DB dialect.
// Oracle doesn't work correct with default query because empty value stored as null value.
String statement;
if (jdbcDataContainer.dbDialect.equalsIgnoreCase(DBConstants.DB_DIALECT_SYBASE))
{
- statement = jdbcDataContainer.multiDb
- ? "select * from JCR_MVALUE where (STORAGE_DESC is null and DATA like null) or (STORAGE_DESC is not null and not DATA like null)"
- : "select V.* from JCR_SVALUE V, JCR_SITEM I where V.PROPERTY_ID = I.ID and I.CONTAINER_NAME='"
- + jdbcDataContainer.containerName
- + "' AND ((STORAGE_DESC is null and DATA like null) or (STORAGE_DESC is not null and not DATA like null))";
+ statement =
+ jdbcDataContainer.multiDb
+ ? "select * from JCR_MVALUE where (STORAGE_DESC is null and DATA like null) or "
+ + "(STORAGE_DESC is not null and not DATA like null)"
+ : "select V.* from JCR_SVALUE V, JCR_SITEM I where V.PROPERTY_ID = I.ID and I.CONTAINER_NAME='"
+ + jdbcDataContainer.containerName
+ + "' AND ((STORAGE_DESC is null and DATA like null) or (STORAGE_DESC is not null and not DATA like null))";
}
else if (jdbcDataContainer.dbDialect.equalsIgnoreCase(DBConstants.DB_DIALECT_ORACLE)
|| jdbcDataContainer.dbDialect.equalsIgnoreCase(DBConstants.DB_DIALECT_ORACLEOCI))
@@ -177,22 +174,23 @@
+ jdbcDataContainer.containerName
+ "' AND (STORAGE_DESC is not null and DATA is not null)";
} else {
- statement = jdbcDataContainer.multiDb
- ? "select * from JCR_MVALUE where (STORAGE_DESC is null and DATA is null) or (STORAGE_DESC is not null and DATA is not null)"
- : "select V.* from JCR_SVALUE V, JCR_SITEM I where V.PROPERTY_ID = I.ID and I.CONTAINER_NAME='"
- + jdbcDataContainer.containerName
- + "' AND ((STORAGE_DESC is null and DATA is null) or (STORAGE_DESC is not null and DATA is not null))";
+ statement =
+ jdbcDataContainer.multiDb
+ ? "select * from JCR_MVALUE where (STORAGE_DESC is null and DATA is null) or "
+ + "(STORAGE_DESC is not null and DATA is not null)"
+ : "select V.* from JCR_SVALUE V, JCR_SITEM I where V.PROPERTY_ID = I.ID and I.CONTAINER_NAME='"
+ + jdbcDataContainer.containerName
+ + "' AND ((STORAGE_DESC is null and DATA is null) or (STORAGE_DESC is not null and DATA is not null))";
}
queries
.add(new InspectionQuery(statement, new String[]{DBConstants.COLUMN_ID}, "Incorrect JCR_VALUE records", InspectionStatus.ERR));
- queries
- .add(new InspectionQuery(
- jdbcDataContainer.multiDb
- ? "select * from JCR_MITEM P where P.P_TYPE=9 and NOT EXISTS( select * from JCR_MREF R where P.ID=R.PROPERTY_ID)"
- : "select * from JCR_SITEM P where P.CONTAINER_NAME='" + jdbcDataContainer.containerName
- + "' and P.P_TYPE=9 and NOT EXISTS( select * from JCR_SREF R where P.ID=R.PROPERTY_ID)",
- new String[]{DBConstants.COLUMN_ID, DBConstants.COLUMN_PARENTID, DBConstants.COLUMN_NAME},
- "Reference properties without reference records", InspectionStatus.ERR));
+ queries.add(new InspectionQuery(jdbcDataContainer.multiDb
+ ? "select * from JCR_MITEM P where P.P_TYPE=9 and NOT EXISTS "
+ + "(select * from JCR_MREF R where P.ID=R.PROPERTY_ID)"
+ : "select * from JCR_SITEM P where P.CONTAINER_NAME='" + jdbcDataContainer.containerName
+ + "' and P.P_TYPE=9 and NOT EXISTS( select * from JCR_SREF R where P.ID=R.PROPERTY_ID)", new String[]{
+ DBConstants.COLUMN_ID, DBConstants.COLUMN_PARENTID, DBConstants.COLUMN_NAME},
+ "Reference properties without reference records", InspectionStatus.ERR));
// properties can refer to missing node. It is possible to perform this usecase via JCR API with no exceptions
queries.add(new InspectionQuery(jdbcDataContainer.multiDb
@@ -332,11 +330,11 @@
try
{
st =
- connection
- .prepareStatement(jdbcDataContainer.multiDb
- ? "SELECT PROPERTY_ID, ORDER_NUM, STORAGE_DESC from JCR_MVALUE where STORAGE_DESC is not null"
- : "SELECT V.PROPERTY_ID, V.ORDER_NUM, V.STORAGE_DESC from JCR_SVALUE V, JCR_SITEM I where I.CONTAINER_NAME='"
- + jdbcDataContainer.containerName + "' and V.PROPERTY_ID = I.ID and STORAGE_DESC is not null");
+ connection.prepareStatement(jdbcDataContainer.multiDb
+ ? "SELECT PROPERTY_ID, ORDER_NUM, STORAGE_DESC from JCR_MVALUE where STORAGE_DESC is not null"
+ : "SELECT V.PROPERTY_ID, V.ORDER_NUM, V.STORAGE_DESC from JCR_SVALUE V, JCR_SITEM I"
+ + " where I.CONTAINER_NAME='" + jdbcDataContainer.containerName
+ + "' and V.PROPERTY_ID = I.ID and STORAGE_DESC is not null");
resultSet = st.executeQuery();
// traverse all values, written to value storage
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/HSQLDBMultiDbJDBCConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/HSQLDBMultiDbJDBCConnection.java 2011-12-26 13:01:40 UTC (rev 5356)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/HSQLDBMultiDbJDBCConnection.java 2011-12-26 13:49:42 UTC (rev 5357)
@@ -24,8 +24,8 @@
import java.io.File;
import java.sql.Connection;
+import java.sql.ResultSet;
import java.sql.SQLException;
-import java.sql.ResultSet;
import java.util.List;
import javax.jcr.InvalidItemStateException;
@@ -86,9 +86,12 @@
FIND_NODES_COUNT_BY_PARENTID = "select count(ID) from JCR_MITEM" + " where PARENT_ID=? and I_CLASS=1";
FIND_PROPERTIES_BY_PARENTID = "select * from JCR_MITEM" + " where PARENT_ID=? and I_CLASS=2" + " order by ID";
FIND_NODES_BY_PARENTID_CQ =
- "select I.*, P.NAME AS PROP_NAME, V.ORDER_NUM, V.DATA"
- + " from JCR_MITEM I, JCR_MITEM P, JCR_MVALUE V"
- + " where I.PARENT_ID=? and I.I_CLASS=1 and (P.PARENT_ID=I.ID and P.I_CLASS=2 and (P.NAME='[http://www.jcp.org/jcr/1.0]primaryType' or P.NAME='[http://www.jcp.org/jcr/1.0]mixinTypes' or P.NAME='[http://www.exoplatform.com/jcr/exo/1.0]owner' or P.NAME='[http://www.exoplatform.com/jcr/exo/1.0]permissions') and V.PROPERTY_ID=P.ID)"
+ "select I.*, P.NAME AS PROP_NAME, V.ORDER_NUM, V.DATA from JCR_MITEM I, JCR_MITEM P, JCR_MVALUE V"
+ + " where I.PARENT_ID=? and I.I_CLASS=1 and (P.PARENT_ID=I.ID and P.I_CLASS=2 and"
+ + " (P.NAME='[http://www.jcp.org/jcr/1.0]primaryType' or"
+ + " P.NAME='[http://www.jcp.org/jcr/1.0]mixinTypes' or"
+ + " P.NAME='[http://www.exoplatform.com/jcr/exo/1.0]owner' or"
+ + " P.NAME='[http://www.exoplatform.com/jcr/exo/1.0]permissions') and V.PROPERTY_ID=P.ID)"
+ " order by I.N_ORDER_NUM, I.ID";
FIND_PROPERTIES_BY_PARENTID_CQ =
"select I.ID, I.PARENT_ID, I.NAME, I.VERSION, I.I_CLASS, I.I_INDEX, I.N_ORDER_NUM, I.P_TYPE, I.P_MULTIVALUED,"
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/HSQLDBSingleDbJDBCConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/HSQLDBSingleDbJDBCConnection.java 2011-12-26 13:01:40 UTC (rev 5356)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/HSQLDBSingleDbJDBCConnection.java 2011-12-26 13:49:42 UTC (rev 5357)
@@ -82,9 +82,9 @@
"select * from JCR_SITEM"
+ " where PARENT_ID=? and CONTAINER_NAME=? and NAME=? and I_INDEX=? order by I_CLASS, VERSION DESC";
FIND_PROPERTY_BY_NAME =
- "select V.DATA"
- + " from JCR_SITEM I, JCR_SVALUE V"
- + " where I.PARENT_ID=? and I.I_CLASS=2 and I.CONTAINER_NAME=? and I.NAME=? and I.ID=V.PROPERTY_ID order by V.ORDER_NUM";
+ "select V.DATA from JCR_SITEM I, JCR_SVALUE V"
+ + " where I.PARENT_ID=? and I.I_CLASS=2 and I.CONTAINER_NAME=? and I.NAME=? and"
+ + " I.ID=V.PROPERTY_ID order by V.ORDER_NUM";
FIND_NODES_BY_PARENTID =
"select * from JCR_SITEM" + " where PARENT_ID=? and I_CLASS=1 and CONTAINER_NAME=?" + " order by N_ORDER_NUM";
@@ -96,14 +96,18 @@
FIND_PROPERTIES_BY_PARENTID =
"select * from JCR_SITEM" + " where PARENT_ID=? and I_CLASS=2 and CONTAINER_NAME=?" + " order by ID";
FIND_NODES_BY_PARENTID_CQ =
- "select I.*, P.NAME AS PROP_NAME, V.ORDER_NUM, V.DATA"
- + " from JCR_SITEM I, JCR_SITEM P, JCR_SVALUE V"
+ "select I.*, P.NAME AS PROP_NAME, V.ORDER_NUM, V.DATA from JCR_SITEM I, JCR_SITEM P, JCR_SVALUE V"
+ " where I.PARENT_ID=? and I.I_CLASS=1 and I.CONTAINER_NAME=? and"
- + " P.PARENT_ID=I.ID and P.I_CLASS=2 and P.CONTAINER_NAME=? and (P.NAME='[http://www.jcp.org/jcr/1.0]primaryType' or P.NAME='[http://www.jcp.org/jcr/1.0]mixinTypes' or P.NAME='[http://www.exoplatform.com/jcr/exo/1.0]owner' or P.NAME='[http://www.exoplatform.com/jcr/exo/1.0]permissions')"
+ + " P.PARENT_ID=I.ID and P.I_CLASS=2 and P.CONTAINER_NAME=? and"
+ + " (P.NAME='[http://www.jcp.org/jcr/1.0]primaryType' or"
+ + " P.NAME='[http://www.jcp.org/jcr/1.0]mixinTypes' or"
+ + " P.NAME='[http://www.exoplatform.com/jcr/exo/1.0]owner' or"
+ + " P.NAME='[http://www.exoplatform.com/jcr/exo/1.0]permissions')"
+ " and V.PROPERTY_ID=P.ID order by I.N_ORDER_NUM, I.ID";
FIND_PROPERTIES_BY_PARENTID_CQ =
- "select I.ID, I.PARENT_ID, I.NAME, I.VERSION, I.I_CLASS, I.I_INDEX, I.N_ORDER_NUM, I.P_TYPE, I.P_MULTIVALUED, V.ORDER_NUM,"
- + " V.DATA, V.STORAGE_DESC from JCR_SITEM I LEFT OUTER JOIN JCR_SVALUE V ON (V.PROPERTY_ID=I.ID)"
+ "select I.ID, I.PARENT_ID, I.NAME, I.VERSION, I.I_CLASS, I.I_INDEX, I.N_ORDER_NUM, I.P_TYPE,"
+ + " I.P_MULTIVALUED, V.ORDER_NUM, V.DATA, V.STORAGE_DESC from JCR_SITEM I LEFT OUTER JOIN"
+ + " JCR_SVALUE V ON (V.PROPERTY_ID=I.ID)"
+ " where I.PARENT_ID=? and I.I_CLASS=2 and I.CONTAINER_NAME=? order by I.NAME";
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MSSQLMultiDbJDBCConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MSSQLMultiDbJDBCConnection.java 2011-12-26 13:01:40 UTC (rev 5356)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MSSQLMultiDbJDBCConnection.java 2011-12-26 13:49:42 UTC (rev 5357)
@@ -38,9 +38,9 @@
*/
public static final String FIND_NODES_AND_PROPERTIES_TEMPLATE =
"select J.*, P.ID AS P_ID, P.NAME AS P_NAME, P.VERSION AS P_VERSION, P.P_TYPE, P.P_MULTIVALUED,"
- + " V.DATA, V.ORDER_NUM, V.STORAGE_DESC from JCR_MVALUE V WITH (INDEX (JCR_IDX_MVALUE_PROPERTY)), JCR_MITEM P "
- + " join (select TOP ${TOP} I.ID, I.PARENT_ID, I.NAME, I.VERSION, I.I_INDEX, I.N_ORDER_NUM from JCR_MITEM I WITH (INDEX (JCR_PK_MITEM))"
- + " where I.I_CLASS=1 AND I.ID > ? order by I.ID) J on P.PARENT_ID = J.ID"
+ + " V.DATA, V.ORDER_NUM, V.STORAGE_DESC from JCR_MVALUE V WITH (INDEX (JCR_IDX_MVALUE_PROPERTY)), JCR_MITEM P"
+ + " join (select TOP ${TOP} I.ID, I.PARENT_ID, I.NAME, I.VERSION, I.I_INDEX, I.N_ORDER_NUM from JCR_MITEM I"
+ + " WITH (INDEX (JCR_PK_MITEM)) where I.I_CLASS=1 AND I.ID > ? order by I.ID) J on P.PARENT_ID = J.ID"
+ " where P.I_CLASS=2 and V.PROPERTY_ID=P.ID order by J.ID";
/**
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MSSQLSingleDbJDBCConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MSSQLSingleDbJDBCConnection.java 2011-12-26 13:01:40 UTC (rev 5356)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MSSQLSingleDbJDBCConnection.java 2011-12-26 13:49:42 UTC (rev 5357)
@@ -40,8 +40,9 @@
*/
private static final String FIND_NODES_AND_PROPERTIES_TEMPLATE =
"select J.*, P.ID AS P_ID, P.NAME AS P_NAME, P.VERSION AS P_VERSION, P.P_TYPE, P.P_MULTIVALUED,"
- + " V.DATA, V.ORDER_NUM, V.STORAGE_DESC from JCR_SVALUE V WITH (INDEX (JCR_IDX_SVALUE_PROPERTY)), JCR_SITEM P "
- + " join (select TOP ${TOP} I.ID, I.PARENT_ID, I.NAME, I.VERSION, I.I_INDEX, I.N_ORDER_NUM from JCR_SITEM I WITH (INDEX (JCR_PK_SITEM))"
+ + " V.DATA, V.ORDER_NUM, V.STORAGE_DESC from JCR_SVALUE V WITH (INDEX (JCR_IDX_SVALUE_PROPERTY)), JCR_SITEM P"
+ + " join (select TOP ${TOP} I.ID, I.PARENT_ID, I.NAME, I.VERSION, I.I_INDEX, I.N_ORDER_NUM from"
+ + " JCR_SITEM I WITH (INDEX (JCR_PK_SITEM))"
+ " where I.CONTAINER_NAME=? AND I.I_CLASS=1 AND I.ID > ? order by I.ID) J on P.PARENT_ID = J.ID"
+ " where P.I_CLASS=2 and P.CONTAINER_NAME=? and V.PROPERTY_ID=P.ID order by J.ID";
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java 2011-12-26 13:01:40 UTC (rev 5356)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java 2011-12-26 13:49:42 UTC (rev 5357)
@@ -54,10 +54,11 @@
{
protected static final String FIND_NODES_BY_PARENTID_CQ_QUERY =
- "select I.*, P.NAME AS PROP_NAME, V.ORDER_NUM, V.DATA"
- + " from JCR_MITEM I, JCR_MITEM P, JCR_MVALUE V"
- + " where I.I_CLASS=1 and I.PARENT_ID=? and"
- + " P.I_CLASS=2 and P.PARENT_ID=I.ID and (P.NAME='[http://www.jcp.org/jcr/1.0]primaryType' or P.NAME='[http://www.jcp.org/jcr/1.0]mixinTypes' or P.NAME='[http://www.exoplatform.com/jcr/exo/1.0]owner' or P.NAME='[http://www.exoplatform.com/jcr/exo/1.0]permissions')"
+ "select I.*, P.NAME AS PROP_NAME, V.ORDER_NUM, V.DATA from JCR_MITEM I, JCR_MITEM P, JCR_MVALUE V"
+ + " where I.I_CLASS=1 and I.PARENT_ID=? and P.I_CLASS=2 and P.PARENT_ID=I.ID and"
+ + " (P.NAME='[http://www.jcp.org/jcr/1.0]primaryType' or P.NAME='[http://www.jcp.org/jcr/1.0]mixinTypes'"
+ + " or P.NAME='[http://www.exoplatform.com/jcr/exo/1.0]owner'"
+ + " or P.NAME='[http://www.exoplatform.com/jcr/exo/1.0]permissions')"
+ " and V.PROPERTY_ID=P.ID order by I.N_ORDER_NUM, I.ID";
protected static final String FIND_PROPERTIES_BY_PARENTID_CQ_QUERY =
@@ -155,9 +156,11 @@
FIND_NODES_BY_PARENTID_CQ = FIND_NODES_BY_PARENTID_CQ_QUERY;
FIND_NODE_MAIN_PROPERTIES_BY_PARENTID_CQ =
- "select I.NAME, V.DATA, V.ORDER_NUM"
- + " from JCR_MITEM I, JCR_MVALUE V"
- + " where I.I_CLASS=2 and I.PARENT_ID=? and (I.NAME='[http://www.jcp.org/jcr/1.0]primaryType' or I.NAME='[http://www.jcp.org/jcr/1.0]mixinTypes' or I.NAME='[http://www.exoplatform.com/jcr/exo/1.0]owner' or I.NAME='[http://www.exoplatform.com/jcr/exo/1.0]permissions') and I.ID=V.PROPERTY_ID";
+ "select I.NAME, V.DATA, V.ORDER_NUM from JCR_MITEM I, JCR_MVALUE V"
+ + " where I.I_CLASS=2 and I.PARENT_ID=? and (I.NAME='[http://www.jcp.org/jcr/1.0]primaryType' or"
+ + " I.NAME='[http://www.jcp.org/jcr/1.0]mixinTypes' or"
+ + " I.NAME='[http://www.exoplatform.com/jcr/exo/1.0]owner' or"
+ + " I.NAME='[http://www.exoplatform.com/jcr/exo/1.0]permissions') and " + "I.ID=V.PROPERTY_ID";
FIND_ITEM_QPATH_BY_ID_CQ = FIND_ITEM_QPATH_BY_ID_CQ_QUERY;
@@ -1041,12 +1044,14 @@
try
{
removeValuesStatement =
- dbConnection
- .prepareStatement("DELETE FROM JCR_MVALUE WHERE PROPERTY_ID IN (SELECT ID FROM JCR_MITEM WHERE NAME = '[http://www.jcp.org/jcr/1.0]lockIsDeep' OR NAME = '[http://www.jcp.org/jcr/1.0]lockOwner')");
+ dbConnection.prepareStatement("DELETE FROM JCR_MVALUE WHERE PROPERTY_ID IN"
+ + " (SELECT ID FROM JCR_MITEM WHERE NAME = '[http://www.jcp.org/jcr/1.0]lockIsDeep' OR"
+ + " NAME = '[http://www.jcp.org/jcr/1.0]lockOwner')");
removeItemsStatement =
- dbConnection
- .prepareStatement("DELETE FROM JCR_MITEM WHERE NAME = '[http://www.jcp.org/jcr/1.0]lockIsDeep' OR NAME = '[http://www.jcp.org/jcr/1.0]lockOwner'");
+ dbConnection.prepareStatement("DELETE FROM JCR_MITEM WHERE"
+ + " NAME = '[http://www.jcp.org/jcr/1.0]lockIsDeep' OR"
+ + " NAME = '[http://www.jcp.org/jcr/1.0]lockOwner'");
removeValuesStatement.executeUpdate();
removeItemsStatement.executeUpdate();
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/OracleMultiDbJDBCConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/OracleMultiDbJDBCConnection.java 2011-12-26 13:01:40 UTC (rev 5356)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/OracleMultiDbJDBCConnection.java 2011-12-26 13:49:42 UTC (rev 5357)
@@ -87,7 +87,8 @@
FIND_PROPERTIES_BY_PARENTID_CQ = FIND_PROPERTIES_BY_PARENTID_CQ_QUERY;
FIND_ITEM_QPATH_BY_ID_CQ = FIND_ITEM_QPATH_BY_ID_CQ_QUERY;
FIND_PROPERTIES_BY_PARENTID_AND_PATTERN_CQ_TEMPLATE =
- "select /*+ INDEX(I JCR_FK_MITEM_PARENT) INDEX(V JCR_IDX_MVALUE_PROPERTY)*/ I.ID, I.PARENT_ID, I.NAME, I.VERSION, I.I_CLASS, I.I_INDEX, I.N_ORDER_NUM, I.P_TYPE, I.P_MULTIVALUED,"
+ "select /*+ INDEX(I JCR_FK_MITEM_PARENT) INDEX(V JCR_IDX_MVALUE_PROPERTY)*/"
+ + " I.ID, I.PARENT_ID, I.NAME, I.VERSION, I.I_CLASS, I.I_INDEX, I.N_ORDER_NUM, I.P_TYPE, I.P_MULTIVALUED,"
+ " V.ORDER_NUM, V.DATA, V.STORAGE_DESC from JCR_MITEM I LEFT OUTER JOIN JCR_MVALUE V ON (V.PROPERTY_ID=I.ID)";
FIND_NODES_AND_PROPERTIES =
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/OracleSingleDbJDBCConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/OracleSingleDbJDBCConnection.java 2011-12-26 13:01:40 UTC (rev 5356)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/OracleSingleDbJDBCConnection.java 2011-12-26 13:49:42 UTC (rev 5357)
@@ -87,7 +87,8 @@
FIND_PROPERTIES_BY_PARENTID_CQ = FIND_PROPERTIES_BY_PARENTID_CQ_QUERY;
FIND_ITEM_QPATH_BY_ID_CQ = FIND_ITEM_QPATH_BY_ID_CQ_QUERY;
FIND_PROPERTIES_BY_PARENTID_AND_PATTERN_CQ_TEMPLATE =
- "select /*+ INDEX(I JCR_FK_SITEM_PARENT) INDEX(V JCR_IDX_SVALUE_PROPERTY)*/ I.ID, I.PARENT_ID, I.NAME, I.VERSION, I.I_CLASS, I.I_INDEX, I.N_ORDER_NUM, I.P_TYPE, I.P_MULTIVALUED, V.ORDER_NUM,"
+ "select /*+ INDEX(I JCR_FK_SITEM_PARENT) INDEX(V JCR_IDX_SVALUE_PROPERTY)*/"
+ + " I.ID, I.PARENT_ID, I.NAME, I.VERSION, I.I_CLASS, I.I_INDEX, I.N_ORDER_NUM, I.P_TYPE, I.P_MULTIVALUED, V.ORDER_NUM,"
+ " V.DATA, V.STORAGE_DESC from JCR_SITEM I LEFT OUTER JOIN JCR_SVALUE V ON (V.PROPERTY_ID=I.ID)";
FIND_NODES_AND_PROPERTIES =
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java 2011-12-26 13:01:40 UTC (rev 5356)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java 2011-12-26 13:49:42 UTC (rev 5357)
@@ -52,10 +52,13 @@
{
protected static final String FIND_NODES_BY_PARENTID_CQ_QUERY =
- "select I.*, P.NAME AS PROP_NAME, V.ORDER_NUM, V.DATA"
- + " from JCR_SITEM I, JCR_SITEM P, JCR_SVALUE V"
+ "select I.*, P.NAME AS PROP_NAME, V.ORDER_NUM, V.DATA from JCR_SITEM I, JCR_SITEM P, JCR_SVALUE V"
+ " where I.I_CLASS=1 and I.CONTAINER_NAME=? and I.PARENT_ID=? and"
- + " P.I_CLASS=2 and P.CONTAINER_NAME=? and P.PARENT_ID=I.ID and (P.NAME='[http://www.jcp.org/jcr/1.0]primaryType' or P.NAME='[http://www.jcp.org/jcr/1.0]mixinTypes' or P.NAME='[http://www.exoplatform.com/jcr/exo/1.0]owner' or P.NAME='[http://www.exoplatform.com/jcr/exo/1.0]permissions')"
+ + " P.I_CLASS=2 and P.CONTAINER_NAME=? and P.PARENT_ID=I.ID and"
+ + " (P.NAME='[http://www.jcp.org/jcr/1.0]primaryType' or"
+ + " P.NAME='[http://www.jcp.org/jcr/1.0]mixinTypes' or"
+ + " P.NAME='[http://www.exoplatform.com/jcr/exo/1.0]owner' or"
+ + " P.NAME='[http://www.exoplatform.com/jcr/exo/1.0]permissions')"
+ " and V.PROPERTY_ID=P.ID order by I.N_ORDER_NUM, I.ID";
protected static final String FIND_PROPERTIES_BY_PARENTID_CQ_QUERY =
@@ -138,9 +141,9 @@
+ " where CONTAINER_NAME=? and PARENT_ID=? and NAME=? and I_INDEX=? order by I_CLASS, VERSION DESC";
FIND_PROPERTY_BY_NAME =
- "select V.DATA"
- + " from JCR_SITEM I, JCR_SVALUE V"
- + " where I.I_CLASS=2 and I.CONTAINER_NAME=? and I.PARENT_ID=? and I.NAME=? and I.ID=V.PROPERTY_ID order by V.ORDER_NUM";
+ "select V.DATA from JCR_SITEM I, JCR_SVALUE V"
+ + " where I.I_CLASS=2 and I.CONTAINER_NAME=? and I.PARENT_ID=? and I.NAME=? and"
+ + " I.ID=V.PROPERTY_ID order by V.ORDER_NUM";
FIND_REFERENCES =
"select P.ID, P.PARENT_ID, P.VERSION, P.P_TYPE, P.P_MULTIVALUED, P.NAME" + " from JCR_SREF R, JCR_SITEM P"
@@ -160,9 +163,12 @@
FIND_NODES_BY_PARENTID_CQ = FIND_NODES_BY_PARENTID_CQ_QUERY;
FIND_NODE_MAIN_PROPERTIES_BY_PARENTID_CQ =
- "select I.NAME, V.DATA, V.ORDER_NUM"
- + " from JCR_SITEM I, JCR_SVALUE V"
- + " where I.I_CLASS=2 and I.CONTAINER_NAME=? and I.PARENT_ID=? and (I.NAME='[http://www.jcp.org/jcr/1.0]primaryType' or I.NAME='[http://www.jcp.org/jcr/1.0]mixinTypes' or I.NAME='[http://www.exoplatform.com/jcr/exo/1.0]owner' or I.NAME='[http://www.exoplatform.com/jcr/exo/1.0]permissions') and I.ID=V.PROPERTY_ID";
+ "select I.NAME, V.DATA, V.ORDER_NUM from JCR_SITEM I, JCR_SVALUE V"
+ + " where I.I_CLASS=2 and I.CONTAINER_NAME=? and I.PARENT_ID=? and"
+ + " (I.NAME='[http://www.jcp.org/jcr/1.0]primaryType' or"
+ + " I.NAME='[http://www.jcp.org/jcr/1.0]mixinTypes' or"
+ + " I.NAME='[http://www.exoplatform.com/jcr/exo/1.0]owner' or"
+ + " I.NAME='[http://www.exoplatform.com/jcr/exo/1.0]permissions') and I.ID=V.PROPERTY_ID";
FIND_ITEM_QPATH_BY_ID_CQ = FIND_ITEM_QPATH_BY_ID_CQ_QUERY;
@@ -177,8 +183,9 @@
FIND_PROPERTIES_BY_PARENTID_CQ = FIND_PROPERTIES_BY_PARENTID_CQ_QUERY;
FIND_PROPERTIES_BY_PARENTID_AND_PATTERN_CQ_TEMPLATE =
- "select I.ID, I.PARENT_ID, I.NAME, I.VERSION, I.I_CLASS, I.I_INDEX, I.N_ORDER_NUM, I.P_TYPE, I.P_MULTIVALUED, V.ORDER_NUM,"
- + " V.DATA, V.STORAGE_DESC from JCR_SITEM I LEFT OUTER JOIN JCR_SVALUE V ON (V.PROPERTY_ID=I.ID)";
+ "select I.ID, I.PARENT_ID, I.NAME, I.VERSION, I.I_CLASS, I.I_INDEX, I.N_ORDER_NUM, I.P_TYPE,"
+ + " I.P_MULTIVALUED, V.ORDER_NUM, V.DATA, V.STORAGE_DESC"
+ + " from JCR_SITEM I LEFT OUTER JOIN JCR_SVALUE V ON (V.PROPERTY_ID=I.ID)";
FIND_NODES_BY_PARENTID_AND_PATTERN_CQ_TEMPLATE =
"select I.*, P.NAME AS PROP_NAME, V.ORDER_NUM, V.DATA from JCR_SITEM I, JCR_SITEM P, JCR_SVALUE V";
@@ -187,8 +194,8 @@
"insert into JCR_SITEM(ID, PARENT_ID, NAME, CONTAINER_NAME, VERSION, I_CLASS, I_INDEX, N_ORDER_NUM) VALUES(?,?,?,?,?,"
+ I_CLASS_NODE + ",?,?)";
INSERT_PROPERTY =
- "insert into JCR_SITEM(ID, PARENT_ID, NAME, CONTAINER_NAME, VERSION, I_CLASS, I_INDEX, P_TYPE, P_MULTIVALUED) VALUES(?,?,?,?,?,"
- + I_CLASS_PROPERTY + ",?,?,?)";
+ "insert into JCR_SITEM(ID, PARENT_ID, NAME, CONTAINER_NAME, VERSION, I_CLASS, I_INDEX, P_TYPE, P_MULTIVALUED)"
+ + " VALUES(?,?,?,?,?," + I_CLASS_PROPERTY + ",?,?,?)";
INSERT_VALUE = "insert into JCR_SVALUE(DATA, ORDER_NUM, PROPERTY_ID, STORAGE_DESC) VALUES(?,?,?,?)";
INSERT_REF = "insert into JCR_SREF(NODE_ID, PROPERTY_ID, ORDER_NUM) VALUES(?,?,?)";
@@ -959,13 +966,15 @@
try
{
removeValuesStatement =
- dbConnection
- .prepareStatement("DELETE FROM JCR_SVALUE WHERE PROPERTY_ID IN (SELECT ID FROM JCR_SITEM WHERE CONTAINER_NAME = ? AND (NAME = '[http://www.jcp.org/jcr/1.0]lockIsDeep' OR NAME = '[http://www.jcp.org/jcr/1.0]lockOwner'))");
+ dbConnection.prepareStatement("DELETE FROM JCR_SVALUE WHERE PROPERTY_ID IN (SELECT ID FROM JCR_SITEM"
+ + " WHERE CONTAINER_NAME = ? AND (NAME = '[http://www.jcp.org/jcr/1.0]lockIsDeep' OR"
+ + " NAME = '[http://www.jcp.org/jcr/1.0]lockOwner'))");
removeValuesStatement.setString(1, containerName);
removeItemsStatement =
- dbConnection
- .prepareStatement("DELETE FROM JCR_SITEM WHERE CONTAINER_NAME = ? AND (NAME = '[http://www.jcp.org/jcr/1.0]lockIsDeep' OR NAME = '[http://www.jcp.org/jcr/1.0]lockOwner')");
+ dbConnection.prepareStatement("DELETE FROM JCR_SITEM WHERE CONTAINER_NAME = ? AND"
+ + " (NAME = '[http://www.jcp.org/jcr/1.0]lockIsDeep' OR"
+ + " NAME = '[http://www.jcp.org/jcr/1.0]lockOwner')");
removeItemsStatement.setString(1, containerName);
removeValuesStatement.executeUpdate();
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SybaseSingleDbJDBCConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SybaseSingleDbJDBCConnection.java 2011-12-26 13:01:40 UTC (rev 5356)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SybaseSingleDbJDBCConnection.java 2011-12-26 13:49:42 UTC (rev 5357)
@@ -116,9 +116,9 @@
super.prepareQueries();
SELECT_LIMIT_OFFSET_NODES_INTO_TEMPORARY_TABLE =
- "select I.ID, I.PARENT_ID, I.NAME, I.VERSION, I.I_INDEX, I.N_ORDER_NUM into "
- + SybaseJDBCConnectionHelper.TEMP_A_TABLE_NAME
- + " from JCR_SITEM I (index JCR_PK_SITEM) where I.CONTAINER_NAME=? AND I.I_CLASS=1 AND I.ID > ? order by I.ID ASC";
+ "select I.ID, I.PARENT_ID, I.NAME, I.VERSION, I.I_INDEX, I.N_ORDER_NUM into "
+ + SybaseJDBCConnectionHelper.TEMP_A_TABLE_NAME + " from JCR_SITEM I (index JCR_PK_SITEM)"
+ + " where I.CONTAINER_NAME=? AND I.I_CLASS=1 AND I.ID > ? order by I.ID ASC";
COUNT_NODES_IN_TEMPORARY_TABLE = "select count(*) from " + SybaseJDBCConnectionHelper.TEMP_A_TABLE_NAME;
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/replication/test/ReplicationTestService.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/replication/test/ReplicationTestService.java 2011-12-26 13:01:40 UTC (rev 5356)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/replication/test/ReplicationTestService.java 2011-12-26 13:49:42 UTC (rev 5357)
@@ -668,7 +668,7 @@
* @return Response return the response
*/
@GET
- @Path("/{repositoryName}/{workspaceName}/{userName}/{password}/{srcRepoPath}/{nodeName}/{destNodeName}/{contentSize}/workspaceCopy")
+ @Path("/{repositoryName}/{workspaceName}/{userName}/{password}/{srcRepoPath}/{nodeName}/{destNodeName}/{contentSize}/workspaceCopy") //NOSONAR
public Response workspaceCopy(@PathParam("repositoryName") String repositoryName,
@PathParam("workspaceName") String workspaceName, @PathParam("userName") String userName,
@PathParam("password") String password, @PathParam("srcRepoPath") String srcRepoPath,
@@ -704,7 +704,7 @@
* @return Response return the response
*/
@GET
- @Path("/{repositoryName}/{workspaceName}/{userName}/{password}/{srcRepoPath}/{nodeName}/{destNodeName}/{contentSize}/workspaceMove")
+ @Path("/{repositoryName}/{workspaceName}/{userName}/{password}/{srcRepoPath}/{nodeName}/{destNodeName}/{contentSize}/workspaceMove") //NOSONAR
public Response workspaceMove(@PathParam("repositoryName") String repositoryName,
@PathParam("workspaceName") String workspaceName, @PathParam("userName") String userName,
@PathParam("password") String password, @PathParam("srcRepoPath") String srcRepoPath,
@@ -740,7 +740,7 @@
* @return Response return the response
*/
@GET
- @Path("/{repositoryName}/{workspaceName}/{userName}/{password}/{srcRepoPath:.*}/{nodeName}/{destNodeName}/{contentSize}/sessionMove")
+ @Path("/{repositoryName}/{workspaceName}/{userName}/{password}/{srcRepoPath:.*}/{nodeName}/{destNodeName}/{contentSize}/sessionMove") //NOSONAR
public Response sessionMove(@PathParam("repositoryName") String repositoryName,
@PathParam("workspaceName") String workspaceName, @PathParam("userName") String userName,
@PathParam("password") String password, @PathParam("srcRepoPath") String srcRepoPath,
@@ -776,7 +776,7 @@
* @return Response return the response
*/
@GET
- @Path("/{repositoryName}/{workspaceName}/{userName}/{password}/{srcRepoPath:.*}/{nodeName}/{destNodeName}/{contentSize}/checkCopyMoveNode")
+ @Path("/{repositoryName}/{workspaceName}/{userName}/{password}/{srcRepoPath:.*}/{nodeName}/{destNodeName}/{contentSize}/checkCopyMoveNode") //NOSONAR
public Response checkCopyMoveNode(@PathParam("repositoryName") String repositoryName,
@PathParam("workspaceName") String workspaceName, @PathParam("userName") String userName,
@PathParam("password") String password, @PathParam("srcRepoPath") String srcRepoPath,
@@ -944,7 +944,7 @@
* @return Response return the response
*/
@GET
- @Path("/{repositoryName}/{workspaceName}/{userName}/{password}/{repoPath:.*}/{fileName}/{iterations}/{simpleContent}/createContent")
+ @Path("/{repositoryName}/{workspaceName}/{userName}/{password}/{repoPath:.*}/{fileName}/{iterations}/{simpleContent}/createContent") //NOSONAR
public Response createContent(@PathParam("repositoryName") String repositoryName,
@PathParam("workspaceName") String workspaceName, @PathParam("userName") String userName,
@PathParam("password") String password, @PathParam("repoPath") String repoPath,
@@ -980,7 +980,7 @@
* @return Response return the response
*/
@GET
- @Path("/{repositoryName}/{workspaceName}/{userName}/{password}/{srcRepoPath:.*}/{srcFileName}/{destRepoPath:.*}/{destFileName}/compareData")
+ @Path("/{repositoryName}/{workspaceName}/{userName}/{password}/{srcRepoPath:.*}/{srcFileName}/{destRepoPath:.*}/{destFileName}/compareData") //NOSONAR
public Response compareData(@PathParam("repositoryName") String repositoryName,
@PathParam("workspaceName") String workspaceName, @PathParam("userName") String userName,
@PathParam("password") String password, @PathParam("srcRepoPath") String srcRepoPath,
@@ -1019,7 +1019,7 @@
* @return Response return the response
*/
@GET
- @Path("/{repositoryName}/{workspaceName}/{userName}/{password}/{srcRepoPath:.*}/{srcFileName}/{destRepoPath:.*}/{destFileName}/{iterations}/startThreadUpdater")
+ @Path("/{repositoryName}/{workspaceName}/{userName}/{password}/{srcRepoPath:.*}/{srcFileName}/{destRepoPath:.*}/{destFileName}/{iterations}/startThreadUpdater") //NOSONAR
public Response startThreadUpdater(@PathParam("repositoryName") String repositoryName,
@PathParam("workspaceName") String workspaceName, @PathParam("userName") String userName,
@PathParam("password") String password, @PathParam("srcRepoPath") String srcRepoPath,
@@ -1156,7 +1156,7 @@
* @return Response return the response
*/
@GET
- @Path("/{repositoryName}/{workspaceName}/{userName}/{password}/{repoPath:.*}/{nodeName}/{size}/{iterations}/addBinaryPropertyOnly")
+ @Path("/{repositoryName}/{workspaceName}/{userName}/{password}/{repoPath:.*}/{nodeName}/{size}/{iterations}/addBinaryPropertyOnly") //NOSONAR
public Response addBinaryPropertyOnly(@PathParam("repositoryName") String repositoryName,
@PathParam("workspaceName") String workspaceName, @PathParam("userName") String userName,
@PathParam("password") String password, @PathParam("repoPath") String repoPath,
12 years, 4 months
exo-jcr SVN: r5356 - in jcr/trunk: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache and 16 other directories.
by do-not-reply@jboss.org
Author: andrew.plotnikov
Date: 2011-12-26 08:01:40 -0500 (Mon, 26 Dec 2011)
New Revision: 5356
Modified:
jcr/trunk/applications/exo.jcr.applications.backupconsole/src/main/java/org/exoplatform/jcr/backupconsole/BackupConsole.java
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/BufferedISPNCache.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/JDBCCacheLoader.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/AbstractQueryHandler.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexChangesFilter.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/QueryResultImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/BufferedJBossCache.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/TransactionableResourceManager.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/HSQLDBSingleDbJDBCConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCWorkspaceDataContainer.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/DB2ConnectionFactory.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/statistics/StatisticsJDBCStorageConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileIOHelper.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java
jcr/trunk/exo.jcr.connectors.jca/src/main/java/org/exoplatform/connectors/jcr/impl/adapter/ManagedSessionFactory.java
jcr/trunk/exo.jcr.connectors.jca/src/main/java/org/exoplatform/connectors/jcr/impl/adapter/ManagedSessionImpl.java
jcr/trunk/exo.jcr.connectors.jca/src/main/java/org/exoplatform/connectors/jcr/impl/adapter/RepositoryResourceAdapter.java
jcr/trunk/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/cli/HelpCommand.java
Log:
EXOJCR-1687: Fixed new sonar violations in project
Modified: jcr/trunk/applications/exo.jcr.applications.backupconsole/src/main/java/org/exoplatform/jcr/backupconsole/BackupConsole.java
===================================================================
--- jcr/trunk/applications/exo.jcr.applications.backupconsole/src/main/java/org/exoplatform/jcr/backupconsole/BackupConsole.java 2011-12-26 12:26:22 UTC (rev 5355)
+++ jcr/trunk/applications/exo.jcr.applications.backupconsole/src/main/java/org/exoplatform/jcr/backupconsole/BackupConsole.java 2011-12-26 13:01:40 UTC (rev 5356)
@@ -66,13 +66,13 @@
+ " <form auth parm> : form <method> <form path>\n"
+ " <method> : POST or GET\n"
+ " <form path> : /path/path?<paramName1>=<paramValue1>&<paramName2>=<paramValue2>...\n"
- + " Example to <url form authentication> : http://127.0.0.1:8080/portal/rest form POST \"/portal/login?initialURI=/portal/private&username=root&password=gtn\"\n\n"
+ + " Example to <url form authentication> : http://127.0.0.1:8080/portal/rest form POST \"/portal/login?initialURI=/portal/private&username=root&password=gtn\"\n\n" //NOSONAR
+ " <cmd> : start <repo[/ws]> <backup_dir> [<incr>] \n"
+ " stop <backup_id> \n"
+ " status <backup_id> \n"
+ " restores <repo[/ws]> \n"
- + " restore [remove-exists] {{<backup_id>|<backup_set_path>} | {<repo[/ws]> {<backup_id>|<backup_set_path>} [<pathToConfigFile>]}} \n"
+ + " restore [remove-exists] {{<backup_id>|<backup_set_path>} | {<repo[/ws]> {<backup_id>|<backup_set_path>} [<pathToConfigFile>]}} \n" //NOSONAR
+ " list [completed] \n"
+ " info \n"
+ " drop [force-close-session] <repo[/ws]> \n"
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/JDBCCacheLoader.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/JDBCCacheLoader.java 2011-12-26 12:26:22 UTC (rev 5355)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/JDBCCacheLoader.java 2011-12-26 13:01:40 UTC (rev 5356)
@@ -41,9 +41,9 @@
{
return JDBCUtils.tableExists(tableName, con);
}
-
+
/**
- * @see org.jboss.cache.loader.AdjListJDBCCacheLoader#processConfig(org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig)
+ * {@inheritDoc}
*/
@Override
protected AdjListJDBCCacheLoaderConfig processConfig(CacheLoaderConfig.IndividualCacheLoaderConfig base)
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/AbstractQueryHandler.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/AbstractQueryHandler.java 2011-12-26 12:26:22 UTC (rev 5355)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/AbstractQueryHandler.java 2011-12-26 13:01:40 UTC (rev 5356)
@@ -82,7 +82,7 @@
}
/**
- * @see org.exoplatform.services.jcr.impl.core.query.QueryHandler#setIndexerIoModeHandler(org.exoplatform.services.jcr.impl.core.query.IndexerIoModeHandler)
+ * {@inheritDoc}
*/
public void setIndexerIoModeHandler(IndexerIoModeHandler modeHandler) throws IOException
{
@@ -98,7 +98,7 @@
}
/**
- * @see org.exoplatform.services.jcr.impl.core.query.QueryHandler#setContext(org.exoplatform.services.jcr.impl.core.query.QueryHandlerContext)
+ * {@inheritDoc}
*/
public void setContext(QueryHandlerContext context)
{
@@ -233,7 +233,7 @@
}
/**
- * @see org.exoplatform.services.jcr.impl.core.query.QueryHandler#setIndexInfos(org.exoplatform.services.jcr.impl.core.query.lucene.IndexInfos)
+ * {@inheritDoc}
*/
public void setIndexInfos(IndexInfos indexInfos)
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java 2011-12-26 12:26:22 UTC (rev 5355)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java 2011-12-26 13:01:40 UTC (rev 5356)
@@ -397,12 +397,12 @@
/**
* Check index consistency. Iterator goes through index documents and check, does each document have
- * according jcr-node. If index is suspended then it will be temporary resumed, while check is running and suspended afterwards.
+ * according jcr-node. If index is suspended then it will be temporary resumed, while check is running
+ * and suspended afterwards.
*/
public void checkIndex(final InspectionLog inspectionLog, final boolean isSystem) throws RepositoryException,
IOException
{
-
if (isSuspended)
{
try
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexChangesFilter.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexChangesFilter.java 2011-12-26 12:26:22 UTC (rev 5355)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexChangesFilter.java 2011-12-26 13:01:40 UTC (rev 5356)
@@ -141,7 +141,9 @@
PrivilegedJBossCacheHelper.create(cache);
PrivilegedJBossCacheHelper.start(cache);
- this.jmxManager = ExoJBossCacheFactory.getJmxRegistrationManager(searchManager.getExoContainerContext(), cache, CacheType.INDEX_CACHE);
+ this.jmxManager =
+ ExoJBossCacheFactory.getJmxRegistrationManager(searchManager.getExoContainerContext(), cache,
+ CacheType.INDEX_CACHE);
if (jmxManager != null)
{
SecurityHelper.doPrivilegedAction(new PrivilegedAction<Void>()
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/QueryResultImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/QueryResultImpl.java 2011-12-26 12:26:22 UTC (rev 5355)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/QueryResultImpl.java 2011-12-26 13:01:40 UTC (rev 5356)
@@ -676,8 +676,8 @@
resultNodes.remove(nextPos);
if (log.isDebugEnabled())
{
- log
- .debug("The node is invalid since we don't have sufficient rights to access it, it will be removed from the results set");
+ log.debug("The node is invalid since we don't have sufficient rights to access it, "
+ + "it will be removed from the results set");
}
}
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2011-12-26 12:26:22 UTC (rev 5355)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2011-12-26 13:01:40 UTC (rev 5356)
@@ -1080,8 +1080,8 @@
// at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:64)
// This is due to the fact that ISPN enlist the cache even for a read access and enlistments are not
// allowed in the commit phase
- // 2. If we call them in the commit phase, we use Arjuna with ISPN and we suspend the current tx, we get deadlocks because we
- // try to acquire locks on cache entries that have been locked by the main tx.
+ // 2. If we call them in the commit phase, we use Arjuna with ISPN and we suspend the current tx,
+ // we get deadlocks because we try to acquire locks on cache entries that have been locked by the main tx.
// 3. If we call them in the afterComplete, we use JOTM with ISPN and we suspend and resume the current tx, we get:
// jotm: resume: Invalid Transaction Status:STATUS_COMMITTED (Current.java, line 743)
// javax.transaction.InvalidTransactionException: Invalid resume org.objectweb.jotm.TransactionImpl
@@ -2400,7 +2400,8 @@
filtersSupported.set(false);
if (LOG.isDebugEnabled())
{
- LOG.debug("The bloom filters are disabled as they are not supported by the cache implementation " + cache.getClass().getName());
+ LOG.debug("The bloom filters are disabled as they are not supported by the cache implementation "
+ + cache.getClass().getName());
}
return;
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/BufferedJBossCache.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/BufferedJBossCache.java 2011-12-26 12:26:22 UTC (rev 5355)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/BufferedJBossCache.java 2011-12-26 13:01:40 UTC (rev 5356)
@@ -1095,7 +1095,8 @@
if (!localMode && cache.getConfiguration().getCacheMode() != CacheMode.LOCAL && cache.getMembers().size() > 1)
{
// to prevent consistency issue since we don't have the list in the local cache, we are in cluster env
- // and we are in a non local mode, we remove all the patterns in order to enforce other cluster nodes to reload them from the db
+ // and we are in a non local mode, we remove all the patterns in order to enforce other cluster nodes
+ // to reload them from the db
cache.removeNode(fqn);
return;
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/TransactionableResourceManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/TransactionableResourceManager.java 2011-12-26 12:26:22 UTC (rev 5355)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/TransactionableResourceManager.java 2011-12-26 13:01:40 UTC (rev 5356)
@@ -249,8 +249,9 @@
}
/**
- * This synchronization is used to apply all changes before commit phase and it is also used to execute actions once the tx is completed
- * which is necessary in case we use non tx aware resources like the lucene indexes and the observation
+ * This synchronization is used to apply all changes before commit phase and it is also used
+ * to execute actions once the tx is completed which is necessary in case we use non tx aware
+ * resources like the lucene indexes and the observation
* @author <a href="mailto:nfilotto@exoplatform.com">Nicolas Filotto</a>
* @version $Id$
*
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java 2011-12-26 12:26:22 UTC (rev 5355)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java 2011-12-26 13:01:40 UTC (rev 5356)
@@ -259,8 +259,8 @@
*/
public JDBCWorkspaceDataContainer(WorkspaceEntry wsConfig, RepositoryEntry repConfig,
InitialContextInitializer contextInit, ValueStoragePluginProvider valueStorageProvider,
- FileCleanerHolder fileCleanerHolder, DataSourceProvider dsProvider) throws RepositoryConfigurationException, NamingException,
- RepositoryException, IOException
+ FileCleanerHolder fileCleanerHolder, DataSourceProvider dsProvider) throws RepositoryConfigurationException,
+ NamingException, RepositoryException, IOException
{
checkIntegrity(wsConfig, repConfig);
this.wsConfig = wsConfig;
@@ -374,7 +374,8 @@
this.dbSourceName = sn;
if (dsProvider == null)
{
- throw new IllegalArgumentException("Since a data source has been defined, the DataSourceProvider cannot be null, add it in your configuration.");
+ throw new IllegalArgumentException(
+ "Since a data source has been defined, the DataSourceProvider cannot be null, add it in your configuration.");
}
// the data source cannot be managed if there is no transaction manager
this.isManaged = dsProvider.isManaged(dbSourceName);
@@ -833,10 +834,10 @@
{
String str =
"JDBC based JCR Workspace Data container \n" + "container name: " + containerName + " \n"
- + (isManaged ? "managed " : "") + "data source JNDI name: " + dbSourceName + "\n" + "is multi database: " + multiDb + "\n"
- + "storage version: " + storageVersion + "\n" + "value storage provider: " + valueStorageProvider + "\n"
- + "max buffer size (bytes): " + maxBufferSize + "\n" + "swap directory path: "
- + PrivilegedFileHelper.getAbsolutePath(swapDirectory);
+ + (isManaged ? "managed " : "") + "data source JNDI name: " + dbSourceName + "\n" + "is multi database: "
+ + multiDb + "\n" + "storage version: " + storageVersion + "\n" + "value storage provider: "
+ + valueStorageProvider + "\n" + "max buffer size (bytes): " + maxBufferSize + "\n"
+ + "swap directory path: " + PrivilegedFileHelper.getAbsolutePath(swapDirectory);
return str;
}
@@ -860,7 +861,8 @@
con = getConnectionFactory().getJdbcConnection();
if (con.getTransactionIsolation() < Connection.TRANSACTION_READ_COMMITTED)
{
- LOG.warn("Wrong default isolation level, please set the default isolation level to READ_COMMITTED or higher. Other default isolation levels are not supported");
+ LOG.warn("Wrong default isolation level, please set the default isolation level "
+ + "to READ_COMMITTED or higher. Other default isolation levels are not supported");
}
}
catch (SQLException e)
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/HSQLDBSingleDbJDBCConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/HSQLDBSingleDbJDBCConnection.java 2011-12-26 12:26:22 UTC (rev 5355)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/HSQLDBSingleDbJDBCConnection.java 2011-12-26 13:01:40 UTC (rev 5356)
@@ -78,7 +78,8 @@
FIND_PROPERTY_BY_NAME =
"select V.DATA"
+ " from JCR_SITEM I, JCR_SVALUE V"
- + " where I.PARENT_ID=? and I.I_CLASS=2 and I.CONTAINER_NAME=? and I.NAME=? and I.ID=V.PROPERTY_ID order by V.ORDER_NUM";
+ + " where I.PARENT_ID=? and I.I_CLASS=2 and I.CONTAINER_NAME=? and I.NAME=? and"
+ + " I.ID=V.PROPERTY_ID order by V.ORDER_NUM";
FIND_NODES_BY_PARENTID =
"select * from JCR_SITEM" + " where PARENT_ID=? and I_CLASS=1 and CONTAINER_NAME=?" + " order by N_ORDER_NUM";
FIND_LAST_ORDER_NUMBER_BY_PARENTID =
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java 2011-12-26 12:26:22 UTC (rev 5355)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java 2011-12-26 13:01:40 UTC (rev 5356)
@@ -564,12 +564,13 @@
try
{
removeValuesStatement =
- dbConnection
- .prepareStatement("DELETE FROM JCR_MVALUE WHERE PROPERTY_ID IN (SELECT ID FROM JCR_MITEM WHERE NAME = '[http://www.jcp.org/jcr/1.0]lockIsDeep' OR NAME = '[http://www.jcp.org/jcr/1.0]lockOwner')");
+ dbConnection.prepareStatement("DELETE FROM JCR_MVALUE WHERE PROPERTY_ID IN "
+ + "(SELECT ID FROM JCR_MITEM WHERE NAME = '[http://www.jcp.org/jcr/1.0]lockIsDeep' OR"
+ + " NAME = '[http://www.jcp.org/jcr/1.0]lockOwner')");
removeItemsStatement =
- dbConnection
- .prepareStatement("DELETE FROM JCR_MITEM WHERE NAME = '[http://www.jcp.org/jcr/1.0]lockIsDeep' OR NAME = '[http://www.jcp.org/jcr/1.0]lockOwner'");
+ dbConnection.prepareStatement("DELETE FROM JCR_MITEM WHERE NAME = '[http://www.jcp.org/jcr/1.0]lockIsDeep'"
+ + " OR NAME = '[http://www.jcp.org/jcr/1.0]lockOwner'");
removeValuesStatement.executeUpdate();
removeItemsStatement.executeUpdate();
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2011-12-26 12:26:22 UTC (rev 5355)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2011-12-26 13:01:40 UTC (rev 5356)
@@ -119,7 +119,8 @@
FIND_PROPERTY_BY_NAME =
"select V.DATA"
+ " from JCR_SITEM I, JCR_SVALUE V"
- + " where I.I_CLASS=2 and I.CONTAINER_NAME=? and I.PARENT_ID=? and I.NAME=? and I.ID=V.PROPERTY_ID order by V.ORDER_NUM";
+ + " where I.I_CLASS=2 and I.CONTAINER_NAME=? and I.PARENT_ID=? and I.NAME=? and"
+ + " I.ID=V.PROPERTY_ID order by V.ORDER_NUM";
FIND_REFERENCES =
"select P.ID, P.PARENT_ID, P.VERSION, P.P_TYPE, P.P_MULTIVALUED, P.NAME" + " from JCR_SREF R, JCR_SITEM P"
@@ -149,8 +150,8 @@
"insert into JCR_SITEM(ID, PARENT_ID, NAME, CONTAINER_NAME, VERSION, I_CLASS, I_INDEX, N_ORDER_NUM) VALUES(?,?,?,?,?,"
+ I_CLASS_NODE + ",?,?)";
INSERT_PROPERTY =
- "insert into JCR_SITEM(ID, PARENT_ID, NAME, CONTAINER_NAME, VERSION, I_CLASS, I_INDEX, P_TYPE, P_MULTIVALUED) VALUES(?,?,?,?,?,"
- + I_CLASS_PROPERTY + ",?,?,?)";
+ "insert into JCR_SITEM(ID, PARENT_ID, NAME, CONTAINER_NAME, VERSION, I_CLASS, I_INDEX, P_TYPE, P_MULTIVALUED) "
+ + "VALUES(?,?,?,?,?," + I_CLASS_PROPERTY + ",?,?,?)";
INSERT_VALUE = "insert into JCR_SVALUE(DATA, ORDER_NUM, PROPERTY_ID, STORAGE_DESC) VALUES(?,?,?,?)";
INSERT_REF = "insert into JCR_SREF(NODE_ID, PROPERTY_ID, ORDER_NUM) VALUES(?,?,?)";
@@ -587,12 +588,13 @@
{
removeValuesStatement =
dbConnection
- .prepareStatement("DELETE FROM JCR_SVALUE WHERE PROPERTY_ID IN (SELECT ID FROM JCR_SITEM WHERE CONTAINER_NAME = ? AND (NAME = '[http://www.jcp.org/jcr/1.0]lockIsDeep' OR NAME = '[http://www.jcp.org/jcr/1.0]lockOwner'))");
+ .prepareStatement("DELETE FROM JCR_SVALUE WHERE PROPERTY_ID IN (SELECT ID FROM JCR_SITEM WHERE CONTAINER_NAME = ? AND "
+ + "(NAME = '[http://www.jcp.org/jcr/1.0]lockIsDeep' OR NAME = '[http://www.jcp.org/jcr/1.0]lockOwner'))");
removeValuesStatement.setString(1, containerName);
removeItemsStatement =
- dbConnection
- .prepareStatement("DELETE FROM JCR_SITEM WHERE CONTAINER_NAME = ? AND (NAME = '[http://www.jcp.org/jcr/1.0]lockIsDeep' OR NAME = '[http://www.jcp.org/jcr/1.0]lockOwner')");
+ dbConnection.prepareStatement("DELETE FROM JCR_SITEM WHERE CONTAINER_NAME = ? AND "
+ + "(NAME = '[http://www.jcp.org/jcr/1.0]lockIsDeep' OR NAME = '[http://www.jcp.org/jcr/1.0]lockOwner')");
removeItemsStatement.setString(1, containerName);
removeValuesStatement.executeUpdate();
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCWorkspaceDataContainer.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCWorkspaceDataContainer.java 2011-12-26 12:26:22 UTC (rev 5355)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCWorkspaceDataContainer.java 2011-12-26 13:01:40 UTC (rev 5356)
@@ -75,8 +75,8 @@
*/
public CQJDBCWorkspaceDataContainer(WorkspaceEntry wsConfig, RepositoryEntry repConfig,
InitialContextInitializer contextInit, ValueStoragePluginProvider valueStorageProvider,
- FileCleanerHolder fileCleanerHolder, DataSourceProvider dsProvider) throws RepositoryConfigurationException, NamingException,
- RepositoryException, IOException
+ FileCleanerHolder fileCleanerHolder, DataSourceProvider dsProvider) throws RepositoryConfigurationException,
+ NamingException, RepositoryException, IOException
{
super(wsConfig, repConfig, contextInit, valueStorageProvider, fileCleanerHolder, dsProvider);
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/DB2ConnectionFactory.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/DB2ConnectionFactory.java 2011-12-26 12:26:22 UTC (rev 5355)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/DB2ConnectionFactory.java 2011-12-26 13:01:40 UTC (rev 5356)
@@ -181,12 +181,14 @@
{
if (isReindexingSupport)
{
- log.debug("RDBMS indexing enabled as the major version is 9, the minor version is 7 and the maintenance version is greater or equals to 2 knowing that the extracted value is "
+ log.debug("RDBMS indexing enabled as the major version is 9, the minor version is 7 "
+ + "and the maintenance version is greater or equals to 2 knowing that the extracted value is "
+ maintenanceVersion + ".");
}
else
{
- log.debug("RDBMS indexing disabled as the major version is 9, the minor version is 7 and the maintenance version is lower than 2 knowing that the extracted value is "
+ log.debug("RDBMS indexing disabled as the major version is 9, the minor version is 7 "
+ + "and the maintenance version is lower than 2 knowing that the extracted value is "
+ maintenanceVersion + ".");
}
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/statistics/StatisticsJDBCStorageConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/statistics/StatisticsJDBCStorageConnection.java 2011-12-26 12:26:22 UTC (rev 5355)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/statistics/StatisticsJDBCStorageConnection.java 2011-12-26 13:01:40 UTC (rev 5356)
@@ -460,7 +460,7 @@
}
/**
- * @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnection#getChildPropertiesData(org.exoplatform.services.jcr.datamodel.NodeData, java.lang.String[] pattern)
+ * {@inheritDoc}
*/
public List<PropertyData> getChildPropertiesData(NodeData parent, List<QPathEntryFilter> pattern)
throws RepositoryException, IllegalStateException
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileIOHelper.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileIOHelper.java 2011-12-26 12:26:22 UTC (rev 5355)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileIOHelper.java 2011-12-26 13:01:40 UTC (rev 5356)
@@ -184,8 +184,9 @@
// not succeeded - copy bytes, temp file will be deleted by transient ValueData
if (LOG.isDebugEnabled())
{
- LOG.debug("Value spool file move (rename) to Values Storage is not succeeded. Trying bytes copy. Spool file: "
- + tempFile.getAbsolutePath() + ". Destination: " + file.getAbsolutePath());
+ LOG.debug("Value spool file move (rename) to Values Storage is not succeeded. "
+ + "Trying bytes copy. Spool file: " + tempFile.getAbsolutePath() + ". Destination: "
+ + file.getAbsolutePath());
}
copyClose(new FileInputStream(tempFile), new FileOutputStream(file));
Modified: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/BufferedISPNCache.java
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/BufferedISPNCache.java 2011-12-26 12:26:22 UTC (rev 5355)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/BufferedISPNCache.java 2011-12-26 13:01:40 UTC (rev 5356)
@@ -282,7 +282,8 @@
}
/**
- * It tries to get Map{filter, Set{itemIds}} by given key. If Map exists then adds itemDatas ID to all acceptable pattern lists.
+ * It tries to get Map{filter, Set{itemIds}} by given key.
+ * If Map exists then adds itemDatas ID to all acceptable pattern lists.
*/
public static class AddToPatternListContainer extends ChangesContainer
{
@@ -330,7 +331,8 @@
&& cache.getCacheManager().getMembers().size() > 1)
{
// to prevent consistency issue since we don't have the list in the local cache, we are in cluster env
- // and we are in a non local mode, we remove all the patterns in order to enforce other cluster nodes to reload them from the db
+ // and we are in a non local mode, we remove all the patterns in order to enforce other cluster nodes
+ // to reload them from the db
cache.withFlags(Flag.SKIP_REMOTE_LOOKUP).remove(key);
}
}
@@ -381,7 +383,8 @@
}
/**
- * It tries to get Map{filter, Set{itemIds}} by given key. IfMap exists then removes item IDs from all acceptable pattern lists.
+ * It tries to get Map{filter, Set{itemIds}} by given key.
+ * IfMap exists then removes item IDs from all acceptable pattern lists.
*/
public static class RemoveFromPatternListContainer extends ChangesContainer
{
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java 2011-12-26 12:26:22 UTC (rev 5355)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java 2011-12-26 13:01:40 UTC (rev 5356)
@@ -317,7 +317,8 @@
/**
* {@inheritDoc}
*/
- public void createRepository(String backupId, RepositoryEntry rEntry, String rToken) throws RepositoryConfigurationException, RepositoryCreationException
+ public void createRepository(String backupId, RepositoryEntry rEntry, String rToken)
+ throws RepositoryConfigurationException, RepositoryCreationException
{
createRepositoryInternally(backupId, rEntry, rToken, null);
}
@@ -847,7 +848,8 @@
}
catch (RepositoryException e)
{
- throw new RepositoryCreationException("It is not possible to check is repository " + repositoryName + " in usage or not", e);
+ throw new RepositoryCreationException("It is not possible to check is repository " + repositoryName
+ + " in usage or not", e);
}
}
Modified: jcr/trunk/exo.jcr.connectors.jca/src/main/java/org/exoplatform/connectors/jcr/impl/adapter/ManagedSessionFactory.java
===================================================================
--- jcr/trunk/exo.jcr.connectors.jca/src/main/java/org/exoplatform/connectors/jcr/impl/adapter/ManagedSessionFactory.java 2011-12-26 12:26:22 UTC (rev 5355)
+++ jcr/trunk/exo.jcr.connectors.jca/src/main/java/org/exoplatform/connectors/jcr/impl/adapter/ManagedSessionFactory.java 2011-12-26 13:01:40 UTC (rev 5356)
@@ -98,7 +98,7 @@
}
/**
- * @see javax.resource.spi.ManagedConnectionFactory#createManagedConnection(javax.security.auth.Subject, javax.resource.spi.ConnectionRequestInfo)
+ * {@inheritDoc}
*/
public ManagedConnection createManagedConnection(Subject subject, ConnectionRequestInfo cxRequestInfo)
throws ResourceException
@@ -137,7 +137,8 @@
}
catch (Exception e)
{
- throw new ResourceException("Could not login to the workspace " + (workspaceName == null ? "'default'" : workspaceName), e);
+ throw new ResourceException("Could not login to the workspace " +
+ (workspaceName == null ? "'default'" : workspaceName), e);
}
return new ManagedSessionImpl(session);
}
@@ -250,7 +251,7 @@
}
/**
- * @see javax.resource.spi.ManagedConnectionFactory#matchManagedConnections(java.util.Set, javax.security.auth.Subject, javax.resource.spi.ConnectionRequestInfo)
+ * {@inheritDoc}
*/
public ManagedConnection matchManagedConnections(@SuppressWarnings("rawtypes") Set connectionSet, Subject subject,
ConnectionRequestInfo cxRequestInfo) throws ResourceException
Modified: jcr/trunk/exo.jcr.connectors.jca/src/main/java/org/exoplatform/connectors/jcr/impl/adapter/ManagedSessionImpl.java
===================================================================
--- jcr/trunk/exo.jcr.connectors.jca/src/main/java/org/exoplatform/connectors/jcr/impl/adapter/ManagedSessionImpl.java 2011-12-26 12:26:22 UTC (rev 5355)
+++ jcr/trunk/exo.jcr.connectors.jca/src/main/java/org/exoplatform/connectors/jcr/impl/adapter/ManagedSessionImpl.java 2011-12-26 13:01:40 UTC (rev 5356)
@@ -109,7 +109,7 @@
}
/**
- * @see javax.resource.spi.ManagedConnection#getConnection(javax.security.auth.Subject, javax.resource.spi.ConnectionRequestInfo)
+ * {@inheritDoc}
*/
public Object getConnection(Subject subject, ConnectionRequestInfo cxRequestInfo) throws ResourceException
{
Modified: jcr/trunk/exo.jcr.connectors.jca/src/main/java/org/exoplatform/connectors/jcr/impl/adapter/RepositoryResourceAdapter.java
===================================================================
--- jcr/trunk/exo.jcr.connectors.jca/src/main/java/org/exoplatform/connectors/jcr/impl/adapter/RepositoryResourceAdapter.java 2011-12-26 12:26:22 UTC (rev 5355)
+++ jcr/trunk/exo.jcr.connectors.jca/src/main/java/org/exoplatform/connectors/jcr/impl/adapter/RepositoryResourceAdapter.java 2011-12-26 13:01:40 UTC (rev 5356)
@@ -37,14 +37,14 @@
{
/**
- * @see javax.resource.spi.ResourceAdapter#endpointActivation(javax.resource.spi.endpoint.MessageEndpointFactory, javax.resource.spi.ActivationSpec)
+ * {@inheritDoc}
*/
public void endpointActivation(MessageEndpointFactory endpointFactory, ActivationSpec spec) throws ResourceException
{
}
/**
- * @see javax.resource.spi.ResourceAdapter#endpointDeactivation(javax.resource.spi.endpoint.MessageEndpointFactory, javax.resource.spi.ActivationSpec)
+ * {@inheritDoc}
*/
public void endpointDeactivation(MessageEndpointFactory endpointFactory, ActivationSpec spec)
{
Modified: jcr/trunk/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/cli/HelpCommand.java
===================================================================
--- jcr/trunk/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/cli/HelpCommand.java 2011-12-26 12:26:22 UTC (rev 5355)
+++ jcr/trunk/exo.jcr.framework.command/src/main/java/org/exoplatform/frameworks/jcr/cli/HelpCommand.java 2011-12-26 13:01:40 UTC (rev 5356)
@@ -62,10 +62,8 @@
map.put("copy", "<srcAbsPath>, <destAbsPath> copy the node at srcAbsPath to the new location at destAbsPath");
map.put("movenode", "<srcAbsPath>, <destAbsPath> move the node at srcAbsPath to the new location at destAbsPath");
map.put("move", "<srcAbsPath>, <destAbsPath> move the node at srcAbsPath to the new location at destAbsPath");
- map
- .put(
- "|",
- "<console size> limit the count of lines to output, e.g. |20 will displayed only 20 lines, works in standalone mode only");
+ map.put("|", "<console size> limit the count of lines to output, e.g. |20 will displayed only 20 lines, "
+ + "works in standalone mode only");
}
@Override
12 years, 4 months
exo-jcr SVN: r5355 - in core/trunk/exo.core.component.organization.tests/src: test and 6 other directories.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-12-26 07:26:22 -0500 (Mon, 26 Dec 2011)
New Revision: 5355
Added:
core/trunk/exo.core.component.organization.tests/src/test/
core/trunk/exo.core.component.organization.tests/src/test/java/
core/trunk/exo.core.component.organization.tests/src/test/java/org/
core/trunk/exo.core.component.organization.tests/src/test/java/org/exoplatform/
core/trunk/exo.core.component.organization.tests/src/test/java/org/exoplatform/services/
core/trunk/exo.core.component.organization.tests/src/test/java/org/exoplatform/services/tck/
core/trunk/exo.core.component.organization.tests/src/test/java/org/exoplatform/services/tck/organization/
core/trunk/exo.core.component.organization.tests/src/test/java/org/exoplatform/services/tck/organization/AbstractOrganizationServiceTest.java
core/trunk/exo.core.component.organization.tests/src/test/java/org/exoplatform/services/tck/organization/TestGroupHandler.java
core/trunk/exo.core.component.organization.tests/src/test/java/org/exoplatform/services/tck/organization/TestGroupListener.java
core/trunk/exo.core.component.organization.tests/src/test/java/org/exoplatform/services/tck/organization/TestMembershipHandler.java
core/trunk/exo.core.component.organization.tests/src/test/java/org/exoplatform/services/tck/organization/TestMembershipTypeEventListener.java
core/trunk/exo.core.component.organization.tests/src/test/java/org/exoplatform/services/tck/organization/TestMembershipTypeHandler.java
core/trunk/exo.core.component.organization.tests/src/test/java/org/exoplatform/services/tck/organization/TestUserHandler.java
core/trunk/exo.core.component.organization.tests/src/test/java/org/exoplatform/services/tck/organization/TestUserProfileHandler.java
Log:
EXOJCR-1694: Fixed the build for Sonar
Added: core/trunk/exo.core.component.organization.tests/src/test/java/org/exoplatform/services/tck/organization/AbstractOrganizationServiceTest.java
===================================================================
--- core/trunk/exo.core.component.organization.tests/src/test/java/org/exoplatform/services/tck/organization/AbstractOrganizationServiceTest.java (rev 0)
+++ core/trunk/exo.core.component.organization.tests/src/test/java/org/exoplatform/services/tck/organization/AbstractOrganizationServiceTest.java 2011-12-26 12:26:22 UTC (rev 5355)
@@ -0,0 +1,257 @@
+/*
+ * Copyright (C) 2003-2011 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.services.tck.organization;
+
+import junit.framework.TestCase;
+
+import org.exoplatform.container.StandaloneContainer;
+import org.exoplatform.services.organization.Group;
+import org.exoplatform.services.organization.GroupHandler;
+import org.exoplatform.services.organization.MembershipHandler;
+import org.exoplatform.services.organization.MembershipType;
+import org.exoplatform.services.organization.MembershipTypeHandler;
+import org.exoplatform.services.organization.OrganizationService;
+import org.exoplatform.services.organization.User;
+import org.exoplatform.services.organization.UserHandler;
+import org.exoplatform.services.organization.UserProfile;
+import org.exoplatform.services.organization.UserProfileHandler;
+
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * <br/>Date: 2011
+ *
+ * @author <a href="mailto:alex.reshetnyak@exoplatform.com.ua">Alex Reshetnyak</a>
+ * @version $Id: AbstractOrganizationServiceTest.java 111 2011-11-11 11:11:11Z rainf0x $
+ */
+public class AbstractOrganizationServiceTest extends TestCase
+{
+
+ protected GroupHandler gHandler;
+
+ protected MembershipHandler mHandler;
+
+ protected UserHandler uHandler;
+
+ protected MembershipTypeHandler mtHandler;
+
+ protected UserProfileHandler upHandler;
+
+ protected String membershipType = "type";
+
+ protected String userName = "user";
+
+ protected String newUserName = "newUser";
+
+ protected String groupName1 = "group1";
+
+ protected String groupName2 = "group2";
+
+ protected StandaloneContainer container;
+
+ /**
+ * The list of users which have been created during test.
+ * Will be removed in tearDown() method.
+ */
+ private List<String> users = new ArrayList<String>();
+
+ /**
+ * The list of membership types which have been created during test.
+ * Will be removed in tearDown() method.
+ */
+ private List<String> types = new ArrayList<String>();
+
+ /**
+ * The list of group which have been created during test.
+ * Will be removed in tearDown() method.
+ */
+ private List<String> groups = new ArrayList<String>();
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setUp() throws Exception
+ {
+ super.setUp();
+
+
+ String configPath = System.getProperty("orgservice.test.configuration.file");
+ if (configPath == null)
+ {
+ configPath = "/conf/standalone/test-configuration.xml";
+ }
+
+ String containerConf = getClass().getResource(configPath).toString();
+
+ StandaloneContainer.addConfigurationURL(containerConf);
+ container = StandaloneContainer.getInstance();
+
+ OrganizationService organizationService =
+ (OrganizationService)container.getComponentInstanceOfType(OrganizationService.class);
+
+ gHandler = organizationService.getGroupHandler();
+ uHandler = organizationService.getUserHandler();
+ mHandler = organizationService.getMembershipHandler();
+ mtHandler = organizationService.getMembershipTypeHandler();
+ upHandler = organizationService.getUserProfileHandler();
+
+ users.add(userName);
+ users.add(newUserName);
+
+ groups.add("/" + groupName1);
+ groups.add("/" + groupName1 + "/" + groupName2);
+
+ types.add(membershipType);
+ }
+
+ /**
+ * Create new user for test purpose only.
+ */
+ protected void createUser(String userName) throws Exception
+ {
+ User u = uHandler.createUserInstance(userName);
+ u.setEmail("email@test");
+ u.setFirstName("first");
+ u.setLastLoginTime(Calendar.getInstance().getTime());
+ u.setCreatedDate(Calendar.getInstance().getTime());
+ u.setLastName("last");
+ u.setPassword("pwd");
+
+ uHandler.createUser(u, true);
+
+ users.add(userName);
+ }
+
+ /**
+ * Create user with profile.
+ */
+ protected void createUserProfile(String userName) throws Exception
+ {
+ UserProfile up = upHandler.createUserProfileInstance(userName);
+ Map<String, String> attributes = up.getUserInfoMap();
+ attributes.put("key1", "value1");
+ attributes.put("key2", "value2");
+ upHandler.saveUserProfile(up, true);
+ }
+
+ /**
+ * Create membership type.
+ */
+ protected void createMembershipType(String type, String desc) throws Exception
+ {
+ MembershipType mt = mtHandler.createMembershipTypeInstance();
+ mt.setName(type);
+ mt.setDescription(desc);
+ mtHandler.createMembershipType(mt, true);
+
+ types.add(type);
+ }
+
+ /**
+ * Create new group.
+ */
+ protected void createGroup(String parentId, String name, String label, String desc) throws Exception
+ {
+ Group parent = parentId == null ? null : gHandler.findGroupById(parentId);
+
+ Group child = gHandler.createGroupInstance();
+ child.setGroupName(name);
+ child.setLabel(label);
+ child.setDescription(desc);
+ gHandler.addChild(parent, child, true);
+
+ groups.add((parent == null ? "" : parentId) + "/" + name);
+ }
+
+ /**
+ * Create membership.
+ */
+ protected void createMembership(String userName, String groupName, String type) throws Exception
+ {
+ createUser(userName);
+ createGroup(null, groupName, "lable", "desc");
+ createMembershipType(type, "desc");
+
+ // link membership
+ mHandler.linkMembership(uHandler.findUserByName(userName), gHandler.findGroupById("/" + groupName), mtHandler
+ .findMembershipType(type), true);
+ }
+
+ /**
+ * Create new group instance.
+ */
+ protected Group createGroupInstance(String parentId, String name, String label, String desc) throws Exception
+ {
+ createGroup(null, name, "lable", "desc");
+ return gHandler.removeGroup(gHandler.findGroupById("/" + name), true);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void tearDown() throws Exception
+ {
+ // remove all users
+ Iterator<String> iter = users.iterator();
+ while (iter.hasNext())
+ {
+ String userName = iter.next();
+
+ if (uHandler.findUserByName(userName) != null)
+ {
+ uHandler.removeUser(userName, true);
+ }
+ iter.remove();
+ }
+
+ // remove all membership types
+ iter = types.iterator();
+ while (iter.hasNext())
+ {
+ String type = iter.next();
+
+ if (mtHandler.findMembershipType(type) != null)
+ {
+ mtHandler.removeMembershipType(type, true);
+ }
+ iter.remove();
+ }
+
+ // remove all groups
+ iter = groups.iterator();
+ while (iter.hasNext())
+ {
+ String groupId = iter.next();
+
+ Group group = gHandler.findGroupById(groupId);
+ if (group != null)
+ {
+ gHandler.removeGroup(group, true);
+ }
+
+ iter.remove();
+ }
+
+ super.tearDown();
+ }
+}
Added: core/trunk/exo.core.component.organization.tests/src/test/java/org/exoplatform/services/tck/organization/TestGroupHandler.java
===================================================================
--- core/trunk/exo.core.component.organization.tests/src/test/java/org/exoplatform/services/tck/organization/TestGroupHandler.java (rev 0)
+++ core/trunk/exo.core.component.organization.tests/src/test/java/org/exoplatform/services/tck/organization/TestGroupHandler.java 2011-12-26 12:26:22 UTC (rev 5355)
@@ -0,0 +1,198 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.services.tck.organization;
+
+import org.exoplatform.services.organization.Group;
+import org.exoplatform.services.organization.GroupEventListener;
+import org.exoplatform.services.organization.GroupEventListenerHandler;
+
+import java.util.List;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * @author <a href="mailto:anatoliy.bazko@exoplatform.com.ua">Anatoliy Bazko</a>
+ * @version $Id: TestOrganizationService.java 111 2008-11-11 11:11:11Z $
+ */
+public class TestGroupHandler extends AbstractOrganizationServiceTest
+{
+
+ /**
+ * Find group by id.
+ */
+ public void testFindGroupById() throws Exception
+ {
+ Group g = gHandler.findGroupById("/platform/administrators");
+ assertNotNull(g);
+ assertEquals(g.getDescription(), "the /platform/administrators group");
+ assertEquals(g.getGroupName(), "administrators");
+ assertEquals(g.getId(), "/platform/administrators");
+ assertEquals(g.getLabel(), "Administrators");
+ assertEquals(g.getParentId(), "/platform");
+
+ // try to find not existed group. We are supposed to get "null" instead of Exception
+ try
+ {
+ assertNull(gHandler.findGroupById("/not-existed-group"));
+ }
+ catch (Exception e)
+ {
+ fail("Exception should be thrown");
+ }
+ }
+
+ /**
+ * Find groups by user.
+ */
+ public void testFindGroupsByUser() throws Exception
+ {
+ assertEquals(gHandler.findGroupsOfUser("john").size(), 3);
+ }
+
+ /**
+ * Find groups.
+ */
+ public void testFindGroups() throws Exception
+ {
+ assertEquals(gHandler.findGroups(null).size(), 4);
+ assertEquals(gHandler.findGroups(gHandler.findGroupById("/organization/operations")).size(), 2);
+ assertEquals(gHandler.findGroups(gHandler.findGroupById("/organization/management/executive-board")).size(), 0);
+ }
+
+ /**
+ * Get all groups.
+ */
+ public void testGetAllGroups() throws Exception
+ {
+ assertEquals(gHandler.getAllGroups().size(), 16);
+ }
+
+ /**
+ * Remove group.
+ */
+ public void testRemoveGroup() throws Exception
+ {
+ createUser(userName);
+ createGroup("/organization", groupName1, "label", "desc");
+ createGroup("/organization/" + groupName1, groupName1, "label", "desc");
+
+ createMembership(newUserName, groupName2, membershipType);
+ assertEquals("We expect to find single membership for user " + newUserName, 1,
+ mHandler.findMembershipsByUser(newUserName).size());
+
+ Group group = gHandler.removeGroup(gHandler.findGroupById("/organization/group1"), true);
+ assertNull(gHandler.findGroupById("/organization/group1"));
+ assertNull(gHandler.findGroupById("/organization/group1/group2"));
+
+ gHandler.removeGroup(gHandler.findGroupById("/" + groupName2), true);
+ assertEquals("We expect to find no membership for user " + newUserName, 0,
+ mHandler.findMembershipsByUser(newUserName).size());
+
+ // try to remove not exited group. Exception should be thrown
+ try
+ {
+ gHandler.removeGroup(group, true);
+ fail("Exception should be thrown");
+ }
+ catch (Exception e)
+ {
+ }
+
+ // create in root
+ createGroup(null, groupName1, "label", "desc");
+ createGroup("/" + groupName1, groupName2, "label", "desc");
+
+ gHandler.removeGroup(gHandler.findGroupById("/" + groupName1), true);
+ assertNull(gHandler.findGroupById("/" + groupName1));
+ assertNull(gHandler.findGroupById("/" + groupName1 + "/" + groupName2));
+ }
+
+ /**
+ * Add child.
+ */
+ public void testAddChild() throws Exception
+ {
+ Group parent = createGroupInstance(null, groupName1, "lable", "desc");
+ Group child = createGroupInstance(null, groupName2, "lable", "desc");
+
+ // try to add child to not existed parent group
+ try
+ {
+ gHandler.addChild(parent, child, false);
+ fail("Exception should be thrown.");
+ }
+ catch (Exception e)
+ {
+ }
+
+ // add parent group
+ gHandler.addChild(null, parent, false);
+ assertNotNull(gHandler.findGroupById("/" + groupName1));
+
+ // add child group
+ gHandler.addChild(parent, child, false);
+ assertNotNull(gHandler.findGroupById("/" + groupName1 + "/" + groupName2));
+ }
+
+ /**
+ * Create group.
+ */
+ public void testCreateGroup() throws Exception
+ {
+ Group group = gHandler.createGroupInstance();
+ group.setGroupName(groupName1);
+ gHandler.createGroup(group, true);
+
+ assertNotNull(gHandler.findGroupById("/" + groupName1));
+ }
+
+ /**
+ * Save group.
+ */
+ public void testSaveGroup() throws Exception
+ {
+ createGroup(null, groupName1, "label", "desc");
+
+ // set new description
+ Group g = gHandler.findGroupById("/" + groupName1);
+ g.setDescription("newDesc");
+ gHandler.saveGroup(g, true);
+
+ // check if group has new description
+ g = gHandler.findGroupById("/" + groupName1);
+ assertEquals(g.getDescription(), "newDesc");
+ }
+
+ /**
+ * Test get listeners.
+ */
+ public void testGetListeners() throws Exception
+ {
+ if (gHandler instanceof GroupEventListenerHandler)
+ {
+ List<GroupEventListener> list = ((GroupEventListenerHandler) gHandler).getGroupListeners();
+ try
+ {
+ list.clear();
+ fail("We are not supposed to be able to change list of listeners.");
+ }
+ catch (Exception e)
+ {
+ }
+ }
+ }
+}
Added: core/trunk/exo.core.component.organization.tests/src/test/java/org/exoplatform/services/tck/organization/TestGroupListener.java
===================================================================
--- core/trunk/exo.core.component.organization.tests/src/test/java/org/exoplatform/services/tck/organization/TestGroupListener.java (rev 0)
+++ core/trunk/exo.core.component.organization.tests/src/test/java/org/exoplatform/services/tck/organization/TestGroupListener.java 2011-12-26 12:26:22 UTC (rev 5355)
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2011 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.services.tck.organization;
+
+import org.exoplatform.container.StandaloneContainer;
+import org.exoplatform.container.component.RequestLifeCycle;
+import org.exoplatform.services.organization.Group;
+import org.exoplatform.services.organization.GroupEventListener;
+
+/**
+ * @author <a href="abazko(a)exoplatform.com">Anatoliy Bazko</a>
+ * @version $Id: TestListener.java 34360 2009-07-22 23:58:59Z tolusha $
+ */
+public class TestGroupListener extends GroupEventListener
+{
+
+ public void preSave(Group group, boolean isNew) throws Exception
+ {
+ RequestLifeCycle.begin(StandaloneContainer.getInstance());
+ RequestLifeCycle.end();
+ }
+}
Added: core/trunk/exo.core.component.organization.tests/src/test/java/org/exoplatform/services/tck/organization/TestMembershipHandler.java
===================================================================
--- core/trunk/exo.core.component.organization.tests/src/test/java/org/exoplatform/services/tck/organization/TestMembershipHandler.java (rev 0)
+++ core/trunk/exo.core.component.organization.tests/src/test/java/org/exoplatform/services/tck/organization/TestMembershipHandler.java 2011-12-26 12:26:22 UTC (rev 5355)
@@ -0,0 +1,525 @@
+/*
+ * Copyright (C) 2003-2008 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.services.tck.organization;
+
+import org.exoplatform.commons.utils.ListAccess;
+import org.exoplatform.commons.utils.PageList;
+import org.exoplatform.services.organization.Group;
+import org.exoplatform.services.organization.Membership;
+import org.exoplatform.services.organization.MembershipEventListener;
+import org.exoplatform.services.organization.MembershipEventListenerHandler;
+import org.exoplatform.services.organization.MembershipType;
+import org.exoplatform.services.organization.User;
+
+import java.util.List;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * @author <a href="mailto:anatoliy.bazko@exoplatform.com.ua">Anatoliy Bazko</a>
+ * @version $Id: TestMembershipImpl.java 111 2008-11-11 11:11:11Z $
+ */
+public class TestMembershipHandler extends AbstractOrganizationServiceTest
+{
+ /**
+ * Find membership.
+ */
+ public void testFindMembership() throws Exception
+ {
+ createMembership(userName, groupName1, membershipType);
+
+ Membership m = mHandler.findMembershipByUserGroupAndType(userName, "/" + groupName1, membershipType);
+ assertNotNull(mHandler.findMembership(m.getId()));
+
+ // try to find not existed membership. We are supposed to get Exception
+ try
+ {
+ assertNull(mHandler.findMembership("not-existed-id"));
+ fail("Exception should be thrown");
+ }
+ catch (Exception e)
+ {
+
+ }
+ }
+
+ /**
+ * Find membership by user and group.
+ */
+ public void testFindMembershipByUserGroupAndType() throws Exception
+ {
+ Membership m = mHandler.findMembershipByUserGroupAndType("marry", "/platform/users", "member");
+
+ assertNotNull(m);
+ assertEquals(m.getGroupId(), "/platform/users");
+ assertEquals(m.getMembershipType(), "member");
+ assertEquals(m.getUserName(), "marry");
+
+ // try to find not existed membership. We are supposed to get null instead of Exception
+ try
+ {
+ assertNull(mHandler.findMembershipByUserGroupAndType(userName, "/platform/users", "member"));
+ }
+ catch (Exception e)
+ {
+ fail("Exception should not be thrown");
+ }
+
+ try
+ {
+ assertNull(mHandler.findMembershipByUserGroupAndType("marry", "/" + groupName1, "member"));
+ }
+ catch (Exception e)
+ {
+ fail("Exception should not be thrown");
+ }
+
+ try
+ {
+ assertNull(mHandler.findMembershipByUserGroupAndType("marry", "/platform/users", membershipType));
+ }
+ catch (Exception e)
+ {
+ fail("Exception should not be thrown");
+ }
+ }
+
+ /**
+ * Find membership by group.
+ */
+ public void testFindMembershipsByGroup() throws Exception
+ {
+ Group g = gHandler.findGroupById("/platform/users");
+ assertEquals(mHandler.findMembershipsByGroup(g).size(), 4);
+
+ // try to find for non-existing group
+ g = gHandler.createGroupInstance();
+ g.setGroupName(groupName1);
+ gHandler.addChild(null, g, false);
+ assertEquals(g.getId(), gHandler.findGroupById("/" + groupName1).getId());
+ g = gHandler.removeGroup(g, false);
+ assertEquals(mHandler.findMembershipsByGroup(g).size(), 0);
+
+ }
+
+ /**
+ * Find membership by group.
+ */
+ public void testFindAllMembershipsByGroup() throws Exception
+ {
+ Group g = gHandler.findGroupById("/platform/users");
+ ListAccess<Membership> memberships = mHandler.findAllMembershipsByGroup(g);
+ assertEquals(memberships.getSize(), 4);
+
+ try
+ {
+ Membership[] m = memberships.load(0, 4);
+ assertEquals(4, m.length);
+ }
+ catch (Exception e)
+ {
+ fail("Exception should not be thrown");
+ }
+
+ try
+ {
+ Membership[] m = memberships.load(1, 2);
+ assertEquals(2, m.length);
+ }
+ catch (Exception e)
+ {
+ fail("Exception should not be thrown");
+ }
+
+ try
+ {
+ Membership[] m = memberships.load(1, 4);
+ fail("Exception should be thrown");
+ }
+ catch (Exception e)
+ {
+ }
+
+ // try to find for non-existing group
+ g = gHandler.createGroupInstance();
+ g.setGroupName(groupName1);
+ gHandler.addChild(null, g, false);
+ assertEquals(g.getId(), gHandler.findGroupById("/" + groupName1).getId());
+ g = gHandler.removeGroup(g, false);
+ assertEquals(mHandler.findMembershipsByGroup(g).size(), 0);
+
+ }
+
+ /**
+ * Find all memberships by user.
+ */
+ public void testFindMembershipsByUser() throws Exception
+ {
+ assertEquals(mHandler.findMembershipsByUser("john").size(), 3);
+ assertEquals(mHandler.findMembershipsByUser("not-existed-user").size(), 0);
+ }
+
+ /**
+ * Find all membership by user and group.
+ */
+ public void testFindMembershipsByUserAndGroup() throws Exception
+ {
+ assertEquals(mHandler.findMembershipsByUserAndGroup("john", "/platform/users").size(), 1);
+
+ // try to find not existed membership. We are supposed to get null instead of Exception
+ try
+ {
+ assertEquals(mHandler.findMembershipsByUserAndGroup("non-existed-john", "/platform/users").size(), 0);
+ }
+ catch (Exception e)
+ {
+ fail("Exception should not be thrown");
+ }
+
+ try
+ {
+ assertEquals(mHandler.findMembershipsByUserAndGroup("john", "/non-existed-group").size(), 0);
+ }
+ catch (Exception e)
+ {
+ fail("Exception should not be thrown");
+ }
+ }
+
+ /**
+ * Link membership.
+ */
+ public void testLinkMembership() throws Exception
+ {
+ createUser(userName);
+ createGroup(null, groupName1, "lable", "desc");
+ createMembershipType(membershipType, "desc");
+
+ // link membership
+ mHandler.linkMembership(uHandler.findUserByName(userName), gHandler.findGroupById("/" + groupName1), mtHandler
+ .findMembershipType(membershipType), true);
+
+ Membership m = mHandler.findMembershipByUserGroupAndType(userName, "/" + groupName1, membershipType);
+ assertNotNull(m);
+
+ // try to create already existed membership. Exception should not be thrown
+ try
+ {
+ mHandler.linkMembership(uHandler.findUserByName(userName), gHandler.findGroupById("/" + groupName1),
+ mtHandler.findMembershipType(membershipType), true);
+ }
+ catch (Exception e)
+ {
+ fail("Exception should not be thrown");
+ }
+
+ // we expect only 1 membership record
+ assertEquals(1, mHandler.findMembershipsByUser(userName).size());
+
+ // test deprecated memthod create membership
+ mHandler.removeMembership(m.getId(), true);
+ mHandler.createMembership(m, true);
+ m = mHandler.findMembershipByUserGroupAndType(userName, "/" + groupName1, membershipType);
+ assertNotNull(m);
+
+ // try to link membership with not existed entries. We are supposed to get Exception
+ Group group = createGroupInstance(null, "not-existed-group", "lable", "desc");
+ try
+ {
+ mHandler.linkMembership(uHandler.findUserByName(userName), group,
+ mtHandler.findMembershipType(membershipType), true);
+ fail("Exception should be thrown");
+ }
+ catch (Exception e)
+ {
+ }
+
+ User user = uHandler.createUserInstance("not-existed-user");
+ try
+ {
+ mHandler.linkMembership(user, gHandler.findGroupById("/" + groupName1), mtHandler
+ .findMembershipType(membershipType), true);
+ fail("Exception should be thrown");
+ }
+ catch (Exception e)
+ {
+ }
+
+ MembershipType mt = mtHandler.createMembershipTypeInstance();
+ mt.setName("not-existed-mt");
+ try
+ {
+ mHandler.linkMembership(uHandler.findUserByName(userName), gHandler.findGroupById("/" + groupName1), mt, true);
+ fail("Exception should be thrown");
+ }
+ catch (Exception e)
+ {
+ }
+
+ try
+ {
+ mHandler.linkMembership(uHandler.findUserByName(userName), null, mtHandler.findMembershipType(membershipType),
+ true);
+ fail("Exception should be thrown");
+ }
+ catch (Exception e)
+ {
+ }
+
+ try
+ {
+ mHandler.linkMembership(null, gHandler.findGroupById("/" + groupName1), mtHandler
+ .findMembershipType(membershipType), true);
+ fail("Exception should be thrown");
+ }
+ catch (Exception e)
+ {
+ }
+
+ try
+ {
+ mHandler.linkMembership(uHandler.findUserByName(userName), gHandler.findGroupById("/" + groupName1), null,
+ true);
+ fail("Exception should be thrown");
+ }
+ catch (Exception e)
+ {
+ }
+ }
+
+ /**
+ * Remove membership
+ */
+ public void testRemoveMembership() throws Exception
+ {
+
+ createMembership(userName, groupName1, membershipType);
+ Membership m = mHandler.findMembershipByUserGroupAndType(userName, "/" + groupName1, membershipType);
+
+ assertNotNull(m);
+
+ m = mHandler.removeMembership(m.getId(), true);
+ assertEquals(m.getGroupId(), "/" + groupName1);
+ assertEquals(m.getMembershipType(), membershipType);
+ assertEquals(m.getUserName(), userName);
+
+ assertNull(mHandler.findMembershipByUserGroupAndType(userName, "/" + groupName1, membershipType));
+
+
+ // try to remove not existed membership. We are supposed to get "null" instead of Exception
+ try
+ {
+ assertNull(mHandler.removeMembership("not-existed-id", true));
+ }
+ catch (Exception e)
+ {
+ fail("Exception should not be thrown");
+ }
+ }
+
+ /**
+ * Remove membership by user.
+ */
+ public void testRemoveMembershipByUser() throws Exception
+ {
+ createMembership(userName, groupName1, membershipType);
+
+ assertEquals(mHandler.removeMembershipByUser("user", true).size(), 1);
+ assertNull(mHandler.findMembershipByUserGroupAndType("user", "/group", "type"));
+
+ // try to remove memberships by not existed users. We are supposed to get empty list instead of Exception
+ try
+ {
+ assertEquals(mHandler.removeMembershipByUser("not-existed-user", true).size(), 0);
+ }
+ catch (Exception e)
+ {
+ fail("Exception should not be thrown");
+ }
+ }
+
+ /**
+ * Find group by membership.
+ */
+ public void testFindGroupByMembership() throws Exception
+ {
+ assertEquals(gHandler.findGroupByMembership("john", "manager").size(), 1);
+
+ // try to find groups by not existed entries. We supposed to get empty list instead of Exception
+ try
+ {
+ assertEquals(gHandler.findGroupByMembership("not-existed-john", "manager").size(), 0);
+ }
+ catch (Exception e)
+ {
+ fail("Exception should not be thrown");
+ }
+
+
+ }
+
+ /**
+ * Find groups of user.
+ */
+ public void testFindGroupsOfUser() throws Exception
+ {
+ assertEquals(gHandler.findGroupsOfUser("john").size(), 3);
+
+ // try to find groups by not existed entries. We supposed to get empty list instead of Exception
+ try
+ {
+ assertEquals(gHandler.findGroupsOfUser("not-existed-james").size(), 0);
+ }
+ catch (Exception e)
+ {
+ fail("Exception should not be thrown");
+ }
+ }
+
+ /**
+ * Find users by group.
+ */
+ public void testFindUsersByGroupId() throws Exception
+ {
+ ListAccess<User> usersListAccess = uHandler.findUsersByGroupId("/platform/users");
+
+ assertEquals(usersListAccess.getSize(), 4);
+
+ for (User u : usersListAccess.load(0, usersListAccess.getSize()))
+ {
+ User currentUrer = uHandler.findUserByName(u.getUserName());
+ assertNotNull(currentUrer);
+
+ assertEquals(currentUrer.getUserName(), u.getUserName());
+ assertEquals(currentUrer.getFirstName(), u.getFirstName());
+ assertEquals(currentUrer.getLastName(), u.getLastName());
+ assertEquals(currentUrer.getEmail(), u.getEmail());
+ assertEquals(currentUrer.getOrganizationId(), u.getOrganizationId());
+ assertEquals(currentUrer.getPassword(), u.getPassword());
+ }
+
+ // try to find users by not existed entries. We supposed to get empty list instead of Exception
+ try
+ {
+ assertEquals(uHandler.findUsersByGroupId("/not-existed-group").getSize(), 0);
+ }
+ catch (Exception e)
+ {
+ fail("Exception should not be thrown");
+ }
+ }
+
+ /**
+ * Find users by group.
+ */
+ public void testFindUsersByGroup() throws Exception
+ {
+ PageList<User> usersList = uHandler.findUsersByGroup("/platform/users");
+
+ assertEquals(usersList.getAll().size(), 4);
+
+ for (User u : usersList.getAll())
+ {
+ User currentUrer = uHandler.findUserByName(u.getUserName());
+ assertNotNull(currentUrer);
+
+ assertEquals(currentUrer.getUserName(), u.getUserName());
+ assertEquals(currentUrer.getFirstName(), u.getFirstName());
+ assertEquals(currentUrer.getLastName(), u.getLastName());
+ assertEquals(currentUrer.getEmail(), u.getEmail());
+ assertEquals(currentUrer.getOrganizationId(), u.getOrganizationId());
+ assertEquals(currentUrer.getPassword(), u.getPassword());
+ }
+
+ // try to find users by not existed entries. We supposed to get empty list instead of Exception
+ try
+ {
+ assertEquals(uHandler.findUsersByGroup("/not-existed-group").getAll().size(), 0);
+ }
+ catch (Exception e)
+ {
+ fail("Exception should not be thrown");
+ }
+ }
+
+ /**
+ * Remove membership type.
+ */
+ public void testRemoveMembershipType() throws Exception
+ {
+ createMembership(userName, groupName1, membershipType);
+
+ mtHandler.removeMembershipType("type", true);
+ assertNull(mtHandler.findMembershipType("type"));
+ assertNull(mHandler.findMembershipByUserGroupAndType(userName, "/" + groupName1, membershipType));
+ }
+
+ /**
+ * Remove group.
+ */
+ public void testRemoveGroup() throws Exception
+ {
+ createMembership(userName, groupName1, membershipType);
+
+ gHandler.removeGroup(gHandler.findGroupById("/" + groupName1), true);
+
+ assertNull(gHandler.findGroupById("/" + groupName1));
+ assertNull(mHandler.findMembershipByUserGroupAndType(userName, "/" + groupName1, membershipType));
+
+
+ // try to remove not existed groups. We are supposed to get Exception
+ try
+ {
+ Group group = createGroupInstance(null, "not-existed-group", "lable", "desc");
+
+ gHandler.removeGroup(group, true);
+
+ fail("Exception should be thrown");
+ }
+ catch (Exception e)
+ {
+ }
+
+ try
+ {
+ gHandler.removeGroup(null, true);
+ fail("Exception should be thrown");
+ }
+ catch (Exception e)
+ {
+ }
+ }
+
+ /**
+ * Test get listeners.
+ */
+ public void testGetListeners() throws Exception
+ {
+ if (mHandler instanceof MembershipEventListenerHandler)
+ {
+ List<MembershipEventListener> list = ((MembershipEventListenerHandler) mHandler).getMembershipListeners();
+ try
+ {
+ list.clear();
+ fail("We are not supposed to change list of listners");
+ }
+ catch (Exception e)
+ {
+ }
+ }
+ }
+}
Added: core/trunk/exo.core.component.organization.tests/src/test/java/org/exoplatform/services/tck/organization/TestMembershipTypeEventListener.java
===================================================================
--- core/trunk/exo.core.component.organization.tests/src/test/java/org/exoplatform/services/tck/organization/TestMembershipTypeEventListener.java (rev 0)
+++ core/trunk/exo.core.component.organization.tests/src/test/java/org/exoplatform/services/tck/organization/TestMembershipTypeEventListener.java 2011-12-26 12:26:22 UTC (rev 5355)
@@ -0,0 +1,163 @@
+/**
+ *
+ */
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.services.tck.organization;
+
+import org.exoplatform.services.organization.MembershipType;
+import org.exoplatform.services.organization.MembershipTypeEventListener;
+import org.exoplatform.services.organization.MembershipTypeEventListenerHandler;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * @author <a href="dmitry.kuleshov(a)exoplatform.com">Dmitry Kuleshov</a>
+ * @version $Id: TestMembershipTypeHandlerImpl.java 111 2008-11-11 11:11:11Z $
+ */
+public class TestMembershipTypeEventListener extends AbstractOrganizationServiceTest
+{
+
+ /**
+ * Test get listeners.
+ */
+ public void testGetListeners() throws Exception
+ {
+ if (mtHandler instanceof MembershipTypeEventListenerHandler)
+ {
+ List<MembershipTypeEventListener> list =
+ ((MembershipTypeEventListenerHandler)mtHandler).getMembershipTypeListeners();
+
+ assertEquals(1, list.size());
+ try
+ {
+ list.clear();
+ fail("We are not supposed to change list of listeners");
+ }
+ catch (Exception e)
+ {
+ }
+ }
+ }
+
+ /**
+ * Test events.
+ */
+ public void testMembershipTypeEventListener() throws Exception
+ {
+ TesterMembershipTypeEventListener testListener = new TesterMembershipTypeEventListener();
+ mtHandler.addMembershipTypeEventListener(testListener);
+
+ if (mtHandler instanceof MembershipTypeEventListenerHandler)
+ {
+ List<MembershipTypeEventListener> list =
+ ((MembershipTypeEventListenerHandler)mtHandler).getMembershipTypeListeners();
+
+ assertEquals(2, list.size());
+ }
+
+ // Create new membership type. In preSave event there is not recored in db.
+ createMembershipType(membershipType, "desc");
+
+ assertEquals(2, testListener.mtInEvent.size());
+ assertEquals(2, testListener.mtInStorage.size());
+
+ // preSave Event
+ assertEquals(membershipType, testListener.mtInEvent.get(0).getName());
+ assertNull(testListener.mtInStorage.get(0));
+
+ // postSave Event
+ assertEquals(membershipType, testListener.mtInEvent.get(1).getName());
+ assertNotNull(testListener.mtInStorage.get(1));
+ assertEquals(membershipType, testListener.mtInStorage.get(1).getName());
+
+ testListener.mtInEvent.clear();
+ testListener.mtInStorage.clear();
+
+ // Modify membership type. In preSave event there is old record in storage.
+ MembershipType mt = mtHandler.findMembershipType(membershipType);
+ mt.setDescription("newDesc");
+
+ mtHandler.saveMembershipType(mt, true);
+
+ // preSave Event
+ assertEquals(2, testListener.mtInEvent.size());
+ assertEquals(2, testListener.mtInStorage.size());
+
+ assertEquals("newDesc", testListener.mtInEvent.get(0).getDescription());
+ assertEquals("desc", testListener.mtInStorage.get(0).getDescription());
+
+ // postSave Event
+ assertEquals("newDesc", testListener.mtInEvent.get(1).getDescription());
+ assertEquals("newDesc", testListener.mtInStorage.get(1).getDescription());
+
+ testListener.mtInEvent.clear();
+ testListener.mtInStorage.clear();
+
+ // Remove membership type. In preDelete Event there is still record in storage
+ mtHandler.removeMembershipType(membershipType, true);
+
+ assertEquals(2, testListener.mtInEvent.size());
+ assertEquals(2, testListener.mtInStorage.size());
+
+ // preDelete Event
+ assertEquals(membershipType, testListener.mtInEvent.get(0).getName());
+ assertNotNull(testListener.mtInStorage.get(0));
+
+ // postDelete Event
+ assertEquals(membershipType, testListener.mtInEvent.get(1).getName());
+ assertNull(testListener.mtInStorage.get(1));
+
+ testListener.mtInEvent.clear();
+ testListener.mtInStorage.clear();
+
+ }
+
+ private class TesterMembershipTypeEventListener extends MembershipTypeEventListener
+ {
+ List<MembershipType> mtInEvent = new ArrayList<MembershipType>();
+
+ List<MembershipType> mtInStorage = new ArrayList<MembershipType>();
+
+ public void preSave(MembershipType type, boolean isNew) throws Exception
+ {
+ mtInEvent.add(type);
+ mtInStorage.add(mtHandler.findMembershipType(type.getName()));
+ }
+
+ public void postSave(MembershipType type, boolean isNew) throws Exception
+ {
+ mtInEvent.add(type);
+ mtInStorage.add(mtHandler.findMembershipType(type.getName()));
+ }
+
+ public void preDelete(MembershipType type) throws Exception
+ {
+ mtInEvent.add(type);
+ mtInStorage.add(mtHandler.findMembershipType(type.getName()));
+ }
+
+ public void postDelete(MembershipType type) throws Exception
+ {
+ mtInEvent.add(type);
+ mtInStorage.add(mtHandler.findMembershipType(type.getName()));
+ }
+ }
+}
Added: core/trunk/exo.core.component.organization.tests/src/test/java/org/exoplatform/services/tck/organization/TestMembershipTypeHandler.java
===================================================================
--- core/trunk/exo.core.component.organization.tests/src/test/java/org/exoplatform/services/tck/organization/TestMembershipTypeHandler.java (rev 0)
+++ core/trunk/exo.core.component.organization.tests/src/test/java/org/exoplatform/services/tck/organization/TestMembershipTypeHandler.java 2011-12-26 12:26:22 UTC (rev 5355)
@@ -0,0 +1,103 @@
+/**
+ *
+ */
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.services.tck.organization;
+
+import org.exoplatform.services.organization.MembershipType;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * @author <a href="mailto:anatoliy.bazko@exoplatform.com.ua">Anatoliy Bazko</a>
+ * @version $Id: TestMembershipTypeHandlerImpl.java 111 2008-11-11 11:11:11Z $
+ */
+public class TestMembershipTypeHandler extends AbstractOrganizationServiceTest
+{
+
+ /**
+ * Find membership type.
+ */
+ public void testFindMembershipType() throws Exception
+ {
+ MembershipType mt = mtHandler.findMembershipType("manager");
+ assertNotNull(mt);
+ assertEquals(mt.getName(), "manager");
+ assertEquals(mt.getDescription(), "manager membership type");
+
+ // try to find not existed membership type
+ assertNull(mtHandler.findMembershipType("manager_"));
+ }
+
+ /**
+ * Find membership types.
+ */
+ public void testFindMembershipTypes() throws Exception
+ {
+ assertEquals(mtHandler.findMembershipTypes().size(), 3);
+
+ createMembershipType("*", "All membership types");
+ assertEquals(mtHandler.findMembershipTypes().size(), 4);
+
+ mtHandler.removeMembershipType("*", true);
+ assertEquals(mtHandler.findMembershipTypes().size(), 3);
+ }
+
+ /**
+ * Remove membership type.
+ */
+ public void testRemoveMembershipType() throws Exception
+ {
+ createMembership(userName, groupName1, membershipType);
+ assertEquals("We expect to find single membership for user " + userName, 1,
+ mHandler.findMembershipsByUser(userName).size());
+
+ MembershipType mt = mtHandler.removeMembershipType("type", true);
+ assertEquals(mt.getName(), membershipType);
+ assertNull(mtHandler.findMembershipType("type"));
+ assertEquals("We expect to find no membership for user " + userName, 0, mHandler.findMembershipsByUser(userName)
+ .size());
+
+ // try to remove not existed membership type. We are supposed to get "null" instead of Exception
+ try
+ {
+ assertNull(mtHandler.removeMembershipType("not-existed-mt", true));
+ fail("Exception should be thrown");
+ }
+ catch (Exception e)
+ {
+ }
+ }
+
+ /**
+ * Save membership type.
+ */
+ public void testSaveMembershipType() throws Exception
+ {
+ createMembershipType(membershipType, "desc");
+ MembershipType mt = mtHandler.findMembershipType(membershipType);
+
+ // change description
+ mt.setDescription("newDesc");
+ mtHandler.saveMembershipType(mt, true);
+
+ mt = mtHandler.findMembershipType(membershipType);
+ assertEquals(mt.getDescription(), "newDesc");
+ }
+
+}
Added: core/trunk/exo.core.component.organization.tests/src/test/java/org/exoplatform/services/tck/organization/TestUserHandler.java
===================================================================
--- core/trunk/exo.core.component.organization.tests/src/test/java/org/exoplatform/services/tck/organization/TestUserHandler.java (rev 0)
+++ core/trunk/exo.core.component.organization.tests/src/test/java/org/exoplatform/services/tck/organization/TestUserHandler.java 2011-12-26 12:26:22 UTC (rev 5355)
@@ -0,0 +1,345 @@
+/*
+ * Copyright (C) 2003-2008 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.services.tck.organization;
+
+import org.exoplatform.services.organization.Query;
+import org.exoplatform.services.organization.User;
+import org.exoplatform.services.organization.UserEventListener;
+import org.exoplatform.services.organization.UserEventListenerHandler;
+
+import java.util.Calendar;
+import java.util.List;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * @author <a href="mailto:anatoliy.bazko@exoplatform.com.ua">Anatoliy Bazko</a>
+ * @version $Id: TestOrganizationService.java 111 2008-11-11 11:11:11Z $
+ */
+public class TestUserHandler extends AbstractOrganizationServiceTest
+{
+
+ /**
+ * User authentication.
+ */
+ public void testAuthenticate() throws Exception
+ {
+ // authentication with existed user and correct password
+ assertTrue(uHandler.authenticate("demo", "exo"));
+
+ // unknown user authentication
+ assertFalse(uHandler.authenticate("demo_", "exo"));
+
+ // authentication with wrong password
+ assertFalse(uHandler.authenticate("demo", "exo_"));
+ }
+
+ /**
+ * Find user by name.
+ */
+ public void testFindUserByName() throws Exception
+ {
+ // try to find existed user
+ User u = uHandler.findUserByName("demo");
+
+ assertNotNull(u);
+ assertEquals("demo@localhost", u.getEmail());
+ assertEquals("Demo", u.getFirstName());
+ assertEquals("exo", u.getLastName());
+ assertEquals("exo", u.getPassword());
+ assertEquals("demo", u.getUserName());
+
+ // try to find not existed user. We are supposed to get "null" instead of Exception.
+ try
+ {
+ assertNull(uHandler.findUserByName("not-existed-user"));
+ }
+ catch (Exception e)
+ {
+ fail("Exception should not be thrown");
+ }
+ }
+
+ /**
+ * Find users by query.
+ */
+ public void testFindUsersByQuery() throws Exception
+ {
+ createUser("tolik");
+
+ Query query = new Query();
+ query.setEmail("email@test");
+
+ // try to find user by email
+ assertEquals(uHandler.findUsersByQuery(query).getSize(), 1);
+
+ // try to find user by name with mask
+ query = new Query();
+ query.setUserName("*tolik*");
+ assertEquals(uHandler.findUsersByQuery(query).getSize(), 1);
+
+ // try to find user by name with mask
+ query = new Query();
+ query.setUserName("tol*");
+ assertEquals(uHandler.findUsersByQuery(query).getSize(), 1);
+
+ // try to find user by name with mask
+ query = new Query();
+ query.setUserName("*lik");
+ assertEquals(uHandler.findUsersByQuery(query).getSize(), 1);
+
+ // try to find user by name explicitly
+ query = new Query();
+ query.setUserName("tolik");
+ assertEquals(uHandler.findUsersByQuery(query).getSize(), 1);
+
+ // try to find user by name explicitly, case sensitive search
+ query = new Query();
+ query.setUserName("Tolik");
+ assertEquals(uHandler.findUsersByQuery(query).getSize(), 1);
+
+ // try to find user by part of name without mask
+ query = new Query();
+ query.setUserName("tol");
+ assertEquals(uHandler.findUsersByQuery(query).getSize(), 1);
+
+ // try to find user by fist and last names, case sensitive search
+ query = new Query();
+ query.setFirstName("fiRst");
+ query.setLastName("lasT");
+ assertEquals(uHandler.findUsersByQuery(query).getSize(), 1);
+
+ String skipDateTests = System.getProperty("orgservice.test.configuration.skipDateTests");
+ if (!"true".equals(skipDateTests))
+ {
+ // try to find user by login date
+ Calendar calc = Calendar.getInstance();
+ calc.set(Calendar.YEAR, calc.get(Calendar.YEAR) - 1);
+
+ query = new Query();
+ query.setFromLoginDate(calc.getTime());
+ query.setUserName("tolik");
+ assertEquals(uHandler.findUsersByQuery(query).getSize(), 1);
+
+ calc = Calendar.getInstance();
+ calc.set(Calendar.YEAR, calc.get(Calendar.YEAR) + 1);
+
+ query = new Query();
+ query.setFromLoginDate(calc.getTime());
+ assertEquals(uHandler.findUsersByQuery(query).getSize(), 0);
+
+ calc = Calendar.getInstance();
+ calc.set(Calendar.YEAR, calc.get(Calendar.YEAR) - 1);
+
+ query = new Query();
+ query.setToLoginDate(calc.getTime());
+ assertEquals(uHandler.findUsersByQuery(query).getSize(), 0);
+
+ calc = Calendar.getInstance();
+ calc.set(Calendar.YEAR, calc.get(Calendar.YEAR) + 1);
+
+ query = new Query();
+ query.setToLoginDate(calc.getTime());
+ query.setUserName("tolik");
+ assertEquals(uHandler.findUsersByQuery(query).getSize(), 1);
+
+ }
+ }
+
+ /**
+ * Find users.
+ */
+ public void testFindUsers() throws Exception
+ {
+ createUser("tolik");
+
+ Query query = new Query();
+ query.setEmail("email@test");
+
+ // try to find user by email
+ assertEquals(uHandler.findUsersByQuery(query).getSize(), 1);
+
+ // try to find user by name with mask
+ query = new Query();
+ query.setUserName("*tolik*");
+ assertEquals(uHandler.findUsersByQuery(query).getSize(), 1);
+
+ // try to find user by name with mask
+ query = new Query();
+ query.setUserName("tol*");
+ assertEquals(uHandler.findUsersByQuery(query).getSize(), 1);
+
+ // try to find user by name with mask
+ query = new Query();
+ query.setUserName("*lik");
+ assertEquals(uHandler.findUsersByQuery(query).getSize(), 1);
+
+ // try to find user by name explicitly
+ query = new Query();
+ query.setUserName("tolik");
+ assertEquals(uHandler.findUsersByQuery(query).getSize(), 1);
+
+ // try to find user by name explicitly, case sensitive search
+ query = new Query();
+ query.setUserName("Tolik");
+ assertEquals(uHandler.findUsersByQuery(query).getSize(), 1);
+
+ // try to find user by part of name without mask
+ query = new Query();
+ query.setUserName("tol");
+ assertEquals(uHandler.findUsersByQuery(query).getSize(), 1);
+
+ // try to find user by fist and last names, case sensitive search
+ query = new Query();
+ query.setFirstName("fiRst");
+ query.setLastName("lasT");
+ assertEquals(uHandler.findUsersByQuery(query).getSize(), 1);
+
+ String skipDateTests = System.getProperty("orgservice.test.configuration.skipDateTests");
+ if (!"true".equals(skipDateTests))
+ {
+ // try to find user by login date
+ Calendar calc = Calendar.getInstance();
+ calc.set(Calendar.YEAR, calc.get(Calendar.YEAR) - 1);
+
+ query = new Query();
+ query.setFromLoginDate(calc.getTime());
+ query.setUserName("tolik");
+ assertEquals(uHandler.findUsersByQuery(query).getSize(), 1);
+
+ calc = Calendar.getInstance();
+ calc.set(Calendar.YEAR, calc.get(Calendar.YEAR) + 1);
+
+ query = new Query();
+ query.setFromLoginDate(calc.getTime());
+ assertEquals(uHandler.findUsersByQuery(query).getSize(), 0);
+
+ calc = Calendar.getInstance();
+ calc.set(Calendar.YEAR, calc.get(Calendar.YEAR) - 1);
+
+ query = new Query();
+ query.setToLoginDate(calc.getTime());
+ assertEquals(uHandler.findUsersByQuery(query).getSize(), 0);
+
+ calc = Calendar.getInstance();
+ calc.set(Calendar.YEAR, calc.get(Calendar.YEAR) + 1);
+
+ query = new Query();
+ query.setToLoginDate(calc.getTime());
+ query.setUserName("tolik");
+ assertEquals(uHandler.findUsersByQuery(query).getSize(), 1);
+ }
+
+ }
+
+ /**
+ * Get users page list.
+ */
+ public void testGetUserPageList() throws Exception
+ {
+ assertEquals(uHandler.getUserPageList(10).getAll().size(), 4);
+ }
+
+ /**
+ * Find all users.
+ */
+ public void testFindAllUsers() throws Exception
+ {
+ assertEquals(uHandler.findAllUsers().getSize(), 4);
+ }
+
+ /**
+ * Remove user.
+ */
+ public void testRemoveUser() throws Exception
+ {
+ createMembership(userName, groupName2, membershipType);
+
+ assertEquals("We expect to find single membership for user " + userName, 1,
+ mHandler.findMembershipsByUser(userName).size());
+
+ assertNotNull(uHandler.removeUser(userName, true));
+
+ assertNull(upHandler.findUserProfileByName(userName));
+ assertEquals("We expect to find no membership for user " + userName, 0, mHandler.findMembershipsByUser(userName)
+ .size());
+
+ // try to find user after remove. We are supposed to get "null" instead of exception
+ try
+ {
+ assertNull(uHandler.findUserByName(userName + "_"));
+ }
+ catch (Exception e)
+ {
+ fail("Exception should not be thrown");
+ }
+ }
+
+ /**
+ * Save user.
+ */
+ public void testSaveUser() throws Exception
+ {
+ createUser(userName);
+
+ String newEmail = "new@Email";
+
+ // change email and check
+ User u = uHandler.findUserByName(userName);
+ u.setEmail(newEmail);
+
+ uHandler.saveUser(u, true);
+ assertEquals(newEmail, uHandler.findUserByName(userName).getEmail());
+
+ }
+
+ /**
+ * Create user.
+ */
+ public void testCreateUser() throws Exception
+ {
+ User u = uHandler.createUserInstance(userName);
+ u.setEmail("email@test");
+ u.setFirstName("first");
+ u.setLastName("last");
+ u.setPassword("pwd");
+ uHandler.createUser(u, true);
+
+ // check if user exists
+ assertNotNull(uHandler.findUserByName(userName));
+ }
+
+ /**
+ * Test get listeners.
+ */
+ public void testGetListeners() throws Exception
+ {
+ if (uHandler instanceof UserEventListenerHandler)
+ {
+ List<UserEventListener> list = ((UserEventListenerHandler) uHandler).getUserListeners();
+ try
+ {
+ // check if we able to modify the list of listeners
+ list.clear();
+ fail("Exception should not be thrown");
+ }
+ catch (Exception e)
+ {
+ }
+ }
+ }
+}
Added: core/trunk/exo.core.component.organization.tests/src/test/java/org/exoplatform/services/tck/organization/TestUserProfileHandler.java
===================================================================
--- core/trunk/exo.core.component.organization.tests/src/test/java/org/exoplatform/services/tck/organization/TestUserProfileHandler.java (rev 0)
+++ core/trunk/exo.core.component.organization.tests/src/test/java/org/exoplatform/services/tck/organization/TestUserProfileHandler.java 2011-12-26 12:26:22 UTC (rev 5355)
@@ -0,0 +1,158 @@
+/**
+ *
+ */
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.services.tck.organization;
+
+import org.exoplatform.services.organization.UserProfile;
+import org.exoplatform.services.organization.UserProfileEventListener;
+import org.exoplatform.services.organization.UserProfileEventListenerHandler;
+
+import java.util.List;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * @author <a href="mailto:anatoliy.bazko@exoplatform.com.ua">Anatoliy Bazko</a>
+ * @version $Id: TestUserProfileHandlerImpl.java 111 2008-11-11 11:11:11Z $
+ */
+public class TestUserProfileHandler extends AbstractOrganizationServiceTest
+{
+ /**
+ * Find user profile by name.
+ */
+ public void testFindUserProfileByName() throws Exception
+ {
+ createUser(userName);
+ createUserProfile(userName);
+
+ UserProfile up = upHandler.findUserProfileByName(userName);
+ assertNotNull(up);
+ assertEquals(userName, up.getUserName());
+ assertEquals("value1", up.getAttribute("key1"));
+ assertEquals("value2", up.getAttribute("key2"));
+
+ // try to find profile for not existed user. We are supposed to get "null" instead of Exception
+ try
+ {
+ assertNull(upHandler.findUserProfileByName(newUserName));
+ }
+ catch (Exception e)
+ {
+ fail("Exception should not be thrown");
+ }
+
+ // try to find not existed profile. We are supposed to get "null" instead of Exception
+ createUser(newUserName);
+ try
+ {
+ assertNull(upHandler.findUserProfileByName(newUserName));
+ }
+ catch (Exception e)
+ {
+ fail("Exception should not be thrown");
+ }
+ }
+
+ /**
+ * Find user profiles.
+ */
+ public void testFindUserProfiles() throws Exception
+ {
+ createUser(userName);
+ createUserProfile(userName);
+
+ createUser(newUserName);
+ createUserProfile(newUserName);
+
+ assertEquals(upHandler.findUserProfiles().size(), 2);
+ }
+
+ /**
+ * Remove user profile.
+ */
+ public void testRemoveUserProfile() throws Exception
+ {
+ createUser(userName);
+ createUserProfile(userName);
+
+ UserProfile up = upHandler.removeUserProfile(userName, true);
+ assertNotNull(up);
+ assertEquals(up.getAttribute("key1"), "value1");
+ assertEquals(up.getAttribute("key2"), "value2");
+ assertNull(upHandler.findUserProfileByName("userP1"));
+
+ // remove not existed profile. We are supposed to get "null" instead of Exception
+ try
+ {
+ assertNull(upHandler.removeUserProfile(newUserName, true));
+ }
+ catch (Exception e)
+ {
+ fail("Exception should not be thrown");
+ }
+ }
+
+ /**
+ * Save user profile.
+ */
+ public void testSaveUserProfile() throws Exception
+ {
+ createUser(userName);
+ createUserProfile(userName);
+
+ UserProfile up = upHandler.findUserProfileByName(userName);
+ up.setAttribute("key1", "value11");
+ up.setAttribute("key2", null);
+ upHandler.saveUserProfile(up, true);
+
+ up = upHandler.findUserProfileByName(userName);
+ assertEquals(up.getAttribute("key1"), "value11");
+ assertNull(up.getAttribute("key2"));
+
+ // try to save user profile for not existed user
+ try
+ {
+ up = upHandler.createUserProfileInstance(newUserName);
+ upHandler.saveUserProfile(up, true);
+ }
+ catch (Exception e)
+ {
+ fail("Exception should not be thrown");
+ }
+ }
+
+ /**
+ * Test get listeners.
+ */
+ public void testGetListeners() throws Exception
+ {
+ if (upHandler instanceof UserProfileEventListenerHandler)
+ {
+ List<UserProfileEventListener> list = ((UserProfileEventListenerHandler) upHandler).getUserProfileListeners();
+ try
+ {
+ list.clear();
+ fail("We should not able to modife list of listeners");
+ }
+ catch (Exception e)
+ {
+ }
+ }
+ }
+}
12 years, 4 months
exo-jcr SVN: r5354 - in core/trunk: exo.core.component.organization.jdbc and 1 other directories.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-12-26 07:24:40 -0500 (Mon, 26 Dec 2011)
New Revision: 5354
Modified:
core/trunk/exo.core.component.organization.jdbc/pom.xml
core/trunk/exo.core.component.organization.ldap/pom.xml
core/trunk/pom.xml
Log:
EXOJCR-1694: Fixed the build for Sonar
Modified: core/trunk/exo.core.component.organization.jdbc/pom.xml
===================================================================
--- core/trunk/exo.core.component.organization.jdbc/pom.xml 2011-12-26 12:23:30 UTC (rev 5353)
+++ core/trunk/exo.core.component.organization.jdbc/pom.xml 2011-12-26 12:24:40 UTC (rev 5354)
@@ -81,7 +81,7 @@
<dependency>
<groupId>org.exoplatform.core</groupId>
<artifactId>exo.core.component.organization.tests</artifactId>
- <classifier>sources</classifier>
+ <classifier>test-sources</classifier>
<scope>test</scope>
</dependency>
<dependency>
@@ -184,7 +184,7 @@
<artifactItem>
<groupId>org.exoplatform.core</groupId>
<artifactId>exo.core.component.organization.tests</artifactId>
- <classifier>sources</classifier>
+ <classifier>test-sources</classifier>
<type>jar</type>
<overWrite>false</overWrite>
</artifactItem>
Modified: core/trunk/exo.core.component.organization.ldap/pom.xml
===================================================================
--- core/trunk/exo.core.component.organization.ldap/pom.xml 2011-12-26 12:23:30 UTC (rev 5353)
+++ core/trunk/exo.core.component.organization.ldap/pom.xml 2011-12-26 12:24:40 UTC (rev 5354)
@@ -70,7 +70,7 @@
<dependency>
<groupId>org.exoplatform.core</groupId>
<artifactId>exo.core.component.organization.tests</artifactId>
- <classifier>sources</classifier>
+ <classifier>test-sources</classifier>
<scope>test</scope>
</dependency>
<dependency>
@@ -104,7 +104,7 @@
<artifactItem>
<groupId>org.exoplatform.core</groupId>
<artifactId>exo.core.component.organization.tests</artifactId>
- <classifier>sources</classifier>
+ <classifier>test-sources</classifier>
<type>jar</type>
<overWrite>false</overWrite>
</artifactItem>
Modified: core/trunk/pom.xml
===================================================================
--- core/trunk/pom.xml 2011-12-26 12:23:30 UTC (rev 5353)
+++ core/trunk/pom.xml 2011-12-26 12:24:40 UTC (rev 5354)
@@ -40,6 +40,9 @@
<org.exoplatform.framework.junit.version>1.2.1-GA</org.exoplatform.framework.junit.version>
<org.exoplatform.kernel.version>2.3.6-GA-SNAPSHOT</org.exoplatform.kernel.version>
+
+ <!-- Plugins updates -->
+ <version.source.plugin>2.1.2</version.source.plugin>
</properties>
<scm>
@@ -131,7 +134,7 @@
<groupId>org.exoplatform.core</groupId>
<artifactId>exo.core.component.organization.tests</artifactId>
<version>${project.version}</version>
- <classifier>sources</classifier>
+ <classifier>test-sources</classifier>
<scope>test</scope>
</dependency>
12 years, 4 months