mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Merged V2.2 to HEAD
7530: Merged V2.1 to V2.2 7378: Fix AR-1862: Failure to map Alfresco properties whose namespace prefix contains _ to jBPM variable 7379: Fixes to handling of invalid web script definitions on startup of server. Done previously 7379: HEAD rev 8343 (CHK-2418) 7380: Adds some evicts during snapshotting to reduce 1st level cache use for large snapshots. 7385: Fix for File Upload message XSS (or not) issue Outstanding 7391: Fix for AWC-1686 - WebClientPortletAuthenticator does not start usertxn when calling public services Outstanding 7394: AR-1875: New Edition on a multilingual document when a rule is present on the parent space 7396: Fix AR-1873: Add Location to webscript response status Done previously in HEAD rev 8344 (CHK-2419) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8384 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -95,6 +95,13 @@ public interface AVMNodeDAO
|
||||
*/
|
||||
public List<AVMNode> getNewInStore(AVMStore store);
|
||||
|
||||
/**
|
||||
* Get the id's of all AVMNodes new in a given store.
|
||||
* @param store
|
||||
* @return
|
||||
*/
|
||||
public List<Long> getNewInStoreIDs(AVMStore store);
|
||||
|
||||
/**
|
||||
* Inappropriate hack to get Hibernate to play nice.
|
||||
*/
|
||||
|
@@ -247,10 +247,11 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
||||
*/
|
||||
}
|
||||
// Clear out the new nodes.
|
||||
List<AVMNode> newInRep = AVMDAOs.Instance().fAVMNodeDAO.getNewInStore(this);
|
||||
List<Long> newInRep = AVMDAOs.Instance().fAVMNodeDAO.getNewInStoreIDs(this);
|
||||
List<AVMNode> layeredNodes = new ArrayList<AVMNode>();
|
||||
for (AVMNode newGuy : newInRep)
|
||||
for (Long newGuyID : newInRep)
|
||||
{
|
||||
AVMNode newGuy = AVMDAOs.Instance().fAVMNodeDAO.getByID(newGuyID);
|
||||
newGuy.setStoreNew(null);
|
||||
Layered layered = null;
|
||||
if (newGuy.getType() == AVMNodeType.LAYERED_DIRECTORY &&
|
||||
@@ -285,6 +286,10 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
||||
layered.setIndirectionVersion(snapShotMap.get(storeName));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
AVMDAOs.Instance().fAVMNodeDAO.evict(newGuy);
|
||||
}
|
||||
}
|
||||
// Make up a new version record.
|
||||
String user = RawServices.Instance().getAuthenticationComponent().getCurrentUserName();
|
||||
|
@@ -10,22 +10,22 @@
|
||||
<class table="avm_nodes" abstract="true"
|
||||
name="AVMNodeImpl"
|
||||
proxy="AVMNode"
|
||||
optimistic-lock="version"
|
||||
optimistic-lock="version"
|
||||
lazy="true">
|
||||
<cache usage="read-write"/>
|
||||
<!-- The id is set programmatically using an Issuer. See below. -->
|
||||
<id name="id"
|
||||
column="id"
|
||||
<id name="id"
|
||||
column="id"
|
||||
type="long"/>
|
||||
<!-- I suppose this would be more efficient to encode type by an int.
|
||||
<!-- I suppose this would be more efficient to encode type by an int.
|
||||
We'll see if using a string makes a difference. -->
|
||||
<discriminator column="class_type"
|
||||
type="string"
|
||||
<discriminator column="class_type"
|
||||
type="string"
|
||||
length="20"/>
|
||||
<!-- We're using hibernate's own versioning scheme for concurrency control.
|
||||
I don't know how well that will play with a full Spring-JTA stack. -->
|
||||
<version column="vers"
|
||||
name="vers"
|
||||
<version column="vers"
|
||||
name="vers"
|
||||
type="long"/>
|
||||
<!-- This should really be not null, but I haven't figured out
|
||||
the right way to build the relation so that nullability constraints
|
||||
@@ -75,8 +75,8 @@
|
||||
<property name="deletedType" type="int"/>
|
||||
</subclass>
|
||||
<!-- Directories, two flavors. -->
|
||||
<subclass name="DirectoryNodeImpl"
|
||||
proxy="DirectoryNode"
|
||||
<subclass name="DirectoryNodeImpl"
|
||||
proxy="DirectoryNode"
|
||||
abstract="true"
|
||||
lazy="true">
|
||||
<!-- A Layered Directory is our smart symlink thingy. -->
|
||||
@@ -221,7 +221,7 @@
|
||||
<property name="serializableValue" column="serializable_value" type="serializable" length="16384"/>
|
||||
</component>
|
||||
</class>
|
||||
<!-- Aspect name table for AVM Nodes. -->
|
||||
<!-- Aspect name table for AVM Nodes. -->
|
||||
<class name="AVMAspectNameImpl" proxy="AVMAspectName" table="avm_aspects">
|
||||
<id name="id" column="id" type="long">
|
||||
<generator class="native"/>
|
||||
@@ -230,7 +230,7 @@
|
||||
<property name="name" column="qname" type="QName" length="200"/>
|
||||
</class>
|
||||
<!-- When a snapshot is created we stow away all of the layered
|
||||
nodes that were frozen by the snapshot so that subsequent
|
||||
nodes that were frozen by the snapshot so that subsequent
|
||||
snapshots can find them and force copies. -->
|
||||
<class name="VersionLayeredNodeEntryImpl" proxy="VersionLayeredNodeEntry"
|
||||
table="avm_version_layered_node_entry">
|
||||
@@ -252,9 +252,16 @@
|
||||
where an.storeNew = :store
|
||||
]]>
|
||||
</query>
|
||||
<query name="AVMNode.GetNewInStoreID">
|
||||
<![CDATA[
|
||||
select an.id
|
||||
from AVMNodeImpl an
|
||||
where an.storeNew = :store
|
||||
]]>
|
||||
</query>
|
||||
<query name="AVMNode.GetDescendents">
|
||||
<![CDATA[
|
||||
select hl.descendent
|
||||
select hl.descendent
|
||||
from HistoryLinkImpl hl
|
||||
where hl.ancestor = :node
|
||||
]]>
|
||||
@@ -295,10 +302,10 @@
|
||||
</query>
|
||||
<query name="FindOrphans">
|
||||
<![CDATA[
|
||||
from AVMNodeImpl an
|
||||
from AVMNodeImpl an
|
||||
where
|
||||
an not in ( select ce.child
|
||||
from ChildEntryImpl ce )
|
||||
an not in ( select ce.child
|
||||
from ChildEntryImpl ce )
|
||||
and an.isRoot = false
|
||||
]]>
|
||||
</query>
|
||||
@@ -311,5 +318,5 @@
|
||||
where pfn.contentURL is not null
|
||||
]]>
|
||||
</query>
|
||||
|
||||
|
||||
</hibernate-mapping>
|
||||
|
@@ -170,6 +170,17 @@ class AVMNodeDAOHibernate extends HibernateDaoSupport implements
|
||||
return (List<AVMNode>)query.list();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.repo.avm.AVMNodeDAO#getNewInStoreIDs(org.alfresco.repo.avm.AVMStore)
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<Long> getNewInStoreIDs(AVMStore store)
|
||||
{
|
||||
Query query = getSession().getNamedQuery("AVMNode.GetNewInStoreID");
|
||||
query.setEntity("store", store);
|
||||
return (List<Long>)query.list();
|
||||
}
|
||||
|
||||
/**
|
||||
* Inappropriate hack to get Hibernate to play nice.
|
||||
*/
|
||||
@@ -218,5 +229,7 @@ class AVMNodeDAOHibernate extends HibernateDaoSupport implements
|
||||
*/
|
||||
public void evict(AVMNode node)
|
||||
{
|
||||
getSession().flush();
|
||||
getSession().evict(node);
|
||||
}
|
||||
}
|
||||
|
@@ -987,22 +987,25 @@ public class RuleServiceImpl implements RuleService, RuntimeRuleService
|
||||
|
||||
if (logger.isDebugEnabled() == true && copiedFrom != null) {logger.debug(" >> Got the copedFrom nodeRef (" + copiedFrom.getId() + ")");};
|
||||
|
||||
if (copiedFrom != null && executedRules.contains(new ExecutedRuleData(copiedFrom, rule)) == true)
|
||||
if (copiedFrom != null)
|
||||
{
|
||||
if (logger.isDebugEnabled() == true)
|
||||
if (executedRules.contains(new ExecutedRuleData(copiedFrom, rule)) == true)
|
||||
{
|
||||
logger.debug(" >> Already executed this rule (" + rule.getTitle()+ ") on this the copied from nodeRef (" + copiedFrom.getId() + ")");
|
||||
if (logger.isDebugEnabled() == true)
|
||||
{
|
||||
logger.debug(" >> Already executed this rule (" + rule.getTitle()+ ") on this the copied from nodeRef (" + copiedFrom.getId() + ")");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (logger.isDebugEnabled() == true)
|
||||
else
|
||||
{
|
||||
logger.debug(" >> Executed this rule (" + rule.getTitle()+ ") on (" + actionedUponNodeRef.getId() + ") copiedFrom is not is list");
|
||||
logger.debug(" > Checking copy");
|
||||
if (logger.isDebugEnabled() == true)
|
||||
{
|
||||
logger.debug(" >> Executed this rule (" + rule.getTitle()+ ") on (" + actionedUponNodeRef.getId() + ") copiedFrom is not is list");
|
||||
logger.debug(" > Checking copy");
|
||||
}
|
||||
result = checkForCopy(executedRules, copiedFrom, rule);
|
||||
}
|
||||
result = checkForCopy(executedRules, copiedFrom, rule);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@@ -2557,7 +2557,8 @@ public class JBPMEngine extends BPMEngine
|
||||
private QName mapNameToQName(String name)
|
||||
{
|
||||
QName qname = null;
|
||||
String qnameStr = name.replaceFirst("_", ":");
|
||||
// NOTE: Map names using old conversion scheme (i.e. : -> _) as well as new scheme (i.e. } -> _)
|
||||
String qnameStr = (name.indexOf('}') == -1) ? name.replaceFirst("_", ":") : name.replace("}", ":");
|
||||
try
|
||||
{
|
||||
qname = QName.createQName(qnameStr, this.namespaceService);
|
||||
@@ -2577,7 +2578,13 @@ public class JBPMEngine extends BPMEngine
|
||||
*/
|
||||
private String mapQNameToName(QName name)
|
||||
{
|
||||
// NOTE: Map names using old conversion scheme (i.e. : -> _) as well as new scheme (i.e. } -> _)
|
||||
// NOTE: Use new scheme
|
||||
String nameStr = name.toPrefixString(this.namespaceService);
|
||||
if (nameStr.indexOf('_') != -1 && nameStr.indexOf('_') < nameStr.indexOf(':'))
|
||||
{
|
||||
return nameStr.replace(':', '}');
|
||||
}
|
||||
return nameStr.replace(':', '_');
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user