Package com.axemble.vdoc.sdk.impl
Class PortalModuleImpl
java.lang.Object
com.axemble.vdoc.sdk.impl.AbstractTranslaterModule
com.axemble.vdoc.sdk.impl.CoreModule
com.axemble.vdoc.sdk.impl.PortalModuleImpl
- All Implemented Interfaces:
IBasePortalModule
,IModule
,IPortalModule
,Serializable
,Remote
- Author:
- vlygeros
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
static class
Module fake pour gérer la sécurité sur les portlets basés sur un pm A éviter au maximum car le pm n'est libéré que par le finalize ! -
Field Summary
Modifier and TypeFieldDescriptionprotected static HashMap
protected static Map
<String, PortalModuleImpl.IURIConverter> Fields inherited from class com.axemble.vdoc.sdk.impl.CoreModule
LOGGER, properties
-
Constructor Summary
ConstructorDescriptionDeprecated.Use com.axemble.vdoc.sdk.Modules.getPortalModule() instead. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAuthenticationKey
(String key, IUser user, Date expirationDate, String authorizedAddress) Adds an authenticationKey for a user The ExternalAuthenticationLoginModule will be automatically connect the user if he uses the parameter _AuthenticationKeycreateConnectionDefinition
(IContext context, IOrganization organization, String name, String label, String categoryName) Create a connection definitioncreateMailingList
(IContext context, IOrganization organization, String name, String label, int type) Creates a new mailing list.void
createNewSession
(String login) Creates a new session.executeTask
(Class<?> extensionClass, Map<String, String> parameters) Execute a BaseTaskExtensionfindNativeClass
(Class interfaceClass) Allows to retrieve the inner native class.generateAuthenticationKey
(IUser user, Date expirationDate, String authorizedAddress) Generates and adds an authenticationKey for a user The ExternalAuthenticationLoginModule will be automatically connect the user if he uses the parameter _AuthenticationKeygenerateSystemName
(String label) Generate a valid system name for this module and this label.Gets an AsyncJobQueue controller.getConnectionDefinition
(IContext context, String name) Gets a connection from its name.Collection
<? extends IConnectionDefinition<?>> getConnectionDefinitions
(IContext context) Gets a collection of connections.Collection
<? extends IConnectionDefinition<?>> getConnectionDefinitionsByCategoryName
(IContext context, String categoryName) Gets a connection from its name.Collection
<? extends IConnectionDefinition<?>> getConnectionDefinitionsByTypeName
(IContext context, String type) Gets a connection from its name.protected static PortalModuleImpl.IURIConverter
getConverter
(String key) getElementByProtocolURI
(String protocolURI) Gets anIElement
object which implementsIProtocolSupport
interface.Gets a History Event controller.getIndexController
(String name) Gets the controller of the specified index name.Gets a JMS controller.getMailingList
(IContext context, String name, int type) Gets a mailing list by its name.Gets a mailing list object from its identifier.getMailingList
(Object object) Gets a mailing list object from its identifier.Collection
<? extends IMailingList> getMailingLists
(IContext context) Gets all mailing lists.protected static Class
getNativeClass
(Class interfaceClass) Get anINotificationController
getPortlet
(IContext context, String name) Gets a portlet by its name.getProtocolURI
(IProtocolSupport protocolSupport) Gets a protocolURI from aIProtocolSupport
object.getProtocolURI
(IProtocolSupport protocolSupport, boolean useNames) Gets a protocolURI from aIProtocolSupport
object.getSecurityController
(ISecuritySupport securitySupport) Gets a security controller on a specified object.getValidatorErrorMessage
(String rule, String language) Get the validator's error messagevoid
Kills the current session.void
killSession
(jakarta.servlet.http.HttpSession session) Kills a session.void
replaceCurrentSession
(String login) Replaces the current session.void
send
(jakarta.mail.internet.MimeMessage message) Allows to send a message through the mail agent.<T> boolean
validate
(Collection<T> values, String... rules) Validate values with validator's rules<T> boolean
Validate value with validator's rulesboolean
verifyAuthentication
(String login, String password) Verifies login / password parameters against JAAS.verifyPassword
(String login, String password) Allows to verify a password for a specified user login.verifyPassword
(String login, String password, jakarta.servlet.http.HttpServletRequest request) Allows to verify a password for a specified user login.verifyToken
(String token) Verifies authentication tokenMethods inherited from class com.axemble.vdoc.sdk.impl.CoreModule
beginTransaction, beginTransaction, commitTransaction, commitTransaction, convertId, createAttachment, createAttachment, createAttachment, createAttachment, createProfile, getAnonymous, getAnonymousContext, getComponentsFactory, getConfiguration, getContext, getContext, getContext, getContextByLogin, getDefinitionsFactory, getElementFromExternalElement, getExternalElement, getExternalElement, getLanguage, getLoggedOnUser, getLoggedOnUserContext, getLoggedOnUserLanguage, getProfile, getProfile, getProfiles, getProtocolPath, getProtocolPath, getProtocolURI, getProtocolURI, getStaticString, getStaticString, getStaticString, getStaticString, getStaticString, getStaticString, getStaticString, getStaticString, getStaticString, getStaticString, getStaticString, getSysadmin, getSysadminContext, getUser, getUser, getUserByLogin, initialize, isTransactionActive, rollbackTransaction, rollbackTransaction, setTransactionTimeout, unInitialize
Methods inherited from class com.axemble.vdoc.sdk.impl.AbstractTranslaterModule
getTranslation, getTranslationForLanguage, getTranslationKey
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.axemble.vdoc.sdk.modules.IBasePortalModule
getConfiguration
Methods inherited from interface com.axemble.vdoc.sdk.modules.IModule
beginTransaction, beginTransaction, commitTransaction, commitTransaction, convertId, getAnonymous, getAnonymousContext, getContext, getContext, getContextByLogin, getElementFromExternalElement, getExternalElement, getExternalElement, getLoggedOnUser, getLoggedOnUserContext, getLoggedOnUserLanguage, getProtocolPath, getProtocolPath, getProtocolURI, getProtocolURI, getStaticString, getStaticString, getStaticString, getStaticString, getStaticString, getStaticString, getStaticString, getStaticString, getStaticString, getStaticString, getStaticString, getSysadmin, getSysadminContext, getTranslation, getTranslationForLanguage, getTranslationKey, initialize, isTransactionActive, rollbackTransaction, rollbackTransaction, setTransactionTimeout, unInitialize
-
Field Details
-
uriConverters
-
nativeClasses
-
-
Constructor Details
-
PortalModuleImpl
Deprecated.Use com.axemble.vdoc.sdk.Modules.getPortalModule() instead.
-
-
Method Details
-
getConverter
-
getElementByProtocolURI
Description copied from interface:IBasePortalModule
Gets anIElement
object which implementsIProtocolSupport
interface.- Specified by:
getElementByProtocolURI
in interfaceIBasePortalModule
- Overrides:
getElementByProtocolURI
in classCoreModule
- Parameters:
protocolURI
- The protocol URI as a java.lang.String.- Returns:
- A
IProtocolSupport
object. - Throws:
ModuleException
- default module exception.
-
getProtocolURI
Description copied from interface:IBasePortalModule
Gets a protocolURI from aIProtocolSupport
object.- Specified by:
getProtocolURI
in interfaceIBasePortalModule
- Parameters:
protocolSupport
- The object to convert into a protocolURI.- Returns:
- A
String
short protocolURI. - Throws:
ModuleException
- default module exception.
-
getProtocolURI
public String getProtocolURI(IProtocolSupport protocolSupport, boolean useNames) throws ModuleException Description copied from interface:IBasePortalModule
Gets a protocolURI from aIProtocolSupport
object.- Specified by:
getProtocolURI
in interfaceIBasePortalModule
- Parameters:
protocolSupport
- The object to convert into a protocolURI.useNames
- use short URI (with id) or long URI (with system names)- Returns:
- A
String
protocolURI. - Throws:
ModuleException
- default module exception.
-
getNativeClass
-
findNativeClass
Description copied from interface:IModule
Allows to retrieve the inner native class.- Specified by:
findNativeClass
in interfaceIModule
- Overrides:
findNativeClass
in classCoreModule
- Parameters:
interfaceClass
- A class type.- Returns:
- The inner native class.
-
createNewSession
Description copied from interface:IBasePortalModule
Creates a new session.- Specified by:
createNewSession
in interfaceIBasePortalModule
- Parameters:
login
- The login of the user to create the session.- Throws:
PortalModuleException
- default module exception.
-
killCurrentSession
Description copied from interface:IBasePortalModule
Kills the current session.- Specified by:
killCurrentSession
in interfaceIBasePortalModule
- Throws:
PortalModuleException
- default module exception.
-
killSession
Description copied from interface:IBasePortalModule
Kills a session.- Specified by:
killSession
in interfaceIBasePortalModule
- Parameters:
session
- the session to kill- Throws:
PortalModuleException
- default module exception.
-
replaceCurrentSession
Description copied from interface:IBasePortalModule
Replaces the current session.- Specified by:
replaceCurrentSession
in interfaceIBasePortalModule
- Parameters:
login
- The login of the user to replace the session with.- Throws:
PortalModuleException
- default module exception.
-
addAuthenticationKey
public void addAuthenticationKey(String key, IUser user, Date expirationDate, String authorizedAddress) throws PortalModuleException Description copied from interface:IBasePortalModule
Adds an authenticationKey for a user The ExternalAuthenticationLoginModule will be automatically connect the user if he uses the parameter _AuthenticationKey- Specified by:
addAuthenticationKey
in interfaceIBasePortalModule
- Parameters:
key
-user
-expirationDate
-authorizedAddress
- (the user will be able to connect only from these ip addresses : null to allow any address)- Throws:
PortalModuleException
-
generateAuthenticationKey
public String generateAuthenticationKey(IUser user, Date expirationDate, String authorizedAddress) throws PortalModuleException Description copied from interface:IBasePortalModule
Generates and adds an authenticationKey for a user The ExternalAuthenticationLoginModule will be automatically connect the user if he uses the parameter _AuthenticationKey- Specified by:
generateAuthenticationKey
in interfaceIBasePortalModule
- Parameters:
user
-expirationDate
-authorizedAddress
- (the user will be able to connect only from these ip addresses : null to allow any address)- Returns:
- the authentication key
- Throws:
PortalModuleException
-
getPortlet
Description copied from interface:IBasePortalModule
Gets a portlet by its name.- Specified by:
getPortlet
in interfaceIBasePortalModule
- Parameters:
context
- The execution context.name
- The name of theIPortlet
object.- Returns:
- The
IPortlet
object. - Throws:
PortalModuleException
- default module exception.
-
getSecurityController
public ISecurityController getSecurityController(ISecuritySupport securitySupport) throws PortalModuleException Description copied from interface:IBasePortalModule
Gets a security controller on a specified object.- Specified by:
getSecurityController
in interfaceIBasePortalModule
- Parameters:
securitySupport
- Any IElement that implements ISecuritySupport interface.- Returns:
- The
ISecurityController
object. - Throws:
PortalModuleException
- default module exception.
-
getJMSController
Description copied from interface:IBasePortalModule
Gets a JMS controller.- Specified by:
getJMSController
in interfaceIBasePortalModule
- Returns:
- the
IJMSController
object. - Throws:
PortalModuleException
- default module exception.
-
getNotificationController
Description copied from interface:IBasePortalModule
Get anINotificationController
- Specified by:
getNotificationController
in interfaceIBasePortalModule
- Returns:
- the
INotificationController
instance - Throws:
PortalModuleException
- default module exception
-
getAsyncJobQueueController
Description copied from interface:IBasePortalModule
Gets an AsyncJobQueue controller.- Specified by:
getAsyncJobQueueController
in interfaceIBasePortalModule
- Returns:
- the
IAsyncJobQueueController
object.
-
getHistoryEventController
Description copied from interface:IBasePortalModule
Gets a History Event controller.- Specified by:
getHistoryEventController
in interfaceIBasePortalModule
- Returns:
- the
IEventController
object.
-
verifyAuthentication
Description copied from interface:IBasePortalModule
Verifies login / password parameters against JAAS.- Specified by:
verifyAuthentication
in interfaceIBasePortalModule
- Parameters:
login
- The login of the user to verify.password
- The password of the user to verify.- Returns:
- true if the parameters are valid, false otherwise.
-
verifyPassword
Description copied from interface:IBasePortalModule
Allows to verify a password for a specified user login.- Specified by:
verifyPassword
in interfaceIBasePortalModule
- Parameters:
login
- The login of the user.password
- The password to verify.- Returns:
- A
IUser
object.
-
verifyPassword
public IUser verifyPassword(String login, String password, jakarta.servlet.http.HttpServletRequest request) Description copied from interface:IBasePortalModule
Allows to verify a password for a specified user login.- Specified by:
verifyPassword
in interfaceIBasePortalModule
- Parameters:
login
- The login of the user.password
- The password to verify.request
- The http Request- Returns:
- A
IUser
object.
-
getMailingList
public IMailingList getMailingList(IContext context, String name, int type) throws PortalModuleException Description copied from interface:IBasePortalModule
Gets a mailing list by its name.- Specified by:
getMailingList
in interfaceIBasePortalModule
- Parameters:
context
- the execution context.name
- the name of theIMailingList
object.type
- the mailing list type- Returns:
- a
IMailingList
object - Throws:
PortalModuleException
- default module exception.
-
createMailingList
public IMailingList createMailingList(IContext context, IOrganization organization, String name, String label, int type) throws PortalModuleException Description copied from interface:IBasePortalModule
Creates a new mailing list.- Specified by:
createMailingList
in interfaceIBasePortalModule
- Parameters:
context
- the execution context.organization
- theIOrganization
of the mailing list.name
- the system name of the mailing list.label
- the label of the mailing list.type
- the type of the mailing list.- Returns:
- a
IMailingList
object. - Throws:
PortalModuleException
- default module exception.
-
getMailingLists
public Collection<? extends IMailingList> getMailingLists(IContext context) throws PortalModuleException Description copied from interface:IBasePortalModule
Gets all mailing lists.- Specified by:
getMailingLists
in interfaceIBasePortalModule
- Parameters:
context
- the execution context.- Returns:
- a java.util.Collection of
IMailingList
objects. - Throws:
PortalModuleException
- default module exception.
-
getMailingList
Description copied from interface:IBasePortalModule
Gets a mailing list object from its identifier.- Specified by:
getMailingList
in interfaceIBasePortalModule
- Parameters:
object
- A object.- Returns:
- A
IMailingList
object. - Throws:
PortalModuleException
- default module exception.
-
getMailingList
Description copied from interface:IBasePortalModule
Gets a mailing list object from its identifier.- Specified by:
getMailingList
in interfaceIBasePortalModule
- Parameters:
key
- The key of the mailing list.- Returns:
- A
IMailingList
object. - Throws:
PortalModuleException
- default module exception.
-
send
Description copied from interface:IBasePortalModule
Allows to send a message through the mail agent.- Specified by:
send
in interfaceIBasePortalModule
- Parameters:
message
- TheMimeMessage
object to send.- Throws:
PortalModuleException
- default module exception.
-
getIndexController
Description copied from interface:IBasePortalModule
Gets the controller of the specified index name.- Specified by:
getIndexController
in interfaceIBasePortalModule
- Parameters:
name
- The name of the index.- Returns:
- A
IIndexController
object. - Throws:
PortalModuleException
- default module exception.
-
validate
Description copied from interface:IBasePortalModule
Validate value with validator's rules- Specified by:
validate
in interfaceIBasePortalModule
- Parameters:
value
- value to validaterules
- rules to apply for validation- Returns:
- true if the value is valid, false otherwise.
-
validate
Description copied from interface:IBasePortalModule
Validate values with validator's rules- Specified by:
validate
in interfaceIBasePortalModule
- Parameters:
values
- values to validaterules
- rules to apply for validation- Returns:
- true if all the values are valid, false otherwise.
-
getValidatorErrorMessage
Description copied from interface:IBasePortalModule
Get the validator's error message- Specified by:
getValidatorErrorMessage
in interfaceIBasePortalModule
- Parameters:
rule
- The validator's namelanguage
- The language- Returns:
- the validator's error message, null otherwise
-
executeTask
public IReport executeTask(Class<?> extensionClass, Map<String, String> parameters) throws PortalModuleExceptionDescription copied from interface:IBasePortalModule
Execute a BaseTaskExtension- Specified by:
executeTask
in interfaceIBasePortalModule
- Parameters:
extensionClass
- class to executeparameters
- parameters sent to the map- Returns:
- execution report
- Throws:
PortalModuleException
-
createConnectionDefinition
public IConnectionDefinition<?> createConnectionDefinition(IContext context, IOrganization organization, String name, String label, String categoryName) Description copied from interface:IBasePortalModule
Create a connection definition- Specified by:
createConnectionDefinition
in interfaceIBasePortalModule
- Parameters:
context
- The execution context.organization
- theIOrganization
organization of the connectionname
- the name of the connectionlabel
- The label of the connectioncategoryName
- the type of the connection- Returns:
- the new connection definition
-
getConnectionDefinition
public IConnectionDefinition<?> getConnectionDefinition(IContext context, String name) throws PortalModuleException Description copied from interface:IBasePortalModule
Gets a connection from its name.- Specified by:
getConnectionDefinition
in interfaceIBasePortalModule
- Parameters:
context
- The execution context.name
- The name of the external reference.- Returns:
- a
IConnectionDefinition
object. - Throws:
PortalModuleException
- default module exception.
-
getConnectionDefinitions
public Collection<? extends IConnectionDefinition<?>> getConnectionDefinitions(IContext context) throws PortalModuleException Description copied from interface:IBasePortalModule
Gets a collection of connections.- Specified by:
getConnectionDefinitions
in interfaceIBasePortalModule
- Parameters:
context
- The execution context.- Returns:
- a
Collection
of IConnectionDefinition object. - Throws:
PortalModuleException
- default module exception.
-
verifyToken
Description copied from interface:IBasePortalModule
Verifies authentication token- Specified by:
verifyToken
in interfaceIBasePortalModule
- Parameters:
token
- the token to verify- Returns:
- null if the token is invalid or expired, the matching
IUser
if the token is valid
-
getConnectionDefinitionsByTypeName
public Collection<? extends IConnectionDefinition<?>> getConnectionDefinitionsByTypeName(IContext context, String type) throws PortalModuleException Description copied from interface:IBasePortalModule
Gets a connection from its name.- Specified by:
getConnectionDefinitionsByTypeName
in interfaceIBasePortalModule
- Parameters:
context
- The execution context.type
- The type of the external reference.- Returns:
- a
Collection
of IConnectionDefinition object. - Throws:
PortalModuleException
- default module exception.
-
getConnectionDefinitionsByCategoryName
public Collection<? extends IConnectionDefinition<?>> getConnectionDefinitionsByCategoryName(IContext context, String categoryName) throws PortalModuleException Description copied from interface:IBasePortalModule
Gets a connection from its name.- Specified by:
getConnectionDefinitionsByCategoryName
in interfaceIBasePortalModule
- Parameters:
context
- The execution context.categoryName
- The categoryName of the external reference.- Returns:
- a
Collection
of IConnectionDefinition object. - Throws:
PortalModuleException
- default module exception.
-
generateSystemName
Description copied from interface:IModule
Generate a valid system name for this module and this label.- Specified by:
generateSystemName
in interfaceIModule
- Parameters:
label
- label to normalize- Returns:
- normalized value
-