Search in sources :

Example 1 with IOpac

use of de.geeksfactory.opacclient.apis.IOpac in project opacclient by opacapp.

the class OpacApiFactory method create.

/**
 * Creates an {@link OpacApi} instance for accessing the given {@link Library}
 *
 * @param lib  the {@link Library} you want to connect to
 * @param sp   the {@link StringProvider} to use
 * @param hcf  the {@link HttpClientFactory} to use
 * @param lang the preferred language as a ISO-639-1 code, see {@link OpacApi#setLanguage(String)}
 * @return a new {@link OpacApi} instance
 */
public static OpacApi create(Library lib, StringProvider sp, HttpClientFactory hcf, String lang, ReportHandler reportHandler) {
    OpacApi newApiInstance;
    if (lib.getApi().equals("bibliotheca")) {
        newApiInstance = new Bibliotheca();
    } else if (lib.getApi().equals("sisis")) {
        newApiInstance = new SISIS();
    } else if (lib.getApi().equals("zones")) {
        newApiInstance = new Zones();
    } else if (lib.getApi().equals("biber1992")) {
        newApiInstance = new BiBer1992();
    } else if (lib.getApi().equals("pica")) {
        switch(lib.getData().optString("account_system", "")) {
            case "lbs":
                newApiInstance = new PicaLBS();
                break;
            case "default":
                newApiInstance = new PicaOld();
                break;
            default:
                newApiInstance = new PicaOld();
                break;
        }
    } else if (lib.getApi().equals("iopac")) {
        newApiInstance = new IOpac();
    } else if (lib.getApi().equals("adis")) {
        newApiInstance = new Adis();
    } else if (lib.getApi().equals("sru")) {
        newApiInstance = new SRU();
    } else if (lib.getApi().equals("primo")) {
        newApiInstance = new Primo();
    } else if (lib.getApi().equals("vufind")) {
        newApiInstance = new VuFind();
    } else if (lib.getApi().equals("webopac.net")) {
        newApiInstance = new WebOpacNet();
    } else if (lib.getApi().equals("web-opac.at") || lib.getApi().equals("littera")) {
        newApiInstance = new Littera();
    } else if (lib.getApi().equals("winbiap")) {
        newApiInstance = new WinBiap();
    } else if (lib.getApi().equals("heidi")) {
        newApiInstance = new Heidi();
    } else if (lib.getApi().equals("touchpoint")) {
        newApiInstance = new TouchPoint();
    } else if (lib.getApi().equals("open")) {
        newApiInstance = new Open();
    } else if (lib.getApi().equals("test")) {
        newApiInstance = new TestApi();
    } else {
        return null;
    }
    newApiInstance.init(lib, hcf);
    newApiInstance.setStringProvider(sp);
    newApiInstance.setReportHandler(reportHandler);
    if (lang != null)
        newApiInstance.setLanguage(lang);
    return newApiInstance;
}
Also used : IOpac(de.geeksfactory.opacclient.apis.IOpac) TestApi(de.geeksfactory.opacclient.apis.TestApi) Littera(de.geeksfactory.opacclient.apis.Littera) Bibliotheca(de.geeksfactory.opacclient.apis.Bibliotheca) VuFind(de.geeksfactory.opacclient.apis.VuFind) WinBiap(de.geeksfactory.opacclient.apis.WinBiap) Zones(de.geeksfactory.opacclient.apis.Zones) PicaOld(de.geeksfactory.opacclient.apis.PicaOld) Open(de.geeksfactory.opacclient.apis.Open) Adis(de.geeksfactory.opacclient.apis.Adis) SISIS(de.geeksfactory.opacclient.apis.SISIS) Primo(de.geeksfactory.opacclient.apis.Primo) SRU(de.geeksfactory.opacclient.apis.SRU) Heidi(de.geeksfactory.opacclient.apis.Heidi) OpacApi(de.geeksfactory.opacclient.apis.OpacApi) PicaLBS(de.geeksfactory.opacclient.apis.PicaLBS) TouchPoint(de.geeksfactory.opacclient.apis.TouchPoint) BiBer1992(de.geeksfactory.opacclient.apis.BiBer1992) WebOpacNet(de.geeksfactory.opacclient.apis.WebOpacNet)

Aggregations

Adis (de.geeksfactory.opacclient.apis.Adis)1 BiBer1992 (de.geeksfactory.opacclient.apis.BiBer1992)1 Bibliotheca (de.geeksfactory.opacclient.apis.Bibliotheca)1 Heidi (de.geeksfactory.opacclient.apis.Heidi)1 IOpac (de.geeksfactory.opacclient.apis.IOpac)1 Littera (de.geeksfactory.opacclient.apis.Littera)1 OpacApi (de.geeksfactory.opacclient.apis.OpacApi)1 Open (de.geeksfactory.opacclient.apis.Open)1 PicaLBS (de.geeksfactory.opacclient.apis.PicaLBS)1 PicaOld (de.geeksfactory.opacclient.apis.PicaOld)1 Primo (de.geeksfactory.opacclient.apis.Primo)1 SISIS (de.geeksfactory.opacclient.apis.SISIS)1 SRU (de.geeksfactory.opacclient.apis.SRU)1 TestApi (de.geeksfactory.opacclient.apis.TestApi)1 TouchPoint (de.geeksfactory.opacclient.apis.TouchPoint)1 VuFind (de.geeksfactory.opacclient.apis.VuFind)1 WebOpacNet (de.geeksfactory.opacclient.apis.WebOpacNet)1 WinBiap (de.geeksfactory.opacclient.apis.WinBiap)1 Zones (de.geeksfactory.opacclient.apis.Zones)1