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:
Derek Hulley
2008-02-26 15:28:17 +00:00
parent fecfd82767
commit 8c434ca496
6 changed files with 73 additions and 31 deletions

View File

@@ -95,6 +95,13 @@ public interface AVMNodeDAO
*/ */
public List<AVMNode> getNewInStore(AVMStore store); 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. * Inappropriate hack to get Hibernate to play nice.
*/ */

View File

@@ -247,10 +247,11 @@ public class AVMStoreImpl implements AVMStore, Serializable
*/ */
} }
// Clear out the new nodes. // 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>(); List<AVMNode> layeredNodes = new ArrayList<AVMNode>();
for (AVMNode newGuy : newInRep) for (Long newGuyID : newInRep)
{ {
AVMNode newGuy = AVMDAOs.Instance().fAVMNodeDAO.getByID(newGuyID);
newGuy.setStoreNew(null); newGuy.setStoreNew(null);
Layered layered = null; Layered layered = null;
if (newGuy.getType() == AVMNodeType.LAYERED_DIRECTORY && if (newGuy.getType() == AVMNodeType.LAYERED_DIRECTORY &&
@@ -285,6 +286,10 @@ public class AVMStoreImpl implements AVMStore, Serializable
layered.setIndirectionVersion(snapShotMap.get(storeName)); layered.setIndirectionVersion(snapShotMap.get(storeName));
} }
} }
else
{
AVMDAOs.Instance().fAVMNodeDAO.evict(newGuy);
}
} }
// Make up a new version record. // Make up a new version record.
String user = RawServices.Instance().getAuthenticationComponent().getCurrentUserName(); String user = RawServices.Instance().getAuthenticationComponent().getCurrentUserName();

View File

@@ -10,22 +10,22 @@
<class table="avm_nodes" abstract="true" <class table="avm_nodes" abstract="true"
name="AVMNodeImpl" name="AVMNodeImpl"
proxy="AVMNode" proxy="AVMNode"
optimistic-lock="version" optimistic-lock="version"
lazy="true"> lazy="true">
<cache usage="read-write"/> <cache usage="read-write"/>
<!-- The id is set programmatically using an Issuer. See below. --> <!-- The id is set programmatically using an Issuer. See below. -->
<id name="id" <id name="id"
column="id" column="id"
type="long"/> 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. --> We'll see if using a string makes a difference. -->
<discriminator column="class_type" <discriminator column="class_type"
type="string" type="string"
length="20"/> length="20"/>
<!-- We're using hibernate's own versioning scheme for concurrency control. <!-- 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. --> I don't know how well that will play with a full Spring-JTA stack. -->
<version column="vers" <version column="vers"
name="vers" name="vers"
type="long"/> type="long"/>
<!-- This should really be not null, but I haven't figured out <!-- This should really be not null, but I haven't figured out
the right way to build the relation so that nullability constraints the right way to build the relation so that nullability constraints
@@ -75,8 +75,8 @@
<property name="deletedType" type="int"/> <property name="deletedType" type="int"/>
</subclass> </subclass>
<!-- Directories, two flavors. --> <!-- Directories, two flavors. -->
<subclass name="DirectoryNodeImpl" <subclass name="DirectoryNodeImpl"
proxy="DirectoryNode" proxy="DirectoryNode"
abstract="true" abstract="true"
lazy="true"> lazy="true">
<!-- A Layered Directory is our smart symlink thingy. --> <!-- A Layered Directory is our smart symlink thingy. -->
@@ -221,7 +221,7 @@
<property name="serializableValue" column="serializable_value" type="serializable" length="16384"/> <property name="serializableValue" column="serializable_value" type="serializable" length="16384"/>
</component> </component>
</class> </class>
<!-- Aspect name table for AVM Nodes. --> <!-- Aspect name table for AVM Nodes. -->
<class name="AVMAspectNameImpl" proxy="AVMAspectName" table="avm_aspects"> <class name="AVMAspectNameImpl" proxy="AVMAspectName" table="avm_aspects">
<id name="id" column="id" type="long"> <id name="id" column="id" type="long">
<generator class="native"/> <generator class="native"/>
@@ -230,7 +230,7 @@
<property name="name" column="qname" type="QName" length="200"/> <property name="name" column="qname" type="QName" length="200"/>
</class> </class>
<!-- When a snapshot is created we stow away all of the layered <!-- 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. --> snapshots can find them and force copies. -->
<class name="VersionLayeredNodeEntryImpl" proxy="VersionLayeredNodeEntry" <class name="VersionLayeredNodeEntryImpl" proxy="VersionLayeredNodeEntry"
table="avm_version_layered_node_entry"> table="avm_version_layered_node_entry">
@@ -252,9 +252,16 @@
where an.storeNew = :store where an.storeNew = :store
]]> ]]>
</query> </query>
<query name="AVMNode.GetNewInStoreID">
<![CDATA[
select an.id
from AVMNodeImpl an
where an.storeNew = :store
]]>
</query>
<query name="AVMNode.GetDescendents"> <query name="AVMNode.GetDescendents">
<![CDATA[ <![CDATA[
select hl.descendent select hl.descendent
from HistoryLinkImpl hl from HistoryLinkImpl hl
where hl.ancestor = :node where hl.ancestor = :node
]]> ]]>
@@ -295,10 +302,10 @@
</query> </query>
<query name="FindOrphans"> <query name="FindOrphans">
<![CDATA[ <![CDATA[
from AVMNodeImpl an from AVMNodeImpl an
where where
an not in ( select ce.child an not in ( select ce.child
from ChildEntryImpl ce ) from ChildEntryImpl ce )
and an.isRoot = false and an.isRoot = false
]]> ]]>
</query> </query>
@@ -311,5 +318,5 @@
where pfn.contentURL is not null where pfn.contentURL is not null
]]> ]]>
</query> </query>
</hibernate-mapping> </hibernate-mapping>

View File

@@ -170,6 +170,17 @@ class AVMNodeDAOHibernate extends HibernateDaoSupport implements
return (List<AVMNode>)query.list(); 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. * Inappropriate hack to get Hibernate to play nice.
*/ */
@@ -218,5 +229,7 @@ class AVMNodeDAOHibernate extends HibernateDaoSupport implements
*/ */
public void evict(AVMNode node) public void evict(AVMNode node)
{ {
getSession().flush();
getSession().evict(node);
} }
} }

View File

@@ -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 (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
}
else
{
if (logger.isDebugEnabled() == true)
{ {
logger.debug(" >> Executed this rule (" + rule.getTitle()+ ") on (" + actionedUponNodeRef.getId() + ") copiedFrom is not is list"); if (logger.isDebugEnabled() == true)
logger.debug(" > Checking copy"); {
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 else

View File

@@ -2557,7 +2557,8 @@ public class JBPMEngine extends BPMEngine
private QName mapNameToQName(String name) private QName mapNameToQName(String name)
{ {
QName qname = null; 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 try
{ {
qname = QName.createQName(qnameStr, this.namespaceService); qname = QName.createQName(qnameStr, this.namespaceService);
@@ -2577,7 +2578,13 @@ public class JBPMEngine extends BPMEngine
*/ */
private String mapQNameToName(QName name) 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); String nameStr = name.toPrefixString(this.namespaceService);
if (nameStr.indexOf('_') != -1 && nameStr.indexOf('_') < nameStr.indexOf(':'))
{
return nameStr.replace(':', '}');
}
return nameStr.replace(':', '_'); return nameStr.replace(':', '_');
} }