Package org.molgenis.app.manager.service
Interface AppManagerService
-
- All Known Implementing Classes:
AppManagerServiceImpl
public interface AppManagerService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidactivateApp(App app)Activate an App by App idAppConfigcheckAndObtainConfig(java.lang.String tempDir, java.lang.String configContent)Check the app-configuration and obtain theAppConfigif the configuration is validvoidconfigureApp(AppConfig appConfig, java.lang.String htmlTemplate)Configure app in database.voiddeactivateApp(App app)Deactivate an App by App idvoiddeleteApp(java.lang.String id)Delete an existing Appjava.lang.StringextractFileContent(java.lang.String appDir, java.lang.String fileName)Get the UTF-8 file-content of a file served by an appAppResponsegetAppByName(java.lang.String appName)Retrieve anAppResponsebased a unique URIjava.util.List<AppResponse>getApps()Retrieve a list ofAppResponsesjava.lang.StringuploadApp(java.io.InputStream zipData, java.lang.String zipFileName, java.lang.String formFieldName)Upload an app If zip fails to verify, throw an exception with the missing information
-
-
-
Method Detail
-
getApps
java.util.List<AppResponse> getApps()
Retrieve a list ofAppResponses
-
getAppByName
AppResponse getAppByName(java.lang.String appName)
Retrieve anAppResponsebased a unique URI- Parameters:
appName- The URI of an App- Returns:
- An
AppResponse - Throws:
AppForURIDoesNotExistException- if there is no app with the requested URI
-
activateApp
void activateApp(App app)
Activate an App by App id- Parameters:
app- The App
-
deactivateApp
void deactivateApp(App app)
Deactivate an App by App id- Parameters:
app- The App
-
deleteApp
void deleteApp(java.lang.String id)
Delete an existing App- Parameters:
id- The id of an App- Throws:
CouldNotDeleteAppException- if deletion fails
-
uploadApp
java.lang.String uploadApp(java.io.InputStream zipData, java.lang.String zipFileName, java.lang.String formFieldName) throws java.io.IOExceptionUpload an app If zip fails to verify, throw an exception with the missing information- Parameters:
zipData- steam with app data in zip fromzipFileName- the name of the zip fileformFieldName- the value of the name field in the form- Returns:
- temporary directory for app
- Throws:
java.io.IOExceptionInvalidAppArchiveException- if the zipData cannot be unzipped
-
checkAndObtainConfig
AppConfig checkAndObtainConfig(java.lang.String tempDir, java.lang.String configContent) throws java.io.IOException
Check the app-configuration and obtain theAppConfigif the configuration is valid- Parameters:
tempDir- temporary directory with uploadede app-content- Returns:
- appConfig
- Throws:
java.io.IOException
-
configureApp
void configureApp(AppConfig appConfig, java.lang.String htmlTemplate)
Configure app in database.- Parameters:
appConfig- app configuration objecthtmlTemplate- HTML template based on the packaged index.html
-
extractFileContent
java.lang.String extractFileContent(java.lang.String appDir, java.lang.String fileName)Get the UTF-8 file-content of a file served by an app- Parameters:
appDir- app directoryfileName- file name- Returns:
- UTF-8 file-content
-
-