mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Merged V2.2 to HEAD
8405: Added causal exception to the runtime generated 8408: AR-2136, AR-2137, AR-2138 8410: WCM-1110, WCM-1111 8417: Stopped chiba:match() function from being inserted into bindings for xforms model elements of type xs:integer. 8419: Fixes for correct use of .empty in name spaces of QNames 8420: Finally fixes WCM-1108 and WCM-1109 8489: Merged V2.1 to V2.2 8482: Fix For AR-2163 8507: Merged V2.1 to V2.2 8504: Fix for AR-2165 - respect repo read only setting during authentication git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8508 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -101,6 +101,8 @@ public class AclDaoComponentImpl extends HibernateDaoSupport implements AclDaoCo
|
||||
static String QUERY_GET_LAYERED_DIRECTORIES = "permission.GetLayeredDirectories";
|
||||
|
||||
static String QUERY_GET_LAYERED_FILES = "permission.GetLayeredFiles";
|
||||
|
||||
static String QUERY_GET_NEW_IN_STORE = "permission.GetNewInStore";
|
||||
|
||||
/** Access to QName entities */
|
||||
private QNameDAO qnameDAO;
|
||||
@@ -1825,14 +1827,22 @@ public class AclDaoComponentImpl extends HibernateDaoSupport implements AclDaoCo
|
||||
try
|
||||
{
|
||||
Session session = getSession();
|
||||
session.connection().setTransactionIsolation(1);
|
||||
Query query = getSession().getNamedQuery("permission.GetAVMHeadNodeCount");
|
||||
Long answer = (Long) query.uniqueResult();
|
||||
return answer;
|
||||
int isolationLevel = session.connection().getTransactionIsolation();
|
||||
try
|
||||
{
|
||||
session.connection().setTransactionIsolation(1);
|
||||
Query query = getSession().getNamedQuery("permission.GetAVMHeadNodeCount");
|
||||
Long answer = (Long) query.uniqueResult();
|
||||
return answer;
|
||||
}
|
||||
finally
|
||||
{
|
||||
session.connection().setTransactionIsolation(isolationLevel);
|
||||
}
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Failed to set TX isolation level");
|
||||
throw new AlfrescoRuntimeException("Failed to set TX isolation level", e);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1842,33 +1852,77 @@ public class AclDaoComponentImpl extends HibernateDaoSupport implements AclDaoCo
|
||||
try
|
||||
{
|
||||
Session session = getSession();
|
||||
session.connection().setTransactionIsolation(1);
|
||||
Query query = getSession().getNamedQuery("permission.GetMaxAclId");
|
||||
Long answer = (Long) query.uniqueResult();
|
||||
return answer;
|
||||
int isolationLevel = session.connection().getTransactionIsolation();
|
||||
try
|
||||
{
|
||||
session.connection().setTransactionIsolation(1);
|
||||
Query query = getSession().getNamedQuery("permission.GetMaxAclId");
|
||||
Long answer = (Long) query.uniqueResult();
|
||||
return answer;
|
||||
}
|
||||
finally
|
||||
{
|
||||
session.connection().setTransactionIsolation(isolationLevel);
|
||||
}
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Failed to set TX isolation level");
|
||||
throw new AlfrescoRuntimeException("Failed to set TX isolation level", e);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean supportsProgressTracking()
|
||||
{
|
||||
try
|
||||
{
|
||||
Session session = getSession();
|
||||
return session.connection().getMetaData().supportsTransactionIsolationLevel(1);
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public Long getAVMNodeCountWithNewACLS(Long above)
|
||||
{
|
||||
try
|
||||
{
|
||||
Session session = getSession();
|
||||
session.connection().setTransactionIsolation(1);
|
||||
Query query = getSession().getNamedQuery("permission.GetAVMHeadNodeCountWherePermissionsHaveChanged");
|
||||
query.setParameter("above", above);
|
||||
Long answer = (Long) query.uniqueResult();
|
||||
return answer;
|
||||
int isolationLevel = session.connection().getTransactionIsolation();
|
||||
try
|
||||
{
|
||||
session.connection().setTransactionIsolation(1);
|
||||
Query query = getSession().getNamedQuery("permission.GetAVMHeadNodeCountWherePermissionsHaveChanged");
|
||||
query.setParameter("above", above);
|
||||
Long answer = (Long) query.uniqueResult();
|
||||
return answer;
|
||||
}
|
||||
finally
|
||||
{
|
||||
session.connection().setTransactionIsolation(isolationLevel);
|
||||
}
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Failed to set TX isolation level");
|
||||
throw new AlfrescoRuntimeException("Failed to set TX isolation level", e);
|
||||
}
|
||||
}
|
||||
|
||||
public Long getNewInStore()
|
||||
{
|
||||
HibernateCallback callback = new HibernateCallback()
|
||||
{
|
||||
public Object doInHibernate(Session session)
|
||||
{
|
||||
Query query = session.getNamedQuery(QUERY_GET_NEW_IN_STORE);
|
||||
return query.uniqueResult();
|
||||
}
|
||||
};
|
||||
Long count = (Long) getHibernateTemplate().execute(callback);
|
||||
return count;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<Indirection> getLayeredDirectories()
|
||||
@@ -1883,16 +1937,16 @@ public class AclDaoComponentImpl extends HibernateDaoSupport implements AclDaoCo
|
||||
};
|
||||
List<Object[]> results = (List<Object[]>) getHibernateTemplate().execute(callback);
|
||||
ArrayList<Indirection> indirections = new ArrayList<Indirection>(results.size());
|
||||
for(Object[] row : results)
|
||||
for (Object[] row : results)
|
||||
{
|
||||
Long from = (Long)row[0];
|
||||
Long from = (Long) row[0];
|
||||
String to = (String) row[1];
|
||||
Integer version = (Integer) row[2];
|
||||
indirections.add(new Indirection(from, to, version));
|
||||
}
|
||||
return indirections;
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<Indirection> getLayeredFiles()
|
||||
{
|
||||
@@ -1906,16 +1960,16 @@ public class AclDaoComponentImpl extends HibernateDaoSupport implements AclDaoCo
|
||||
};
|
||||
List<Object[]> results = (List<Object[]>) getHibernateTemplate().execute(callback);
|
||||
ArrayList<Indirection> indirections = new ArrayList<Indirection>(results.size());
|
||||
for(Object[] row : results)
|
||||
for (Object[] row : results)
|
||||
{
|
||||
Long from = (Long)row[0];
|
||||
Long from = (Long) row[0];
|
||||
String to = (String) row[1];
|
||||
Integer version = (Integer) row[2];
|
||||
indirections.add(new Indirection(from, to, version));
|
||||
}
|
||||
return indirections;
|
||||
}
|
||||
|
||||
|
||||
public List<Indirection> getAvmIndirections()
|
||||
{
|
||||
List<Indirection> dirList = getLayeredDirectories();
|
||||
@@ -1936,7 +1990,7 @@ public class AclDaoComponentImpl extends HibernateDaoSupport implements AclDaoCo
|
||||
Long from;
|
||||
|
||||
String to;
|
||||
|
||||
|
||||
Integer toVersion;
|
||||
|
||||
Indirection(Long from, String to, Integer toVersion)
|
||||
@@ -1960,8 +2014,6 @@ public class AclDaoComponentImpl extends HibernateDaoSupport implements AclDaoCo
|
||||
{
|
||||
return toVersion;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user