Package org.apache.turbine.services.resources

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


     */
    protected void setUp() throws Exception
    {
        super.setUp();

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

        this.defaultSkin = serviceConf.getString("default.skin");
        String path = getTestConfig().getString(SKIN_TEST_PATH);
        String path2 = getTestConfig().getString(SKIN_TEST2_PATH);
        String path3 = getTestConfig().getString(SKIN_TEST3_PATH);
        String path4 = getTestConfig().getString(SKIN_TEST4_PATH);
        prof1 = new File(path);
View Full Code Here


    {

        //Ensure that the servlet service is initialized
        TurbineServices.getInstance().initService(ServletService.SERVICE_NAME, conf);

        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)
            {
                Log.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)
            {
                Log.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

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

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

        // read the configuration keys
        try
        {
View Full Code Here

        if (getInit()) return;

        super.init(conf);

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


        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(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 );

        useFallbackToRoot = serviceConf.getBoolean( CONFIG_FALLBACK_TO_ROOT, useFallbackToRoot );

        useFallbackLanguage = serviceConf.getBoolean( CONFIG_FALLBACK_LANGUAGE, useFallbackLanguage );

        useRoleMerge = serviceConf.getBoolean( CONFIG_ROLE_MERGE, useRoleMerge );

        rolemergeControl = serviceConf.getString( CONFIG_ROLE_MERGE_CONTROL, DEFAULT_CONFIG_ROLE_MERGE_CONTROL );

        rolemergeController = serviceConf.getString( CONFIG_ROLE_MERGE_CONTROLLER, DEFAULT_CONFIG_ROLE_MERGE_CONTROLLER );

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

        try
        {
            mediaTypes = serviceConf.getStringArray(CONFIG_NEWUSER_MEDIA);
        }
        catch (Exception e)
        {}

        if (null == mediaTypes || mediaTypes.length == 0)
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

        if (getInit()) return;

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

            this.mapping = serviceConf.getString(CONFIG_MAPPING, this.mapping);

            this.directory = serviceConf.getString(CONFIG_DIRECTORY, this.directory);

            this.mapping = TurbineServlet.getRealPath(this.mapping);
            this.directory = TurbineServlet.getRealPath(this.directory);

            loadForwards();
View Full Code Here

     * 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

    /**
     * This method initializes the service.
     */
    private void internalInit() throws InitializationException
    {
        ResourceService props = getResources();
        if (props == null)
        {
            throw new InitializationException("LoggingService failed to "
                                              + "get access to the properties for this service.");
        }

        //looking for default logger name
        String defaultLoggerName = props.getString(LoggingConfig.DEFAULT);

        //checking whether default logger is properly configured
        if (defaultLoggerName == null)
        {
            throw new InitializationException("LoggingService can't find "
                                              + "default logger name in the configuration file.");
        }

        // Configure log4j logging
        String log4jProperties = props.getString(this.CONFIG_LOG4J_PROPERTIES, this.CONFIG_LOG4J_PROPERTIES_DEFAULT);
        if (log4jProperties != null)
        {
            configureLog4J(log4jProperties);
        }

View Full Code Here

    {
        connections = new Hashtable();
        connector = null;
        parser = null;
        env = new Properties();
        ResourceService serviceConf = ((TurbineServices)TurbineServices.getInstance())
                                                     .getResources(SERVICE_NAME);
        this.host = serviceConf.getString("host");
        this.port = serviceConf.getInt("port",DEFAULT_PORT);
        this.sslport = serviceConf.getInt("sslport",DEFAULT_SSLPORT);
        this.limit = serviceConf.getInt("limit",DEFAULT_LIMIT);
        this.timeout = serviceConf.getInt("timeout",DEFAULT_TIMEOUT);
        this.version = serviceConf.getInt("version",DEFAULT_VERSION);
        this.listFilter = repair(serviceConf.getString("listfilter","(objectclass=*)"));
        this.basedn = repair(serviceConf.getString("basedn"));
        this.managerdn = repair(serviceConf.getString("managerdn"));
        this.password = serviceConf.getString("password");
        this.attributesList = getList(serviceConf.getString("attributeslist")," ");
        this.showOpAttributes = serviceConf.getBoolean("showopattributes",false);
        this.anonymousBind = serviceConf.getBoolean("anonymousbind",false);
        this.securityAuthentication = serviceConf.getString("securityauthentication","simple");
        this.securityProtocol = serviceConf.getString("securityprotocol");
        this.socketFactory = serviceConf.getString("socketfactory");
        this.useCachedDirContexts = serviceConf.getBoolean("contextcache", false);

        this.jndiprovider = serviceConf.getString("jndiprovider",DEFAULT_CTX);
        this.saslclientpckgs = serviceConf.getString("saslclientpckgs");
        mainConnect(new LDAPURL(host,port,basedn));
        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.