Examples of FieldSearchQuery


Examples of org.fcrepo.server.types.gen.FieldSearchQuery

     * service defined by the indicated sDef.
     */
    public static Map getDeploymentLabelMap(String sDefPID) throws IOException {
        try {
            HashMap labelMap = new HashMap();
            FieldSearchQuery query = new FieldSearchQuery();
            Condition[] conditions = new Condition[2];
            conditions[0] = new Condition();
            conditions[0].setProperty("fType");
            conditions[0].setOperator(ComparisonOperator.fromValue("eq"));
            conditions[0].setValue("M");
            conditions[1] = new Condition();
            conditions[1].setProperty("bDef");
            conditions[1].setOperator(ComparisonOperator.fromValue("has"));
            conditions[1].setValue(sDefPID);
            FieldSearchQuery.Conditions conds =
                    new FieldSearchQuery.Conditions();
            conds.getCondition().addAll(Arrays.asList(conditions));
            ObjectFactory factory = new ObjectFactory();
            query.setConditions(factory.createFieldSearchQueryConditions(conds));
            String[] fields = new String[] {"pid", "label"};
            if (true) {
                /*
                 * FIXME: find some other way to do this, if we care. it uses
                 * fType and bDef, which are no longer in field search,
View Full Code Here

Examples of org.fcrepo.server.types.gen.FieldSearchQuery

    /**
     * Get the indicated fields of the indicated object from the repository.
     */
    public static ObjectFields getObjectFields(String pid, String[] fields)
            throws IOException {
        FieldSearchQuery query = new FieldSearchQuery();
        Condition condition = new Condition();
        condition.setProperty("pid");
        condition.setOperator(ComparisonOperator.fromValue("eq"));
        condition.setValue(pid);
        FieldSearchQuery.Conditions conds = new FieldSearchQuery.Conditions();
        conds.getCondition().add(condition);
        ObjectFactory factory = new ObjectFactory();
        query.setConditions(factory.createFieldSearchQueryConditions(conds));
        FieldSearchResult result =
                Administrator.APIA
                        .findObjects(TypeUtility.convertStringtoAOS(fields),
                                     new BigInteger("1"),
                                     query);
View Full Code Here

Examples of org.fcrepo.server.types.gen.FieldSearchQuery

                                           FedoraAPIMMTOM targetRepoAPIM,
                                           String logMessage,
                                           PrintStream log,
                                           IngestCounter c) throws Exception {
        // prepare the FieldSearch query
        FieldSearchQuery query = new FieldSearchQuery();
        FieldSearchQuery.Conditions condi = new FieldSearchQuery.Conditions();
        org.fcrepo.server.types.gen.Condition cond =
                new org.fcrepo.server.types.gen.Condition();
        cond.setProperty("pid");
        cond.setOperator(ComparisonOperator.fromValue("has"));
        condi.getCondition().add(cond);
        org.fcrepo.server.types.gen.ObjectFactory factory =
                new org.fcrepo.server.types.gen.ObjectFactory();
        query.setConditions(factory.createFieldSearchQueryConditions(condi));
        query.setTerms(null);
        ArrayOfString resultFields = new ArrayOfString();
        resultFields.getItem().add("pid");

        // get the first chunk of search results
        FieldSearchResult result =
View Full Code Here

Examples of org.fcrepo.server.types.gen.FieldSearchQuery

                            String exportContext,
                            File dir) throws Exception {
        int count = 0;

        // prepare the FieldSearch query
        FieldSearchQuery query = new FieldSearchQuery();
        query.setTerms(null);

        ArrayOfString resultFields = new ArrayOfString();
        resultFields.getItem().add("pid");

        // get the first chunk of search results
View Full Code Here

Examples of org.fcrepo.server.types.gen.FieldSearchQuery

    @Test
    public void testFindObjects() throws Exception {
        // Test that a search for pid=demo:5 returns one result; demo:5
        String[] resultFields = {"pid"};
        java.math.BigInteger maxResults = new java.math.BigInteger("" + 100);
        FieldSearchQuery query = new FieldSearchQuery();
        Conditions conds = new Conditions();
        Condition cond = new Condition();
        cond.setOperator(ComparisonOperator.EQ);
        cond.setProperty("pid");
        cond.setValue("demo:5");
        conds.getCondition().add(cond);
        ObjectFactory factory = new ObjectFactory();
        query.setConditions(factory.createFieldSearchQueryConditions(conds));
        FieldSearchResult result =
                apia.findObjects(TypeUtility.convertStringtoAOS(resultFields),
                                 maxResults,
                                 query);
        ResultList resultList = result.getResultList();
View Full Code Here

Examples of org.fcrepo.server.types.gen.FieldSearchQuery

        // test getting xml for object demo:5
        System.out.println("Running TestAPIM.testValidate...");

        String[] resultFields = {"pid"};
        java.math.BigInteger maxResults = new java.math.BigInteger("" + 1000);
        FieldSearchQuery query = new FieldSearchQuery();
        ObjectFactory factory = new ObjectFactory();
        query.setTerms(factory.createFieldSearchQueryTerms("*"));
        FieldSearchResult result =
                apia.findObjects(TypeUtility.convertStringtoAOS(resultFields), maxResults, query);
        List<ObjectFields> fields = result.getResultList().getObjectFields();
        for (ObjectFields objectFields : fields) {
            String pid = objectFields.getPid().getValue();
View Full Code Here

Examples of org.fcrepo.server.types.gen.FieldSearchQuery

            String baseURL = protocol + "://" + host + ":" + port + "/" + context;
            FedoraClient fc = new FedoraClient(baseURL, user, pass);
            AutoFinder finder = new AutoFinder(fc.getAPIAMTOM());
            fc.shutdown();

            FieldSearchQuery query = new FieldSearchQuery();
            org.fcrepo.server.types.gen.ObjectFactory factory =
                new org.fcrepo.server.types.gen.ObjectFactory();
            query.setTerms(factory.createFieldSearchQueryTerms(phrase));
            String[] arrayS = fields.split(" ");
            ArrayOfString aux = new ArrayOfString();
            aux.getItem().addAll(Arrays.asList(arrayS));
            FieldSearchResult result =
                    finder.findObjects(aux, 20, query);
View Full Code Here

Examples of org.fcrepo.server.types.gen.FieldSearchQuery


        String termsTemplate = "$value$";
        TemplatedResourceIterator tri = new TemplatedResourceIterator(termsTemplate, "src/test/resources/APIM2/searchvalues");
        while (tri.hasNext()) {
            FieldSearchQuery query;
            // using conditions
            FieldSearchQuery.Conditions conds = new FieldSearchQuery.Conditions();
            Condition c = new Condition();
            c.setProperty("pid");
            c.setOperator(ComparisonOperator.fromValue("eq"));
            c.setValue(tri.getAttributeValue("value"));
            conds.getCondition().add(c);
            query = new FieldSearchQuery();
            ObjectFactory factory = new ObjectFactory();
            query.setConditions(factory.createFieldSearchQueryConditions(conds));
            apia.findObjects(TypeUtility.convertStringtoAOS(resultFields), maxResults, query);


            String terms = tri.next();
            query = new FieldSearchQuery();
            query.setTerms(factory.createFieldSearchQueryTerms(terms));
            apia.findObjects(TypeUtility.convertStringtoAOS(resultFields), maxResults, query);

        }

        purgeDemoObjects(s_client);
View Full Code Here

Examples of org.fcrepo.server.types.gen.FieldSearchQuery

    @Test
    public void testValidate() throws Exception {
        String[] resultFields = {"pid"};
        java.math.BigInteger maxResults = new java.math.BigInteger("" + 1000);
        FieldSearchQuery query = new FieldSearchQuery();
        org.fcrepo.server.types.gen.ObjectFactory factory = new org.fcrepo.server.types.gen.ObjectFactory();
        query.setTerms(factory.createFieldSearchQueryTerms("*"));
        FieldSearchResult result =
                apia.findObjects(TypeUtility.convertStringtoAOS(resultFields),
                                 maxResults,
                                 query);

View Full Code Here

Examples of org.fcrepo.server.types.gen.FieldSearchQuery

            String[] displayFields = new String[fields.size()];
            ObjectFactory factory = new ObjectFactory();
            for (int i = 0; i < fields.size(); i++) {
                displayFields[i] = (String) fields.get(i);
            }
            FieldSearchQuery query = new FieldSearchQuery();
            if (m_tabbedPane.getSelectedIndex() == 0) {
                query.setTerms(factory.createFieldSearchQueryTerms(m_simpleQueryField.getText()));
            } else {
                List<Condition> conditions = m_model.getConditions();
                Condition[] cond = new Condition[conditions.size()];
                for (int i = 0; i < conditions.size(); i++) {
                    cond[i] = conditions.get(i);
                }
                FieldSearchQuery.Conditions conds = new FieldSearchQuery.Conditions();
                conds.getCondition().addAll(conditions);
                query.setConditions(factory.createFieldSearchQueryConditions(conds));
            }
            ResultFrame frame =
                    new ResultFrame("Search Results", displayFields, 100, query);
            frame.setVisible(true);
            Administrator.getDesktop().add(frame);
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.