diff options
| author | Andrew Branson <andrew.branson@cern.ch> | 2012-06-04 15:37:34 +0200 |
|---|---|---|
| committer | Andrew Branson <andrew.branson@cern.ch> | 2012-06-04 15:37:34 +0200 |
| commit | 388a76a73c8a8131c7af8df2ba03cf16511c8ea5 (patch) | |
| tree | 473206237625785b7828dd73c7e7be8b184bfba0 /resources/boot/SC/LocalObjectDefCreator.xml | |
| parent | eac30db6329f05cc7cf2a35613497e357b4db3aa (diff) | |
Mavenized
Diffstat (limited to 'resources/boot/SC/LocalObjectDefCreator.xml')
| -rw-r--r-- | resources/boot/SC/LocalObjectDefCreator.xml | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/resources/boot/SC/LocalObjectDefCreator.xml b/resources/boot/SC/LocalObjectDefCreator.xml deleted file mode 100644 index 32b154c..0000000 --- a/resources/boot/SC/LocalObjectDefCreator.xml +++ /dev/null @@ -1,54 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<cristalscript>
- <output name="errors" type="com.c2kernel.scripting.ErrorInfo"/>
- <script language="javascript" name="LocalObjectDefCreator"><![CDATA[
- importClass(Packages.com.c2kernel.utils.CastorXMLUtility);
- importClass(Packages.com.c2kernel.utils.Resource);
- importClass(Packages.com.c2kernel.process.Bootstrap);
- importClass(Packages.com.c2kernel.lifecycle.CompositeActivityDef);
- importClass(Packages.com.c2kernel.lifecycle.ActivityDef);
-
- var type = job.getActPropString("NewType");
- var name = job.getOutcome().getField("ObjectName");
- var folder = job.getOutcome().getField("SubFolder");
- // Find the root of that object type
- var domPath = Bootstrap.getTypeRoot(type).toString();
- if (folder != null) domPath = domPath + "/" + folder.getData();
-
- var params = new Array(2);
- params[0] = name;
- params[1] = domPath;
-
- // Create the new item
- try {
- agent.execute(item, "CreateItemFromDescription", params);
- } catch (e) {
- throw "Could not create "+name+": "+e.message;
- }
-
- // Store a fresh one in the new item
-
- 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();
- }
- // 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);
-
- ]]></script>
-</cristalscript>
|
