Package org.fcrepo.server.types.gen

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


            String[] fields = new String[] {"pid", "label"};
            if (true) {
                /* FIXME: find some other way to do this */
                throw new UnsupportedOperationException("This operation uses obsolete field search semantics");
            }
            FieldSearchResult result =
                    Administrator.APIA.findObjects(TypeUtility.convertStringtoAOS(fields),
                                                   new BigInteger("50"),
                                                   query);
            while (result != null) {
                ResultList resultList = result.getResultList();
                if (resultList != null && resultList.getObjectFields() != null) {
                    for (ObjectFields element : resultList.getObjectFields()) {
                        labelMap.put(element.getPid(), element.getLabel());
                    }
                }
                if (result.getListSession() != null) {
                    result =
                            Administrator.APIA.resumeFindObjects(result
                                    .getListSession().getValue().getToken());
                } else {
                    result = null;
                }
            }
View Full Code Here


                 * FIXME: find some other way to do this, if we care. it uses
                 * fType and bDef, which are no longer in field search,
                 */
                throw new UnsupportedOperationException("This operation uses obsolete field search semantics");
            }
            FieldSearchResult result =
                    Administrator.APIA
                            .findObjects(TypeUtility.convertStringtoAOS(fields),
                                         new BigInteger("50"),
                                         query);
            while (result != null) {
                ResultList resultList = result.getResultList();
                if (resultList != null && resultList.getObjectFields() != null) {
                    for (ObjectFields element : resultList.getObjectFields()) {
                        labelMap.put(element.getPid(), element.getLabel());
                    }
                }
                if (result.getListSession() != null) {
                    result =
                            Administrator.APIA.resumeFindObjects(result
                                    .getListSession().getValue().getToken());
                } else {
                    result = null;
                }
            }
View Full Code Here

        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);
        ResultList resultList = result.getResultList();
        if (resultList == null || resultList.getObjectFields() == null
                && resultList.getObjectFields().size() == 0) {
            throw new IOException("Object not found in repository");
        }
        return resultList.getObjectFields().get(0);
View Full Code Here

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

        // get the first chunk of search results

        FieldSearchResult result =
                AutoFinder.findObjects(apia, resultFields, 100, query);

        while (result != null && result.getResultList() != null) {

            List<ObjectFields> ofs = result.getResultList().getObjectFields();

            // export all objects from this chunk of search results
            for (ObjectFields element : ofs) {
                String pid = element.getPid().getValue();
                one(apia, apim, pid, format, exportContext, dir);
                count++;
            }

            // get the next chunk of search results, if any
            String token = null;
            try {
                token = result.getListSession().getValue().getToken();
            } catch (Throwable th) {
            }

            if (token != null) {
                result = AutoFinder.resumeFindObjects(apia, token);
View Full Code Here

        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();
        List<ObjectFields> fields = resultList.getObjectFields();
        assertEquals(1, fields.size());
        assertEquals("demo:5", fields.get(0).getPid().getValue());
    }
View Full Code Here

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

        // get the first chunk of search results
        FieldSearchResult result =
                AutoFinder
                        .findObjects(sourceRepoAPIA, resultFields, 100, query);

        while (result != null && result.getResultList() != null) {

            List<ObjectFields> ofs = result.getResultList().getObjectFields();

            // ingest all objects from this chunk of search results
            for (ObjectFields element : ofs) {
                String pid = element.getPid().getValue();
                try {
                    String newPID =
                            oneFromRepository(sourceRepoAPIA,
                                              sourceRepoAPIM,
                                              sourceExportFormat,
                                              pid,
                                              targetRepoAPIA,
                                              targetRepoAPIM,
                                              logMessage);
                    c.successes++;
                    IngestLogger.logFromRepos(log, pid, newPID);
                } catch (Exception e) {
                    // failed... just log it and continue
                    c.failures++;
                    IngestLogger.logFailedFromRepos(log, pid, e);
                }
            }

            // get the next chunk of search results, if any
            String token = null;
            try {
                token = result.getListSession().getValue().getToken();
            } catch (Throwable th) {
            }

            if (token != null) {
                result = AutoFinder.resumeFindObjects(sourceRepoAPIA, token);
View Full Code Here

        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();
            System.out.println("Validating object '" + pid + "'");
            Validation validation = apim.validate(pid, null);
            if (!validation.isValid()) {
View Full Code Here

                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);
            int matchNum = 0;
            while (result != null) {
                for (int i = 0; i < result.getResultList().getObjectFields().size(); i++) {
                    ObjectFields o = result.getResultList().getObjectFields().get(i);
                    matchNum++;
                    System.out.println("#" + matchNum);
                    AutoFinder.printValue("pid              ", o.getPid() != null ? o.getPid().getValue() : null);
                    AutoFinder.printValue("state            ", o.getState() != null ? o.getState().getValue() : null);
                    AutoFinder.printValue("ownerId          ", o.getOwnerId() != null ? o.getOwnerId().getValue() : null);
                    AutoFinder.printValue("cDate            ", o.getCDate() != null ? o.getCDate().getValue() : null);
                    AutoFinder.printValue("mDate            ", o.getMDate() != null ? o.getMDate().getValue() : null);
                    AutoFinder.printValue("dcmDate          ", o.getDcmDate() != null ? o.getDcmDate().getValue() : null);
                    AutoFinder.printValue("title            ", o.getTitle() != null ? o.getTitle().toString() : null);
                    AutoFinder.printValue("creator          ", o.getCreator() != null ? o.getCreator().toString() : null);
                    AutoFinder.printValue("subject          ", o.getSubject() != null ? o.getSubject().toString() : null);
                    AutoFinder.printValue("description      ", o.getDescription() != null ? o.getDescription().toString() : null);
                    AutoFinder.printValue("publisher        ", o.getPublisher() != null ? o.getPublisher().toString() : null);
                    AutoFinder.printValue("contributor      ", o.getContributor() != null ? o.getContributor().toString() : null);
                    AutoFinder.printValue("date             ", o.getDate() != null ? o.getDate().toString() : null);
                    AutoFinder.printValue("type             ", o.getType() != null ? o.getType().toString() : null);
                    AutoFinder.printValue("format           ", o.getFormat() != null ? o.getFormat().toString() : null);
                    AutoFinder.printValue("identifier       ", o.getIdentifier() != null ? o.getIdentifier().toString() : null);
                    AutoFinder.printValue("source           ", o.getSource() != null ? o.getSource().toString() : null);
                    AutoFinder.printValue("language         ", o.getLanguage() != null ? o.getLanguage().toString() : null);
                    AutoFinder.printValue("relation         ", o.getRelation() != null ? o.getRelation().toString() : null);
                    AutoFinder.printValue("coverage         ", o.getCoverage() != null ? o.getCoverage().toString() : null);
                    AutoFinder.printValue("rights           ", o.getRights() != null ? o.getRights().toString() : null);
                    System.out.println("");
                }
                if (result.getListSession() != null && result.getListSession().getValue() != null) {
                    result = finder.resumeFindObjects(result.getListSession().getValue().getToken());
                } else {
                    result = null;
                }
            }
        } catch (Exception e) {
View Full Code Here

        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);

        List<ObjectFields> fields = result.getResultList().getObjectFields();
        String pid = "";
        URI url = null;
        for (ObjectFields objectFields : fields) {
            if (objectFields != null) {
                pid = objectFields.getPid() != null ? objectFields.getPid().getValue() : "";
View Full Code Here

            if (true) {
                /* FIXME: find some other way to do this */
                throw new UnsupportedOperationException("This operation uses obsolete field search semantics");
            }

            FieldSearchResult result =
                    APIA.findObjects(TypeUtility.convertStringtoAOS(fields),
                                     new BigInteger("50"),
                                     query);
            while (result != null) {
                ResultList resultList = result.getResultList();
                if (result.getResultList() != null) {
                    for (ObjectFields element : resultList.getObjectFields()) {
                        labelMap.put(element.getPid().getValue(), element
                                .getLabel().getValue());
                    }
                }
                if (result.getListSession() != null) {
                    result =
                            APIA.resumeFindObjects(result.getListSession()
                                    .getValue().getToken());
                } else {
                    result = null;
                }
            }
View Full Code Here

TOP

Related Classes of org.fcrepo.server.types.gen.FieldSearchResult

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.