Package org.fcrepo.server.search

Examples of org.fcrepo.server.search.FieldSearchQuery


            if (wantedFields.length > 0 || sessionToken != null) {
                if (sessionToken != null) {
                    result = m_access.resumeFindObjects(context, sessionToken);
                } else {
                    if ((terms != null) && (terms.length() != 0)) {
                        result = m_access.findObjects(context, wantedFields, maxResults, new FieldSearchQuery(terms));
                    } else {
                        result = m_access.findObjects(context, wantedFields, maxResults, new FieldSearchQuery(Condition.getConditions(query)));
                    }
                }
            }

            String output;
View Full Code Here


            //FIXME: use maxResults from... config instead of hardcoding 100?
            l =
                    m_fieldSearch
                            .findObjects(s_headerAndDCFields,
                                         100,
                                         new FieldSearchQuery(Condition
                                                 .getConditions("pid='"
                                                         + pid
                                                         + "' dcmDate>'2000-01-01'")))
                            .objectFieldsList();
        } catch (ServerException se) {
            throw new RepositoryException(se.getClass().getName() + ": "
                    + se.getMessage());
        }
        if (l.size() > 0) {
            ObjectFields f = (ObjectFields) l.get(0);
            return new SimpleRecord(getHeader(f), getDCXML(f), s_emptySet);
        } else {
            // see if it exists
            try {
                l =
                        m_fieldSearch
                                .findObjects(new String[] {"pid"},
                                             1,
                                             new FieldSearchQuery(Condition
                                                     .getConditions("pid='"
                                                             + pid + "'")))
                                .objectFieldsList();
            } catch (ServerException se) {
                throw new RepositoryException(se.getClass().getName() + ": "
View Full Code Here

        try {
            fsr =
                    m_fieldSearch
                            .findObjects(s_headerAndDCFields,
                                         (int) getMaxRecords(),
                                         new FieldSearchQuery(Condition
                                                 .getConditions("dcmDate>'2000-01-01'"
                                                         + getDatePart(from,
                                                                       until))));
            l = fsr.objectFieldsList();
        } catch (ServerException se) {
View Full Code Here

        try {
            fsr =
                    m_fieldSearch
                            .findObjects(s_headerFields,
                                         (int) getMaxHeaders(),
                                         new FieldSearchQuery(Condition
                                                 .getConditions("dcmDate>'2000-01-01'"
                                                         + getDatePart(from,
                                                                       until))));
            l = fsr.objectFieldsList();
        } catch (ServerException se) {
View Full Code Here

        try {
            l =
                    m_fieldSearch
                            .findObjects(new String[] {"pid"},
                                         1,
                                         new FieldSearchQuery(Condition
                                                 .getConditions("pid='"
                                                         + pid
                                                         + "' dcmDate>'2000-01-01'")))
                            .objectFieldsList();
        } catch (ServerException se) {
            throw new RepositoryException(se.getClass().getName() + ": "
                    + se.getMessage());
        }
        if (l.size() > 0) {
            return m_formats;
        }
        try {
            l =
                    m_fieldSearch.findObjects(new String[] {"pid"},
                                              1,
                                              new FieldSearchQuery(Condition
                                                      .getConditions("pid='"
                                                              + pid + "'")))
                            .objectFieldsList();
        } catch (ServerException se) {
            throw new RepositoryException(se.getClass().getName() + ": "
View Full Code Here

                        fsr =
                                m_access
                                        .findObjects(context,
                                                     fieldsArray,
                                                     maxResults,
                                                     new FieldSearchQuery(terms));
                    } else {
                        fsr =
                                m_access
                                        .findObjects(context,
                                                     fieldsArray,
                                                     maxResults,
                                                     new FieldSearchQuery(Condition
                                                             .getConditions(query)));
                    }
                }
                List<ObjectFields> searchResults = fsr.objectFieldsList();
                if (!xml) {
View Full Code Here

     * A {@link FieldSearchQuery} may be made from a terms string or a query
     * string, but not both.
     */
    private FieldSearchQuery assembleFieldSearchQuery(String query, String terms) {
        if (terms != null) {
            return new FieldSearchQuery(terms);
        } else {
            try {
                return new FieldSearchQuery(Condition.getConditions(query));
            } catch (QueryParseException e) {
                throw new ValidatorProcessUsageException("Value '" + query
                        + "' of parameter '" + PARAMETER_QUERY
                        + "' is not a valid query string.");
            }
View Full Code Here

                .getPassword());
        assertEquals("serverurl", new URL("http://some.url/"), parms
                .getServiceInfo().getBaseUrl());
        assertEquals("iteratorType", IteratorType.FS_QUERY, parms
                .getIteratorType());
        FieldSearchQuery fsq = parms.getQuery();
        assertEquals("queryType", FieldSearchQuery.TERMS_TYPE, fsq.getType());
        assertEquals("terms", "terms", fsq.getTerms());
    }
View Full Code Here

                .getPassword());
        assertEquals("serverurl", new URL("http://some.url/"), parms
                .getServiceInfo().getBaseUrl());
        assertEquals("iteratorType", IteratorType.FS_QUERY, parms
                .getIteratorType());
        FieldSearchQuery fsq = parms.getQuery();
        assertEquals("queryType", FieldSearchQuery.CONDITIONS_TYPE, fsq
                .getType());
        assertEquals("conditions", Condition.getConditions("pid=fred"), fsq
                .getConditions());
    }
View Full Code Here

TOP

Related Classes of org.fcrepo.server.search.FieldSearchQuery

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.