示例#1
0
        ///
        ///	 <summary> * sets all relevant parameters of this to the values specified in resourceLink or its linked resource or JDF node
        ///	 *  </summary>
        ///	 * <param name="resourceLink"> the resourceLink to extract the information from </param>
        ///	 * <param name="rqp"> parameters </param>
        ///
        public virtual void setLink(JDFResourceLink resourceLink, JDFResourceQuParams rqp)
        {
            if (resourceLink == null)
            {
                return;
            }
            JDFAmountPool ap = resourceLink.getAmountPool();

            if (ap != null)
            {
                copyElement(ap, null);
            }
            else
            {
                if (resourceLink.hasAttribute(AttributeName.ACTUALAMOUNT))
                {
                    setActualAmount(resourceLink.getActualAmount(null));
                }
                if (resourceLink.hasAttribute(AttributeName.AMOUNT))
                {
                    setAmount(resourceLink.getAmount(null));
                }
            }
            setProcessUsage(resourceLink.getEnumProcessUsage());

            JDFResource r = resourceLink.getTarget();

            if (r == null && rqp != null)
            {
                rqp.setExact(false);
            }

            bool bExact = rqp == null ? false : rqp.getExact();

            if (!bExact || r == null) // if we do not have a resource let's limp
            // along and provide as much as we have
            {
                setResourceName(resourceLink.getLinkedResourceName());
                setAttribute(AttributeName.RESOURCEID, resourceLink.getrRef());
                EnumUsage usage = resourceLink.getUsage();
                if (usage != null)
                {
                    setAttribute(AttributeName.USAGE, usage.getName());
                }
                if (r != null && r.hasAttribute(AttributeName.PRODUCTID))
                {
                    setProductID(r.getProductID());
                }
            }
            else
            {
                // create a copy of the resource in the original jdf
                JDFResource rr = (JDFResource)r.getParentNode_KElement().copyElement(r, null);
                rr.inlineRefElements(null, null, true);
                // move resource copy from the original node into this document
                moveElement(rr, null);
            }
        }
示例#2
0
        ///
        ///	 <summary> * if a Resource is available, return it's ProductID
        ///	 *  </summary>
        ///	 * <seealso cref= org.cip4.jdflib.auto.JDFAutoResourceInfo#getProductID() </seealso>
        ///
        public override string getProductID()
        {
            string _name = base.getResourceName();

            if (isWildCard(_name))
            {
                JDFResource r = getResource(null);
                if (r == null)
                {
                    return(null);
                }
                _name = r.getProductID();
            }
            return(_name);
        }
示例#3
0
        ///
        ///	 <summary> * sets all relevant parameters of <code>this</code> to the values specified in resourceLink or its linked resource
        ///	 * or JDF node
        ///	 *  </summary>
        ///	 * <param name="resourceLink"> the resourceLink to extract the information from </param>
        ///
        public virtual void setLink(JDFResourceLink resourceLink)
        {
            if (resourceLink == null)
            {
                return;
            }
            JDFResource r = resourceLink.getTarget();

            JDFNode parentJDF = resourceLink.getParentJDF();

            setJDF(parentJDF);
            setProcessUsage(resourceLink.getEnumProcessUsage());

            if (r.hasAttribute(AttributeName.PRODUCTID))
            {
                setProductID(r.getProductID());
            }
            setResourceID(r.getID());
            setResourceName(r.LocalName);
            setUsage(resourceLink.getUsage());
            setPartMapVector(resourceLink.getPartMapVector());
        }