Package org.apache.jetspeed.profiler

Examples of org.apache.jetspeed.profiler.ProfileLocator


            return;
        }

        // determine profiled page context using profile locator; get
        // page profile locator from session/principal profile locators
        ProfileLocator locator = selectPageProfileLocator(pageContext.getLocators());

        // get request path
        String requestPath = locator.getRequestPath();

        // get profiled page context initialization parameters
        Folder folder = null;
        Page page = null;
        NodeSet siblingPages = null;
        Folder parentFolder = null;
        NodeSet siblingFolders = null;
        NodeSet rootLinks = null;
        NodeSet documentSets = null;
        Map documentSetNames = null;
        Map documentSetNodeSets = null;
        List allProfiledFolders = null;
        if (profilingEnabled)
        {
            // profile page request using profile locator
            Folder [] profiledFolder = new Folder[1];
            Page [] profiledPage = new Page[1];
            List profiledFolders = new ArrayList(16);
            List searchProfiledFolders = new ArrayList(24);

            // generate profile locator folder/page search paths
            List searchPaths = generateProfilingSearchPaths(requestPath, locator, false);

            // find page in page manager content using search paths
            boolean profiled = findProfiledPageAndFolders(searchPaths, profiledPage, profiledFolder, profiledFolders, searchProfiledFolders);

            // profile fallback to default root folder to locate folder/page
            boolean rootFallback = false;
            if (rootFallback = (! profiled && ! requestPath.equals(Folder.PATH_SEPARATOR)))
            {
                // profile default root folder, (ignoring request path)
                searchPaths = generateProfilingSearchPaths(Folder.PATH_SEPARATOR, locator, true);
                profiled = findProfiledPageAndFolders(searchPaths, profiledPage, profiledFolder, profiledFolders, searchProfiledFolders);

                // if profiled successfully at root fallback but failed previous
                // attempt, profile request path against available alternate profile
                // locators. This is used only to select a page: all other context
                // information remains determined from fallback.
                if (profiled && (pageContext.getLocators().size() > 1))
                {
                    // profile to locate request path using alternate locators
                    Page [] alternateProfiledPage = new Page[1];
                    Iterator locatorsIter = selectAlternatePageProfileLocators(pageContext.getLocators()).iterator();
                    while ((alternateProfiledPage[0] == null) && locatorsIter.hasNext())
                    {
                        ProfileLocator alternateLocator = (ProfileLocator) locatorsIter.next();
                        List alternateSearchPaths = generateProfilingSearchPaths(requestPath, alternateLocator, false);
                        findProfiledPageAndFolders(alternateSearchPaths, alternateProfiledPage);
                    }

                    // if request path matched, use just profiled page; note: page is
View Full Code Here


    private NodeSetImpl expandAndProfileDocumentSet(Map profileLocators, DocumentSet documentSet, NodeSetImpl expandedNodes, String documentSetNamePrefix, Map documentSetNames, Map documentSetNodeSets, List allProfiledFolders)
    {
        // expand and profile document set using document set or default
        // navigation profile locator
        ProfileLocator navigationLocator = selectNavigationProfileLocator(documentSet.getProfileLocatorName(), profileLocators);
        if (navigationLocator == null)
        {
            log.warn("expandAndProfileDocumentSet(): Navigation profile locator " + documentSet.getProfileLocatorName() + " unavailable for document set " + documentSet.getPath() + ", ignored." );
            return null;
        }
View Full Code Here

    }

    protected ProfileLocator selectNavigationProfileLocator(String profileLocatorName, Map profileLocators)
    {
        // select navigation profile locator from session/principal profile locators
        ProfileLocator locator = null;
        if (profileLocatorName != null)
        {
            locator = (ProfileLocator) profileLocators.get(profileLocatorName);
        }
        else
View Full Code Here

     */
    public ProfileLocator createLocator( RequestContext context )
    {
        try
        {
            ProfileLocator locator = (ProfileLocator) locatorClass.newInstance();
            locator.init(this, context.getPath());
            return locator;
        }
        catch (Exception e)
        {
            log.error("Failed to create locator for " + locatorClass);
View Full Code Here

            Map locators = null;
            String locatorName = (String)request.getAttribute(PROFILE_LOCATOR_REQUEST_ATTR_KEY);
            if ( locatorName != null )
            {
                ProfileLocator locator = profiler.getProfile(request,locatorName);
                if ( locator != null )
                {
                    locators = new HashMap();
                    locators.put(ProfileLocator.PAGE_LOCATOR, locator);
                }
View Full Code Here

            // get request specific profile locators if required
            Map locators = null;
            String locatorName = (String)request.getAttribute(PROFILE_LOCATOR_REQUEST_ATTR_KEY);
            if ( locatorName != null )
            {
                ProfileLocator locator = profiler.getProfile(request,locatorName);
                if ( locator != null )
                {
                    locators = new HashMap();
                    locators.put(ProfileLocator.PAGE_LOCATOR, locator);
                }
View Full Code Here

            String pathSave = this.getPath();          
            this.setPath(nonProfiledPath);
            ContentPage realPage = this.getPage();
            this.setPage(null);               
            Map locators = null;
            ProfileLocator locator = profiler.getProfile(this, ProfileLocator.PAGE_LOCATOR);
            if ( locator != null )
            {
                locators = new HashMap();
                locators.put(ProfileLocator.PAGE_LOCATOR, locator);
            }              
View Full Code Here

            // generate locators search paths; aggregate individual
            // profile locator search paths with the 'page' locator
            // having priority, (all other named locators are processed
            // subsequent to 'page' in unspecified order).
            List searchPaths = new ArrayList(8 * locators.size());
            ProfileLocator pageLocator = (ProfileLocator)locators.get(ProfileLocator.PAGE_LOCATOR);
            if (pageLocator != null)
            {
                // add priority 'page' locator search paths
                mergeSearchPathList(ProfileLocator.PAGE_LOCATOR, pageLocator, searchPaths);
            }
View Full Code Here

        // validate and update session profile locators if modified
        if (updateSessionProfileLocators(requestProfileLocators))
        {
            // extract page request path from the locators
            String requestPath = Folder.PATH_SEPARATOR;
            ProfileLocator locator = (ProfileLocator)requestProfileLocators.get(ProfileLocator.PAGE_LOCATOR);
            if (locator != null)
            {
                // use 'page' locator to determine request page by executing
                // profile locator to determine path
                requestPath = getRequestPathFromLocator(locator);
            }
            else
            {
                // 'page' locator unavailable, use first locator since
                // all locators should have identical request paths, (do
                // not execute profile locator though to determine path:
                // simply use the request path)
                locator = (ProfileLocator)requestProfileLocators.values().iterator().next();
                requestPath = locator.getRequestPath();
            }
           
            // attempt to select request page or folder using
            // profile locators and site view; if fallback
            // enabled, fallback on missing node or access
View Full Code Here

                    Iterator entriesIter = profileLocators.entrySet().iterator();
                    while (entriesIter.hasNext())
                    {
                        Map.Entry entry = (Map.Entry)entriesIter.next();
                        String locatorName = (String)entry.getKey();
                        ProfileLocator locator = (ProfileLocator)entry.getValue();
                        if (!firstEntry)
                        {
                            debug.append(",");
                        }
                        else
                        {
                            firstEntry = false;
                        }
                        debug.append(locatorName);
                        debug.append("=");
                        debug.append(locator.toString());
                    }
                }
                else
                {
                    debug.append("null");
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.profiler.ProfileLocator

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.