Class AssetManagementServiceImpl

    • Constructor Detail

      • AssetManagementServiceImpl

        public AssetManagementServiceImpl()
    • Method Detail

      • readResourceFileFromExport

        public AssetExportFileData readResourceFileFromExport​(InputStream inputStream)
                                                       throws FcAssetException
        Description copied from interface: IAssetManagementService
        Reads the main file of the resource contained in the specified resource export data, e.g. to replace the file of an existing resource with it. Only the export data is read; neither the database is accessed nor are any permissions checked.
        Specified by:
        readResourceFileFromExport in interface IAssetManagementService
        Parameters:
        inputStream - The InputStream containing the resource export data to read.
        Returns:
        The file name, MIME type and content of the main file of the exported resource.
        Throws:
        FcAssetException - if the export data is invalid, is not a resource export or does not contain a main file.
      • analyzeForResourceImport

        public AssetImportAnalysisResult analyzeForResourceImport​(InputStream inputStream,
                                                                  AssetScope targetScope,
                                                                  IUser user)
                                                           throws FcAssetException
        Description copied from interface: IAssetManagementService
        Analyzes the specified resource export data before it is imported into the given target scope, checking whether the target scope already contains a resource with the same UUID and whether the user may overwrite it.
        Specified by:
        analyzeForResourceImport in interface IAssetManagementService
        Parameters:
        inputStream - The InputStream containing the resource export data to analyze.
        targetScope - The scope into which the resource should be imported.
        user - The user requesting the import.
        Returns:
        The analysis result, describing the exported resource and the conflicting resource, if any.
        Throws:
        FcAssetException - if the export data is invalid, the target scope does not exist, the user may not read the conflicting resource or another error occurs during analysis.
      • analyzeForTemplateImport

        public AssetImportAnalysisResult analyzeForTemplateImport​(InputStream inputStream,
                                                                  AssetScope targetScope,
                                                                  IUser user)
                                                           throws FcAssetException
        Description copied from interface: IAssetManagementService
        Analyzes the specified template export data before it is imported into the given target scope, checking whether the target scope already contains a template with the same UUID and whether the user may overwrite it.
        Specified by:
        analyzeForTemplateImport in interface IAssetManagementService
        Parameters:
        inputStream - The InputStream containing the template export data to analyze.
        targetScope - The scope into which the template should be imported.
        user - The user requesting the import.
        Returns:
        The analysis result, describing the exported template and the conflicting template, if any.
        Throws:
        FcAssetException - if the export data is invalid, the target scope does not exist, the user may not read the conflicting template or another error occurs during analysis.
      • importResource

        public ResourceImportResult importResource​(ResourceImportSpec spec,
                                                   InputStream inputStream,
                                                   IUser user)
                                            throws FcAssetException
        Description copied from interface: IAssetManagementService
        Imports a resource from the provided InputStream according to the given import specification.
        Specified by:
        importResource in interface IAssetManagementService
        Parameters:
        spec - The import specification detailing how to perform the import, e.g. the target scope and whether to update existing assets.
        inputStream - The InputStream from which the resource data will be read.
        user - The user requesting the import.
        Returns:
        An IAssetImportResult containing the results of the import, e.g. the IDs of the created or updated assets and any errors that occurred during the import.
        Throws:
        FcAssetException - if an error occurs during the import process, e.g. if the input data is invalid or the user lacks permissions to perform the import.
      • importTemplate

        public TemplateImportResult importTemplate​(TemplateImportSpec spec,
                                                   InputStream inputStream,
                                                   IUser user)
                                            throws FcAssetException
        Description copied from interface: IAssetManagementService
        Imports a template from the provided InputStream according to the given import specification.
        Specified by:
        importTemplate in interface IAssetManagementService
        Parameters:
        spec - The import specification detailing how to perform the import, e.g. the target scope and whether to update existing assets.
        inputStream - The InputStream from which the template data will be read.
        user - The user requesting the import.
        Returns:
        An IAssetImportResult containing the results of the import, e.g. the IDs of the created or updated assets and any errors that occurred during the import.
        Throws:
        FcAssetException - if an error occurs during the import process, e.g. if the input data is invalid or the user lacks permissions to perform the import.