Examples of DisseminationCrosswalk


Examples of org.dspace.content.crosswalk.DisseminationCrosswalk

                    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
View Full Code Here

Examples of org.dspace.content.crosswalk.DisseminationCrosswalk

            // the crosswalk API. So we can skip this one.
            if ("DIM".equals(dmdType)) {
                continue;
            }

            DisseminationCrosswalk crosswalk = getDisseminationCrosswalk(dmdType);

            if (crosswalk == null) {
                continue;
            }

            String dmdID = getGenericID("dmd_");
            // Add our id to the list.
            dmdSecIDS.append(" " + dmdID);

            ////////////////////////////////
            // Start a metadata wrapper
            attributes = new AttributeMap();
            attributes.put("ID", dmdID);
            attributes.put("GROUPID", groupID);
            startElement(METS, "dmdSec", attributes);

            ////////////////////////////////
            // Start a metadata wrapper
            attributes = new AttributeMap();
            if (isDefinedMETStype(dmdType)) {
                attributes.put("MDTYPE", dmdType);
            } else {
                attributes.put("MDTYPE", "OTHER");
                attributes.put("OTHERMDTYPE", dmdType);
            }
            startElement(METS, "mdWrap", attributes);

            // ////////////////////////////////
            // Start the xml data
            startElement(METS, "xmlData");


            // ///////////////////////////////
            // Send the actual XML content
            try {
                Element dissemination = crosswalk.disseminateElement(item);

                SAXFilter filter = new SAXFilter(contentHandler, lexicalHandler, namespaces);
                // Allow the basics for XML
                filter.allowElements().allowIgnorableWhitespace().allowCharacters().allowCDATA().allowPrefixMappings();
View Full Code Here

Examples of org.dspace.content.crosswalk.DisseminationCrosswalk

            List<String> mdTypes = amdTypes.get(amdSecName);

            // For each crosswalk
            for (String mdType : mdTypes) {
                //get our dissemination crosswalk
                DisseminationCrosswalk crosswalk = getDisseminationCrosswalk(mdType);

                //skip, if we cannot find this crosswalk in config file
                if (crosswalk == null) {
                    continue;
                }

                //First, check if this crosswalk can handle disseminating Item-level Administrative metadata
                if (crosswalk.canDisseminate(item)) {
                    //Since this crosswalk works with items, first render a section for entire item
                    renderAmdSubSection(amdSecName, mdType, crosswalk, item);
                }

                //Next, we'll try and render Bitstream-level administrative metadata
                // (Although, we're only rendering this metadata for the bundles specified)
                List<Bundle> bundles = findEnabledBundles();
                for (Bundle bundle : bundles) {
                    Bitstream[] bitstreams = bundle.getBitstreams();

                    //Create a sub-section of <amdSec> for each bitstream in bundle
                    for (Bitstream bitstream : bitstreams) {
                        //Only render the section if crosswalk works with bitstreams
                        if (crosswalk.canDisseminate(bitstream)) {
                            renderAmdSubSection(amdSecName, mdType, crosswalk, bitstream);
                        }
                    }//end for each bitstream
                }//end for each bundle
            }//end for each crosswalk
View Full Code Here

Examples of org.dspace.content.crosswalk.DisseminationCrosswalk

                // If DIM was requested then it was generated above without using
                // the crosswalk API. So we can skip this one.
                if ("DIM".equals(dmdType))
                        continue;
               
                DisseminationCrosswalk crosswalk = getDisseminationCrosswalk(dmdType);
               
                if (crosswalk == null)
                        continue;
               
                String dmdID = getGenericID("dmd_");
                 // Add our id to the list.
                dmdSecIDS.append(" " + dmdID);
               
                ////////////////////////////////
                // Start a metadata wrapper
                attributes = new AttributeMap();
                attributes.put("ID", dmdID);
                attributes.put("GROUPID", groupID);
                startElement(METS, "dmdSec", attributes);

                 ////////////////////////////////
                // Start a metadata wrapper
                attributes = new AttributeMap();
                if (isDefinedMETStype(dmdType))
                {
                        attributes.put("MDTYPE", dmdType);
                }
                else
                {
                        attributes.put("MDTYPE","OTHER");
                        attributes.put("OTHERMDTYPE", dmdType);
                }
                startElement(METS,"mdWrap",attributes);
               
                // ////////////////////////////////
                // Start the xml data
                startElement(METS,"xmlData");

               
                // ///////////////////////////////
                // Send the actual XML content
                try {
                        Element dissemination = crosswalk.disseminateElement(item);
       
                        SAXFilter filter = new SAXFilter(contentHandler, lexicalHandler, namespaces);
                        // Allow the basics for XML
                        filter.allowElements().allowIgnorableWhitespace().allowCharacters().allowCDATA().allowPrefixMappings();
                       
View Full Code Here

Examples of org.dspace.content.crosswalk.DisseminationCrosswalk

          // For each crosswalk
          for (String mdType : mdTypes)
          {
            //get our dissemination crosswalk
            DisseminationCrosswalk crosswalk = getDisseminationCrosswalk(mdType);

            //skip, if we cannot find this crosswalk in config file
            if (crosswalk == null)
              continue;

            //First, check if this crosswalk can handle disseminating Item-level Administrative metadata
            if(crosswalk.canDisseminate(item))
            {
              //Since this crosswalk works with items, first render a section for entire item
              renderAmdSubSection(amdSecName, mdType, crosswalk, item);
            }

            //Next, we'll try and render Bitstream-level administrative metadata
            // (Although, we're only rendering this metadata for the bundles specified)
            List<Bundle> bundles = findEnabledBundles();
            for (Bundle bundle : bundles)
            {
              Bitstream[] bitstreams = bundle.getBitstreams();

              //Create a sub-section of <amdSec> for each bitstream in bundle
              for(Bitstream bitstream : bitstreams)
              {
                 //Only render the section if crosswalk works with bitstreams
                 if(crosswalk.canDisseminate(bitstream))
                 {
                    renderAmdSubSection(amdSecName, mdType, crosswalk, bitstream);
                 }
              }//end for each bitstream
            }//end for each bundle
View Full Code Here

Examples of org.dspace.content.crosswalk.DisseminationCrosswalk

     * Since this gets called by the constructor, we can't initialize the
     * xwalk field so the plugin gets thrown away.
     */
    private static String makeSchemaLocation(String schemaLabel)
    {
        DisseminationCrosswalk xwalk = (DisseminationCrosswalk)
                    PluginManager.getNamedPlugin(DisseminationCrosswalk.class,
                                                 schemaLabel);
        if (xwalk != null)
        {
            String schemaLoc = xwalk.getSchemaLocation();

            // initialize the oaicat Crosswalk with a "schemalocation" string,
            // which is "{namespace-URI} {schema-URL}"  (space separated)
            if (schemaLoc != null)
            {
View Full Code Here

Examples of org.dspace.content.crosswalk.DisseminationCrosswalk

              throw new ResourceNotFoundException("Unable to locate object.");
           
           
            // Instantiate and execute the ORE plugin
            SAXOutputter out = new SAXOutputter(contentHandler);
            DisseminationCrosswalk xwalk = (DisseminationCrosswalk)PluginManager.getNamedPlugin(DisseminationCrosswalk.class,"ore");
           
            Element ore = xwalk.disseminateElement(item);
            out.output(ore);
           
      /* Generate the METS document
      contentHandler.startDocument();
      adapter.renderMETS(contentHandler,lexicalHandler);
View Full Code Here

Examples of org.dspace.content.crosswalk.DisseminationCrosswalk

        // If DIM was requested then it was generated above without using
        // the crosswalk API. So we can skip this one.
        if ("DIM".equals(dmdType))
          continue;
       
        DisseminationCrosswalk crosswalk = getDisseminationCrosswalk(dmdType);
       
        if (crosswalk == null)
          continue;
       
          String dmdID = getGenericID("dmd_");
         // Add our id to the list.
         dmdSecIDS.append(" " + dmdID);

            // ////////////////////////////////
            // Start a new dmdSec for each crosswalk.
            attributes = new AttributeMap();
            attributes.put("ID", dmdID);
            attributes.put("GROUPID", groupID);
            startElement(METS,"dmdSec",attributes);
           
            // ////////////////////////////////
            // Start metadata wrapper
            attributes = new AttributeMap();
            if (isDefinedMETStype(dmdType))
            {
              attributes.put("MDTYPE", dmdType);
            }
            else
            {
              attributes.put("MDTYPE", "OTHER");
              attributes.put("OTHERMDTYPE", dmdType);
            }
            startElement(METS,"mdWrap",attributes);

            // ////////////////////////////////
            // Start the xml data
            startElement(METS,"xmlData");
           
            // ///////////////////////////////
        // Send the actual XML content
            try {
          Element dissemination = crosswalk.disseminateElement(dso);
 
          SAXFilter filter = new SAXFilter(contentHandler, lexicalHandler, namespaces);
          // Allow the basics for XML
          filter.allowElements().allowIgnorableWhitespace().allowCharacters().allowCDATA().allowPrefixMappings();
         
View Full Code Here

Examples of org.dspace.content.crosswalk.DisseminationCrosswalk

     * @return The crosswalk or throw an exception if not found.
     */
    public DisseminationCrosswalk getDisseminationCrosswalk(String crosswalkName) throws WingException
    {
      // Fixme add some caching here
      DisseminationCrosswalk crosswalk = (DisseminationCrosswalk) PluginManager.getNamedPlugin(DisseminationCrosswalk.class, crosswalkName);

      if (crosswalk == null)
          throw new WingException("Unable to find named DisseminationCrosswalk: " + crosswalkName);
     
      return crosswalk;
View Full Code Here

Examples of org.dspace.content.crosswalk.DisseminationCrosswalk

            }
           
           
            // Instantiate and execute the ORE plugin
            SAXOutputter out = new SAXOutputter(contentHandler);
            DisseminationCrosswalk xwalk = (DisseminationCrosswalk)PluginManager.getNamedPlugin(DisseminationCrosswalk.class,"ore");
           
            Element ore = xwalk.disseminateElement(item);
            out.output(ore);
           
      /* Generate the METS document
      contentHandler.startDocument();
      adapter.renderMETS(contentHandler,lexicalHandler);
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.