Class ObjectFactory


  • @VelocityVariable("Factory")
    @VelocityCallable("instance")
    public final class ObjectFactory
    extends Object
    This class is solely intended to create or access objects without having them preallocated in the Velocity context.

    NOTE: Database connections and session objects are intentionally required in the methods' parameter lists to make their usage explicit in the Velocity script files.

    • Constructor Detail

      • ObjectFactory

        public ObjectFactory​(de.uplanet.lucy.server.scripting.velocity.callables.IInternalObjectFactory p_internalObjectFactory)
      • ObjectFactory

        public ObjectFactory​(de.uplanet.lucy.server.scripting.velocity.callables.IInternalObjectFactory p_internalObjectFactory,
                             de.uplanet.lucy.server.portlet.dao.IMainPortalDaoFactory p_mainPortalDaoFactory)
    • Method Detail

      • createFilter

        public IFilter<?> createFilter​(String p_strFilterClass)
                                throws Exception
        Create a filter.
        Parameters:
        p_strFilterClass - The fully qualified name of a class that implements IFilter, and has a public default constructor.
        Returns:
        A new filter object.
        Throws:
        Exception - If an error occurred.
      • createFilter

        public IFilter<?> createFilter​(String p_strFilterClass,
                                       Object p_param)
                                throws Exception
        Create a filter with a single construction parameter.
        Parameters:
        p_strFilterClass - The fully qualified name of a class that implements IFilter, and has a public default constructor.
        p_param - a construction parameter for the filter.
        Returns:
        A new filter object.
        Throws:
        Exception - If an error occurred.
      • getUserProfile

        public de.uplanet.lucy.server.profile.IUserProfile getUserProfile​(de.uplanet.jdbc.JdbcConnection p_conn,
                                                                          String p_strUserId,
                                                                          int p_iCacheUsage)
        See Also:
        UserProfile
      • getPortletUtil

        public de.uplanet.lucy.server.auxiliaries.portlet.VelocityPortlets getPortletUtil()
        Get the portlet util callable.
        Returns:
        The portlet util callable.
      • getLicUtil

        public LicUtil getLicUtil()
        Get the license util callable.
        Returns:
        The license util callable.
      • getNag

        public de.uplanet.lucy.server.kahab.NagResult getNag​(de.uplanet.lucy.server.engine.http.IWebProcessingContext p_ctx,
                                                             String p_strLang)
        For internal use only.
        Parameters:
        p_ctx - The current processing context.
        p_strLang - The language identifier.
        Returns:
        The nag result.
      • getPortletManagerForDefaultUser

        public de.uplanet.lucy.server.auxiliaries.portlet.VelocityPortletManager getPortletManagerForDefaultUser​(de.uplanet.lucy.server.engine.http.IWebProcessingContext p_ctx,
                                                                                                                 de.uplanet.lucy.server.businesslogic.rtappservices.IWebDataCollection p_dataCollection,
                                                                                                                 String p_strGridId,
                                                                                                                 String p_strLang)
        Get a portlet manager for the default user.
        Parameters:
        p_ctx - The current processing context.
        p_strGridId - The grid-ID/portlet container-GUID.
        p_strLang - The language identifier.
        Returns:
        A portlet manager.
      • getPortletManager

        public de.uplanet.lucy.server.auxiliaries.portlet.VelocityPortletManager getPortletManager​(de.uplanet.lucy.server.engine.http.IWebProcessingContext p_ctx,
                                                                                                   de.uplanet.lucy.server.businesslogic.rtappservices.IWebDataCollection p_dataCollection,
                                                                                                   String p_strGridId,
                                                                                                   String p_strUserGuid,
                                                                                                   String p_strLang)
        Get a portlet manager for the given user.
        Parameters:
        p_ctx - The current processing context.
        p_strGridId - The grid-ID/portlet container-GUID.
        p_strUserGuid - The user for whom the portlet manager should be created.
        p_strLang - The language identifier.
        Returns:
        A portlet manager.
      • hasPortalAdminPermission

        public boolean hasPortalAdminPermission​(de.uplanet.lucy.server.engine.http.IWebProcessingContext p_ctx,
                                                de.uplanet.lucy.server.businesslogic.rtappservices.IWebDataCollection p_dataCollection,
                                                String p_strGridId)
      • getPortletGridManagerForDefaultUser

        public de.uplanet.lucy.server.auxiliaries.portlet.VelocityPortletGridManager getPortletGridManagerForDefaultUser​(de.uplanet.jdbc.JdbcConnection p_conn,
                                                                                                                         String p_strGridId,
                                                                                                                         String p_strLang)
        Get a portlet grid manager for the default user.
        Parameters:
        p_conn - The database connection to be used.
        p_strGridId - The grid-ID/portal container-GUID.
        p_strLang - The language identifier.
        Returns:
        A portlet grid manager.
      • getPortletGridManager

        public de.uplanet.lucy.server.auxiliaries.portlet.VelocityPortletGridManager getPortletGridManager​(de.uplanet.jdbc.JdbcConnection p_conn,
                                                                                                           String p_strGridId,
                                                                                                           String p_strUserGuid,
                                                                                                           String p_strLang)
        Get a portlet grid manager for the given user.
        Parameters:
        p_conn - The database connection to be used.
        p_strGridId - The grid-ID/portal container-GUID.
        p_strUserGuid - The user for whom the portlet grid manager should be created.
        p_strLang - The language identifier.
        Returns:
        A portlet grid manager.
      • getNewsAgent

        public de.uplanet.lucy.server.auxiliaries.NewsAgentProxy getNewsAgent​(de.uplanet.jdbc.JdbcConnection p_conn)
        Returns:
        A news agent (proxy) instance.
        See Also:
        NewsAgentProxy
      • getAuthProxy

        public de.uplanet.lucy.server.auxiliaries.AuthProxy getAuthProxy​(de.uplanet.jdbc.JdbcConnection p_conn)
        Create an AuthProxy instance.
        Returns:
        The authentication proxy.
      • getHttpRequest

        public de.uplanet.lucy.server.auxiliaries.net.HttpRequest getHttpRequest()
        Create a HttpRequest instance.
        Returns:
        A HTTP request object.
      • getRFC5545Util

        public RFC5545Util getRFC5545Util()
        Returns:
        A RFC 5545 utility.
        Since:
        Intrexx version 5.2.
      • getUserFromId

        public IUser getUserFromId​(de.uplanet.jdbc.JdbcConnection p_conn,
                                   int p_iUserId)
        Get a user from the database.
        Returns:
        The user with the specified integer id, or null if the user was not found in the database.
      • getUserFromGuid

        public IUser getUserFromGuid​(de.uplanet.jdbc.JdbcConnection p_conn,
                                     String p_strGuid)
        Get a user from the database.
        Returns:
        The user with the specified unique identifier, or null if the user was not found in the database.
      • getUserFromLoginName

        public IUser getUserFromLoginName​(de.uplanet.jdbc.JdbcConnection p_conn,
                                          String p_strLoginName,
                                          String p_strLoginDomain)
        Get a user from the database.
        Returns:
        The user with the specified login name and domain, or null if the user was not found in the database.
      • getUserFromQualifiedLoginName

        public IUser getUserFromQualifiedLoginName​(de.uplanet.jdbc.JdbcConnection p_conn,
                                                   String p_strQualifiedLoginName)
        Get a user from the database.
        Returns:
        The user with the specified qualified login name, or null if the user was not found in the database.
      • getNumberByStringAggregator

        public NumberByStringAggregator getNumberByStringAggregator​(String p_strMode)
        Create a helper object for aggregating strings.

        The following aggregation modes are supported:

        • caseSensitiveCategory: categories are treated case-sensitive
        • caseInsensitiveCategory: categories are treated case-insensitive

        Parameters:
        p_strMode - The mode used for aggregation.
        Returns:
        An aggregator object.
      • getNumberByDateAggregator

        public NumberByDateAggregator getNumberByDateAggregator​(String p_strMode,
                                                                TimeZone p_tz)
        Create a helper object for aggregating time values.

        The following aggregation modes are supported:

        • year: by year
        • month: by month
        • day: by day
        • hour: by hour
        • minute: by minute
        • second: by second
        • millisecond: (should normally not be used)
        • quarter: by quarter
        • week: by start of the week

        Parameters:
        p_strMode - The mode used for aggregation.
        p_tz - The time zone.
        Returns:
        An aggregator object.
      • getNumberByLongAggregator

        public NumberByLongAggregator getNumberByLongAggregator()
        Create a helper object for aggregating integer numbers.
        Returns:
        An aggregator object.
      • getNumberByDoubleAggregator

        public NumberByDoubleAggregator getNumberByDoubleAggregator()
        Create a helper object for aggregating floating point numbers.
        Returns:
        An aggregator object.