Examples of XmlData


Examples of com.caucho.xmpp.im.XmlData

      else {
        String name = _in.getLocalName();
        String uri = _in.getNamespaceURI();
        String data = _in.readAsXmlString();

        extraList.add(new XmlData(name, uri, data));
      }
    }

    if (_isFinest)
      debug(_in);
View Full Code Here

Examples of com.caucho.xmpp.im.XmlData

      else {
  String name = _in.getLocalName();
  String uri = _in.getNamespaceURI();
  String data = _in.readAsXmlString();

  extraList.add(new XmlData(name, uri, data));
      }
    }

    if (_isFinest)
      debug(_in);
View Full Code Here

Examples of de.pdf_scrutinizer.API.XMLData

                ScriptableObject.putProperty(scope, "app", Context.javaToJS(app, scope));
                ScriptableObject.putProperty(scope, "Collab", Context.javaToJS(new Collab(scrutinizer), scope));
                ScriptableObject.putProperty(scope, "util", Context.javaToJS(new Util(scrutinizer), scope));
                ScriptableObject.putProperty(scope, "event", Context.javaToJS(new Event(scrutinizer, doc), scope));
                ScriptableObject.putProperty(scope, "media", Context.javaToJS(new Media(scrutinizer), scope));
                ScriptableObject.putProperty(scope, "XMLData", Context.javaToJS(new XMLData(scrutinizer), scope));
                ScriptableObject.putProperty(scope, "display", Context.javaToJS(new display(), scope));
                ScriptableObject.putProperty(scope, "console", Context.javaToJS(doc.console, scope));
                ScriptableObject.putProperty(scope, "info", Context.javaToJS(doc.info, scope));
                ScriptableObject.putProperty(scope, "spell", Context.javaToJS(new Spell(scrutinizer), scope));
View Full Code Here

Examples of edu.harvard.hul.ois.mets.XmlData

            dmdSec.setID("DMD_hdl_" + item.getHandle());

            MdWrap mdWrap = new MdWrap();
            mdWrap.setMDTYPE(Mdtype.MODS);

            XmlData xmlData = new XmlData();
            createMODS(item, xmlData);

            mdWrap.getContent().add(xmlData);
            dmdSec.getContent().add(mdWrap);
            mets.getContent().add(dmdSec);
View Full Code Here

Examples of edu.harvard.hul.ois.mets.XmlData

            String dmdGroup = gensym("dmd_group");
            String dmdId[] = new String[dmdTypes.length];
            for (int i = 0; i < dmdTypes.length; ++i)
            {
                dmdId[i] = gensym("dmd");
                XmlData xmlData = new XmlData();
                String xwalkName, metsName;
                String parts[] = dmdTypes[i].split(":", 2);
                if (parts.length > 1)
                {
                    metsName = parts[0];
                    xwalkName = parts[1];
                }
                else
                    xwalkName = metsName = dmdTypes[i];

                DisseminationCrosswalk xwalk = (DisseminationCrosswalk)
                  PluginManager.getNamedPlugin(DisseminationCrosswalk.class, xwalkName);
                if (xwalk == null)
                    throw new PackageValidationException("Cannot find "+dmdTypes[i]+" crosswalk plugin!");
                else
                    crosswalkToMets(xwalk, item, xmlData);

                DmdSec dmdSec = new DmdSec();
                dmdSec.setID(dmdId[i]);
                dmdSec.setGROUPID(dmdGroup);
                MdWrap mdWrap = new MdWrap();
                setMdType(mdWrap, metsName);
                mdWrap.getContent().add(xmlData);
                dmdSec.getContent().add(mdWrap);
                mets.getContent().add(dmdSec);
            }
        
            // Only add license AMD section if there are any licenses.
            // Catch authorization failures accessing license bitstreams
            // only if we are skipping unauthorized bitstreams.
            String licenseID = null;
            try
            {
            AmdSec amdSec = new AmdSec();
            addRightsMd(context, item, amdSec);
            if (amdSec.getContent().size() > 0)
            {
                licenseID = gensym("license");
                amdSec.setID(licenseID);
                mets.getContent().add(amdSec);
            }
            }
            catch (AuthorizeException e)
            {
                String unauth = (params == null) ? null : params.getProperty("unauthorized");
                if (!(unauth != null && unauth.equalsIgnoreCase("skip")))
                    throw e;
                else
                    log.warn("Skipping license metadata because of access failure: "+e.toString());
            }

            // FIXME: History data???? Nooooo!!!!

            // fileSec - all non-metadata bundles go into fileGrp,
            // and each bitstream therein into a file.
            // Create the bitstream-level techMd and div's for structmap
            // at the same time so we can connec the IDREFs to IDs.
            FileSec fileSec = new FileSec();
        
            String techMdType = getTechMdType(params);
            String parts[] = techMdType.split(":", 2);
            String xwalkName, metsName;
            if (parts.length > 1)
            {
                metsName = parts[0];
                xwalkName = parts[1];
            }
            else
                xwalkName = metsName = techMdType;

            DisseminationCrosswalk xwalk = (DisseminationCrosswalk)
              PluginManager.getNamedPlugin(DisseminationCrosswalk.class, xwalkName);
            if (xwalk == null)
                throw new PackageValidationException("Cannot find "+xwalkName+" crosswalk plugin!");

            // log the primary bitstream for structmap
            String primaryBitstreamFileID = null;

            // accumulate content DIV items to put in structMap later.
            List contentDivs = new ArrayList();

            // how to handle unauthorized bundle/bitstream:
            String unauth = (params == null) ? null : params.getProperty("unauthorized");

            Bundle[] bundles = item.getBundles();
            for (int i = 0; i < bundles.length; i++)
            {
                if (PackageUtils.isMetaInfoBundle(bundles[i]))
                    continue;

                // unauthorized bundle?
                // NOTE: This must match the logic in disseminate()
                if (!AuthorizeManager.authorizeActionBoolean(context,
                            bundles[i], Constants.READ))
                {
                    if (unauth != null &&
                        (unauth.equalsIgnoreCase("skip")))
                        continue;
                    else
                        throw new AuthorizeException("Not authorized to read Bundle named \""+bundles[i].getName()+"\"");
                }

                Bitstream[] bitstreams = bundles[i].getBitstreams();

                // Create a fileGrp
                FileGrp fileGrp = new FileGrp();
        
                // Bundle name for USE attribute
                String bName = bundles[i].getName();
                if ((bName != null) && !bName.equals(""))
                    fileGrp.setUSE(bundleToFileGrp(bName));
        
                // watch for primary bitstream
                int primaryBitstreamID = -1;
                boolean isContentBundle = false;
                if ((bName != null) && bName.equals("ORIGINAL"))
                {
                    isContentBundle = true;
                    primaryBitstreamID = bundles[i].getPrimaryBitstreamID();
                }

                for (int bits = 0; bits < bitstreams.length; bits++)
                {
                    // Check for authorization.  Handle unauthorized
                    // bitstreams to match the logic in disseminate(),
                    // i.e. "unauth=zero" means include a 0-length bitstream,
                    // "unauth=skip" means to ignore it (and exclude from
                    // manifest).
                    boolean auth = AuthorizeManager.authorizeActionBoolean(context,
                            bitstreams[bits], Constants.READ);
                    if (!auth)
                    {
                        if (unauth != null && unauth.equalsIgnoreCase("skip"))
                            continue;
                        else if (!(unauth != null && unauth.equalsIgnoreCase("zero")))
                            throw new AuthorizeException("Not authorized to read Bitstream, SID="+String.valueOf(bitstreams[bits].getSequenceID()));
                    }

                    String sid = String.valueOf(bitstreams[bits].getSequenceID());
        
                    edu.harvard.hul.ois.mets.File file = new edu.harvard.hul.ois.mets.File();
        
                    String xmlIDstart = "bitstream_";
                    String fileID = xmlIDstart + sid;

                    file.setID(fileID);

                    // log primary bitstream for later (structMap)
                    if (bitstreams[bits].getID() == primaryBitstreamID)
                        primaryBitstreamFileID = fileID;

                    // if this is content, add to structmap too:
                    if (isContentBundle)
                    {
                        Div div = new Div();
                        div.setID(gensym("div"));
                        div.setTYPE("DSpace Content Bitstream");
                        Fptr fptr = new Fptr();
                        fptr.setFILEID(fileID);
                        div.getContent().add(fptr);
                        contentDivs.add(div);
                    }

                    file.setSEQ(bitstreams[bits].getSequenceID());
        
                    String groupID = "GROUP_" + xmlIDstart + sid;
        
                    /*
                     * If we're in THUMBNAIL or TEXT bundles, the bitstream is
                     * extracted text or a thumbnail, so we use the name to work
                     * out which bitstream to be in the same group as
                     */
                    if ((bundles[i].getName() != null)
                            && (bundles[i].getName().equals("THUMBNAIL") ||
                                bundles[i].getName().startsWith("TEXT")))
                    {
                        // Try and find the original bitstream, and chuck the
                        // derived bitstream in the same group
                        Bitstream original = findOriginalBitstream(item,
                                bitstreams[bits]);
        
                        if (original != null)
                        {
                            groupID = "GROUP_" + xmlIDstart
                                    + original.getSequenceID();
                        }
                    }
        
                    file.setGROUPID(groupID);
                    file.setMIMETYPE(bitstreams[bits].getFormat().getMIMEType());
        
                    // FIXME: CREATED: no date

                    file.setSIZE(auth ? bitstreams[bits].getSize() : 0);

                    // translate checksum and type to METS, if available.
                    String csType = bitstreams[bits].getChecksumAlgorithm();
                    String cs = bitstreams[bits].getChecksum();
                    if (auth && cs != null && csType != null)
                    {
                        try
                        {
                            file.setCHECKSUMTYPE(Checksumtype.parse(csType));
                            file.setCHECKSUM(cs);
                        }
                        catch (MetsException e)
                        {
                            log.warn("Cannot set bitstream checksum type="+csType+" in METS.");
                        }
                    }
        
                    // FLocat: filename is MD5 checksum
                    FLocat flocat = new FLocat();
                    flocat.setLOCTYPE(Loctype.URL);
                    flocat.setXlinkHref(makeBitstreamName(bitstreams[bits]));

                    // Make bitstream techMD metadata, add to file.
                    String techID = "techMd_for_bitstream_"+bitstreams[bits].getSequenceID();
                    AmdSec fAmdSec = new AmdSec();
                    fAmdSec.setID(techID);
                    TechMD techMd = new TechMD();
                    techMd.setID(gensym("tech"));
                    MdWrap mdWrap = new MdWrap();
                    setMdType(mdWrap, metsName);
                    XmlData xmlData = new XmlData();
                    mdWrap.getContent().add(xmlData);
                    techMd.getContent().add(mdWrap);
                    fAmdSec.getContent().add(techMd);
                    mets.getContent().add(fAmdSec);
                    crosswalkToMets(xwalk, bitstreams[bits], xmlData);
View Full Code Here

Examples of edu.harvard.hul.ois.mets.XmlData

                    //For a normal DisseminationCrosswalk, we will be expecting an XML (DOM) based result.
                    // So, we are going to wrap this XML result in an <mdWrap> element
                    MdWrap mdWrap = new MdWrap();
                    setMdType(mdWrap, metsName);
                    XmlData xmlData = new XmlData();
                    if (crosswalkToMetsElement(xwalk, dso, xmlData) != null)
                    {
                        mdWrap.getContent().add(xmlData);
                        mdSec.getContent().add(mdWrap);
                        return mdSec;
View Full Code Here

Examples of edu.indiana.dlib.metsnav.mets.v1_4.XmlData

        desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Object.class, "_anyObject", (java.lang.String) null, org.exolab.castor.xml.NodeType.Element);
        handler = new org.exolab.castor.xml.XMLFieldHandler() {
            public java.lang.Object getValue( java.lang.Object object )
                throws IllegalStateException
            {
                XmlData target = (XmlData) object;
                return target.getAnyObject();
            }
            public void setValue( java.lang.Object object, java.lang.Object value)
                throws IllegalStateException, IllegalArgumentException
            {
                try {
                    XmlData target = (XmlData) object;
                    target.addAnyObjectvalue );
                } catch (java.lang.Exception ex) {
                    throw new IllegalStateException(ex.toString());
                }
            }
            public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
                try {
                    XmlData target = (XmlData) object;
                    target.removeAllAnyObject();
                } catch (java.lang.Exception ex) {
                    throw new IllegalStateException(ex.toString());
                }
            }
            public java.lang.Object newInstance(java.lang.Object parent) {
View Full Code Here

Examples of edu.indiana.dlib.metsnav.mets.v1_5.XmlData

        desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Object.class, "_anyObject", (java.lang.String) null, org.exolab.castor.xml.NodeType.Element);
        handler = new org.exolab.castor.xml.XMLFieldHandler() {
            public java.lang.Object getValue( java.lang.Object object )
                throws IllegalStateException
            {
                XmlData target = (XmlData) object;
                return target.getAnyObject();
            }
            public void setValue( java.lang.Object object, java.lang.Object value)
                throws IllegalStateException, IllegalArgumentException
            {
                try {
                    XmlData target = (XmlData) object;
                    target.addAnyObjectvalue );
                } catch (java.lang.Exception ex) {
                    throw new IllegalStateException(ex.toString());
                }
            }
            public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
                try {
                    XmlData target = (XmlData) object;
                    target.removeAllAnyObject();
                } catch (java.lang.Exception ex) {
                    throw new IllegalStateException(ex.toString());
                }
            }
            public java.lang.Object newInstance(java.lang.Object parent) {
View Full Code Here

Examples of edu.indiana.dlib.metsnav.mets.v1_6.XmlData

        desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Object.class, "_anyObject", (java.lang.String) null, org.exolab.castor.xml.NodeType.Element);
        handler = new org.exolab.castor.xml.XMLFieldHandler() {
            public java.lang.Object getValue( java.lang.Object object )
                throws IllegalStateException
            {
                XmlData target = (XmlData) object;
                return target.getAnyObject();
            }
            public void setValue( java.lang.Object object, java.lang.Object value)
                throws IllegalStateException, IllegalArgumentException
            {
                try {
                    XmlData target = (XmlData) object;
                    target.addAnyObjectvalue );
                } catch (java.lang.Exception ex) {
                    throw new IllegalStateException(ex.toString());
                }
            }
            public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
                try {
                    XmlData target = (XmlData) object;
                    target.removeAllAnyObject();
                } catch (java.lang.Exception ex) {
                    throw new IllegalStateException(ex.toString());
                }
            }
            public java.lang.Object newInstance(java.lang.Object parent) {
View Full Code Here

Examples of framework.utils.XMLData

*/
public class Parser {

    public static String xmlCheckupToUserView(String xml, String metadata) throws JDOMException {
        String target = "\n";
        XMLData data = new XMLData(xml, metadata);

        //название анализа
        //Фиелды до таблицы
        ArrayList<Pair<Integer, String>> preField = data.getPreFieldList();

        for(int i = 0; i < preField.size(); i++) {
            String fieldName = preField.get(i).second + ": ";
            String fieldValue = data.getField(preField.get(i).first);
            if (fieldValue == null || fieldValue.trim().isEmpty()) {
                continue;
            }
            target += fieldName + fieldValue + "\n";
        }

        ArrayList<String> probeList = data.getProbeList();
        if (!probeList.isEmpty()) {
            //добавляем заголовок таблицы
            ArrayList<String> valueList = data.getProbeValueList();

            //добавляем строки таблицы
            for (int i = 0; i < probeList.size(); i++) {
                if (!probeList.get(i).startsWith("separator")) {
                    String str = data.getProbeTitle(probeList.get(i)) + " ";
                    for (int j = 0; j < valueList.size(); j++) {
                        Object value = data.getProbeValue(probeList.get(i), valueList.get(j));
                        String metric = data.getProbeValueMetric(probeList.get(i), valueList.get(j));
                        String valueMetric = ( value == null ? "" : value.toString() + " " + (metric == null ? "" : metric));
                        if (value != null && !value.toString().trim().isEmpty()) {
                            str += valueMetric + ", ";
                        }
                    }
                    String strProbeNumber = "";
                    String probeNumber = data.getProbeNumber(probeList.get(i));
                    if (probeNumber != null) {
                        if (probeNumber.isEmpty()) {
                            strProbeNumber = " (Номер пробы не указан)";
                        } else {
                            strProbeNumber = " (Номер пробы " + probeNumber + ")";
                        }
                    }
                    if (!str.trim().isEmpty()) {
                        target += str + strProbeNumber + "\n";
                    }

                }
            }
        }
        //Фиелды после таблицы
        ArrayList<Pair<Integer, String>> postField = data.getPostFieldList();
        for(int i = 0; i < postField.size(); i++) {
            String fieldName = postField.get(i).second + ": ";
            String fieldValue = data.getField(postField.get(i).first);
            if (fieldValue == null || fieldValue.trim().isEmpty()) {
                continue;
            }
            target += fieldName + fieldValue + "\n";
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.