Class Product

java.lang.Object
com.imc.iss.groovy.product.Product

public class Product extends Object
This is a class representing a Product for use by groovy scripts

Inside the script, an instance of this class, containing the data of the Product that the script will be run on, will be provided automatically and can be accessed as a variable Product

See Also:
  • Method Details

    • addSalesInfo

      public Product addSalesInfo(Collection<SalesInfo> salesInfo)
    • deleteProductSalesInfo

      public void deleteProductSalesInfo(Collection<BusinessObject> slaesInfoBOs) throws IMCException
      Throws:
      IMCException
    • deleteSalesInfo

      public Product deleteSalesInfo(Collection<BusinessObject> salesInfo)
    • getAttachmentFilesByType

      public List<AttachmentData> getAttachmentFilesByType(String fileType) throws IMCException
      Get the list of the attachement file by file type. @see AttachmentData.
      Parameters:
      fileType - as String. The file type.
      Returns:
      AttachmentData in List.
      Throws:
      IMCException
    • getAttachmentFolder

      public AttachmentFolderData getAttachmentFolder(String folderName) throws IMCException
      Get an attachement folder by folder name. @see AttachmentFolderData.
      Parameters:
      folderName - the name of the folder.
      Returns:
      AttachmentFolderData.
      Throws:
      IMCException
    • getAttachmentFolders

      public List<AttachmentFolderData> getAttachmentFolders() throws IMCException
      Get the list of the attachment folder.
      Returns:
      AttachmentFolderData in List.
      Throws:
      IMCException
    • getProductDataAttributeValue

      public String getProductDataAttributeValue(String attributeURI) throws IMCException
      To get the value of a Product data attribute by attribute URI.
      Parameters:
      attributeURI - as String. The URI of the Product data attribute.
      Returns:
      the value of the Product data attribute as Object.
      Throws:
      IMCException
    • getProductErpId

      public String getProductErpId() throws IMCException
      Retrieves the erp id of the country that the Product belongs to The relationship is as follows: Product -> includesAddress -> hasCountry
      Returns:
      The country erp id
      Throws:
      IMCException
    • getProductID

      public String getProductID() throws IMCException
      Retrieves the ID of the Product
      Returns:
      The Product ID
      Throws:
      IMCException
    • getProductRelationAttributeErpId

      public String getProductRelationAttributeErpId(String attributeURI) throws IMCException
      To get the ERPID of a Product relation attribute by attribute URI.
      Parameters:
      attributeURI - as String. The URI of the Product relation attribute.
      Returns:
      the ERPId of the Product relation attribute as String.
      Throws:
      IMCException
    • getProductRelationAttributeObjectId

      public String getProductRelationAttributeObjectId(String attributeURI) throws IMCException
      To get the object Id of a Product relation attribute by attribute URI.
      Parameters:
      attributeURI - as String. The URI of the Product relation attribute.
      Returns:
      the objectId of the Product relation attribute as String.
      Throws:
      IMCException
    • getProductRelationAttributeObjectName

      public String getProductRelationAttributeObjectName(String attributeURI) throws IMCException
      To get the object name of a Product relation attribute by attribute URI.
      Parameters:
      attributeURI - as String. The URI of the Product relation attribute.
      Returns:
      the object name of the Product relation attribute as String.
      Throws:
      IMCException
    • getProductRelationAttributeURI

      public String getProductRelationAttributeURI(String attributeURI) throws IMCException
      To get the URI of a Product relation attribute by attribute URI.
      Parameters:
      attributeURI - as String. The URI of the Product relation attribute.
      Returns:
      the object URI of the Product relation attribute as String.
      Throws:
      IMCException
    • getProductTitle

      public String getProductTitle() throws IMCException
      Retrieves the title of this Product
      Returns:
      The Product title as String
      Throws:
      IMCException
    • getProductURI

      public String getProductURI()
      Retrieves the URI of this Product
      Returns:
      The Product URI as String
    • getSalesInfo

      public Collection<BusinessObject> getSalesInfo(SalesInfo salesInfoRecord) throws IMCException
      Throws:
      IMCException
    • setProductDataAttribute

      public Product setProductDataAttribute(String attributeURI, Object value) throws IMCException
      To set a value for the Product data attribute.
      Parameters:
      attributeURI - as String. The URI of the Product data attribute.
      value - as Object. The value for the Product data attribute.
      Returns:
      The Product
      Throws:
      IMCException - the platform exception
    • setProductRelationAttribute

      public Product setProductRelationAttribute(String attributeURI, String valueURI) throws IMCException
      To set a value for the Product relation attribute.
      Parameters:
      attributeURI - as String. The URI of the Product relation attribute.
      valueURI - as Object. The value for the Product relation attribute.
      Returns:
      The Product
      Throws:
      IMCException - the platform exception
    • toString

      public String toString()
      Returns a string representation of the Product, which prints all the line items in hierarchical manner
      Overrides:
      toString in class Object
      Returns:
      A string representation of the Product.