Examples of QueryLocator


Examples of org.apache.jetspeed.om.profile.QueryLocator

        {
            entries = (Map) rundata.getUser().getTemp(PsmlManagerAction.CACHED_PSML);
            if (entries == null)
            {           
                // Initialize the query locator
                QueryLocator ql = new QueryLocator(QueryLocator.QUERY_USER);

                JetspeedRunData jdata = (JetspeedRunData) rundata;
                ql.setUser(jdata.getJetspeedUser());
                //ql.setMediaType(jdata.getCapability().getPreferredMediaType());
                entries = new Hashtable();
                Iterator i = Profiler.query(ql);
                while (i.hasNext())
                {
View Full Code Here

Examples of org.apache.jetspeed.om.profile.QueryLocator

            msg = "Running with Exporter Service: " + exporterService.getClass();
            System.out.println(msg);
            logger.info(msg);


            QueryLocator locator = new QueryLocator(QueryLocator.QUERY_ALL);
            count = exporterService.export(importerService, locator);
        }
        catch (Exception e)
        {
            System.out.println("Error importing: " + e.toString());
View Full Code Here

Examples of org.apache.jetspeed.om.profile.QueryLocator

    public boolean alreadyImported()
    {
        try
        {
            JetspeedUser user = JetspeedSecurity.getUser("admin");
            QueryLocator ql = new QueryLocator(QueryLocator.QUERY_USER);
            ql.setUser(user);
            Iterator iterator = PsmlManager.query(ql);
            if (iterator.hasNext())
            {                     
                String msg = "PSMLImporter: Detected database is populated. No need to import.";
                System.out.println(msg);
View Full Code Here

Examples of org.apache.jetspeed.om.profile.QueryLocator

    protected void testCases()
    {
        try
        {
            QueryLocator locator = new QueryLocator( QueryLocator.QUERY_USER );
            Iterator x1 = query( locator );
            dump( x1 );

            QueryLocator locator2 = new QueryLocator( QueryLocator.QUERY_USER );
            locator2.setUser( JetspeedSecurity.getUser("turbine") );
            Iterator x2 = query( locator2 );
            dump( x2 );


            QueryLocator locator4 = new QueryLocator( QueryLocator.QUERY_GROUP );
//            locator4.setGroup( JetspeedSecurity.getGroup("apache") );
            Iterator x4 = query( locator4 );
            dump( x4 );
          }
        catch (Exception e)
View Full Code Here

Examples of org.apache.jetspeed.om.profile.QueryLocator

            Iterator psmlIterator = null;
            if (StringUtils.isEmpty(filterType)
                || StringUtils.isEmpty(filterValue))
            {
                psmlIterator =
                    Profiler.query(new QueryLocator(QueryLocator.QUERY_ALL));
            }
            else
            {
                PortletSessionState.setAttribute(
                    portlet,
                    rundata,
                    FILTER_TYPE,
                    filterType);
        PortletSessionState.setAttribute(
          portlet,
          rundata,
          FILTER_VALUE,
          filterValue);
        context.put(FILTER_TYPE, filterType);
        context.put(FILTER_VALUE, filterValue);
       
                QueryLocator ql = null;
                if (filterType.equalsIgnoreCase("filter_type_user"))
                {
                    try
                    {
                        JetspeedUser user =
                            JetspeedSecurity.getUser(filterValue);
                        ql = new QueryLocator(QueryLocator.QUERY_USER);
                        ql.setUser(user);
                        psmlIterator = Profiler.query(ql);
                    }
                    catch (Exception e)
                    {
                    }
                }
                else if (filterType.equalsIgnoreCase("filter_type_role"))
                {
                    try
                    {
                        Role role = JetspeedSecurity.getRole(filterValue);
                        ql = new QueryLocator(QueryLocator.QUERY_ROLE);
                        ql.setRole(role);
                        psmlIterator = Profiler.query(ql);
                    }
                    catch (Exception e)
                    {
                    }
                }
                else if (filterType.equalsIgnoreCase("filter_type_group"))
                {
                    try
                    {
                        Group group = JetspeedSecurity.getGroup(filterValue);
                        ql = new QueryLocator(QueryLocator.QUERY_GROUP);
                        ql.setGroup(group);
                        psmlIterator = Profiler.query(ql);
                    }
                    catch (Exception e)
                    {
                    }
View Full Code Here

Examples of org.apache.jetspeed.om.profile.QueryLocator

        DatabaseBrowserIterator windowIterator =
            (DatabaseBrowserIterator) PortletSessionState.getAttribute(portlet, rundata, PROFILE_ITERATOR);
        if ((windowIterator == null) || refreshFlag)
        {
            int index = 0;
            QueryLocator ql = new QueryLocator(QueryLocator.QUERY_ALL);
            ArrayList entries = new ArrayList();
            Iterator i = Profiler.query(ql);

            // Is filtering requested?
            String filterValue = rundata.getParameters().getString(FILTER_VALUE);
View Full Code Here

Examples of org.apache.jetspeed.om.profile.QueryLocator

        {
            entries = (Map) rundata.getUser().getTemp(PsmlManagerAction.CACHED_PSML);
            if (entries == null)
            {           
                // Initialize the query locator
                QueryLocator ql = new QueryLocator(QueryLocator.QUERY_USER);

                JetspeedRunData jdata = (JetspeedRunData) rundata;
                ql.setUser(jdata.getJetspeedUser());
                //ql.setMediaType(jdata.getCapability().getPreferredMediaType());
                entries = new Hashtable();
                Iterator i = Profiler.query(ql);
                while (i.hasNext())
                {
View Full Code Here

Examples of org.apache.jetspeed.om.profile.QueryLocator

            copyTo = rundata.getParameters().getString("CopyTo");

            //
            // retrieve the profiles to export
            //
            Iterator i = Profiler.query(new QueryLocator(QueryLocator.QUERY_ALL));
            while (i.hasNext())
            {
                Profile profile = (Profile) i.next();
                PSMLDocument doc = profile.getDocument();
                if(doc != null)
View Full Code Here

Examples of org.apache.jetspeed.om.profile.QueryLocator

     * @return
     */
    private DatabaseBrowserIterator performSearch(RunData rundata, Portlet portlet, int type, String value)
    {
        // Initialize the query locator
        QueryLocator ql = new QueryLocator(type);
        if (value != null)
        {
            switch (type)
            {
                case QueryLocator.QUERY_USER:
                {
                    try
                    {
                        ql.setUser(JetspeedSecurity.getUser(value));
                    }
                    catch (Exception e)
                    {
                    }
                }
                case QueryLocator.QUERY_ROLE:
                {
                    try
                    {
                        ql.setRole(JetspeedSecurity.getRole(value));
                    }
                    catch (Exception e)
                    {
                    }
                }
                case QueryLocator.QUERY_GROUP:
                {
                    try
                    {
                        ql.setGroup(JetspeedSecurity.getGroup(value));
                    }
                    catch (Exception e)
                    {
                    }
                }
View Full Code Here

Examples of org.apache.jetspeed.om.profile.QueryLocator

            copyTo = rundata.getParameters().getString("CopyTo");

            //
            // retrieve the profiles to export
            //
            Iterator i = Profiler.query(new QueryLocator(QueryLocator.QUERY_ALL));
            while (i.hasNext())
            {
                Profile profile = (Profile) i.next();
                PSMLDocument doc = profile.getDocument();
                if (doc != null)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.