Class XMLDataCollectionAdapter

java.lang.Object
org.imixs.workflow.xml.XMLDataCollectionAdapter

public class XMLDataCollectionAdapter extends Object
An XMLItemCollectionAdapter converts a org.imixs.workflow.xml.XMLItemCollection into a org.imixs.workflow.ItemCollection and reverse
Version:
1.1
Author:
imixs.com - Ralph Soika
See Also:
  • Constructor Details

    • XMLDataCollectionAdapter

      public XMLDataCollectionAdapter()
  • Method Details

    • putDataCollection

      public static List<ItemCollection> putDataCollection(XMLDataCollection xmlDocuments)
      This Method converts a org.imixs.workflow.xml.DocumentCollection into a List of org.imixs.workflow.ItemCollection The method returns an empty list if the collection is empty or null
      Parameters:
      entity -
      Returns:
      ItemCollection
    • getDataCollection

      public static XMLDataCollection getDataCollection(Collection<ItemCollection> documents)
      This method transforms a Collection into a DocumentCollection
      Parameters:
      documents -
      Returns:
    • getDataCollection

      public static XMLDataCollection getDataCollection(Collection<ItemCollection> documents, List<String> itemNames)
      This method transforms a Collection into a XMLDocumentCollection If the attribute List is provided only the corresponding properties will be returned.
      Parameters:
      documents - - collection of ItemCollection objects to be converted
      itemNames - - optional list of item names to be converted. If null all items will be converted
      Returns:
    • getDataCollection

      public static XMLDataCollection getDataCollection(ItemCollection document)
      This method transforms a single ItemCollection into a XMLDocumentCollection
    • getDataCollection

      public static XMLDataCollection getDataCollection(ItemCollection document, List<String> itemNames)
      This method transforms a single ItemCollection into a XMLDocumentCollection
    • readCollectionFromInputStream

      public static List<ItemCollection> readCollectionFromInputStream(InputStream inputStream) throws jakarta.xml.bind.JAXBException, IOException
      This method imports an xml entity data stream and returns a List of ItemCollection objects. The method can import any kind of entity data like model or configuration data an xml export of workitems.
      Parameters:
      inputStream - xml input stream
      Returns:
      List of ItemCollection objects
      Throws:
      jakarta.xml.bind.JAXBException
      IOException
    • readCollection

      public static List<ItemCollection> readCollection(byte[] byteInput) throws jakarta.xml.bind.JAXBException, IOException
      This method imports an xml entity data byte array and returns a List of ItemCollection objects. The method can import any kind of entity data like model or configuration data an xml export of workitems.
      Parameters:
      inputStream - xml input stream
      Returns:
      List of ItemCollection objects
      Throws:
      jakarta.xml.bind.JAXBException
      IOException
    • writeItemCollection

      public static byte[] writeItemCollection(Collection<ItemCollection> documents) throws jakarta.xml.bind.JAXBException, IOException
      This method writes a collection of ItemCollection into a Byte array representing a XMLDataCollection
      Parameters:
      inputStream - xml input stream
      Returns:
      List of ItemCollection objects
      Throws:
      jakarta.xml.bind.JAXBException
      IOException
    • writeItemCollection

      public static byte[] writeItemCollection(ItemCollection document) throws jakarta.xml.bind.JAXBException, IOException
      This method writes a ItemCollection into a Byte array representing a XMLDataCollection
      Parameters:
      inputStream - xml input stream
      Returns:
      List of ItemCollection objects
      Throws:
      jakarta.xml.bind.JAXBException
      IOException
    • getBytesFromStream

      public static byte[] getBytesFromStream(InputStream is) throws IOException
      Throws:
      IOException