From eac30db6329f05cc7cf2a35613497e357b4db3aa Mon Sep 17 00:00:00 2001 From: abranson Date: Thu, 26 Apr 2012 00:31:26 +0200 Subject: Update for javax.script --- build.xml | 47 +++------ resources/boot/CA/ItemDescriptionFactoryWf.xml | 108 ++++++++++++++++++++- .../boot/SC/CreateNewNumberedVersionFromLast.xml | 44 +++------ resources/boot/SC/InstantiateItem.xml | 11 +-- resources/boot/SC/LocalObjectDefCreator.xml | 59 +++++------ resources/boot/SC/New.xml | 6 -- resources/boot/SC/SetWorkflow.xml | 56 +++++------ 7 files changed, 186 insertions(+), 145 deletions(-) diff --git a/build.xml b/build.xml index 0fc492b..0b934cb 100644 --- a/build.xml +++ b/build.xml @@ -1,33 +1,16 @@ - - - - - - - - - - - - - - - - - - - + + @@ -36,24 +19,11 @@ - - - - + - - - - - - - - - - @@ -68,4 +38,15 @@ + + + + + + + + + + + diff --git a/resources/boot/CA/ItemDescriptionFactoryWf.xml b/resources/boot/CA/ItemDescriptionFactoryWf.xml index 43cdfc1..270c473 100644 --- a/resources/boot/CA/ItemDescriptionFactoryWf.xml +++ b/resources/boot/CA/ItemDescriptionFactoryWf.xml @@ -1 +1,107 @@ -713671213CreateItem612 \ No newline at end of file + + + + + + + + + + 7 + + + + + + + + + + + 13 + 6 + 7 + + + + + + + + + + + + + 12 + 13 + + + + + CreateItem + + + + + + + + 6 + 12 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/resources/boot/SC/CreateNewNumberedVersionFromLast.xml b/resources/boot/SC/CreateNewNumberedVersionFromLast.xml index bb66f4c..321855a 100644 --- a/resources/boot/SC/CreateNewNumberedVersionFromLast.xml +++ b/resources/boot/SC/CreateNewNumberedVersionFromLast.xml @@ -3,37 +3,25 @@ diff --git a/resources/boot/SC/InstantiateItem.xml b/resources/boot/SC/InstantiateItem.xml index 0f16a65..4e80e9d 100644 --- a/resources/boot/SC/InstantiateItem.xml +++ b/resources/boot/SC/InstantiateItem.xml @@ -4,12 +4,6 @@ diff --git a/resources/boot/SC/LocalObjectDefCreator.xml b/resources/boot/SC/LocalObjectDefCreator.xml index 445a517..32b154c 100644 --- a/resources/boot/SC/LocalObjectDefCreator.xml +++ b/resources/boot/SC/LocalObjectDefCreator.xml @@ -8,10 +8,6 @@ importClass(Packages.com.c2kernel.lifecycle.CompositeActivityDef); importClass(Packages.com.c2kernel.lifecycle.ActivityDef); - var job = bsf.lookupBean("job"); - var item = bsf.lookupBean("item"); - var agent = bsf.lookupBean("agent"); - var errorBuffer = bsf.lookupBean("errors"); var type = job.getActPropString("NewType"); var name = job.getOutcome().getField("ObjectName"); var folder = job.getOutcome().getField("SubFolder"); @@ -24,40 +20,35 @@ params[1] = domPath; // Create the new item - if (!(errorBuffer.getFatal())) { - try { - agent.execute(item, "CreateItemFromDescription", params); - } catch (e) { - errorBuffer.addError("Could not create "+name+": "+e.message); - errorBuffer.setFatal(); - } + try { + agent.execute(item, "CreateItemFromDescription", params); + } catch (e) { + throw "Could not create "+name+": "+e.message; } // Store a fresh one in the new item - if (!(errorBuffer.getFatal())) { - var newObj; - // Activities are serialized new instances - if (type.equals("EA") || type.equals("CA")) { - var newAct = type.equals("CA")?new CompositeActivityDef(): new ActivityDef(); - newAct.setName(name); - newObj = CastorXMLUtility.marshall(newAct); - } - else { - // Empty schemas and scripts are stored as outcomes of the factory. - var fileType = type.equals("OD")?"Schema":"Script"; - newObj = item.getObject("/ViewPoint/"+fileType+"/last").getOutcome().getData(); + + var newObj; + // Activities are serialized new instances + if (type.equals("EA") || type.equals("CA")) { + var newAct = type.equals("CA")?new CompositeActivityDef(): new ActivityDef(); + newAct.setName(name); + newObj = CastorXMLUtility.marshall(newAct); } - // Store the new object with the 'EditDefinition' activity - var newPath = new Packages.com.c2kernel.lookup.DomainPath(domPath+"/"+name); - var newItem = agent.getItem(newPath); - newItem.requestAction(agent.getSystemKey(), "workflow/domain/EditDefinition", 4, newObj); - - // If this script is running in the Cristal GUI, open the new item. - var tree = Packages.com.c2kernel.gui.MainFrame.treeBrowser; - if (tree != null) // open new item in the gui - tree.push(newPath); - + else { + // Empty schemas and scripts are stored as outcomes of the factory. + var fileType = type.equals("OD")?"Schema":"Script"; + newObj = item.getObject("/ViewPoint/"+fileType+"/last").getOutcome().getData(); } - errorBuffer; + // Store the new object with the 'EditDefinition' activity + var newPath = new Packages.com.c2kernel.lookup.DomainPath(domPath+"/"+name); + var newItem = agent.getItem(newPath); + newItem.requestAction(agent.getSystemKey(), "workflow/domain/EditDefinition", 4, newObj); + + // If this script is running in the Cristal GUI, open the new item. + var tree = Packages.com.c2kernel.gui.MainFrame.treeBrowser; + if (tree != null) // open new item in the gui + tree.push(newPath); + ]]> diff --git a/resources/boot/SC/New.xml b/resources/boot/SC/New.xml index a706310..a07a7b9 100644 --- a/resources/boot/SC/New.xml +++ b/resources/boot/SC/New.xml @@ -3,11 +3,5 @@ diff --git a/resources/boot/SC/SetWorkflow.xml b/resources/boot/SC/SetWorkflow.xml index 5dbfa6d..88a061f 100644 --- a/resources/boot/SC/SetWorkflow.xml +++ b/resources/boot/SC/SetWorkflow.xml @@ -1,14 +1,9 @@ - -- cgit v1.2.3