Search in sources :

Example 1 with Account

use of fr.mom.arkeo.soap.Account in project opentheso by miledrousset.

the class ArkClient method login.

private static Account login(String baseId, String user, String password) {
    URL wsdlURL = LoginService.WSDL_LOCATION;
    LoginService ss = new LoginService(wsdlURL, LOGIN_SERVICE_NAME);
    Login login = ss.getLoginPort();
    Account account = login.authentification(baseId, user, password);
    return account;
}
Also used : Account(fr.mom.arkeo.soap.Account) Login(fr.mom.arkeo.soap.Login) URL(java.net.URL) LoginService(fr.mom.arkeo.soap.LoginService)

Example 2 with Account

use of fr.mom.arkeo.soap.Account in project opentheso by miledrousset.

the class ArkClient method getArkId.

public String getArkId(String date, String url, String title, String creator, ArrayList<DcElement> dcElementsList, String prefix) {
    Account account;
    try {
        account = login(propertiesArk.getProperty("idNaan"), propertiesArk.getProperty("user"), propertiesArk.getProperty("password"));
        if (account == null)
            return null;
        // System.out.println("authentification.result=" + account.getUser().getFirstname() + " " + account.getUser().getLastname());
        Ark inputArk = new Ark();
        inputArk.setDate(date);
        inputArk.setUrlTarget(url);
        inputArk.setTitle(title);
        // prefixes à définir type DCMI
        // "pcrt");
        inputArk.setType(prefix);
        inputArk.setCreator(creator);
        for (DcElement dcElementsList1 : dcElementsList) {
            inputArk.getDcElements().add(dcElementsList1);
        }
        Ark returnedArk = createArk(account, inputArk);
        if (returnedArk != null)
            return returnedArk.getArk();
        return null;
    } catch (Exception e) {
        System.out.println(e.toString());
    }
    return null;
/*
        for(DcElement dcElement : returnedArk.getDcElements()){
        	System.out.println(dcElement.getName()+" = " +dcElement.getValue());
        }
        */
// Liste des DcElements
/*     
        EL_ABSTRACT = "abstract",
        EL_ACCRIGHTS = "accessRights",
        EL_ACCMETHOD = "accrualMethod",
        EL_ACCPERIOD = "accrualPeriodicity",
        EL_ACCPOLICY = "accrualPolicy",
        EL_ALT = "alternative",
        EL_AUDIENCE = "audience",
        EL_AVAILABLE = "available",
        EL_BIBCITE = "bibliographicCitation",
        EL_CONFORMS = "conformsTo",
        EL_CONTRIB = "contributor",
        EL_COVERAGE = "coverage",
        EL_CREATED = "created",
        EL_CREATOR = "creator",
        EL_DATE = "date",
        EL_DATEACC = "dateAccepted",
        EL_DATECPR = "dateCopyrighted",
        EL_DATESUB = "dateSubmitted",
        EL_DESC = "description",
        EL_EDUCLEVEL = "educationLevel",
        EL_EXTENT = "extent",
        EL_FORMAT = "format",
        EL_HASFORMAT = "hasFormat",
        EL_HASPART = "hasPart",
        EL_HASVERS = "hasVersion",
        EL_ID = "identifier",
        EL_INSTMETHOD = "instructionalMethod",
        EL_ISFMTOF = "isFormatOf",
        EL_ISPARTOF = "isPartOf",
        EL_ISREFBY = "isReferencedBy",
        EL_ISREPBY = "isReplacedBy",
        EL_ISREQBY = "isRequiredBy",
        EL_ISSUED = "issued",
        EL_ISVSNOF = "isVersionOf",
        EL_LANG = "language",
        EL_LICENSE = "license",
        EL_MEDIATOR = "mediator",
        EL_MEDIUM = "medium",
        EL_MOD = "modified",
        EL_PROV = "provenance",
        EL_PUB = "publisher",
        EL_REFS = "references",
        EL_REL = "relation",
        EL_REP = "replaces",
        EL_REQ = "requires",
        EL_RIGHTS = "rights",
        EL_RIGHTSHOLDER = "rightsHolder",
        EL_SOURCE = "source",
        EL_SPATIAL = "spatial",
        EL_SUBJECT = "subject",
        EL_TOC = "tableOfContents",
        EL_TEMPORAL = "temporal",
        EL_TITLE = "title",
        EL_TYPE = "type",
        EL_VALID = "valid";
        */
// System.out.println("ark.result=" + returnedArk.getArk());
}
Also used : DcElement(fr.mom.arkeo.soap.DcElement) Account(fr.mom.arkeo.soap.Account) Ark(fr.mom.arkeo.soap.Ark)

Example 3 with Account

use of fr.mom.arkeo.soap.Account in project opentheso by miledrousset.

the class ArkClient method getInfosArkId.

public String getInfosArkId(String idArk) {
    // compte de Frantiq
    Account account = login(propertiesArk.getProperty("idNaan"), propertiesArk.getProperty("user"), propertiesArk.getProperty("password"));
    Ark ark = getArk(account, idArk);
    if (ark != null)
        return ark.getArk();
    return null;
}
Also used : Account(fr.mom.arkeo.soap.Account) Ark(fr.mom.arkeo.soap.Ark)

Example 4 with Account

use of fr.mom.arkeo.soap.Account in project opentheso by miledrousset.

the class ArkClient method updateArkId.

public String updateArkId(String date, String url, String title, String creator, ArrayList<DcElement> dcElementsList, String type) {
    // compte de Frantiq
    Account account = login(propertiesArk.getProperty("idNaan"), propertiesArk.getProperty("user"), propertiesArk.getProperty("password"));
    // System.out.println("authentification.result=" + account.getUser().getFirstname() + " " + account.getUser().getLastname());
    Ark inputArk = new Ark();
    inputArk.setDate(date);
    inputArk.setUrlTarget(url);
    inputArk.setTitle(title);
    // prefixes à définir type DCMI
    // "pcrt");
    inputArk.setType(type);
    inputArk.setCreator(creator);
    for (DcElement dcElementsList1 : dcElementsList) {
        inputArk.getDcElements().add(dcElementsList1);
    }
    Ark returnedArk = updateArk(account, inputArk);
    /*
        for(DcElement dcElement : returnedArk.getDcElements()){
        	System.out.println(dcElement.getName()+" = " +dcElement.getValue());
        }
        */
    if (returnedArk != null)
        return returnedArk.getArk();
    return null;
// Liste des DcElements
/*     
        EL_ABSTRACT = "abstract",
        EL_ACCRIGHTS = "accessRights",
        EL_ACCMETHOD = "accrualMethod",
        EL_ACCPERIOD = "accrualPeriodicity",
        EL_ACCPOLICY = "accrualPolicy",
        EL_ALT = "alternative",
        EL_AUDIENCE = "audience",
        EL_AVAILABLE = "available",
        EL_BIBCITE = "bibliographicCitation",
        EL_CONFORMS = "conformsTo",
        EL_CONTRIB = "contributor",
        EL_COVERAGE = "coverage",
        EL_CREATED = "created",
        EL_CREATOR = "creator",
        EL_DATE = "date",
        EL_DATEACC = "dateAccepted",
        EL_DATECPR = "dateCopyrighted",
        EL_DATESUB = "dateSubmitted",
        EL_DESC = "description",
        EL_EDUCLEVEL = "educationLevel",
        EL_EXTENT = "extent",
        EL_FORMAT = "format",
        EL_HASFORMAT = "hasFormat",
        EL_HASPART = "hasPart",
        EL_HASVERS = "hasVersion",
        EL_ID = "identifier",
        EL_INSTMETHOD = "instructionalMethod",
        EL_ISFMTOF = "isFormatOf",
        EL_ISPARTOF = "isPartOf",
        EL_ISREFBY = "isReferencedBy",
        EL_ISREPBY = "isReplacedBy",
        EL_ISREQBY = "isRequiredBy",
        EL_ISSUED = "issued",
        EL_ISVSNOF = "isVersionOf",
        EL_LANG = "language",
        EL_LICENSE = "license",
        EL_MEDIATOR = "mediator",
        EL_MEDIUM = "medium",
        EL_MOD = "modified",
        EL_PROV = "provenance",
        EL_PUB = "publisher",
        EL_REFS = "references",
        EL_REL = "relation",
        EL_REP = "replaces",
        EL_REQ = "requires",
        EL_RIGHTS = "rights",
        EL_RIGHTSHOLDER = "rightsHolder",
        EL_SOURCE = "source",
        EL_SPATIAL = "spatial",
        EL_SUBJECT = "subject",
        EL_TOC = "tableOfContents",
        EL_TEMPORAL = "temporal",
        EL_TITLE = "title",
        EL_TYPE = "type",
        EL_VALID = "valid";
        */
// System.out.println("ark.result=" + returnedArk.getArk());
}
Also used : DcElement(fr.mom.arkeo.soap.DcElement) Account(fr.mom.arkeo.soap.Account) Ark(fr.mom.arkeo.soap.Ark)

Aggregations

Account (fr.mom.arkeo.soap.Account)4 Ark (fr.mom.arkeo.soap.Ark)3 DcElement (fr.mom.arkeo.soap.DcElement)2 Login (fr.mom.arkeo.soap.Login)1 LoginService (fr.mom.arkeo.soap.LoginService)1 URL (java.net.URL)1