Package edu.harvard.hul.ois.mets

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


    // use external file and mdRef if possible, wrap and binData if not.
    private void addRightsStream(InputStream is , String resourceName,
                                 String mimeType, String mdType, AmdSec amdSec)
        throws IOException, MetsException
    {
        RightsMD rightsMD = new RightsMD();
        rightsMD.setID(gensym("rights"));
        if (extraFiles == null)
        {
            MdWrap rightsMDWrap = new MdWrap();
            rightsMDWrap.setMIMETYPE(mimeType);
            rightsMDWrap.setMDTYPE(Mdtype.OTHER);
            rightsMDWrap.setOTHERMDTYPE(mdType);
            BinData bin = new BinData();
            bin.getContent().add(new Base64(is));
            rightsMDWrap.getContent().add(bin);
            rightsMD.getContent().add(rightsMDWrap);
        }
        else
        {
            extraFiles.put(resourceName, is);
            MdRef rightsMDRef = new MdRef();
            rightsMDRef.setMIMETYPE(mimeType);
            rightsMDRef.setMDTYPE(Mdtype.OTHER);
            rightsMDRef.setOTHERMDTYPE(mdType);
            rightsMDRef.setLOCTYPE(Loctype.URL);
            rightsMDRef.setXlinkHref(resourceName);
            rightsMD.getContent().add(rightsMDRef);
        }
        amdSec.getContent().add(rightsMD);
    }
View Full Code Here


            // License as <rightsMD><mdWrap><binData>base64encoded</binData>...
            InputStream licenseStream = findLicense(context, item);

            if (licenseStream != null)
            {
                RightsMD rightsMD = new RightsMD();
                MdWrap rightsMDWrap = new MdWrap();
                rightsMDWrap.setMIMETYPE("text/plain");
                rightsMDWrap.setMDTYPE(Mdtype.OTHER);
                rightsMDWrap.setOTHERMDTYPE("TEXT");

                BinData binData = new BinData();
                Base64 base64 = new Base64(licenseStream);

                binData.getContent().add(base64);
                rightsMDWrap.getContent().add(binData);
                rightsMD.getContent().add(rightsMDWrap);
                amdSec.getContent().add(rightsMD);
            }

            // FIXME: History data???? Nooooo!!!!
            mets.getContent().add(amdSec);
View Full Code Here

TOP

Related Classes of edu.harvard.hul.ois.mets.RightsMD

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.