Package com.saperion.ngc.model
Class SettingsClassicConnectorService
java.lang.Object
com.saperion.ngc.model.ClassicConnectorService
com.saperion.ngc.model.SettingsClassicConnectorService
- All Implemented Interfaces:
Service
,SettingsService
public class SettingsClassicConnectorService
extends ClassicConnectorService
implements SettingsService
Default-implementation of
SettingsService
.-
Field Summary
Fields inherited from class com.saperion.ngc.model.ClassicConnectorService
ddcCache
-
Constructor Summary
ConstructorsConstructorDescriptionSettingsClassicConnectorService
(jakarta.servlet.http.HttpSession session) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionboolean
deleteSetting
(String name, String section, boolean longSetting) Deletes a setting in the backend.fixRevId
(DocumentId id, boolean force) Fix the revision id, if it's empty.Reads the actual user name from connector.Gets all ACL names.Deprecated.com.saperion.config.SQLType
getDatabaseType
(String ddcName) This method returns the type of database the given DDC is stored on.com.saperion.intf.DDC
Retrieves the specified DDC.Retrieves the fast access items.final List<com.saperion.intf.SaFieldDescription>
getFieldDescriptionsList
(String definitionName) Retrieves the field descriptions for the specified definition.Reads and sort the last launched workflow names.getProperties
(String section) Reads the properties stored in the given section in the INI configuration files of Saperion.final com.saperion.ngc.iform.xml.ResultType
getResultType
(String formName, int id, int rev, String ddc) Deprecated.use getSetting insteadgetSetting
(String name, String section, boolean longSetting) Retrieves a setting from the backend.getUtf8Properties
(String section) Reads the properties stored in the given section in the INI configuration files of Saperion.boolean
hasLicence
(com.saperion.rmi.SaFeature.FeatureKind kind) Checks, if the feature is supported.boolean
isAlive()
Check the backend connector.boolean
isAuditTable
(String ddcName) Checks, if the given ddc is an audit/protocol table.boolean
isLookupTable
(String ddcName) Checks, if the given ddc is a lookup table.boolean
Checks if release feature active.void
setFastAccessItems
(Map<String, String> items) Stores the fast access items.void
setLastLaunched
(String lastName) Set the last lauched workflow name.void
setProperties
(Map<String, String> props, String section) Writes the given properties to the given section.final void
setResultType
(String formName, int id, int rev, com.saperion.ngc.iform.xml.ResultType resultType, String ddc) Deprecated.use setSetting insteadvoid
setSetting
(String value, String name, String section, boolean longSetting) Stores a setting in the backend.void
setUtf8Properties
(Map<String, String> props, String section, boolean cleanSection) Writes the given properties with UTF-8 encoded values to the given section.Methods inherited from class com.saperion.ngc.model.ClassicConnectorService
convertAuthenticationException, getCachedDDC, getConnectionProvider, getCurrentUserFromSession, getSession, getWfConnectionProvider, isActive
-
Constructor Details
-
SettingsClassicConnectorService
public SettingsClassicConnectorService() -
SettingsClassicConnectorService
public SettingsClassicConnectorService(jakarta.servlet.http.HttpSession session) Constructor.- Parameters:
session
- Session
-
-
Method Details
-
getActualUser
Reads the actual user name from connector.- Specified by:
getActualUser
in interfaceSettingsService
- Returns:
- Actual user name
- See Also:
-
isAlive
public boolean isAlive() throws com.saperion.exception.SaSystemExceptionCheck the backend connector.- Specified by:
isAlive
in interfaceSettingsService
- Returns:
- Connector is alive
- Throws:
com.saperion.exception.SaSystemException
- System exception- See Also:
-
hasLicence
Checks, if the feature is supported.- Specified by:
hasLicence
in interfaceSettingsService
- Parameters:
kind
- Feature kind- Returns:
- True, if feature exists
- Throws:
SystemException
- See Also:
-
isReleaseActive
Checks if release feature active.- Specified by:
isReleaseActive
in interfaceSettingsService
- Returns:
- true, if release feature active
- Throws:
SystemException
- the system exceptionAuthenticationException
- the authentication exception- See Also:
-
getProperties
public Map<String,String> getProperties(String section) throws AuthenticationException, SystemException Reads the properties stored in the given section in the INI configuration files of Saperion. Tenant-specific settings will not be resolved automatically. To read a tenant-specific setting, the section name must include the tenant-ID. Consider usingSaperionIniSettings
instead for automatic tenant handling.- Specified by:
getProperties
in interfaceSettingsService
- Parameters:
section
- Section- Returns:
- Properties
- Throws:
AuthenticationException
- authentication exceptionSystemException
- system exception- See Also:
-
getUtf8Properties
public Map<String,String> getUtf8Properties(String section) throws AuthenticationException, SystemException Reads the properties stored in the given section in the INI configuration files of Saperion. The content of the section must be UTF-8 encoded. enant-specific settings will not be resolved automatically. To read a tenant-specific setting, the section name must include the tenant-ID.- Specified by:
getUtf8Properties
in interfaceSettingsService
- Parameters:
section
- Section- Returns:
- Properties
- Throws:
AuthenticationException
- authentication exceptionSystemException
- system exception- See Also:
-
setProperties
public void setProperties(Map<String, String> props, String section) throws AuthenticationException, SystemExceptionWrites the given properties to the given section.- Specified by:
setProperties
in interfaceSettingsService
- Parameters:
props
- Propertiessection
- Section- Throws:
AuthenticationException
- authentication exceptionSystemException
- system exception- See Also:
-
setUtf8Properties
public void setUtf8Properties(Map<String, String> props, String section, boolean cleanSection) throws AuthenticationException, SystemExceptionWrites the given properties with UTF-8 encoded values to the given section.- Specified by:
setUtf8Properties
in interfaceSettingsService
- Parameters:
props
- Propertiessection
- SectioncleanSection
- Clean section- Throws:
AuthenticationException
- authentication exceptionSystemException
- system exception- See Also:
-
getLastLaunched
Reads and sort the last launched workflow names.- Specified by:
getLastLaunched
in interfaceSettingsService
- Returns:
- Last launched items
- Throws:
AuthenticationException
- authentication exceptionSystemException
- system exception- See Also:
-
setLastLaunched
Set the last lauched workflow name.- Specified by:
setLastLaunched
in interfaceSettingsService
- Parameters:
lastName
- Last name- Throws:
AuthenticationException
- authentication exceptionSystemException
- system exception- See Also:
-
getFieldDescriptionsList
public final List<com.saperion.intf.SaFieldDescription> getFieldDescriptionsList(String definitionName) throws SystemException, AuthenticationException Retrieves the field descriptions for the specified definition.- Specified by:
getFieldDescriptionsList
in interfaceSettingsService
- Parameters:
definitionName
- definition name- Returns:
- field descriptions
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exception- See Also:
-
getDDC
public com.saperion.intf.DDC getDDC(String definitionName) throws SystemException, AuthenticationException Retrieves the specified DDC.- Specified by:
getDDC
in interfaceSettingsService
- Parameters:
definitionName
- name of the DDC to retrieve- Returns:
- information about the requested DDC
- Throws:
SystemException
- system error when retrieving DDCAuthenticationException
- authentication error when retrieving DDC- See Also:
-
isLookupTable
Checks, if the given ddc is a lookup table.- Specified by:
isLookupTable
in interfaceSettingsService
- Parameters:
ddcName
- DDC name- Returns:
- True, if it is a lookup table
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exception- See Also:
-
isAuditTable
Checks, if the given ddc is an audit/protocol table.- Specified by:
isAuditTable
in interfaceSettingsService
- Parameters:
ddcName
- DDC name- Returns:
- True, if it is a audit table
- Throws:
SystemException
- system exceptionAuthenticationException
- authentication exception- See Also:
-
fixRevId
public DocumentId fixRevId(DocumentId id, boolean force) throws SystemException, AuthenticationException Fix the revision id, if it's empty.- Specified by:
fixRevId
in interfaceSettingsService
- Parameters:
id
- Document idforce
- Force the renew- Returns:
- New document id
- Throws:
SystemException
- System exceptionAuthenticationException
- authentication exception- See Also:
-
getAllAcls
Gets all ACL names.- Specified by:
getAllAcls
in interfaceSettingsService
- Returns:
- list of ACL names
- Throws:
AuthenticationException
SystemException
- See Also:
-
setResultType
@Deprecated public final void setResultType(String formName, int id, int rev, com.saperion.ngc.iform.xml.ResultType resultType, String ddc) throws SystemException, AuthenticationException Deprecated.use setSetting insteadSave the resultset format to backend.- Specified by:
setResultType
in interfaceSettingsService
- Parameters:
formName
- Form nameid
- Frame idrev
- Revision numberresultType
- Result type instanceddc
- DDC name- Throws:
SystemException
- System exceptionAuthenticationException
- Authentication exception- See Also:
-
getResultType
@Deprecated public final com.saperion.ngc.iform.xml.ResultType getResultType(String formName, int id, int rev, String ddc) throws SystemException, AuthenticationException Deprecated.use getSetting insteadReads the resultset format from backend.- Specified by:
getResultType
in interfaceSettingsService
- Parameters:
formName
- Form nameid
- Frame idrev
- Revision numberddc
- DDC name- Returns:
- Result type instance
- Throws:
SystemException
- System exceptionAuthenticationException
- Authentication exception- See Also:
-
getSetting
public String getSetting(String name, String section, boolean longSetting) throws SystemException, AuthenticationException Retrieves a setting from the backend.- Specified by:
getSetting
in interfaceSettingsService
- Parameters:
name
- the name of the settingsection
- the section of the settinglongSetting
- whether the value of the setting is allowed to be longer than 2KB or not- Returns:
- the setting's value as a string. Note that long settings cannot hold unicode chararacters
- Throws:
SystemException
- system error when retrieving the settingAuthenticationException
- authentication error when retrieving the setting- See Also:
-
setSetting
public void setSetting(String value, String name, String section, boolean longSetting) throws SystemException, AuthenticationException Stores a setting in the backend.- Specified by:
setSetting
in interfaceSettingsService
- Parameters:
value
- the setting's value. If longSetting is false, this is limited to 2KB. If longSetting is true, the string must not contain unicode characters.name
- the name of the settingsection
- the section of the settinglongSetting
- whether the value is allowed to be longer than 2KB or not- Throws:
SystemException
- system error when storing the settingAuthenticationException
- authentication error when storing the setting- See Also:
-
deleteSetting
public boolean deleteSetting(String name, String section, boolean longSetting) throws SystemException, AuthenticationException Deletes a setting in the backend.- Specified by:
deleteSetting
in interfaceSettingsService
- Parameters:
name
- the name of the settingsection
- the section of the settinglongSetting
- whether the setting's value is allowed to be longer than 2KB or not- Returns:
- true if setting was deleted
- Throws:
SystemException
- system error when deleting the settingAuthenticationException
- authentication error when deleting the setting- See Also:
-
getFastAccessItems
Retrieves the fast access items.- Specified by:
getFastAccessItems
in interfaceSettingsService
- Returns:
- fast access items
- Throws:
AuthenticationException
- authentication exceptionSystemException
- system exception- See Also:
-
setFastAccessItems
public void setFastAccessItems(Map<String, String> items) throws AuthenticationException, SystemExceptionStores the fast access items.- Specified by:
setFastAccessItems
in interfaceSettingsService
- Parameters:
items
- fast access items as pairs of name and path- Throws:
AuthenticationException
- authentication exceptionSystemException
- system exception- See Also:
-
getDatabaseType
Deprecated.Description copied from interface:SettingsService
Convenience method to get the type of the database currently in use.- Specified by:
getDatabaseType
in interfaceSettingsService
- Returns:
- type of the database
- Throws:
AuthenticationException
- authentication exceptionSystemException
- system exception
-
getDatabaseType
public com.saperion.config.SQLType getDatabaseType(String ddcName) throws AuthenticationException, SystemException Description copied from interface:SettingsService
This method returns the type of database the given DDC is stored on.- Specified by:
getDatabaseType
in interfaceSettingsService
- Parameters:
ddcName
- the name of the DDC to check- Returns:
- the type of database for the DDC
- Throws:
AuthenticationException
- missing privileges or re-logon requiredSystemException
- system error when loading DDC
-