Class AppManagerServiceImpl
- java.lang.Object
-
- org.molgenis.app.manager.service.impl.AppManagerServiceImpl
-
- All Implemented Interfaces:
AppManagerService
@Service public class AppManagerServiceImpl extends Object implements AppManagerService
-
-
Field Summary
Fields Modifier and Type Field Description static StringAPP_PLUGIN_ROOTstatic StringAPPS_DIRstatic StringZIP_CONFIG_FILEstatic StringZIP_INDEX_FILE
-
Constructor Summary
Constructors Constructor Description AppManagerServiceImpl(AppFactory appFactory, DataService dataService, org.molgenis.data.file.FileStore fileStore, com.google.gson.Gson gson, org.molgenis.data.plugin.model.PluginFactory pluginFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivateApp(App app)Activate an App by App idAppConfigcheckAndObtainConfig(String tempDir, String configContent)Check the app-configuration and obtain theAppConfigif the configuration is validvoidconfigureApp(AppConfig appConfig, String htmlTemplate)Configure app in database.voiddeactivateApp(App app)Deactivate an App by App idvoiddeleteApp(String id)Delete an existing AppStringextractFileContent(String appDir, String fileName)Get the UTF-8 file-content of a file served by an appAppResponsegetAppByName(String appName)Retrieve anAppResponsebased a unique URIList<AppResponse>getApps()Retrieve a list ofAppResponsesStringuploadApp(InputStream zipData, String zipFileName, String formFieldName)Upload an app If zip fails to verify, throw an exception with the missing information
-
-
-
Field Detail
-
APPS_DIR
public static final String APPS_DIR
- See Also:
- Constant Field Values
-
ZIP_INDEX_FILE
public static final String ZIP_INDEX_FILE
- See Also:
- Constant Field Values
-
ZIP_CONFIG_FILE
public static final String ZIP_CONFIG_FILE
- See Also:
- Constant Field Values
-
APP_PLUGIN_ROOT
public static final String APP_PLUGIN_ROOT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AppManagerServiceImpl
public AppManagerServiceImpl(AppFactory appFactory, DataService dataService, org.molgenis.data.file.FileStore fileStore, com.google.gson.Gson gson, org.molgenis.data.plugin.model.PluginFactory pluginFactory)
-
-
Method Detail
-
getApps
public List<AppResponse> getApps()
Description copied from interface:AppManagerServiceRetrieve a list ofAppResponses- Specified by:
getAppsin interfaceAppManagerService
-
getAppByName
public AppResponse getAppByName(String appName)
Description copied from interface:AppManagerServiceRetrieve anAppResponsebased a unique URI- Specified by:
getAppByNamein interfaceAppManagerService- Parameters:
appName- The URI of an App- Returns:
- An
AppResponse
-
activateApp
@Transactional public void activateApp(App app)
Description copied from interface:AppManagerServiceActivate an App by App id- Specified by:
activateAppin interfaceAppManagerService- Parameters:
app- The App
-
deactivateApp
@Transactional public void deactivateApp(App app)
Description copied from interface:AppManagerServiceDeactivate an App by App id- Specified by:
deactivateAppin interfaceAppManagerService- Parameters:
app- The App
-
deleteApp
@Transactional public void deleteApp(String id)
Description copied from interface:AppManagerServiceDelete an existing App- Specified by:
deleteAppin interfaceAppManagerService- Parameters:
id- The id of an App
-
uploadApp
public String uploadApp(InputStream zipData, String zipFileName, String formFieldName) throws IOException
Description copied from interface:AppManagerServiceUpload an app If zip fails to verify, throw an exception with the missing information- Specified by:
uploadAppin interfaceAppManagerService- 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:
IOException
-
checkAndObtainConfig
public AppConfig checkAndObtainConfig(String tempDir, String configContent) throws IOException
Description copied from interface:AppManagerServiceCheck the app-configuration and obtain theAppConfigif the configuration is valid- Specified by:
checkAndObtainConfigin interfaceAppManagerService- Parameters:
tempDir- temporary directory with uploadede app-content- Returns:
- appConfig
- Throws:
IOException
-
configureApp
@Transactional public void configureApp(AppConfig appConfig, String htmlTemplate)
Description copied from interface:AppManagerServiceConfigure app in database.- Specified by:
configureAppin interfaceAppManagerService- Parameters:
appConfig- app configuration objecthtmlTemplate- HTML template based on the packaged index.html
-
extractFileContent
public String extractFileContent(String appDir, String fileName)
Description copied from interface:AppManagerServiceGet the UTF-8 file-content of a file served by an app- Specified by:
extractFileContentin interfaceAppManagerService- Parameters:
appDir- app directoryfileName- file name- Returns:
- UTF-8 file-content
-
-