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);
/**
* 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.
*/

View File

@@ -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();

View File

@@ -252,6 +252,13 @@
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

View File

@@ -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);
}
}

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 (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

View File

@@ -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(':', '_');
}