org.cristalise.dev.resources.boot.SC.InstantiateItem.xml Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cristalise-dev Show documentation
Show all versions of cristalise-dev Show documentation
CRISTAL-iSE Development Module
<!-- This file is part of the CRISTAL-iSE Development Module. Copyright (c) 2001-2017 The CRISTAL Consortium. All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; with out even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. http://www.fsf.org/licensing/licenses/lgpl.html --> <cristalscript> <param name="item" type="org.cristalise.kernel.entity.proxy.ItemProxy" /> <param name="agent" type="org.cristalise.kernel.entity.proxy.AgentProxy" /> <param name="job" type="org.cristalise.kernel.entity.agent.Job" /> <output name="errors" type="org.cristalise.kernel.scripting.ErrorInfo" /> <script language="javascript" name="InstantiateItem"><![CDATA[ // Get parameters from outcome var name = job.getOutcome().getField("ObjectName"); var folder = job.getOutcome().getField("SubFolder"); var root = job.getActPropString("Root"); var domPath = (root != null?root:"") + "/" + (folder != null?folder:""); // Create new Item var params = new Array(2); params[0] = name; params[1] = domPath; try { agent.execute(item, "CreateItemFromDescription", params); } catch (e) { throw "Could not create "+name+": "+e.message; } ]]></script> </cristalscript>