Package org.apache.jetspeed.om.folder

Examples of org.apache.jetspeed.om.folder.DocumentSetPath


            // more than one document, attempt to use path to determine
            // document ordering if it is not root relative
            List documentPaths = documentSet.getDefaultedDocumentPaths();
            if (documentPaths.size() == 1)
            {
                DocumentSetPath documentSetPath = (DocumentSetPath) documentPaths.get(0);
                if (documentSetPath.isRegexp())
                {
                    // enforce assumption that document set paths are absolute
                    // and extract folder
                    String documentFolderPath = forceAbsoluteDocumentSetPath(documentSetPath.getPath());
                    int lastSlashIndex = documentFolderPath.lastIndexOf(Folder.PATH_SEPARATOR_CHAR);
                    if (lastSlashIndex > 2)
                    {
                        // non-root document path
                        documentFolderPath = documentFolderPath.substring(0, lastSlashIndex);
                       
                        // iterate over search paths formed with document path
                        Iterator pathsIter = searchPaths.iterator();
                        while ((documentOrder == null) && pathsIter.hasNext())
                        {
                            // search folder path
                            String folderPath = (String) pathsIter.next();
                            if (folderPath.endsWith(Folder.PATH_SEPARATOR))
                            {
                                folderPath = folderPath.substring(0, folderPath.length()-1) + documentFolderPath;
                            }
                            else
                            {
                                folderPath = folderPath + documentFolderPath;
                            }
                           
                            // check folder for document order
                            try
                            {
                                FolderImpl folder = (FolderImpl) setProfiledNodePathAndUrl((AbstractNode) folderHandler.getFolder(folderPath));
                                if ((folder.getMetaData() != null) && (folder.getMetaData().getDocumentOrder() != null) &&
                                    ! folder.getMetaData().getDocumentOrder().isEmpty())
                                {
                                    documentOrder = folder.getMetaData().getDocumentOrder();
                                }               
                            }
                            catch (NodeException ne)
                            {
                            }
                        }
                    }
                }
            }

            // fallback to root search paths to determine document ordering
            if (documentOrder == null)
            {
                Iterator pathsIter = searchPaths.iterator();
                while ((documentOrder == null) && pathsIter.hasNext())
                {
                    // root search folder path
                    String folderPath = (String) pathsIter.next();
                    if (folderPath.endsWith(Folder.PATH_SEPARATOR) && (folderPath.length() > 1))
                    {
                        folderPath = folderPath.substring(0, folderPath.length()-1);
                    }

                    // check folder for document order
                    try
                    {
                        FolderImpl folder = (FolderImpl) setProfiledNodePathAndUrl((AbstractNode) folderHandler.getFolder(folderPath));
                        if ((folder.getMetaData() != null) && (folder.getMetaData().getDocumentOrder() != null) &&
                            ! folder.getMetaData().getDocumentOrder().isEmpty())
                        {
                            documentOrder = folder.getMetaData().getDocumentOrder();
                        }
                    }
                    catch (NodeException ne)
                    {
                    }
                }
            }

            // create ordered node set
            Comparator documentComparator = new DocumentOrderComparator(documentOrder);
            expandedNodes = new NodeSetImpl(null, documentComparator);
        }

        // save doucument set name, (limits recursive expansion)
        String name = documentSetNamePrefix + documentSet.getUrl();
        documentSetNames.put(documentSet, name);

        // profile each document path using profile locator search paths
        Iterator documentSetPathsIter = documentSet.getDefaultedDocumentPaths().iterator();
        while (documentSetPathsIter.hasNext())
        {
            DocumentSetPath documentSetPath = (DocumentSetPath) documentSetPathsIter.next();

            // enforce assumption that document set paths are absolute
            String path = forceAbsoluteDocumentSetPath(documentSetPath.getPath());
            log.debug("expandAndProfileDocumentSet(), document set path = " + path);

            // convert regexp paths to java/perl5 form
            boolean regexp = documentSetPath.isRegexp();
            if (regexp)
            {
                path = pathToPerl5Regexp(path);
            }
View Full Code Here


        // expand document set against managed repository only without
        // profiling; ignores document set profiling rules as well
        Iterator documentSetPathsIter = documentSet.getDefaultedDocumentPaths().iterator();
        while (documentSetPathsIter.hasNext())
        {
            DocumentSetPath documentSetPath = (DocumentSetPath) documentSetPathsIter.next();

            // enforce assumption that document set paths are absolute
            String path = forceAbsoluteDocumentSetPath(documentSetPath.getPath());
            log.debug("expandDocumentSet(), document set path = " + path);

            // convert regexp paths to java/perl5 form
            boolean regexp = documentSetPath.isRegexp();
            if (regexp)
            {
                path = pathToPerl5Regexp(path);
            }
View Full Code Here

    public Vector getDefaultedDocumentPaths()
    {
        if (documentPaths.isEmpty())
        {
            // default document set paths
            DocumentSetPath defaultPath = new DocumentSetPathImpl();
            String name = getName();
            if (name.endsWith(DOCUMENT_TYPE))
            {
                name = name.substring(0, name.length() - DOCUMENT_TYPE.length());
            }
            defaultPath.setPath(PATH_SEPARATOR + name + PATH_SEPARATOR + "*.*");
            defaultPath.setRegexp(true);
            documentPaths.add(defaultPath);
        }
        return documentPaths;
    }
View Full Code Here

            // more than one document, attempt to use path to determine
            // document ordering if it is not root relative
            List documentPaths = documentSet.getDefaultedDocumentPaths();
            if (documentPaths.size() == 1)
            {
                DocumentSetPath documentSetPath = (DocumentSetPath) documentPaths.get(0);
                if (documentSetPath.isRegexp())
                {
                    // enforce assumption that document set paths are absolute
                    // and extract folder
                    String documentFolderPath = forceAbsoluteDocumentSetPath(documentSetPath.getPath());
                    int lastSlashIndex = documentFolderPath.lastIndexOf(Folder.PATH_SEPARATOR_CHAR);
                    if (lastSlashIndex > 2)
                    {
                        // non-root document path
                        documentFolderPath = documentFolderPath.substring(0, lastSlashIndex);
                       
                        // iterate over search paths formed with document path
                        Iterator pathsIter = searchPaths.iterator();
                        while ((documentOrder == null) && pathsIter.hasNext())
                        {
                            // search folder path
                            String folderPath = (String) pathsIter.next();
                            if (folderPath.endsWith(Folder.PATH_SEPARATOR))
                            {
                                folderPath = folderPath.substring(0, folderPath.length()-1) + documentFolderPath;
                            }
                            else
                            {
                                folderPath = folderPath + documentFolderPath;
                            }
                           
                            // check folder for document order
                            try
                            {
                                FolderImpl folder = (FolderImpl) setProfiledNodePathAndUrl((AbstractNode) folderHandler.getFolder(folderPath));
                                if ((folder.getMetaData() != null) && (folder.getMetaData().getDocumentOrder() != null) &&
                                    ! folder.getMetaData().getDocumentOrder().isEmpty())
                                {
                                    documentOrder = folder.getMetaData().getDocumentOrder();
                                }               
                            }
                            catch (NodeException ne)
                            {
                            }
                        }
                    }
                }
            }

            // fallback to root search paths to determine document ordering
            if (documentOrder == null)
            {
                Iterator pathsIter = searchPaths.iterator();
                while ((documentOrder == null) && pathsIter.hasNext())
                {
                    // root search folder path
                    String folderPath = (String) pathsIter.next();
                    if (folderPath.endsWith(Folder.PATH_SEPARATOR) && (folderPath.length() > 1))
                    {
                        folderPath = folderPath.substring(0, folderPath.length()-1);
                    }

                    // check folder for document order
                    try
                    {
                        FolderImpl folder = (FolderImpl) setProfiledNodePathAndUrl((AbstractNode) folderHandler.getFolder(folderPath));
                        if ((folder.getMetaData() != null) && (folder.getMetaData().getDocumentOrder() != null) &&
                            ! folder.getMetaData().getDocumentOrder().isEmpty())
                        {
                            documentOrder = folder.getMetaData().getDocumentOrder();
                        }
                    }
                    catch (NodeException ne)
                    {
                    }
                }
            }

            // create ordered node set
            Comparator documentComparator = new DocumentOrderComparator(documentOrder);
            expandedNodes = new NodeSetImpl(null, documentComparator);
        }

        // save doucument set name, (limits recursive expansion)
        String name = documentSetNamePrefix + documentSet.getUrl();
        documentSetNames.put(documentSet, name);

        // profile each document path using profile locator search paths
        Iterator documentSetPathsIter = documentSet.getDefaultedDocumentPaths().iterator();
        while (documentSetPathsIter.hasNext())
        {
            DocumentSetPath documentSetPath = (DocumentSetPath) documentSetPathsIter.next();

            // enforce assumption that document set paths are absolute
            String path = forceAbsoluteDocumentSetPath(documentSetPath.getPath());
            log.debug("expandAndProfileDocumentSet(), document set path = " + path);

            // convert regexp paths to java/perl5 form
            boolean regexp = documentSetPath.isRegexp();
            if (regexp)
            {
                path = pathToPerl5Regexp(path);
            }
View Full Code Here

        // expand document set against managed repository only without
        // profiling; ignores document set profiling rules as well
        Iterator documentSetPathsIter = documentSet.getDefaultedDocumentPaths().iterator();
        while (documentSetPathsIter.hasNext())
        {
            DocumentSetPath documentSetPath = (DocumentSetPath) documentSetPathsIter.next();

            // enforce assumption that document set paths are absolute
            String path = forceAbsoluteDocumentSetPath(documentSetPath.getPath());
            log.debug("expandDocumentSet(), document set path = " + path);

            // convert regexp paths to java/perl5 form
            boolean regexp = documentSetPath.isRegexp();
            if (regexp)
            {
                path = pathToPerl5Regexp(path);
            }
View Full Code Here

            // more than one document, attempt to use path to determine
            // document ordering if it is not root relative
            List documentPaths = documentSet.getDefaultedDocumentPaths();
            if (documentPaths.size() == 1)
            {
                DocumentSetPath documentSetPath = (DocumentSetPath) documentPaths.get(0);
                if (documentSetPath.isRegexp())
                {
                    // enforce assumption that document set paths are absolute
                    // and extract folder
                    String documentFolderPath = forceAbsoluteDocumentSetPath(documentSetPath.getPath());
                    int lastSlashIndex = documentFolderPath.lastIndexOf(Folder.PATH_SEPARATOR_CHAR);
                    if (lastSlashIndex > 2)
                    {
                        // non-root document path
                        documentFolderPath = documentFolderPath.substring(0, lastSlashIndex);
                       
                        // iterate over search paths formed with document path
                        Iterator pathsIter = searchPaths.iterator();
                        while ((documentOrder == null) && pathsIter.hasNext())
                        {
                            // search folder path
                            String folderPath = (String) pathsIter.next();
                            if (folderPath.endsWith(Folder.PATH_SEPARATOR))
                            {
                                folderPath = folderPath.substring(0, folderPath.length()-1) + documentFolderPath;
                            }
                            else
                            {
                                folderPath = folderPath + documentFolderPath;
                            }
                           
                            // check folder for document order
                            try
                            {
                                FolderImpl folder = (FolderImpl) setProfiledNodePathAndUrl((AbstractNode) folderHandler.getFolder(folderPath));
                                if ((folder.getMetaData() != null) && (folder.getMetaData().getDocumentOrder() != null) &&
                                    ! folder.getMetaData().getDocumentOrder().isEmpty())
                                {
                                    documentOrder = folder.getMetaData().getDocumentOrder();
                                }               
                            }
                            catch (NodeException ne)
                            {
                            }
                        }
                    }
                }
            }

            // fallback to root search paths to determine document ordering
            if (documentOrder == null)
            {
                Iterator pathsIter = searchPaths.iterator();
                while ((documentOrder == null) && pathsIter.hasNext())
                {
                    // root search folder path
                    String folderPath = (String) pathsIter.next();
                    if (folderPath.endsWith(Folder.PATH_SEPARATOR) && (folderPath.length() > 1))
                    {
                        folderPath = folderPath.substring(0, folderPath.length()-1);
                    }

                    // check folder for document order
                    try
                    {
                        FolderImpl folder = (FolderImpl) setProfiledNodePathAndUrl((AbstractNode) folderHandler.getFolder(folderPath));
                        if ((folder.getMetaData() != null) && (folder.getMetaData().getDocumentOrder() != null) &&
                            ! folder.getMetaData().getDocumentOrder().isEmpty())
                        {
                            documentOrder = folder.getMetaData().getDocumentOrder();
                        }
                    }
                    catch (NodeException ne)
                    {
                    }
                }
            }

            // create ordered node set
            Comparator documentComparator = new DocumentOrderComparator(documentOrder);
            expandedNodes = new NodeSetImpl(null, documentComparator);
        }

        // save doucument set name, (limits recursive expansion)
        String name = documentSetNamePrefix + documentSet.getUrl();
        documentSetNames.put(documentSet, name);

        // profile each document path using profile locator search paths
        Iterator documentSetPathsIter = documentSet.getDefaultedDocumentPaths().iterator();
        while (documentSetPathsIter.hasNext())
        {
            DocumentSetPath documentSetPath = (DocumentSetPath) documentSetPathsIter.next();

            // enforce assumption that document set paths are absolute
            String path = forceAbsoluteDocumentSetPath(documentSetPath.getPath());
            log.debug("expandAndProfileDocumentSet(), document set path = " + path);

            // convert regexp paths to java/perl5 form
            boolean regexp = documentSetPath.isRegexp();
            if (regexp)
            {
                path = pathToPerl5Regexp(path);
            }
View Full Code Here

        // expand document set against managed repository only without
        // profiling; ignores document set profiling rules as well
        Iterator documentSetPathsIter = documentSet.getDefaultedDocumentPaths().iterator();
        while (documentSetPathsIter.hasNext())
        {
            DocumentSetPath documentSetPath = (DocumentSetPath) documentSetPathsIter.next();

            // enforce assumption that document set paths are absolute
            String path = forceAbsoluteDocumentSetPath(documentSetPath.getPath());
            log.debug("expandDocumentSet(), document set path = " + path);

            // convert regexp paths to java/perl5 form
            boolean regexp = documentSetPath.isRegexp();
            if (regexp)
            {
                path = pathToPerl5Regexp(path);
            }
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.om.folder.DocumentSetPath

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.