Package edu.indiana.dlib.metsnav.data

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


     */
    @SuppressWarnings("unchecked")
    public JSONObject getJSONCompositeItem(MetsObject obj, String cid) {
        CompositeItem item = obj.getCompositeItemMap().get(cid);
       
        DescriptiveMetadata dmd = obj.getDmdMap().get(item.getDmdID());

        JSONObject citem = null;
       
        // Gets the descriptive metadata to be shown
        if (dmd == null) {
            if (StringUtils.isBlank(item.getLabel())) {
                return null;
            } else {
                citem = new JSONObject();
                citem.put("id", item.getId());
                citem.put("title", item.getLabel());
            }
        } else {
            DescriptiveMetadataHandler handler = new XSLTDescriptiveMetadataHandler(); //TODO: generalize, dynamic loading
            citem =  (JSONObject)JSONSerializer.toJSON(handler.getMetadata(dmd.getDmd(), "simple"));
            citem.put("hasDmd", true);
        }
        citem.put("firstPage", item.getFirst().getSequentialOrder());
        citem.put("lastPage", item.getLast().getSequentialOrder());
        citem.put("label", item.getLabel());
View Full Code Here


                } else {
                    if (dmdSecs[i].getMdWrap().getXmlData().getAnyObjectCount() == 1) {
                        AnyNode anyNode = (AnyNode) dmdSecs[i].getMdWrap().getXmlData()
                                .getAnyObject(0);
                        int type = dmdSecs[i].getMdWrap().getMDTYPE().getType();
                        DescriptiveMetadata dmd = new DescriptiveMetadata(anyNode, type);
                        String id = dmdSecs[i].getID();
                        dmdMap.put(id, dmd);
                    }
                }
            }
View Full Code Here

                } else {
                    if (dmdSecs[i].getMdWrap().getXmlData().getAnyObjectCount() == 1) {
                        AnyNode anyNode = (AnyNode) dmdSecs[i].getMdWrap().getXmlData()
                                .getAnyObject(0);
                        int type = dmdSecs[i].getMdWrap().getMDTYPE().getType();
                        DescriptiveMetadata dmd = new DescriptiveMetadata(anyNode, type);
                        String id = dmdSecs[i].getID();
                        dmdMap.put(id, dmd);
                    }
                }
            }
View Full Code Here

                } else {
                    if (dmdSecs[i].getMdWrap().getXmlData().getAnyObjectCount() == 1) {
                        AnyNode anyNode = (AnyNode) dmdSecs[i].getMdWrap().getXmlData()
                                .getAnyObject(0);
                        int type = dmdSecs[i].getMdWrap().getMDTYPE().getType();
                        DescriptiveMetadata dmd = new DescriptiveMetadata(anyNode, type);
                        String id = dmdSecs[i].getID();
                        dmdMap.put(id, dmd);
                    }
                }
            }
View Full Code Here

    ArrayList<AbstractItem> children = root.getChildren();
    ArrayList toc = new ArrayList();
    for (AbstractItem item : children) {
      CompositeItem ci = (CompositeItem)item;
      DescriptiveMetadataHandler handler = new XSLTDescriptiveMetadataHandler();
      DescriptiveMetadata dmd =mo.getDmdMap().get(ci.getDmdID());
      Map md = null;
      if (dmd == null) {
        md = new HashMap();
        md.put("id", ci.getId());
        md.put("title", ci.getLabel());
      } else {
        md =  handler.getMetadata(dmd.getDmd(), "simple");
      }
      md.put("firstPage", ci.getFirst().getId());
      md.put("lastPage", ci.getLast().getId());     
      toc.add(md);
    }
View Full Code Here

   * @return
   */
  @SuppressWarnings("unchecked")
  public Map<String, Map> getArticle(MetsObject obj, String id, String size) {
    CompositeItem item = obj.getCompositeItemMap().get(id);
    DescriptiveMetadata dmd = obj.getDmdMap().get(item.getDmdID());
    Map md = null;
    if (dmd == null) {
      md = new HashMap();
      md.put("id", item.getId());
      md.put("title", item.getLabel());
    } else {
      DescriptiveMetadataHandler handler = new XSLTDescriptiveMetadataHandler();
      md = handler.getMetadata(dmd.getDmd(), "simple");
    }
    md.put("firstPage", item.getFirst().getId());
    md.put("lastPage", item.getLast().getId());
   
    Map ret = new HashMap();
View Full Code Here

TOP

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

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.