mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Have a decrepit basic WCM submit workflow working.
Fixed bug in handling requests for AVM Node properties which don't have a dictionary type definition. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3871 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -837,8 +837,8 @@ public class AVMNodeService extends AbstractNodeServiceImpl implements NodeServi
|
|||||||
for (QName qName : props.keySet())
|
for (QName qName : props.keySet())
|
||||||
{
|
{
|
||||||
PropertyValue value = props.get(qName);
|
PropertyValue value = props.get(qName);
|
||||||
PropertyDefinition def = this.dictionaryService.getProperty(qName);
|
PropertyDefinition def = dictionaryService.getProperty(qName);
|
||||||
result.put(qName, value.getValue(def.getDataType().getName()));
|
result.put(qName, makeSerializableValue(def, value));
|
||||||
}
|
}
|
||||||
// Now spoof properties that are built in.
|
// Now spoof properties that are built in.
|
||||||
result.put(ContentModel.PROP_CREATED, new Date(desc.getCreateDate()));
|
result.put(ContentModel.PROP_CREATED, new Date(desc.getCreateDate()));
|
||||||
@@ -900,7 +900,7 @@ public class AVMNodeService extends AbstractNodeServiceImpl implements NodeServi
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
PropertyDefinition def = this.dictionaryService.getProperty(qname);
|
PropertyDefinition def = this.dictionaryService.getProperty(qname);
|
||||||
return value.getValue(def.getDataType().getName());
|
return makeSerializableValue(def, value);
|
||||||
}
|
}
|
||||||
catch (AVMNotFoundException e)
|
catch (AVMNotFoundException e)
|
||||||
{
|
{
|
||||||
|
@@ -17,9 +17,13 @@
|
|||||||
|
|
||||||
package org.alfresco.repo.avm.wf;
|
package org.alfresco.repo.avm.wf;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.alfresco.repo.workflow.jbpm.JBPMSpringActionHandler;
|
import org.alfresco.repo.workflow.jbpm.JBPMSpringActionHandler;
|
||||||
import org.alfresco.service.cmr.avm.AVMService;
|
import org.alfresco.service.cmr.avm.AVMService;
|
||||||
|
import org.alfresco.service.cmr.avmsync.AVMDifference;
|
||||||
import org.alfresco.service.cmr.avmsync.AVMSyncService;
|
import org.alfresco.service.cmr.avmsync.AVMSyncService;
|
||||||
|
import org.alfresco.service.namespace.QName;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.jbpm.graph.exe.ExecutionContext;
|
import org.jbpm.graph.exe.ExecutionContext;
|
||||||
import org.springframework.beans.factory.BeanFactory;
|
import org.springframework.beans.factory.BeanFactory;
|
||||||
@@ -63,6 +67,21 @@ public class AVMSubmitHandler extends JBPMSpringActionHandler
|
|||||||
public void execute(ExecutionContext executionContext) throws Exception
|
public void execute(ExecutionContext executionContext) throws Exception
|
||||||
{
|
{
|
||||||
String avmSource = (String)executionContext.getContextInstance().getVariable("sourcePath");
|
String avmSource = (String)executionContext.getContextInstance().getVariable("sourcePath");
|
||||||
fgLogger.error("Would be submittting: " + avmSource);
|
String [] storePath = avmSource.split(":");
|
||||||
|
if (storePath.length != 2)
|
||||||
|
{
|
||||||
|
fgLogger.error("Malformed path: " + avmSource);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String webSiteName =
|
||||||
|
fAVMService.getStoreProperty(storePath[0], QName.createQName(null, ".website.name")).
|
||||||
|
getStringValue();
|
||||||
|
String avmDest = webSiteName + "-staging:" + storePath[1];
|
||||||
|
List<AVMDifference> diffs =
|
||||||
|
fAVMSyncService.compare(-1, avmSource, -1, avmDest);
|
||||||
|
// Ignore conflicts and older nodes for now.
|
||||||
|
fAVMSyncService.update(diffs, true, true, false, false);
|
||||||
|
// Now flatten out the source.
|
||||||
|
fAVMSyncService.flatten(avmSource, avmDest);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user