Package com.axemble.vdoc.sdk.modules
Interface IBasePortalModule
- All Known Subinterfaces:
IPortalModule
- All Known Implementing Classes:
PortalModuleImpl
The IPortalModule interface is the main entry point from where most of the methods to manipulate the full set of portal
objects are made available.
Code sample :
// creation of a portal module object
IBasePortalModule portalModule = Modules.getPortalModule();
try
{
}
finally
{
// uninitialize the module
Modules.releaseModule(portalModule);
}
- Since:
- 2.0
- Version:
- 1.0, 14/02/2009
- Author:
- vlygeros
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAuthenticationKey
(String key, IUser user, Date expirationDate, String authorizedAddresses) 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 BaseTaskExtensiongenerateAuthenticationKey
(IUser user, Date expirationDate, String authorizedAddresses) Generates and adds an authenticationKey for a user The ExternalAuthenticationLoginModule will be automatically connect the user if he uses the parameter _AuthenticationKeyGets an AsyncJobQueue controller.Gets the global configuration.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.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) Deprecated.use getMailingList( IStorageKey key )Collection
<? extends IMailingList> getMailingLists
(IContext context) Gets all mailing lists.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 interface com.axemble.vdoc.sdk.modules.IModule
beginTransaction, beginTransaction, commitTransaction, commitTransaction, convertId, findNativeClass, generateSystemName, 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
-
Method Details
-
getConfiguration
IConfiguration getConfiguration()Gets the global configuration.- Returns:
- a
IConfiguration
object.
-
verifyAuthentication
Verifies login / password parameters against JAAS.- 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.
-
verifyToken
Verifies authentication token- Parameters:
token
- the token to verify- Returns:
- null if the token is invalid or expired, the matching
IUser
if the token is valid
-
killCurrentSession
Kills the current session.- Throws:
PortalModuleException
- default module exception.
-
killSession
Kills a session.- Parameters:
session
- the session to kill- Throws:
PortalModuleException
- default module exception.
-
createNewSession
Creates a new session.- Parameters:
login
- The login of the user to create the session.- Throws:
PortalModuleException
- default module exception.
-
replaceCurrentSession
Replaces the current session.- Parameters:
login
- The login of the user to replace the session with.- Throws:
PortalModuleException
- default module exception.
-
addAuthenticationKey
void addAuthenticationKey(String key, IUser user, Date expirationDate, String authorizedAddresses) throws PortalModuleException Adds an authenticationKey for a user The ExternalAuthenticationLoginModule will be automatically connect the user if he uses the parameter _AuthenticationKey- Parameters:
key
-user
-expirationDate
-authorizedAddresses
- (the user will be able to connect only from these ip addresses : null to allow any address)- Throws:
PortalModuleException
-
generateAuthenticationKey
String generateAuthenticationKey(IUser user, Date expirationDate, String authorizedAddresses) throws PortalModuleException Generates and adds an authenticationKey for a user The ExternalAuthenticationLoginModule will be automatically connect the user if he uses the parameter _AuthenticationKey- Parameters:
user
-expirationDate
-authorizedAddresses
- (the user will be able to connect only from these ip addresses : null to allow any address)- Returns:
- the authentication key
- Throws:
PortalModuleException
-
getPortlet
Gets a portlet by its name.- Parameters:
context
- The execution context.name
- The name of theIPortlet
object.- Returns:
- The
IPortlet
object. - Throws:
PortalModuleException
- default module exception.
-
getSecurityController
ISecurityController getSecurityController(ISecuritySupport securitySupport) throws PortalModuleException Gets a security controller on a specified object.- Parameters:
securitySupport
- Any IElement that implements ISecuritySupport interface.- Returns:
- The
ISecurityController
object. - Throws:
PortalModuleException
- default module exception.
-
getJMSController
Gets a JMS controller.- Returns:
- the
IJMSController
object. - Throws:
PortalModuleException
- default module exception.
-
getNotificationController
Get anINotificationController
- Returns:
- the
INotificationController
instance - Throws:
PortalModuleException
- default module exception
-
getAsyncJobQueueController
IAsyncJobQueueController getAsyncJobQueueController()Gets an AsyncJobQueue controller.- Returns:
- the
IAsyncJobQueueController
object.
-
getHistoryEventController
IEventController getHistoryEventController()Gets a History Event controller.- Returns:
- the
IEventController
object.
-
verifyPassword
Allows to verify a password for a specified user login.- Parameters:
login
- The login of the user.password
- The password to verify.- Returns:
- A
IUser
object.
-
verifyPassword
IUser verifyPassword(String login, String password, jakarta.servlet.http.HttpServletRequest request) Allows to verify a password for a specified user login.- Parameters:
login
- The login of the user.password
- The password to verify.request
- The http Request- Returns:
- A
IUser
object.
-
createMailingList
IMailingList createMailingList(IContext context, IOrganization organization, String name, String label, int type) throws PortalModuleException Creates a new mailing list.- 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.
-
getMailingList
Gets a mailing list by its name.- 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.
-
getMailingLists
Gets all mailing lists.- Parameters:
context
- the execution context.- Returns:
- a java.util.Collection of
IMailingList
objects. - Throws:
PortalModuleException
- default module exception.
-
getMailingList
Deprecated.use getMailingList( IStorageKey key )Gets a mailing list object from its identifier.- Parameters:
object
- A object.- Returns:
- A
IMailingList
object. - Throws:
PortalModuleException
- default module exception.
-
getMailingList
Gets a mailing list object from its identifier.- Parameters:
key
- The key of the mailing list.- Returns:
- A
IMailingList
object. - Throws:
PortalModuleException
- default module exception.
-
send
Allows to send a message through the mail agent.- Parameters:
message
- TheMimeMessage
object to send.- Throws:
PortalModuleException
- default module exception.
-
getElementByProtocolURI
Gets anIElement
object which implementsIProtocolSupport
interface.- Parameters:
protocolURI
- The protocol URI as a java.lang.String.- Returns:
- A
IProtocolSupport
object. - Throws:
ModuleException
- default module exception.
-
getProtocolURI
Gets a protocolURI from aIProtocolSupport
object.- Parameters:
protocolSupport
- The object to convert into a protocolURI.- Returns:
- A
String
short protocolURI. - Throws:
ModuleException
- default module exception.
-
getProtocolURI
Gets a protocolURI from aIProtocolSupport
object.- 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.
-
getIndexController
Gets the controller of the specified index name.- Parameters:
name
- The name of the index.- Returns:
- A
IIndexController
object. - Throws:
PortalModuleException
- default module exception.
-
validate
Validate value with validator's rules- Parameters:
value
- value to validaterules
- rules to apply for validation- Returns:
- true if the value is valid, false otherwise.
-
validate
Validate values with validator's rules- Parameters:
values
- values to validaterules
- rules to apply for validation- Returns:
- true if all the values are valid, false otherwise.
-
getValidatorErrorMessage
Get the validator's error message- Parameters:
rule
- The validator's namelanguage
- The language- Returns:
- the validator's error message, null otherwise
-
executeTask
IReport executeTask(Class<?> extensionClass, Map<String, String> parameters) throws PortalModuleExceptionExecute a BaseTaskExtension- Parameters:
extensionClass
- class to executeparameters
- parameters sent to the map- Returns:
- execution report
- Throws:
PortalModuleException
-
getConnectionDefinition
IConnectionDefinition<?> getConnectionDefinition(IContext context, String name) throws PortalModuleException Gets a connection from its name.- Parameters:
context
- The execution context.name
- The name of the external reference.- Returns:
- a
IConnectionDefinition
object. - Throws:
PortalModuleException
- default module exception.
-
getConnectionDefinitionsByTypeName
Collection<? extends IConnectionDefinition<?>> getConnectionDefinitionsByTypeName(IContext context, String type) throws PortalModuleException Gets a connection from its name.- Parameters:
context
- The execution context.type
- The type of the external reference.- Returns:
- a
Collection
of IConnectionDefinition object. - Throws:
PortalModuleException
- default module exception.
-
getConnectionDefinitionsByCategoryName
Collection<? extends IConnectionDefinition<?>> getConnectionDefinitionsByCategoryName(IContext context, String categoryName) throws PortalModuleException Gets a connection from its name.- Parameters:
context
- The execution context.categoryName
- The categoryName of the external reference.- Returns:
- a
Collection
of IConnectionDefinition object. - Throws:
PortalModuleException
- default module exception.
-
getConnectionDefinitions
Collection<? extends IConnectionDefinition<?>> getConnectionDefinitions(IContext context) throws PortalModuleException Gets a collection of connections.- Parameters:
context
- The execution context.- Returns:
- a
Collection
of IConnectionDefinition object. - Throws:
PortalModuleException
- default module exception.
-
createConnectionDefinition
IConnectionDefinition<?> createConnectionDefinition(IContext context, IOrganization organization, String name, String label, String categoryName) throws PortalModuleException Create a connection definition- 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
- Throws:
PortalModuleException
- default module exception.
-