Package org.apache.turbine.services.resources

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


        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, cachingEnable );
        setInit(true);
     }
View Full Code Here


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

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

        // 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

        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, cachingEnable );
        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, defaultRole);
        cascadeDelete = serviceConf.getBoolean( CASCADE_DELETE, DEFAULT_CASCADE_DELETE );

        setInit(true);
     }
View Full Code Here

            if(mode != null && mode.equals("export_all"))
            {
                if (msgid == null)
                {
                    // get the PSML Root Directory
                    ResourceService serviceConf = ((TurbineServices)TurbineServices.getInstance())
                                                                 .getResources(PsmlManagerService.SERVICE_NAME);
                    String root = serviceConf.getString("root", "/WEB-INF/psml");
                    context.put(COPY_TO, TurbineServlet.getRealPath(root));
                }
                else
                {
                    context.put(COPY_TO, rundata.getUser().getTemp(COPY_TO));
                }
            }

            if(mode != null && mode.equals("import"))
            {
                org.apache.jetspeed.om.registry.Registry mediaTypes = Registry.get(Registry.MEDIA_TYPE);
                context.put("mediaTypes", mediaTypes.listEntryNames());
                if (msgid == null)
                {
                    // get the PSML Root Directory
                    ResourceService serviceConf = ((TurbineServices)TurbineServices.getInstance())
                                                                 .getResources(PsmlManagerService.SERVICE_NAME);
                    String root = serviceConf.getString("root", "/WEB-INF/psml");
                    root = TurbineServlet.getRealPath(root);

                    if(path == null)
                    {
                        context.put(CATEGORY_NAME, Profiler.PARAM_USER);
                        context.put("categoryValue", Profiler.PARAM_ANON);
                        context.put("copyFrom",
                                    root +
                                    File.separator +
                                    Profiler.PARAM_USER +
                                    File.separator +
                                    Profiler.PARAM_ANON +
                                    File.separator +
                                    Profiler.PARAM_MEDIA_TYPE +
                                    File.separator +
                                    "html" +
                                    File.separator +
                                    Profiler.PARAM_PAGE +
                                    File.separator +
                                    Profiler.FULL_DEFAULT_PROFILE);
                    }
                    else
                    {
                        ProfileLocator tmpLocator = Profiler.createLocator();
                        tmpLocator.createFromPath(path);
                        Profile profile = Profiler.getProfile(tmpLocator);
                        if (profile != null)
                        {
                            rundata.getUser().setTemp(TEMP_LOCATOR, tmpLocator);
                            context.put("profile", profile);
                        }
                        String categoryName = Profiler.PARAM_GROUP;
                        String categoryValue = tmpLocator.getGroupName();
                        if (categoryValue == null)
                        {
                            categoryName = Profiler.PARAM_ROLE;
                            categoryValue = tmpLocator.getRoleName();
                            if (categoryValue == null)
                            {
                                categoryName = Profiler.PARAM_USER;
                                categoryValue = tmpLocator.getUserName();
                                if (categoryValue == null)
                                {
                                    categoryName = Profiler.PARAM_USER;
                                    categoryValue = Profiler.PARAM_ANON;
                                }
                            }

                        }
                        context.put(CATEGORY_NAME, categoryName);
                        context.put("categoryValue", categoryValue);
                        String filePath = this.mapLocatorToFile(tmpLocator);
                        context.put("copyFrom", root + File.separator + filePath.toString());
                    }
                }
                else
                {
                    context.put(CATEGORY_NAME, rundata.getUser().getTemp(CATEGORY_NAME));
                    context.put(CATEGORY_VALUE, rundata.getUser().getTemp(CATEGORY_VALUE));
                    context.put(COPY_FROM, rundata.getUser().getTemp(COPY_FROM));
                }
            }

            if(mode != null && mode.equals("import_all"))
            {
                if (msgid == null)
                {
                    // get the PSML Root Directory
                    ResourceService serviceConf = ((TurbineServices)TurbineServices.getInstance())
                                                                 .getResources(PsmlManagerService.SERVICE_NAME);
                    String root = serviceConf.getString("root", "/WEB-INF/psml");
                    context.put(COPY_FROM, TurbineServlet.getRealPath(root));
                }
                else
                {
                    context.put(COPY_FROM, rundata.getUser().getTemp(COPY_FROM));
View Full Code Here

     */
    private Mapping loadMapping()
        throws Exception
    {
        // get configuration parameters from Jetspeed Resources
        ResourceService serviceConf = ((TurbineServices)TurbineServices.getInstance())
                                                     .getResources(PsmlManagerService.SERVICE_NAME);

        // test the mapping file and create the mapping object
        Mapping mapping = null;
        String mapFile = serviceConf.getString("mapping","${webappRoot}/WEB-INF/conf/psml-mapping.xml");
        mapFile = TurbineServlet.getRealPath( mapFile );
        if (mapFile != null)
        {
            File map = new File(mapFile);
            Log.debug("Loading psml mapping file "+mapFile);
View Full Code Here

        if (null == userClassName)
        {
            try
            {
                ResourceService serviceConf = ((TurbineServices)TurbineServices.getInstance())
                                                         .getResources(JetspeedSecurityService.SERVICE_NAME);
                userClassName = serviceConf.getString(CONFIG_USER_CLASSNAME);                                                            
                userClass = Class.forName(userClassName);
            }
            catch(Exception e)
            {
                throw new UserException(
View Full Code Here

        if (null == groupClassName)
        {
            try
            {
                ResourceService serviceConf = ((TurbineServices)TurbineServices.getInstance())
                                                         .getResources(JetspeedSecurityService.SERVICE_NAME);
                groupClassName = serviceConf.getString(CONFIG_GROUP_CLASSNAME);                                                            
                groupClass = Class.forName(groupClassName);
            }
            catch(Exception e)
            {
                throw new GroupException(
View Full Code Here

        if (null == roleClassName)
        {
            try
            {
                ResourceService serviceConf = ((TurbineServices)TurbineServices.getInstance())
                                                         .getResources(JetspeedSecurityService.SERVICE_NAME);
                roleClassName = serviceConf.getString(CONFIG_ROLE_CLASSNAME);                                                            
                roleClass = Class.forName(roleClassName);
            }
            catch(Exception e)
            {
                throw new RoleException(
View Full Code Here

        if (null == permissionClassName)
        {
            try
            {
                ResourceService serviceConf = ((TurbineServices)TurbineServices.getInstance())
                                                         .getResources(JetspeedSecurityService.SERVICE_NAME);
                permissionClassName = serviceConf.getString(CONFIG_GROUP_CLASSNAME);                                                            
                permissionClass = Class.forName(permissionClassName);
            }
            catch(Exception e)
            {
                throw new PermissionException(
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.