Package org.openbel.framework.ws.model

Examples of org.openbel.framework.ws.model.Citation


            } else {
                citations = kAMStore.getCitations(ki, citation);
            }

            for (org.openbel.framework.api.internal.KAMStoreDaoImpl.Citation c : citations) {
                Citation c2 = convert(c);
                list.add(c2);
            }
        } catch (KAMStoreException e) {
            logger.warn(e.getMessage());
            throw new KamStoreServiceException(e);
View Full Code Here


    }

    public static Citation convert(org.openbel.framework.common.model.Citation citation) {
        if (citation == null) return null;

        Citation wsCitation = OBJECT_FACTORY.createCitation();
        wsCitation.setId(citation.getReference());
        if (citation.getType() != null) {
            String value = citation.getType().getDisplayValue().toUpperCase().replace(' ', '_');
            wsCitation.setCitationType(fromValue(value));
        }
        if (citation.getName() != null) {
            wsCitation.setName(citation.getName());
        }
        if (citation.getDate() != null) {
            try {
                GregorianCalendar calendar = new GregorianCalendar();
                calendar.setTime(citation.getDate().getTime());
                wsCitation.setPublicationDate(DatatypeFactory.newInstance().newXMLGregorianCalendar(calendar));
            } catch (DatatypeConfigurationException e) {
                // Swallowed
            }
        }
        if (citation.getAuthors() != null) {
            wsCitation.getAuthors().addAll(citation.getAuthors());
        }
        wsCitation.setComment(citation.getComment());
        return wsCitation;
    }
View Full Code Here

     * @return
     */
    public static Citation
            convert(KAMStoreDaoImpl.Citation objCitation) {

        Citation citation = OBJECT_FACTORY.createCitation();
        citation.setCitationType(convert(objCitation.getCitationType()));
        citation.setComment(objCitation.getComment());
        citation.setId(objCitation.getId());
        citation.setName(objCitation.getName());

        Date pubdate = objCitation.getPublicationDate();
        if (pubdate != null) {
            try {
                calendar.setTime(pubdate);
                citation.setPublicationDate(DatatypeFactory.newInstance()
                        .newXMLGregorianCalendar(calendar));
            } catch (DatatypeConfigurationException e) {
                // Swallowed
            }
        }

        List<String> authors = objCitation.getAuthors();
        if (authors != null) {
            citation.getAuthors().addAll(authors);
        }

        return citation;
    }
View Full Code Here

TOP

Related Classes of org.openbel.framework.ws.model.Citation

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.