Class Download
java.lang.Object
it.uniroma2.art.semanticturkey.services.STServiceAdapter
it.uniroma2.art.semanticturkey.services.core.Download
- All Implemented Interfaces:
NewerNewStyleService
,STService
- Author:
- Andrea Turbati
-
Field Summary
Fields inherited from class it.uniroma2.art.semanticturkey.services.STServiceAdapter
applicationEventPublisher, cfManager, exptManager, stServiceContext
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
createAlignmentDownload
(String targetUriPrefix, List<org.eclipse.rdf4j.model.IRI> mappingProperties, String fileName, org.eclipse.rdf4j.model.Literal localizedLabel, org.eclipse.rdf4j.rio.RDFFormat format, boolean zipFile, boolean overwrite) Generate a downloadable distribution containing the alignments of the current datasetvoid
createDownload
(String fileName, org.eclipse.rdf4j.model.Literal localizedLabel, org.eclipse.rdf4j.rio.RDFFormat format, boolean zipFile, boolean overwrite) Create a downloadable distribution for the current datasetvoid
createExternalDownload
(org.eclipse.rdf4j.model.IRI externalLink, org.eclipse.rdf4j.model.Literal localizedLabel, boolean distribution, boolean overwrite) Add an external link downloadList<org.eclipse.rdf4j.rio.RDFFormat>
void
Downloads a filevoid
removeDownload
(String fileName) void
removeExternalDistribution
(String distRef) void
updateLocalized
(String fileName, String localized, String lang) void
updateLocalizedMap
(String fileName, Map<String, String> localizedMap) void
updateLocalizedMapInternal
(String fileName, Map<String, String> localizedMap) void
uploadFile
(org.springframework.web.multipart.MultipartFile file, org.eclipse.rdf4j.model.Literal localizedLabel, boolean distribution, boolean overwrite) Add a file to the downloadable files (not distribution)Methods inherited from class it.uniroma2.art.semanticturkey.services.STServiceAdapter
addValue, checkNotLocallyDefined, createQueryBuilder, generateIRI, generateNatureSPARQLSelectPart, generateNatureSPARQLWherePart, generateResourceWithCustomConstructor, getCodaLexModeForSearchFromLexicalizationModel, getDeleteGraph, getGraphFromNature, getInitializedCodaCore, getManagedConnection, getMetadataGraph, getOptionalProject, getPlatformTransactionManager, getProject, getRepository, getRoleFromNature, getUserNamedGraphs, getWorkingGraph, instantiateSearchStrategy, instantiateSearchStrategy, parseReference, publishResourceDeleted, publishResourceDeleted, removeReifiedValue, retrieveResources, shutDownCodaCore, updateTriplePredicate
-
Constructor Details
-
Download
public Download()
-
-
Method Details
-
createDownload
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorized(\'pm(project, downloads)\', \'C\')") @Read public void createDownload(String fileName, org.eclipse.rdf4j.model.Literal localizedLabel, org.eclipse.rdf4j.rio.RDFFormat format, @Optional(defaultValue="true") boolean zipFile, @Optional(defaultValue="false") boolean overwrite) throws IOException, NoSuchSettingsManager Create a downloadable distribution for the current dataset- Parameters:
fileName
-localizedLabel
-format
-zipFile
-overwrite
-- Throws:
IOException
NoSuchSettingsManager
-
createAlignmentDownload
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorized(\'pm(project, downloads)\', \'C\')") @Read public void createAlignmentDownload(@Optional String targetUriPrefix, @Optional(defaultValue="") List<org.eclipse.rdf4j.model.IRI> mappingProperties, String fileName, org.eclipse.rdf4j.model.Literal localizedLabel, @Optional(defaultValue="TURTLE") org.eclipse.rdf4j.rio.RDFFormat format, @Optional(defaultValue="true") boolean zipFile, @Optional(defaultValue="false") boolean overwrite) throws IOException, NoSuchSettingsManager Generate a downloadable distribution containing the alignments of the current dataset- Parameters:
targetUriPrefix
-mappingProperties
-fileName
-localizedLabel
-format
-zipFile
-overwrite
-- Throws:
IOException
NoSuchSettingsManager
-
createExternalDownload
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorized(\'pm(project, downloads)\', \'C\')") public void createExternalDownload(org.eclipse.rdf4j.model.IRI externalLink, org.eclipse.rdf4j.model.Literal localizedLabel, @Optional(defaultValue="true") boolean distribution, @Optional(defaultValue="false") boolean overwrite) throws NoSuchSettingsManager, STPropertyAccessException, FileAlreadyExistsException Add an external link download- Parameters:
externalLink
-localizedLabel
-distribution
- tells if the file represents a dataset distribution or simple file related to the dataset- Throws:
NoSuchSettingsManager
STPropertyAccessException
FileAlreadyExistsException
-
uploadFile
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorized(\'pm(project, downloads)\', \'C\')") public void uploadFile(org.springframework.web.multipart.MultipartFile file, org.eclipse.rdf4j.model.Literal localizedLabel, @Optional(defaultValue="false") boolean distribution, @Optional(defaultValue="false") boolean overwrite) throws IOException, NoSuchSettingsManager Add a file to the downloadable files (not distribution)- Parameters:
file
-localizedLabel
-overwrite
-- Throws:
IOException
NoSuchSettingsManager
-
getAvailableFormats
-
removeDownload
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorized(\'pm(project, downloads)\', \'D\')") public void removeDownload(String fileName) throws IOException, NoSuchSettingsManager - Throws:
IOException
NoSuchSettingsManager
-
removeExternalDistribution
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorized(\'pm(project, downloads)\', \'D\')") public void removeExternalDistribution(String distRef) throws NoSuchSettingsManager - Throws:
NoSuchSettingsManager
-
getDownloadInfoList
@STServiceOperation public DownloadProjectSettings getDownloadInfoList() throws NoSuchSettingsManager- Throws:
NoSuchSettingsManager
-
getFile
@STServiceOperation public void getFile(jakarta.servlet.http.HttpServletResponse oRes, String fileName) throws IOException Downloads a file- Parameters:
oRes
- the response object to which the file will be written tofileName
- the name of the file to download from this project- Throws:
IOException
-
updateLocalized
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorized(\'pm(project, downloads)\', \'U\')") public void updateLocalized(String fileName, String localized, String lang) throws NoSuchSettingsManager - Throws:
NoSuchSettingsManager
-
updateLocalizedMap
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorized(\'pm(project, downloads)\', \'U\')") public void updateLocalizedMap(String fileName, Map<String, String> localizedMap) throws NoSuchSettingsManager- Throws:
NoSuchSettingsManager
-
updateLocalizedMapInternal
public void updateLocalizedMapInternal(String fileName, Map<String, String> localizedMap) throws NoSuchSettingsManager- Throws:
NoSuchSettingsManager
-