public class FilesystemConfigServiceImpl extends java.lang.Object implements IConfigService
Constructor and Description |
---|
FilesystemConfigServiceImpl() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
deleteConfig(java.lang.String name,
java.lang.String type,
java.lang.String ticket,
java.lang.String appId,
javax.servlet.http.HttpServletRequest request)
Delete the config by name
|
java.io.ByteArrayOutputStream |
exportConfigByPath(java.lang.String ticket,
java.lang.Boolean userPref,
java.lang.String appId,
java.util.List<java.lang.String> failedDocs)
This method builds up a ZipOutputStream and an oco of the config folder (appId) to be zipped and exported
and then calls the zipSubDirectory on that folder, which returns a byte array output stream containing the zip
for the browser to download
|
java.util.Map<java.lang.String,java.lang.String> |
extractFolder(java.lang.String zipName,
java.lang.String ticket,
java.io.InputStream configStream)
Import configs - this method receives zip file data from the front end and extracts those files
into the users docbase by creating versions if the files already exist, or creating new ones if
they do not
|
void |
findOrCreateAppIdFolder(java.lang.String ticket,
java.lang.String appId)
Looks for the app id folder and creates it if it does not exist
|
org.json.JSONObject |
getConfigByName(java.lang.String type,
java.lang.String name,
java.lang.String ticket,
boolean latest,
boolean shallow,
java.lang.String appId)
Return a TSG configuration for internal use in OpenContent.
|
java.lang.String |
getConfigByName(java.lang.String type,
java.lang.String name,
java.lang.String ticket,
boolean latest,
boolean shallow,
java.lang.String appId,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
This method returns a TSG configuration.
|
java.lang.Object |
getConfigByPathId(java.lang.String id,
java.lang.String ticket,
java.lang.String appId,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
This method returns a config by id.
|
java.util.List |
getConfigByType(java.lang.String type,
java.lang.String ticket,
boolean latest,
boolean fullConfigs,
java.lang.String appId)
This method returns a TSG configuration.
|
java.lang.String |
getConfigPath(java.lang.String ticket,
javax.servlet.http.HttpServletRequest request) |
java.lang.String |
getRootPath()
returns the injected root path for hpi
|
java.lang.String |
saveConfig(java.lang.String name,
java.lang.String type,
java.lang.String ticket,
java.lang.String appId,
javax.servlet.http.HttpServletRequest request)
Save config
|
void |
setConfigPath(java.lang.String configPath)
Sets the config path.
|
java.lang.String |
updateConfig(java.lang.String name,
java.lang.String type,
java.lang.String ticket,
java.lang.String appId,
javax.servlet.http.HttpServletRequest request)
Update config
|
java.lang.String |
updateConfigById(java.lang.String type,
java.lang.String id,
java.lang.String ticket,
javax.servlet.http.HttpServletRequest request)
Update config by id rather then name
|
public java.util.List getConfigByType(java.lang.String type, java.lang.String ticket, boolean latest, boolean fullConfigs, java.lang.String appId)
IConfigService
getConfigByType
in interface IConfigService
type
- - The type of configticket
- - The resolved session ticketlatest
- - By default returns the 'active' config. If true this will return the current version of the configuration.appId
- - The application id that allows for separation of configs.public java.lang.String getConfigByName(java.lang.String type, java.lang.String name, java.lang.String ticket, boolean latest, boolean shallow, java.lang.String appId, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
IConfigService
getConfigByName
in interface IConfigService
type
- - The type of configname
- - The name of the config objectticket
- - The resolved session ticketlatest
- - By default returns the 'active' config. If true this will return the current version of the configuration.appId
- - The application id that allows for separation of configs.public org.json.JSONObject getConfigByName(java.lang.String type, java.lang.String name, java.lang.String ticket, boolean latest, boolean shallow, java.lang.String appId)
IConfigService
getConfigByName
in interface IConfigService
public java.lang.Object getConfigByPathId(java.lang.String id, java.lang.String ticket, java.lang.String appId, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
IConfigService
getConfigByPathId
in interface IConfigService
id
- - id of object requestticket
- - The ticket from the requestappId
- - The application id that allows for separation of configs.public java.lang.String saveConfig(java.lang.String name, java.lang.String type, java.lang.String ticket, java.lang.String appId, javax.servlet.http.HttpServletRequest request)
IConfigService
saveConfig
in interface IConfigService
name
- - The name of the config objecttype
- - The type of config objectticket
- - The resolved session ticketappId
- - The application id that allows for separation of configspublic java.lang.String updateConfigById(java.lang.String type, java.lang.String id, java.lang.String ticket, javax.servlet.http.HttpServletRequest request)
IConfigService
updateConfigById
in interface IConfigService
type
- - the object typeid
- - the object idticket
- - The resolved session ticketrequest
- the requestpublic java.lang.String updateConfig(java.lang.String name, java.lang.String type, java.lang.String ticket, java.lang.String appId, javax.servlet.http.HttpServletRequest request)
IConfigService
updateConfig
in interface IConfigService
name
- - The name of the config objecttype
- - The type of config objectticket
- - The resolved session ticketpublic java.lang.String deleteConfig(java.lang.String name, java.lang.String type, java.lang.String ticket, java.lang.String appId, javax.servlet.http.HttpServletRequest request)
IConfigService
deleteConfig
in interface IConfigService
name
- - The name of the config objecttype
- - The type of config objectticket
- - The resolved session ticketappId
- - The application id that allows for separation of configs.public java.lang.String getConfigPath(java.lang.String ticket, javax.servlet.http.HttpServletRequest request)
@Value(value="${restConfigService.rootpath}") public void setConfigPath(java.lang.String configPath)
configPath
- the new config pathpublic java.io.ByteArrayOutputStream exportConfigByPath(java.lang.String ticket, java.lang.Boolean userPref, java.lang.String appId, java.util.List<java.lang.String> failedDocs)
IConfigService
exportConfigByPath
in interface IConfigService
ticket
- - the session/cookie ticket from HPIuserPref
- - boolean indicating whether to include user preferencesappId
- - the name of the config folder, located at /hpi/"appId"failedDocs
- - used by addDocumentToZip to keep track of documents that fail to add to the zippublic java.util.Map<java.lang.String,java.lang.String> extractFolder(java.lang.String zipName, java.lang.String ticket, java.io.InputStream configStream)
IConfigService
extractFolder
in interface IConfigService
ticket
- - The resolved session ticketconfigStream
- - a ZipStream containing all of the file data from the front endpublic java.lang.String getRootPath()
IConfigService
getRootPath
in interface IConfigService
public void findOrCreateAppIdFolder(java.lang.String ticket, java.lang.String appId)
IConfigService
findOrCreateAppIdFolder
in interface IConfigService