Package com.lariflix.jemm.reports
Class JellyfinReportStudios
java.lang.Object
com.lariflix.jemm.reports.JellyfinReportStudios
The JellyfinReportStudios class is used to represent studios in a report.
This class contains the details of a studio, such as the name and other relevant details. It provides methods to set and retrieve these details.
- Author:
- Cesar Bianchi
-
Constructor Summary
ConstructorsConstructorDescriptionJellyfinReportStudios
(JellyfinInstanceDetails instanceData, JellyfinReportTypes rpType) Constructor for the JellyfinReportStudios class.Constructor for the JellyfinReportStudios class. -
Method Summary
Modifier and TypeMethodDescriptiongetItems()
Retrieves the items property of this JellyfinReportStudios.int
Retrieves the totalsubItems property of this JellyfinReportStudios.void
Loads the report items for this JellyfinReportStudios.void
Prints the report for this JellyfinReportStudios.void
setTotalsubItems
(int totalsubItems) Sets the totalsubItems property of this JellyfinReportStudios.
-
Constructor Details
-
JellyfinReportStudios
Constructor for the JellyfinReportStudios class. This constructor initializes a new instance of the JellyfinReportStudios class with the given report type.- Parameters:
rpType
- A JellyfinReportTypes object representing the type of report to generate. This could be either STUDIOS_BASIC or STUDIOS_FULL.- Since:
- 1.1
-
JellyfinReportStudios
Constructor for the JellyfinReportStudios class. This constructor initializes a new instance of the JellyfinReportStudios class with the given instance data and report type.- Parameters:
instanceData
- 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.rpType
- A JellyfinReportTypes object representing the type of report to generate. This could be either STUDIOS_BASIC or STUDIOS_FULL.- Since:
- 1.1
-
-
Method Details
-
loadReportItems
public void loadReportItems() throws IOException, MalformedURLException, org.json.simple.parser.ParseException, net.sf.jasperreports.engine.JRExceptionLoads the report items for this JellyfinReportStudios. This method loads the items for this JellyfinReportStudios based on the report type. If the report type is STUDIOS_BASIC, it only loads the items. If the report type is STUDIOS_FULL, it loads both the items and the sub-items. This method throws an IOException if there is a problem with the input or output, a MalformedURLException if the URL of the Jellyfin instance is not formatted correctly, a ParseException if there is a problem with parsing the data, and a JRException if there is a problem with generating the report.- Throws:
IOException
- If there is a problem with the input or output.MalformedURLException
- If the URL of the Jellyfin instance is not formatted correctly.org.json.simple.parser.ParseException
- If there is a problem with parsing the data.net.sf.jasperreports.engine.JRException
- If there is a problem with generating the report.- Since:
- 1.1
-
printReport
public void printReport() throws net.sf.jasperreports.engine.JRException, MalformedURLException, IOExceptionPrints the report for this JellyfinReportStudios. This method generates and displays a report based on the report type. If the report type is STUDIOS_BASIC, it generates a basic report. If the report type is STUDIOS_FULL, it generates a full report with sub-items. The method first determines the paths for the report files, then compiles the report based on the report type. If the application is running in debug mode, it uses local files. Otherwise, it uses embedded resources. After compiling the report, it sets the data source to the items of this JellyfinReportStudios, sets the report parameters, fills the report with data, and displays the report in a new JasperViewer. This method throws a JRException if there is a problem with generating the report, a MalformedURLException if the URL of the Jellyfin instance is not formatted correctly, and an IOException if there is a problem with the input or output.- Throws:
net.sf.jasperreports.engine.JRException
- If there is a problem with generating the report.MalformedURLException
- If the URL of the Jellyfin instance is not formatted correctly.IOException
- If there is a problem with the input or output.- Since:
- 1.1
-
getItems
Retrieves the items property of this JellyfinReportStudios.- Returns:
- A JellyfinReportStudiosStructure object representing the items of this JellyfinReportStudios. Each item in the JellyfinReportStudiosStructure represents a studio in the report.
- Since:
- 1.1
-
getTotalsubItems
public int getTotalsubItems()Retrieves the totalsubItems property of this JellyfinReportStudios.- Returns:
- An integer representing the total number of sub-items in this JellyfinReportStudios.
- Since:
- 1.1
-
setTotalsubItems
public void setTotalsubItems(int totalsubItems) Sets the totalsubItems property of this JellyfinReportStudios.- Parameters:
totalsubItems
- An integer that should be used as the new total number of sub-items in this JellyfinReportStudios.- Since:
- 1.1
-