Package edu.indiana.dlib.metsnav.data

Examples of edu.indiana.dlib.metsnav.data.AtomicItem


        return cc;
  }
   
  @SuppressWarnings("unchecked")
    public JSONObject getJSONAtomicItem(MetsObject obj, int pageNum) {
        AtomicItem ai = obj.getPhysicalStruct().get(pageNum-1);
        JSONObject aim = new JSONObject();
        aim.put("pageNumber", ai.getSequentialOrder());
        aim.put("pageLabel", ai.getLabeledOrder());
        aim.put("pageId", ai.getId());
       
        JSONObject dataStream = new JSONObject();
        Map<String, String> map = ai.getDataStreamsMap().get("size");
        for (Map.Entry<String, String> entry : map.entrySet()) {
            dataStream.put(entry.getKey(), entry.getValue());
        }
        aim.put("dataStream", dataStream);
       
        aim.put("imageText", ai.getLabel());
        List<String> parents = ai.parents();
        JSONArray parentList = new JSONArray();
        for (String string : parents) {
            parentList.add(string);
        }
        aim.put("parents", parentList);
View Full Code Here


        if ("page".equals(div.getTYPE()) || div.getDivCount() == 0) {
            if (div.getFptrCount() > 0) {
                Fptr fptr = div.getFptr(0);
                File file = (File) fptr.getFILEID();
                String groupId = file.getGROUPID();
                AtomicItem item = metsObj.getAtomicItemByID(groupId);
                item.setParent(parent);
                return item;
            } else if (div.getMptrCount() > 0) {
                Mptr mptr = div.getMptr(0);
                MetsPointerAtomicItem item = new MetsPointerAtomicItem();
                item.setType(div.getTYPE());
                item.setLabel(div.getLABEL());
                item.setParent(parent);
                item.setHref(mptr.getHref());
                return item;
            } else {
                return null;
            }
        } else {
View Full Code Here

     * @param pageDiv
     * @return
     * @throws DAOException
     */
    protected AtomicItem parsePage(Div pageDiv) throws DAOException {
        AtomicItem page = new AtomicItem();

        HashMap<String, String> map = new HashMap<String, String>();
        Fptr[] fptrs = pageDiv.getFptr();
        for (int i = 0; i < fptrs.length; i++) {
            Fptr fptr = fptrs[i];
            File file = (File) fptr.getFILEID();
            if (file != null) {
                FLocat locat = file.getFLocat(0);
                String group = file.getUSE();
                map.put(group, locat.getHref());
            }
        }
        page.getDataStreamsMap().put("size", map);
        page.setSequentialOrder(pageDiv.getORDER());
        page.setLabeledOrder(pageDiv.getORDERLABEL());
        return page;
    }
View Full Code Here

                Fptr fptr = d.getFptr(0);
                File file = (File) fptr.getFILEID();
                String groupId = file.getGROUPID();
                int size = list.size();
                if (size == 0 || (size > 0 && !(groupId.equals(list.get(size - 1).getId())))) {
                    AtomicItem item = parsePage(d);
                    item.setId(groupId);
                    list.add(item);
                }
            } else {
                throw new DAOException("div with type other than page in physical structMap");
            }
View Full Code Here

        if ("page".equals(div.getTYPE()) || div.getDivCount() == 0) {
            if (div.getFptrCount() > 0) {
                Fptr fptr = div.getFptr(0);
                File file = (File) fptr.getFILEID();
                String groupId = file.getGROUPID();
                AtomicItem item = metsObj.getAtomicItemByID(groupId);
                item.setParent(parent);
                return item;
            } else if (div.getMptrCount() > 0) {
                Mptr mptr = div.getMptr(0);
                MetsPointerAtomicItem item = new MetsPointerAtomicItem();
                item.setType(div.getTYPE());
                item.setLabel(div.getLABEL());
                item.setParent(parent);
                item.setHref(mptr.getHref());
                return item;
            } else {
                return null;
            }
        } else {
View Full Code Here

     * @param pageDiv
     * @return
     * @throws DAOException
     */
    protected AtomicItem parsePage(Div pageDiv) throws DAOException {
        AtomicItem page = new AtomicItem();

        HashMap<String, String> map = new HashMap<String, String>();
        Fptr[] fptrs = pageDiv.getFptr();
        for (int i = 0; i < fptrs.length; i++) {
            Fptr fptr = fptrs[i];
            File file = (File) fptr.getFILEID();
            if (file != null) {
                FLocat locat = file.getFLocat(0);
                String group = file.getUSE();
                map.put(group, locat.getHref());
            }
        }
        page.getDataStreamsMap().put("size", map);
        page.setSequentialOrder(pageDiv.getORDER());
        page.setLabeledOrder(pageDiv.getORDERLABEL());
        return page;
    }
View Full Code Here

                Fptr fptr = d.getFptr(0);
                File file = (File) fptr.getFILEID();
                String groupId = file.getGROUPID();
                int size = list.size();
                if (size == 0 || (size > 0 && !(groupId.equals(list.get(size - 1).getId())))) {
                    AtomicItem item = parsePage(d);
                    item.setId(groupId);
                    list.add(item);
                }
            } else {
                throw new DAOException("div with type other than page in physical structMap");
            }
View Full Code Here

        if ("page".equals(div.getTYPE()) || div.getDivCount() == 0) {
            if (div.getFptrCount() > 0) {
                Fptr fptr = div.getFptr(0);
                File file = (File) fptr.getFILEID();
                String groupId = file.getGROUPID();
                AtomicItem item = metsObj.getAtomicItemByID(groupId);
                item.setParent(parent);
                return item;
            } else if (div.getMptrCount() > 0) {
                Mptr mptr = div.getMptr(0);
                MetsPointerAtomicItem item = new MetsPointerAtomicItem();
                item.setType(div.getTYPE());
                item.setLabel(div.getLABEL());
                item.setParent(parent);
                item.setHref(mptr.getHref());
                return item;
            } else {
                return null;
            }
        } else {
View Full Code Here

     * @param pageDiv
     * @return
     * @throws DAOException
     */
    protected AtomicItem parsePage(Div pageDiv) throws DAOException {
        AtomicItem page = new AtomicItem();

        HashMap<String, String> map = new HashMap<String, String>();
        Fptr[] fptrs = pageDiv.getFptr();
        for (int i = 0; i < fptrs.length; i++) {
            Fptr fptr = fptrs[i];
            File file = (File) fptr.getFILEID();
            if (file != null) {
                FLocat locat = file.getFLocat(0);
                String group = file.getUSE();
                map.put(group, locat.getHref());
            }
        }
        page.getDataStreamsMap().put("size", map);
        page.setSequentialOrder(pageDiv.getORDER());
        page.setLabeledOrder(pageDiv.getORDERLABEL());
        return page;
    }
View Full Code Here

                Fptr fptr = d.getFptr(0);
                File file = (File) fptr.getFILEID();
                String groupId = file.getGROUPID();
                int size = list.size();
                if (size == 0 || (size > 0 && !(groupId.equals(list.get(size - 1).getId())))) {
                    AtomicItem item = parsePage(d);
                    item.setId(groupId);
                    list.add(item);
                }
            } else {
                throw new DAOException("div with type other than page in physical structMap");
            }
View Full Code Here

TOP

Related Classes of edu.indiana.dlib.metsnav.data.AtomicItem

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.