Class JellyfinReportInventory

java.lang.Object
com.lariflix.jemm.reports.JellyfinReportInventory

public class JellyfinReportInventory extends Object
The JellyfinReportInventory class is used to generate inventory reports from a Jellyfin server. This class retrieves inventory data from the Jellyfin server and formats it into a report. The report includes details such as the item name, the number of items in each category, and other relevant details.
Author:
Cesar Bianchi
  • Constructor Details

    • JellyfinReportInventory

      public JellyfinReportInventory(JellyfinReportTypes rpType)
      Constructor for the JellyfinReportInventory class.
      Parameters:
      rpType - A JellyfinReportTypes object representing the type of report to generate. This could be any of the types defined in the JellyfinReportTypes class.
      Since:
      1.1
    • JellyfinReportInventory

      public JellyfinReportInventory(JellyfinInstanceDetails instanceData, JellyfinReportTypes rpType)
      Constructor for the JellyfinReportInventory class.
      Parameters:
      instanceData - A JellyfinInstanceDetails object containing the details of the Jellyfin instance from which to generate the report. This includes the URL, API token, and other necessary details.
      rpType - A JellyfinReportTypes object representing the type of report to generate. This could be any of the types defined in the JellyfinReportTypes class.
      Since:
      1.1
  • Method Details

    • loadReportItems

      public void loadReportItems() throws IOException, MalformedURLException, org.json.simple.parser.ParseException, net.sf.jasperreports.engine.JRException
      Throws:
      IOException
      MalformedURLException
      org.json.simple.parser.ParseException
      net.sf.jasperreports.engine.JRException
    • printReport

      public void printReport() throws net.sf.jasperreports.engine.JRException, MalformedURLException, IOException
      Prints the inventory report. This method generates and prints the inventory report based on the report type. If the report type is INVENTORY_BASIC, it generates a basic report. If the report type is INVENTORY_FULL, it generates a full report with sub-items. The method first compiles the report, then sets the data source and report parameters, and finally fills the report and shows it.
      Throws:
      net.sf.jasperreports.engine.JRException - If there is an error generating the report. This can happen if there's a problem with the report template, the data, or the JasperReports engine.
      MalformedURLException - If the URL of the Jellyfin server is not formatted correctly.
      IOException - If an I/O error occurs. This can happen if there's a problem with the network connection, the server, or the local machine.
      Since:
      1.1
    • getInstanceData

      public static JellyfinInstanceDetails getInstanceData()
      Retrieves the instanceData property of the JellyfinReportInventory class.
      Returns:
      A JellyfinInstanceDetails object representing the details of the Jellyfin instance from which to generate the report. This includes the URL, API token, and other necessary details.
      Since:
      1.1
    • getItems

      Retrieves the items property of this JellyfinReportInventory.
      Returns:
      A JellyfinReportInventoryStructure object representing the items of this JellyfinReportInventory. This includes the inventory items and their sub-items.
      Since:
      1.1
    • setInstanceData

      public static void setInstanceData(JellyfinInstanceDetails instanceData)
      Sets the instanceData property of the JellyfinReportInventory class.
      Parameters:
      instanceData - A JellyfinInstanceDetails object that should be used as the new instance data for the JellyfinReportInventory class. This includes the URL, API token, and other necessary details.
      Since:
      1.1
    • setItems

      public void setItems(JellyfinReportInventoryStructure items)
      Sets the items property of this JellyfinReportInventory.
      Parameters:
      items - A JellyfinReportInventoryStructure object that should be used as the new items for this JellyfinReportInventory. This includes the inventory items and their sub-items.
      Since:
      1.1