@Service public class AppManagerServiceImpl extends Object implements AppManagerService
| Modifier and Type | Field and Description |
|---|---|
static String |
APP_PLUGIN_ROOT |
static String |
APPS_DIR |
static String |
ZIP_CONFIG_FILE |
static String |
ZIP_INDEX_FILE |
| Constructor and Description |
|---|
AppManagerServiceImpl(AppFactory appFactory,
DataService dataService,
org.molgenis.data.file.FileStore fileStore,
com.google.gson.Gson gson,
org.molgenis.data.plugin.model.PluginFactory pluginFactory) |
| Modifier and Type | Method and Description |
|---|---|
void |
activateApp(App app)
Activate an App by App id
|
AppConfig |
checkAndObtainConfig(String tempDir,
String configContent)
Check the app-configuration and obtain the
AppConfig
if the configuration is valid |
void |
configureApp(AppConfig appConfig,
String htmlTemplate)
Configure app in database.
|
void |
deactivateApp(App app)
Deactivate an App by App id
|
void |
deleteApp(String id)
Delete an existing App
|
String |
extractFileContent(String appDir,
String fileName)
Get the UTF-8 file-content of a file served by an app
|
AppResponse |
getAppByName(String appName)
Retrieve an
AppResponse based a unique URI |
List<AppResponse> |
getApps()
Retrieve a list of
AppResponses |
String |
uploadApp(InputStream zipData,
String zipFileName,
String formFieldName)
Upload an app
If zip fails to verify, throw an exception with the missing information
|
public static final String APPS_DIR
public static final String ZIP_INDEX_FILE
public static final String ZIP_CONFIG_FILE
public static final String APP_PLUGIN_ROOT
public AppManagerServiceImpl(AppFactory appFactory, DataService dataService, org.molgenis.data.file.FileStore fileStore, com.google.gson.Gson gson, org.molgenis.data.plugin.model.PluginFactory pluginFactory)
public List<AppResponse> getApps()
AppManagerServiceAppResponsesgetApps in interface AppManagerServicepublic AppResponse getAppByName(String appName)
AppManagerServiceAppResponse based a unique URIgetAppByName in interface AppManagerServiceappName - The URI of an AppAppResponse@Transactional public void activateApp(App app)
AppManagerServiceactivateApp in interface AppManagerServiceapp - The App@Transactional public void deactivateApp(App app)
AppManagerServicedeactivateApp in interface AppManagerServiceapp - The App@Transactional public void deleteApp(String id)
AppManagerServicedeleteApp in interface AppManagerServiceid - The id of an Apppublic String uploadApp(InputStream zipData, String zipFileName, String formFieldName) throws IOException
AppManagerServiceuploadApp in interface AppManagerServicezipData - steam with app data in zip fromzipFileName - the name of the zip fileformFieldName - the value of the name field in the formIOExceptionpublic AppConfig checkAndObtainConfig(String tempDir, String configContent) throws IOException
AppManagerServiceAppConfig
if the configuration is validcheckAndObtainConfig in interface AppManagerServicetempDir - temporary directory with uploadede app-contentIOException@Transactional public void configureApp(AppConfig appConfig, String htmlTemplate)
AppManagerServiceconfigureApp in interface AppManagerServiceappConfig - app configuration objecthtmlTemplate - HTML template based on the packaged index.htmlpublic String extractFileContent(String appDir, String fileName)
AppManagerServiceextractFileContent in interface AppManagerServiceappDir - app directoryfileName - file nameCopyright © 2018 Pivotal Software, Inc.. All rights reserved.