Examples of FedoraClient


Examples of org.fcrepo.client.FedoraClient

    @BeforeClass
    public static void bootstrap() throws Exception {

        s_client =
                new FedoraClient(FedoraServerTestCase.getBaseURL(),
                                 FedoraServerTestCase.getUsername(),
                                 FedoraServerTestCase.getPassword());
        Util.ingestTestObjects(s_client, SHARED_DEPLOYMENT_BASE);
    }
View Full Code Here

Examples of org.fcrepo.client.FedoraClient

    @BeforeClass
    public static void bootstrap() throws Exception {

        s_client =
                new FedoraClient(FedoraServerTestCase.getBaseURL(),
                                 FedoraServerTestCase.getUsername(),
                                 FedoraServerTestCase.getPassword());
        Util.ingestTestObjects(s_client, DC2MODS_DEPLOYMENT_BASE);
    }
View Full Code Here

Examples of org.fcrepo.client.FedoraClient

    @BeforeClass
    public static void bootstrap() throws Exception {

        s_client =
                new FedoraClient(FedoraServerTestCase.getBaseURL(),
                                 FedoraServerTestCase.getUsername(),
                                 FedoraServerTestCase.getPassword());
        Util.ingestTestObjects(s_client, SIMPLE_DEPLOYMENT_BASE);
    }
View Full Code Here

Examples of org.fcrepo.client.FedoraClient

    }

    @Before
    public void setUp() throws Exception {

        client = new FedoraClient(getBaseURL(), getUsername(), getPassword());

        Map<String, String> nsMap = new HashMap<String, String>();
        nsMap.put(NS_FEDORA_TYPES_PREFIX, NS_FEDORA_TYPES);
        nsMap.put("oai", "http://www.openarchives.org/OAI/2.0/");
        NamespaceContext ctx = new SimpleNamespaceContext(nsMap);
View Full Code Here

Examples of org.fcrepo.client.FedoraClient

    }

    private void reloadPolicies() {
        System.out.println("Reloading Policies...");
        try {
            FedoraClient client =
                    new FedoraClient(ServerUtility.getBaseURL(getProtocol()),
                                     getUsername(),
                                     getPassword());
            client.reloadPolicies();
            System.out.println("  Done Reloading Policies");
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

Examples of org.fcrepo.client.FedoraClient

        backupFedoraUsersFile();
        createNewFedoraUsersFileWithTestUsers();
        installJunitPolicies();
        reloadPolicies();
        System.out.println("creating alternate users");
        testuser1 = new FedoraClient(getBaseURL(), "testuser1", "testuser1");
        testuserroleA =
                new FedoraClient(getBaseURL(), "testuserroleA", "testuserroleA");
        testuser2 = new FedoraClient(getBaseURL(), "testuser2", "testuser2");
        testuser3 = new FedoraClient(getBaseURL(), "testuser3", "testuser3");
        testuserroleB =
                new FedoraClient(getBaseURL(), "testuserroleB", "testuserroleB");
        testuserroleC =
                new FedoraClient(getBaseURL(), "testuserroleC", "testuserroleC");
        testuserroleC2 =
                new FedoraClient(getBaseURL(),
                                 "testuserroleC2",
                                 "testuserroleC2");
        testuser4 = new FedoraClient(getBaseURL(), "testuser4", "testuser4");
        System.out.println("done setting up");
    }
View Full Code Here

Examples of org.fcrepo.client.FedoraClient

                    + "test-objects/foxml/cli-utils"
                    : "src/test/resources/test-objects/foxml/cli-utils";

    @Before
    public void setUp() throws Exception {
        FedoraClient client = getFedoraClient();
        apia = client.getAPIAMTOM();
        apim = client.getAPIMMTOM();
        client.shutdown();
    }
View Full Code Here

Examples of org.fcrepo.client.FedoraClient

    @BeforeClass
    public static void bootStrap() throws Exception {
        String baseURL =
                getProtocol() + "://" + getHost() + ":" + getPort() + "/"
                        + getFedoraAppServerContext();
        s_client = new FedoraClient(baseURL, getUsername(), getPassword());
        // do we actually use the demo objects in this suite of tests?
        //ingestDemoObjects(s_client);
    }
View Full Code Here

Examples of org.fcrepo.client.FedoraClient

                            // ******************************************************
                            // NEW: use the new client utility class FedoraClient
                            String baseURL =
                                    m_protocol + "://" + m_host + ":" + m_port
                                            + "/" + m_contextField.getText();
                            FedoraClient fc =
                                    new FedoraClient(baseURL,
                                                     m_usernameField.getText(),
                                                     new String(m_passwordField
                                                             .getPassword()));
                            m_apia = fc.getAPIAMTOM();
                            m_apim = fc.getAPIMMTOM();
                            fc.shutdown();
                            //*******************************************************

                            // Get SOAP stubs for the source repository.
                            // NOTE! For backward compatibility with Fedora 2.0
                            // we will immediately try a describe repository
View Full Code Here

Examples of org.fcrepo.client.FedoraClient

                // ******************************************
                // NEW: use new client utility class
                String baseURL =
                        protocol + "://" + hp[0] + ":"
                                + Integer.parseInt(hp[1]) + "/" + context;
                FedoraClient fc = new FedoraClient(baseURL, args[4], args[5]);
                FedoraAPIAMTOM targetRepoAPIA = fc.getAPIAMTOM();
                FedoraAPIMMTOM targetRepoAPIM = fc.getAPIMMTOM();
                fc.shutdown();
                //*******************************************

                String pid =
                        Ingest.oneFromFile(f,
                                           ingestFormat,
                                           targetRepoAPIA,
                                           targetRepoAPIM,
                                           logMessage);
                if (pid == null) {
                    System.out.print("ERROR: ingest failed for file: "
                            + args[1]);
                } else {
                    System.out.println("Ingested pid: " + pid);
                }
            } else if (kind == 'd') {
                // USAGE: fedora-ingest d[ir] path format targetHost:targetPort targetUser targetPassword targetProtocol [log] [context]
                if (args.length < 7 || args.length > 9) {
                    Ingest.badArgs("Wrong number of arguments (" + args.length
                            + ") for directory ingest.");
                    System.out
                            .println("USAGE: fedora-ingest d[ir] path format targetHost:targetPort targetUser targetPassword targetProtocol [log] [context]");
                }
                File d = new File(args[1]);
                String ingestFormat = args[2];
                String logMessage = null;

                if (args.length == 8) {
                    logMessage = args[7];
                }

                if (args.length == 9 && !args[8].equals("")) {
                    context = args[8];
                }

                String protocol = args[6];
                String[] hp = args[3].split(":");

                // ******************************************
                // NEW: use new client utility class
                String baseURL =
                        protocol + "://" + hp[0] + ":"
                                + Integer.parseInt(hp[1]) + "/" + context;
                FedoraClient fc = new FedoraClient(baseURL, args[4], args[5]);
                FedoraAPIAMTOM targetRepoAPIA = fc.getAPIAMTOM();
                FedoraAPIMMTOM targetRepoAPIM = fc.getAPIMMTOM();
                //*******************************************

                logRootName = "ingest-from-dir";
                logFile = IngestLogger.newLogFile(logRootName);
                log =
                        new PrintStream(new FileOutputStream(logFile),
                                        true,
                                        "UTF-8");
                IngestLogger.openLog(log, logRootName);
                Ingest.multiFromDirectory(d,
                                          ingestFormat,
                                          targetRepoAPIA,
                                          targetRepoAPIM,
                                          logMessage,
                                          log,
                                          counter);
                IngestLogger.closeLog(log, logRootName);
                summarize(counter, logFile);
            } else if (kind == 'r') {
                // USAGE: fedora-ingest r[epos] sourceHost:sourcePort sourceUser sourcePassword pid|* targetHost:targetPort targetUser targetPassword sourceProtocol targetProtocol [log] [context]
                if (args.length < 10 || args.length > 12) {
                    Ingest.badArgs("Wrong number of arguments for repository ingest.");
                }
                String logMessage = null;
                if (args.length == 11) {
                    logMessage = args[10];
                }

                if (args.length == 12 && !args[11].equals("")) {
                    context = args[11];
                }
                //Source repository
                String[] shp = args[1].split(":");
                String source_host = shp[0];
                String source_port = shp[1];
                String source_user = args[2];
                String source_password = args[3];
                String source_protocol = args[8];

                // ******************************************
                // NEW: use new client utility class
                String sourceBaseURL =
                        source_protocol + "://" + source_host + ":"
                                + Integer.parseInt(source_port) + "/" + context;
                FedoraClient sfc =
                        new FedoraClient(sourceBaseURL,
                                         source_user,
                                         source_password);
                FedoraAPIAMTOM sourceRepoAPIA = sfc.getAPIAMTOM();
                FedoraAPIMMTOM sourceRepoAPIM = sfc.getAPIMMTOM();
                //*******************************************

                //Target repository
                String[] thp = args[5].split(":");
                String target_host = thp[0];
                String target_port = thp[1];
                String target_user = args[6];
                String target_password = args[7];
                String target_protocol = args[9];

                // ******************************************
                // NEW: use new client utility class
                String targetBaseURL =
                        target_protocol + "://" + target_host + ":"
                                + Integer.parseInt(target_port) + "/" + context;
                FedoraClient tfc =
                        new FedoraClient(targetBaseURL,
                                         target_user,
                                         target_password);
                FedoraAPIAMTOM targetRepoAPIA = tfc.getAPIAMTOM();
                FedoraAPIMMTOM targetRepoAPIM = tfc.getAPIMMTOM();
                //*******************************************

                // Determine export format
                RepositoryInfo repoinfo = sourceRepoAPIA.describeRepository();
                System.out
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.