Package edu.harvard.hul.ois.mets

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


            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


        // copy extra (metadata, license, etc) bitstreams into zip, update manifest
        if (extraStreams != null)
        {
            for (Map.Entry<MdRef, InputStream> ment : extraStreams.getMap().entrySet())
            {
                MdRef ref = ment.getKey();

                // Both Deposit Licenses & CC Licenses which are referenced as "extra streams" may already be
                // included in our Package (if their bundles are already included in the <filSec> section of manifest).
                // So, do a special check to see if we need to link up extra License <mdRef> entries to the bitstream in the <fileSec>.
                // (this ensures that we don't accidentally add the same License file to our package twice)
                linkLicenseRefsToBitstreams(context, params, dso, ref);

                //If this 'mdRef' is NOT already linked up to a file in the package,
                // then its file must be missing.  So, we are going to add a new
                // file to the Zip package.
                if(ref.getXlinkHref()==null || ref.getXlinkHref().isEmpty())
                {
                    InputStream is = ment.getValue();

                    // create a hopefully unique filename within the Zip
                    String fname = gensym("metadata");
                    // link up this 'mdRef' to point to that file
                    ref.setXlinkHref(fname);
                    if (log.isDebugEnabled())
                    {
                        log.debug("Writing EXTRA stream to Zip: " + fname);
                    }
                    //actually add the file to the Zip package
View Full Code Here

                        //If we are capturing extra files to put into a Zip package
                        if(extraStreams!=null)
                        {
                            //Create an <mdRef> -- we'll just reference the file by name in Zip package
                            MdRef mdRef = new MdRef();
                            //add the crosswalked Stream to list of files to add to Zip package later
                            extraStreams.addStream(mdRef, crosswalkedStream);

                            //set properties on <mdRef>
                            // Note, filename will get set on this <mdRef> later,
                            // when we process all the 'extraStreams'
                            mdRef.setMIMETYPE(sxwalk.getMIMEType());
                            setMdType(mdRef, metsName);
                            mdRef.setLOCTYPE(Loctype.URL);
                            mdSec.getContent().add(mdRef);
                        }
                        else
                        {
                            //If we are *not* capturing extra streams to add to Zip package later,
View Full Code Here

TOP

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

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.