Package org.dspace.content.crosswalk

Examples of org.dspace.content.crosswalk.DisseminationCrosswalk


        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(" ").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


     * @return The crosswalk or throw an exception if not found.
     */
    public final 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);
        }
View Full Code Here

            boolean xwalkFound = PluginManager.hasNamedPlugin(DisseminationCrosswalk.class, xwalkName);

            if(xwalkFound)
            {
                // Find the crosswalk we will be using to generate the metadata for this mdSec
                DisseminationCrosswalk xwalk = (DisseminationCrosswalk)
                    PluginManager.getNamedPlugin(DisseminationCrosswalk.class, xwalkName);

                if (xwalk.canDisseminate(dso))
                {
                    // Check if our Crosswalk actually wraps another Packager Plugin
                    if(xwalk instanceof AbstractPackagerWrappingCrosswalk)
                    {
                        // If this crosswalk wraps another Packager Plugin, we can pass it our Packaging Parameters
View Full Code Here

                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(" ").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

          // 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

TOP

Related Classes of org.dspace.content.crosswalk.DisseminationCrosswalk

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.