Package org.apache.turbine.services.resources

Examples of org.apache.turbine.services.resources.ResourceService


     * Turbine <code>Service</code> framework
     */
    public void init( ServletConfig conf ) throws InitializationException
    {

        ResourceService serviceConf = ((TurbineServices)TurbineServices.getInstance())
                                                     .getResources(PortletFactoryService.SERVICE_NAME);

        this.enableCache = serviceConf.getBoolean("enable.cache",true);
       
        // get the runData service
        this.runDataService =
            (JetspeedRunDataService)TurbineServices.getInstance()
                .getService(RunDataService.SERVICE_NAME);
View Full Code Here


     * Turbine <code>Service</code> framework
     */
    public void init( ServletConfig conf ) throws InitializationException
    {

        ResourceService serviceConf = ((TurbineServices)TurbineServices.getInstance())
                                                     .getResources(PortletStatsService.SERVICE_NAME);

        this.enabled = serviceConf.getBoolean("enabled");
        this.dateFormat = serviceConf.getString("dateFormat", "dd/MM/yyyy:hh:mm:ss z");
        this.formatter = new SimpleDateFormat(this.dateFormat);
        this.logLoadTime = serviceConf.getBoolean("logLoadTime", false);
       
        setInit(true);

    }
View Full Code Here

     * fails to initialize
     */
    private void initConfiguration() throws InitializationException
    {
        // get configuration parameters from Jetspeed Resources
        ResourceService serviceConf = ((TurbineServices)TurbineServices.getInstance())
                                                     .getResources(IdGeneratorService.SERVICE_NAME);

        peidPrefix = serviceConf.getString( CONFIG_PEID_PREFIX, DEFAULT_CONFIG_PEID_PREFIX );
        peidSuffix = serviceConf.getString( CONFIG_PEID_SUFFIX, DEFAULT_CONFIG_PEID_SUFFIX );
        synchronized(JetspeedIdGeneratorService.class)
        {
            idCounter = serviceConf.getLong( CONFIG_COUNTER_START, DEFAULT_CONFIG_COUNTER_START );
        }
       
   }
View Full Code Here

                logger.warn("Messaging support has been disabled due to a failure to initialize the service or add a listener.");
            }
        }

        // get configuration parameters from Jetspeed Resources
        ResourceService serviceConf = ((TurbineServices)TurbineServices.getInstance())
                                                     .getResources(PsmlManagerService.SERVICE_NAME);
        // get the PSML Root Directory
        this.root = serviceConf.getString( CONFIG_ROOT, DEFAULT_ROOT );
        this.rootDir = new File(root);

        //If the rootDir does not exist, treat it as context relative
        if ( !rootDir.exists() )
        {
            try
            {
                this.rootDir = new File(conf.getServletContext().getRealPath(root));
            }
            catch (Exception e)
            {
                // this.rootDir = new File("./webapp" + this.rootDir.toString());
            }
        }
        //If it is still missing, try to create it
        if (!rootDir.exists())
        {
            try
            {
                rootDir.mkdirs();
            }
            catch (Exception e)
            {
            }
        }

        // get default extension
        this.ext = serviceConf.getString( CONFIG_EXT, DEFAULT_EXT );

        // create the serializer output format
        this.format = new OutputFormat();
        format.setIndenting(true);
        format.setIndent(4);
        format.setLineWidth(0);

        // psml castor mapping file
        mapFile = serviceConf.getString("mapping",DEFAULT_MAPPING);
        mapFile = TurbineServlet.getRealPath( mapFile );
        loadMapping();

        this.scanRate = serviceConf.getLong(CONFIG_SCAN_RATE, this.scanRate);
        this.cacheSize= serviceConf.getInt(CONFIG_CACHE_SIZE, this.cacheSize);

        documents = new FileCache(this.scanRate, this.cacheSize);
        documents.addListener(this);
        documents.startFileScanner();
View Full Code Here

                enableMessaging = false;
                logger.warn("Messaging support has been disabled due to a failure to initialize the service or add a listener.");
            }
        }

        ResourceService serviceConf =
                      ((TurbineServices)TurbineServices.getInstance())
                              .getResources(PsmlManagerService.SERVICE_NAME);
        try
        {
            // get configuration parameters from Turbine Resources
            // we'll use only string accessors so the values can be multiply
            // specified in the properties files (the first one wins).
            String value = serviceConf.getString(REFRESH_RATE);
            refreshRate = DEFAULT_REFRESH_RATE;
            try
            {
                refreshRate = Long.parseLong(value);
            }
            catch (Exception e)
            {
                logger.warn("DatabasePsmlManagerService: error in refresh-rate configuration: using default");
            }

            // get the name of the torque database pool to use
            poolName = serviceConf.getString(POOL_NAME);

            //find out if caching allowed
            value = serviceConf.getString(CACHING_ON);
            cachingOn = DEFAULT_CACHING_ON;
            try
            {
                cachingOn = value.equals("true");
            }
            catch (Exception e)
            {
                logger.warn("DatabasePsmlManagerService: error in caching-on configuration: using default");
            }

            // psml castor mapping file
            mapFile = serviceConf.getString("mapping",DEFAULT_MAPPING);
            mapFile = TurbineServlet.getRealPath( mapFile );
            loadMapping();
        }
        catch (Throwable t)
        {
View Full Code Here

        if (getInit()) return;

        super.init(conf);

        // get configuration parameters from Jetspeed Resources
        ResourceService serviceConf = ((TurbineServices)TurbineServices.getInstance())
                                                     .getResources(JetspeedSecurityService.SERVICE_NAME);

        this.runDataService =
           (JetspeedRunDataService)TurbineServices.getInstance()
               .getService(RunDataService.SERVICE_NAME);

        cascadeDelete = serviceConf.getBoolean( CASCADE_DELETE, DEFAULT_CASCADE_DELETE );
        cachingEnable = serviceConf.getBoolean( CACHING_ENABLE, DEFAULT_CACHING_ENABLE );
        setInit(true);
     }
View Full Code Here

    {
        profileClass = ServiceHelper.loadModelClass(this, "profile.impl");
        locatorClass = ServiceHelper.loadModelClass(this, "locator.impl");

        // get configuration parameters from Jetspeed Resources
        ResourceService serviceConf =
            ((TurbineServices) TurbineServices.getInstance()).getResources(
                ProfilerService.SERVICE_NAME);

        resourceDefault =
            serviceConf.getString(
                CONFIG_RESOURCE_DEFAULT,
                DEFAULT_CONFIG_RESOURCE_DEFAULT);

        resourceExt =
            serviceConf.getString(
                CONFIG_RESOURCE_EXT,
                DEFAULT_CONFIG_RESOURCE_EXT);
        if (-1 == resourceExt.indexOf(PATH_EXTENSION_DELIMITER))
        {
            resourceExt = PATH_EXTENSION_DELIMITER + resourceExt;
        }

        useSecurity =
            serviceConf.getBoolean(CONFIG_SECURITY, DEFAULT_CONFIG_SECURITY);

        useRoleFallback =
            serviceConf.getBoolean(
                CONFIG_ROLE_FALLBACK,
                DEFAULT_CONFIG_ROLE_FALLBACK);

        newUserTemplate =
            serviceConf.getString(
                CONFIG_NEWUSER_TEMPLATE,
                DEFAULT_CONFIG_NEWUSER_TEMPLATE);

        newGroupTemplate =
            serviceConf.getString(
                CONFIG_NEWGROUP_TEMPLATE,
                DEFAULT_CONFIG_NEWGROUP_TEMPLATE);

        useFallbackToRoot =
            serviceConf.getBoolean(CONFIG_FALLBACK_TO_ROOT, useFallbackToRoot);

        useFallbackLanguage =
            serviceConf.getBoolean(
                CONFIG_FALLBACK_LANGUAGE,
                useFallbackLanguage);

        useRoleMerge = serviceConf.getBoolean(CONFIG_ROLE_MERGE, useRoleMerge);
        useGroupMerge =
            serviceConf.getBoolean(CONFIG_GROUP_MERGE, useGroupMerge);

        if (useRoleMerge && useGroupMerge)
        {
            logger.warn(
                "Both role and group merging are enabled. Disabling the group merging feature");
            useGroupMerge = false;
        }

        if (useRoleMerge)
        {
            useRoleFallback = true;

            rolemergeControl =
                serviceConf.getString(
                    CONFIG_ROLE_MERGE_CONTROL,
                    DEFAULT_CONFIG_ROLE_MERGE_CONTROL);

            rolemergeController =
                serviceConf.getString(
                    CONFIG_ROLE_MERGE_CONTROLLER,
                    DEFAULT_CONFIG_ROLE_MERGE_CONTROLLER);
        }
        else if (useGroupMerge)
        {
            useRoleFallback = true;

            groupmergeControl =
                serviceConf.getString(
                    CONFIG_GROUP_MERGE_CONTROL,
                    DEFAULT_CONFIG_GROUP_MERGE_CONTROL);

            groupmergeController =
                serviceConf.getString(
                    CONFIG_GROUP_MERGE_CONTROLLER,
                    DEFAULT_CONFIG_GROUP_MERGE_CONTROLLER);

            groupmergeSecurityref =
                serviceConf.getString(CONFIG_GROUP_MERGE_SECURITYREF, null);
        }

        if (useFallbackLanguage == false)
        {
            useFallbackCountry = false;
        }
        else
        {
            useFallbackCountry =
                serviceConf.getBoolean(
                    CONFIG_FALLBACK_COUNTRY,
                    useFallbackCountry);
        }

        try
        {
            mediaTypes = serviceConf.getStringArray(CONFIG_NEWUSER_MEDIA);
        }
        catch (Exception e)
        {
            logger.error("Error getting media types", e);
        }
View Full Code Here

        if (getInit()) return;

        super.init(conf);

        // get configuration parameters from Jetspeed Resources
        ResourceService serviceConf = ((TurbineServices)TurbineServices.getInstance())
                                                     .getResources(JetspeedSecurityService.SERVICE_NAME);
       
        try
        {
            roles = serviceConf.getStringArray(CONFIG_NEWUSER_ROLES);
      adminRoles = serviceConf.getStringArray(CONFIG_ACTIONS_ADMIN_ROLES);
        }
        catch (Exception e)
        {}
           
        if (null == roles || roles.length == 0)
        {
            roles = DEFAULT_CONFIG_NEWUSER_ROLES;
        }

    if (null == adminRoles || adminRoles.length == 0)
    {
      adminRoles = DEFAULT_ADMIN_ROLES;
    }

        caseInsensitiveUsername = serviceConf.getBoolean(CONFIG_CASEINSENSITIVE_USERNAME, caseInsensitiveUsername);
        caseInsensitivePassword = serviceConf.getBoolean(CONFIG_CASEINSENSITIVE_PASSWORD, caseInsensitivePassword);
        caseInsensitiveUpper = serviceConf.getBoolean(CONFIG_CASEINSENSITIVE_UPPER, caseInsensitiveUpper);

        strikeCount = serviceConf.getInt(CONFIG_LOGON_STRIKE_COUNT, strikeCount);
        strikeInterval = serviceConf.getLong(CONFIG_LOGON_STRIKE_INTERVAL, strikeInterval);
        strikeMax = serviceConf.getInt(CONFIG_LOGON_STRIKE_MAX, strikeMax);

        autoLogonDisable = serviceConf.getBoolean(CONFIG_LOGON_AUTO_DISABLE, autoLogonDisable);
        actionsAnonDisable = serviceConf.getBoolean(CONFIG_ACTIONS_ANON_DISABLE, actionsAnonDisable);
        actionsAllUsersDisable = serviceConf.getBoolean(CONFIG_ACTIONS_ALLUSERS_DISABLE, actionsAllUsersDisable);

        anonymousUser = serviceConf.getString(CONFIG_ANONYMOUS_USER, anonymousUser);

        // initialization done
        setInit(true);
     }
View Full Code Here

     * Turbine <code>Service</code> framework
     */
    public void init(ServletConfig conf) throws InitializationException
    {

        ResourceService serviceConf =
            ((TurbineServices) TurbineServices.getInstance()).getResources(
                PortalToolkitService.SERVICE_NAME);

        this.defaultControl = serviceConf.getString("default.control");
        this.defaultController = serviceConf.getString("default.controller");
        this.defaultSkin = serviceConf.getString("default.skin");
        this.defaultUserSecurityRef = serviceConf.getString("default.user.security.ref");
        this.defaultAnonSecurityRef = serviceConf.getString("default.anon.security.ref");
        this.defaultRoleSecurityRef = serviceConf.getString("default.role.security.ref");
        this.defaultGroupSecurityRef = serviceConf.getString("default.group.security.ref");
        setInit(true);

    }
View Full Code Here

    {
        if (getInit()) return;
        super.init(conf);

        // get configuration parameters from Jetspeed Resources
        ResourceService serviceConf = ((TurbineServices)TurbineServices.getInstance())
                                                     .getResources(JetspeedSecurityService.SERVICE_NAME);

        this.runDataService =
           (JetspeedRunDataService)TurbineServices.getInstance()
               .getService(RunDataService.SERVICE_NAME);

        defaultRole = serviceConf.getString(CONFIG_DEFAULT_ROLE, DEFAULT_DEFAULT_ROLE);
        cascadeDelete = serviceConf.getBoolean( CASCADE_DELETE, DEFAULT_CASCADE_DELETE );

        setInit(true);
     }
View Full Code Here

TOP

Related Classes of org.apache.turbine.services.resources.ResourceService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.