Class ProductComponent

    • Field Detail

      • ATTRIBUTE_NAME_VARIED_PRODUCT_CMPT

        protected static final java.lang.String ATTRIBUTE_NAME_VARIED_PRODUCT_CMPT
        See Also:
        Constant Field Values
    • Constructor Detail

      • ProductComponent

        public ProductComponent​(IRuntimeRepository repository,
                                java.lang.String id,
                                java.lang.String productKindId,
                                java.lang.String versionId)
        Creates a new product component with the indicate id, kind id and version id.
        Parameters:
        repository - The component registry the component uses to resolve references to other components.
        id - The component's runtime id.
        productKindId - The component's kind id
        versionId - The component's version id
        Throws:
        java.lang.NullPointerException - if repository, id, productKindId, or versionId is null.
    • Method Detail

      • getKindId

        public java.lang.String getKindId()
        Description copied from interface: IProductComponent
        Returns the id of the product component kind that this product component belongs to.
        Specified by:
        getKindId in interface IProductComponent
      • getVersionId

        public java.lang.String getVersionId()
        Description copied from interface: IProductComponent
        Returns the version id that identifies this product component in its kind.
        Specified by:
        getVersionId in interface IProductComponent
      • getId

        public java.lang.String getId()
        Description copied from interface: IProductComponent
        Returns the product component's id that uniquely identifies it in the repository it belongs to.
        Specified by:
        getId in interface IProductComponent
      • getValidFrom

        public DateTime getValidFrom()
        Description copied from interface: IProductObject
        Returns the date from which this generation is valid.
        Specified by:
        getValidFrom in interface IProductObject
        Returns:
        The valid from date of this generation
      • getValidFrom

        public java.util.Date getValidFrom​(java.util.TimeZone zone)
        Description copied from interface: IProductObject
        Returns the point in time this generation is valid from in the given time zone. This method never returns null.
        Specified by:
        getValidFrom in interface IProductObject
      • setValidFrom

        public void setValidFrom​(DateTime validfrom)
        Sets the new valid from date.

        Attention: Conceptually, the valid from date of the first generation must be equal to the valid from date of the product component itself. Therefore, if clients call this method, then to achieve data consistency clients must set the valid from date of the first generation, too.

        Throws:
        IllegalRepositoryModificationException - if the repository this product component belongs to does not allow to modify its contents
        See Also:
        ProductComponentGeneration.setValidFrom(DateTime)
      • getValidTo

        public DateTime getValidTo()
        Description copied from interface: IProductComponent
        Returns the date when this product component expires. Returning null means no end of the validity period.
        Specified by:
        getValidTo in interface IProductComponent
      • setValidTo

        public void setValidTo​(DateTime validTo)
      • getDescription

        public java.lang.String getDescription​(java.util.Locale locale)
        Description copied from interface: IProductComponent
        Returns the description for this product component in the specified locale. If there is no description in the specified locale, it tries to find the description in the locale's language. If there is also no description in the locale's language it returns the empty string.
        Specified by:
        getDescription in interface IProductComponent
        Returns:
        the description for the given locale/language or an empty string if no description exists for the given locale
      • initFromXml

        public void initFromXml​(org.w3c.dom.Element cmptElement)
        Initializes the generation with the data from the xml element.
        Specified by:
        initFromXml in interface IClRepositoryObject
        Throws:
        java.lang.NullPointerException - if cmptElement is null.
      • doInitPropertiesFromXml

        protected void doInitPropertiesFromXml​(java.util.Map<java.lang.String,​org.w3c.dom.Element> map)
        Initializes the properties with the data in the map.
        Parameters:
        map - the map of property elements
      • doInitTableUsagesFromXml

        protected void doInitTableUsagesFromXml​(java.util.Map<java.lang.String,​org.w3c.dom.Element> map)
        Initializes the table content usages with the data in the map. The map contains the table structure usage roles as key and the qualified table content name as value.
        Parameters:
        map - the map of property elements
      • doInitFormulaFromXml

        protected void doInitFormulaFromXml​(org.w3c.dom.Element element)
        Initializes all formulas contained by Element. If formula evaluation is supported, the map contains the compiled expression for every formula.
      • isFormulaAvailable

        protected boolean isFormulaAvailable​(java.lang.String formularSignature)
        Returns true if the expression of the given formulaSignature not empty.
      • doInitReferencesFromXml

        protected void doInitReferencesFromXml​(java.util.Map<java.lang.String,​java.util.List<org.w3c.dom.Element>> linkElements)
        Parameters:
        linkElements - the XML elements used to initialize ProductComponentLink instances.
      • doInitValidationRuleConfigsFromXml

        protected void doInitValidationRuleConfigsFromXml​(org.w3c.dom.Element element)
        Creates a map containing the validation rule configurations found in the indicated XML element. For each validation rule configuration the map contains an entry with the rule name as a key and an ValidationRuleConfiguration instance as value.
        Parameters:
        element - an XML element containing a product component's data
        Throws:
        java.lang.NullPointerException - if element is null.
        Since:
        3.22
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toXml

        public org.w3c.dom.Element toXml​(org.w3c.dom.Document document)
        Creates an XML Element that represents this product component's data.

        Throws an UnsupportedOperationException if the support for toXml ("Generate toXml Support") is not activated in the FIPS standard builder.

        Specified by:
        toXml in interface IXmlPersistenceSupport
        Parameters:
        document - a document, that can be used to create XML elements.
        Returns:
        an Element that represents this object as XML element
      • toXml

        public org.w3c.dom.Element toXml​(org.w3c.dom.Document document,
                                         boolean includeGenerations)
        Creates an XML Element that represents this product component's data.

        Throws an UnsupportedOperationException if the support for toXml ("Generate toXml Support") is not activated in the FIPS standard builder.

        Parameters:
        document - a document, that can be used to create XML elements.
        includeGenerations - true if the created XML element should include the data of all the product component's generations, false if generations should be ignored when creating the XML output.
      • writePropertiesToXml

        protected void writePropertiesToXml​(org.w3c.dom.Element element)
        Subclasses override this method to write their properties into the given XML element.

        The standard implementation throws an UnsupportedOperationException if the support for toXml ("Generate toXml Support") is not activated in the FIPS standard builder. Generated classes override but do NOT call super.

        Parameters:
        element - the XML element to write the properties to
      • writeTableUsagesToXml

        protected void writeTableUsagesToXml​(org.w3c.dom.Element element)
        This is a utility method called by generated code. The given Element is the element representing this ProductComponent.
        Parameters:
        element - the element all table usages should be added to
      • writeTableUsageToXml

        protected void writeTableUsageToXml​(org.w3c.dom.Element element,
                                            java.lang.String structureUsage,
                                            java.lang.String tableContentName)
        This method is used for writing a table usage to the XML of the given Element.
        Parameters:
        element - the element where the table usage will be added to
        structureUsage - the value for the structureUsage XML attribute
        tableContentName - the name of the used table content
      • writeReferencesToXml

        protected void writeReferencesToXml​(org.w3c.dom.Element element)
        This is a utility method called by generated code. The given Element is the element representing this ProductComponentGeneration.
        Parameters:
        element - the element all table usages should be added to
        Since:
        3.8
      • writeValidationRuleConfigsToXml

        protected void writeValidationRuleConfigsToXml​(org.w3c.dom.Element genElement)
        Since:
        3.22
      • writeFormulaToXml

        protected void writeFormulaToXml​(org.w3c.dom.Element element)
        This method is used for writing a formulas to the XML of the given Element.
      • isValidationRuleActivated

        public boolean isValidationRuleActivated​(java.lang.String ruleName)
        Description copied from interface: IProductObject
        Returns whether the validation rule with the given name is configured as active in this IProductObject. If there is no configuration for the given rule, false is returned.

        Please be aware that only one of IProductComponent or IProductComponentGeneration can configure any given rule depending on its changing-over-time configuration.

        Specified by:
        isValidationRuleActivated in interface IProductObject
        Parameters:
        ruleName - the name of the rule in question
        Returns:
        true if the rule was activated, false else.
      • setValidationRuleActivated

        public void setValidationRuleActivated​(java.lang.String ruleName,
                                               boolean active)
        Description copied from interface: IProductObject
        Enables or disables validation for a specific rule.
        Specified by:
        setValidationRuleActivated in interface IProductObject
        Parameters:
        ruleName - the name of the rule in question
        active - indicating whether the validation rule is configured as active