Package org.apache.jetspeed.util

Examples of org.apache.jetspeed.util.Path


            TemplateDescriptor template = locator.locateTemplate(descriptor);
            // Check for defaults above the currently specified root
            if (template == null)
            {
                Path pathObject = new Path(path);
                if (pathObject.length() > 1)
                {
                    template = getTemplate(pathObject.getSegment(1).toString(), templateType, locator, descriptor);
                }
            }
            return template;
        }
        catch (TemplateLocatorException e)
View Full Code Here


    private Set portletDecorationsList = Collections.EMPTY_SET;

    public DecorationFactoryImpl(String decorationsPath, ResourceValidator validator, String defaultLayoutDecorator, String defaultPortletDecorator)
    {
        this.registry = null;
        this.decorationsPath = new Path(decorationsPath);
        this.validator = validator;
        this.defaultLayoutDecorator = defaultLayoutDecorator;
        this.defaultPortletDecorator = defaultPortletDecorator;
    }
View Full Code Here

                                 ResourceValidator validator,
                                 String defaultLayoutDecorator,
                                 String defaultPortletDecorator)
    {
        this.registry =  registry;
        this.decorationsPath = new Path(decorationsPath);
        this.validator = validator;
        this.defaultLayoutDecorator = defaultLayoutDecorator;
        this.defaultPortletDecorator = defaultPortletDecorator;
    }
View Full Code Here

    }

    public PortletDecoration getPortletDecoration(String name, RequestContext requestContext)

    {
        Path basePath = createClientPath(name, requestContext, Fragment.PORTLET);

        Properties configuration = getConfiguration(name, Fragment.PORTLET);
        configuration.setProperty("name", name);
        return new PortletDecorationImpl(configuration, validator, basePath, new SessionPathResolverCache(
                requestContext.getRequest().getSession()));
View Full Code Here

    }

    public LayoutDecoration getLayoutDecoration(String name, RequestContext requestContext)

    {
        Path basePath = createClientPath(name, requestContext, Fragment.LAYOUT);

        Properties configuration = getConfiguration(name, Fragment.LAYOUT);
        configuration.setProperty("name", name);
        return new LayoutDecorationImpl(configuration, validator, basePath, new SessionPathResolverCache(
                requestContext.getRequest().getSession()));
View Full Code Here

     * @see Path
     * @see RequestContext
     */
    protected Path createClientPath(String name, RequestContext requestContext, String decorationType)
    {
        Path basePath = ((Path)decorationsPath.clone())
                          .addSegment(decorationType)
                          .addSegment(name);
        String mediaType = requestContext.getMediaType();
        Locale locale = requestContext.getLocale();
        String language = locale.getLanguage();
        String country = locale.getCountry();
        String variant = locale.getVariant();

        basePath.addSegment(mediaType).addSegment(language);

        if (country != null)
        {
            basePath.addSegment(country);
        }

        if (variant != null)
        {
            basePath.addSegment(variant);
        }
        return basePath;
    }
View Full Code Here

    {
        Iterator itr = rawList.iterator();
        Set filteredList = new HashSet();
        while(itr.hasNext())
        {
            Path path = new Path((String) itr.next());
            if(path.getFileName() == null && validator.resourceExists(path.toString()+"decorator.properties"))
            {
                int offset = path.length() - 1;
                filteredList.add(path.getSegment(offset));
            }
        }
        return filteredList;
    }
View Full Code Here

        return name;
    }

    public String getResource(String path)
    {       
        Path workingPath = basePath.getChild(path);
       
        if(cache.getPath(workingPath.toString()) != null)
        {
            return cache.getPath(workingPath.toString());
        }
        else
        {
            String locatedPath = getResource((Path)basePath.clone(), new Path(path));
            if(!locatedPath.startsWith(NO_SUCH_RESOURCE))
            {
                if(!path.startsWith("/"))
                {
                    locatedPath = locatedPath.substring(1);
                }
                          
                cache.addPath(workingPath.toString(), locatedPath);
            }
           
          
           
            return locatedPath;
View Full Code Here

        return basePath.addSegment( relativePath ).toString();
    }
       
    public String getResource( String path )
    {       
        Path workingPath = baseClientPath.getChild( path );
       
        String hit = cache.getPath( workingPath.toString());
        ifhit != null )
        {
            return hit;
        }
        else
        {
            String locatedPath = getResource( baseClientPath, new Path( path ) );
            if( ! locatedPath.startsWith( NO_SUCH_RESOURCE ) )
            {
                if( ! path.startsWith( "/" ) )
                {
                    locatedPath = locatedPath.substring( 1 );
                }
                cache.addPath( workingPath.toString(), locatedPath );
                return locatedPath;
            }
        }
      return null;
    }
View Full Code Here

                                  JetspeedCache decorationConfigurationCache,
                                  String defLayoutDecoration,
                                  String defPortletDecoration)
    {
        this.registry =  registry;
        this.decorationsPath = new Path( decorationsPath );
        this.layoutDecorationsPath = getBasePath( Fragment.LAYOUT );
        this.layoutDecorationsPathStr = this.layoutDecorationsPath.toString();
        this.portletDecorationsPath = getBasePath( Fragment.PORTLET );
        this.portletDecorationsPathStr = this.portletDecorationsPath.toString();
        this.validator = validator;
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.util.Path

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.