
org.cip4.jdflib.resource.intent.JDFDropIntent Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of JDFLibJ Show documentation
Show all versions of JDFLibJ Show documentation
CIP4 JDF Library for JDF 1.x
/*
* The CIP4 Software License, Version 1.0
*
*
* Copyright (c) 2001-2020 The International Cooperation for the Integration of Processes in Prepress, Press and Postpress (CIP4). All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if any, must include the following acknowledgment: "This product includes software developed by the The International Cooperation for
* the Integration of Processes in Prepress, Press and Postpress (www.cip4.org)" Alternately, this acknowledgment mrSubRefay appear in the software itself, if and wherever such third-party
* acknowledgments normally appear.
*
* 4. The names "CIP4" and "The International Cooperation for the Integration of Processes in Prepress, Press and Postpress" must not be used to endorse or promote products derived from this software
* without prior written permission. For written permission, please contact [email protected].
*
* 5. Products derived from this software may not be called "CIP4", nor may "CIP4" appear in their name, without prior writtenrestartProcesses() permission of the CIP4 organization
*
* Usage of this software in commercial products is subject to restrictions. For details please consult [email protected].
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE INTERNATIONAL COOPERATION FOR THE INTEGRATION OF PROCESSES IN PREPRESS, PRESS AND POSTPRESS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIrSubRefAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE. ====================================================================
*
* This software consists of voluntary contributions made by many individuals on behalf of the The International Cooperation for the Integration of Processes in Prepress, Press and Postpress and was
* originally based on software restartProcesses() copyright (c) 1999-2001, Heidelberger Druckmaschinen AG copyright (c) 1999-2001, Agfa-Gevaert N.V.
*
* For more information on The International Cooperation for the Integration of Processes in Prepress, Press and Postpress , please see .
*
*/
/**
* ========================================================================== class JDFDropIntent extends JDFResource ==========================================================================
*
* @COPYRIGHT Heidelberger Druckmaschinen AG, 1999-2001 ALL RIGHTS RESERVED
* @Author: [email protected] using a code generator Warning! very preliminary test version. Interface subject to change without prior notice! Revision history: ...
*/
package org.cip4.jdflib.resource.intent;
import java.util.List;
import org.apache.xerces.dom.CoreDocumentImpl;
import org.cip4.jdflib.auto.JDFAutoDropIntent;
import org.cip4.jdflib.core.AttributeName;
import org.cip4.jdflib.core.ElementName;
import org.cip4.jdflib.datatypes.JDFAttributeMap;
import org.cip4.jdflib.resource.process.JDFComponent;
import org.cip4.jdflib.resource.process.JDFContact;
import org.cip4.jdflib.resource.process.JDFDrop;
import org.cip4.jdflib.resource.process.JDFDropItem;
import org.cip4.jdflib.span.JDFNameSpan;
import org.cip4.jdflib.span.JDFSpanSurplusHandling;
import org.cip4.jdflib.span.JDFSpanTransfer;
import org.cip4.jdflib.span.JDFStringSpan;
import org.cip4.jdflib.util.ContainerUtil;
import org.cip4.jdflib.util.StringUtil;
import org.w3c.dom.DOMException;
import org.w3c.dom.Node;
public class JDFDropIntent extends JDFAutoDropIntent
{
private static final long serialVersionUID = 1L;
/**
* Constructor for JDFDropIntent
*
* @param ownerDocument
* @param qualifiedName
* @throws DOMException
*/
public JDFDropIntent(final CoreDocumentImpl myOwnerDocument, final String qualifiedName)
{
super(myOwnerDocument, qualifiedName);
}
/**
* Constructor for JDFDropIntent
*
* @param ownerDocument
* @param namespaceURI
* @param qualifiedName
* @throws DOMException
*/
public JDFDropIntent(final CoreDocumentImpl myOwnerDocument, final String myNamespaceURI, final String qualifiedName)
{
super(myOwnerDocument, myNamespaceURI, qualifiedName);
}
/**
* Constructor for JDFDropIntent
*
* @param ownerDocument
* @param namespaceURI
* @param qualifiedName
* @param localName
* @throws DOMException
*/
public JDFDropIntent(final CoreDocumentImpl myOwnerDocument, final String myNamespaceURI, final String qualifiedName, final String myLocalName)
{
super(myOwnerDocument, myNamespaceURI, qualifiedName, myLocalName);
}
@Override
public String toString()
{
return "JDFDropIntent[ --> " + super.toString() + " ]";
}
/**
* Get parent node of 'this' - node DeliveryIntent
*
* @return KElement: DeliveryIntent node
*/
public JDFDeliveryIntent getParentDeliveryIntent()
{
Node parentNode = getParentNode();
return (parentNode instanceof JDFDeliveryIntent) ? (JDFDeliveryIntent) parentNode : null;
}
/**
* Get of 'this' the value of attribute AdditionalAmount. If not specified, get the default value of attribute AdditionalAmount, that is specified in it's parent element (node
* DeliveryIntent)
*
* @return WString: attribute value
*/
@Override
public int getAdditionalAmount()
{
if (hasAttribute(AttributeName.ADDITIONALAMOUNT, null, false))
{
return super.getAdditionalAmount();
}
return getParentDeliveryIntent().getAdditionalAmount();
}
/**
* Get of 'this' the value of attribute BuyerAccount. If not specified, get the default value of attribute BuyerAccount, that is specified in it's parent element (node
* DeliveryIntent)
*
* @return WString: attribute value
*/
@Override
public String getBuyerAccount()
{
if (hasAttribute(AttributeName.BUYERACCOUNT))
{
return super.getBuyerAccount();
}
return getParentDeliveryIntent().getBuyerAccount();
}
/**
* Get of 'this' the value of element Method. If not specified, get the default value of element Method, that is specified in it's parent element (node DeliveryIntent)
*
* @return JDFNameSpan: element value
*/
@Override
public JDFNameSpan getMethod()
{
if (hasChildElement(ElementName.METHOD, null))
{
return super.getMethod();
}
return getParentDeliveryIntent().getMethod();
}
/**
* Get of 'this' the value of element ReturnMethod. If not specified, get the default value of element ReturnMethod, that is specified in it's parent element (node
* DeliveryIntent)
*
* @return JDFNameSpan: element value
*/
@Override
public JDFNameSpan getReturnMethod()
{
if (hasChildElement(ElementName.RETURNMETHOD, null))
{
return super.getReturnMethod();
}
return getParentDeliveryIntent().getReturnMethod();
}
/**
* Get of 'this' the value of element ServiceLevel. If not specified, get the default value of element ServiceLevel, that is specified in it's parent element (node
* DeliveryIntent)
*
* @return JDFStringSpan: element value
*/
@Override
public JDFStringSpan getServiceLevel()
{
if (hasChildElement(ElementName.SERVICELEVEL, null))
{
return super.getServiceLevel();
}
return getParentDeliveryIntent().getServiceLevel();
}
/**
* Get of 'this' the value of element SurplusHandling. If not specified, get the default value of element SurplusHandling, that is specified in it's parent element (node
* DeliveryIntent)
*
* @return JDFSpanSurplusHandling: element value
*/
@Override
public JDFSpanSurplusHandling getSurplusHandling()
{
if (hasChildElement(ElementName.SURPLUSHANDLING, null))
{
return super.getSurplusHandling();
}
return getParentDeliveryIntent().getSurplusHandling();
}
/**
* Get of 'this' the value of element Transfer. If not specified, get the default value of element Transfer, that is specified in it's parent element (node DeliveryIntent)
*
* @return JDFSpanTransfer: element value
*/
@Override
public JDFSpanTransfer getTransfer()
{
if (hasChildElement(ElementName.TRANSFER, null))
{
return getTransfer();
}
return getParentDeliveryIntent().getTransfer();
}
/**
* Get of 'this' the iSkip-th child element Contact. If not specified, get the child element Contact of it's parent element (node DeliveryIntent)
*
* @return JDFContact: the found element
*/
@Override
public JDFContact getContact(final int iSkip)
{
if (hasChildElement(ElementName.CONTACT, null))
{
return super.getContact(iSkip);
}
return getParentDeliveryIntent().getContact();
}
/**
* get the dropItemIntent for a given component also checks partition
*
* @param c
* @return
*/
public JDFDropItemIntent getDropItemWithComponent(final JDFComponent c)
{
final List v = getChildArrayByClass(JDFDropItemIntent.class, false, 0);
if (v == null || c == null || StringUtil.getNonEmpty(c.getID()) == null)
{
return null;
}
final String cID = c.getID();
final JDFAttributeMap partMap = c.getPartMap();
for (final JDFDropItemIntent dii : v)
{
final JDFComponent cdii = dii.getComponent();
if (cdii != null && cID.equals(cdii.getID()) && ContainerUtil.equals(partMap, cdii.getPartMap()))
{
return dii;
}
}
return null;
}
/**
* get the dropItemIntent for a given component
*
* @param c
* @return
*/
public JDFDropItemIntent getCreateDropItemWithComponent(final JDFComponent c)
{
if (c == null)
return null;
JDFDropItemIntent di = getDropItemWithComponent(c);
if (di == null)
{
di = appendDropItemIntent();
di.refComponent(c);
}
return di;
}
/**
*
* @param dropIntent
*/
public void setFromDrop(final JDFDrop drop)
{
if (drop != null)
{
final List vdi = drop.getChildArrayByClass(JDFDropItem.class, false, 0);
for (final JDFDropItem dropItem : vdi)
{
final JDFDropItemIntent dropItemIntent = appendDropItemIntent();
dropItemIntent.setFromDropItem(dropItem);
}
JDFIntentResource.copyProcessToActual(this, drop, null, AttributeName.METHOD);
JDFIntentResource.copyProcessToActual(this, drop, null, AttributeName.EARLIEST);
JDFIntentResource.copyProcessToActual(this, drop, null, AttributeName.REQUIRED);
copyAttribute(AttributeName.DROPID, drop);
copyChildren(ElementName.CONTACT, drop);
copyChildren(ElementName.FILESPEC, drop);
// TODO more
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy