Package org.purl.sword.atom

Examples of org.purl.sword.atom.Content


      if (bf != null)
      {
        format = bf.getMIMEType();
      }

      Content con = new Content();
      con.setType(format);
      con.setSource(bsurl);
      entry.setContent(con);

      log.debug("Adding content element with url=" + bsurl);
    }
    catch (InvalidMediaTypeException e)
View Full Code Here


          // if we keep the original, then expose this as the content element
          // otherwise, expose the unpacked version
          if (keepOriginal)
          {
            Content con = new Content();
            Bundle[] bundles = item.getBundles(swordBundle);
            if (bundles.length > 0)
            {
              Bitstream[] bss = bundles[0].getBitstreams();
              for (int i = 0; i < bss.length; i++)
              {
                BitstreamFormat bf = bss[i].getFormat();
                String format = "application/octet-stream";
                if (bf != null)
                {
                  format = bf.getMIMEType();
                }
                con.setType(format);

                // calculate the bitstream link.
                String bsLink = urlManager.getBitstreamUrl(bss[i]);
                con.setSource(bsLink);

                entry.setContent(con);
              }
            }
          }
          else
          {
            // return a link to the DSpace entry page
            Content content = new Content();
            content.setType("text/html");
            content.setSource(HandleManager.getCanonicalForm(handle));
            entry.setContent(content);
          }
        }
      }
    }
View Full Code Here

    generator.setContent("Stuart's Dummy SWORD Server");
    generator.setUri("http://dummy-sword-server.example.com/");
    generator.setVersion("1.3");
    se.setGenerator(generator);
   
    Content content = new Content();
    try {
      content.setType("application/zip");
    } catch (InvalidMediaTypeException ex) {
      ex.printStackTrace();
    }
    content.setSource("http://www.myrepository.ac.uk/sdl/uploads/upload-" + counter + ".zip");
    se.setContent(content);
   
    se.setTreatment("Short back and sides");
   
    if (deposit.isVerbose()) {
View Full Code Here

    generator.setContent("Stuart's Dummy SWORD Server");
    generator.setUri("http://dummy-sword-server.example.com/");
    generator.setVersion("1.3");
    se.setGenerator(generator);
   
    Content content = new Content();
    try {
      content.setType("application/zip");
    } catch (InvalidMediaTypeException ex) {
      ex.printStackTrace();
    }
    content.setSource("http://www.myrepository.ac.uk/sdl/uploads/upload-" + counter + ".zip");
    se.setContent(content);
   
    se.setTreatment("Short back and sides");
   
    if (deposit.isVerbose()) {
View Full Code Here

         // process summary
         String summaryString = getTextConstructDetails(entry.getSummary());
         addTableRow(buffer, "Summary", summaryString);

         // process content
         Content content = entry.getContent();
         String contentString = "";
         if( content == null )
         {
            contentString = "Not defined.";
         }
         else
         {
            contentString += "Source: '" + content.getSource() + "', Type: '" +
            content.getType() + "'";
         }
         addTableRow(buffer, "Content", contentString);

         // process links
         Iterator<Link> links = entry.getLinks();
View Full Code Here

          // if we keep the original, then expose this as the content element
          // otherwise, expose the unpacked version
          if (keepOriginal)
          {
            Content con = new Content();
            Bundle[] bundles = item.getBundles(swordBundle);
            if (bundles.length > 0)
            {
              Bitstream[] bss = bundles[0].getBitstreams();
              for (int i = 0; i < bss.length; i++)
              {
                BitstreamFormat bf = bss[i].getFormat();
                String format = "application/octet-stream";
                if (bf != null)
                {
                  format = bf.getMIMEType();
                }
                con.setType(format);

                // calculate the bitstream link.
                String bsLink = urlManager.getBitstreamUrl(bss[i]);
                con.setSource(bsLink);

                entry.setContent(con);
              }
            }
          }
          else
          {
            // return a link to the DSpace entry page
            Content content = new Content();
            content.setType("text/html");
            content.setSource(HandleManager.getCanonicalForm(handle));
            entry.setContent(content);
          }
        }
      }
    }
View Full Code Here

      if (bf != null)
      {
        format = bf.getMIMEType();
      }

      Content con = new Content();
      con.setType(format);
      con.setSource(bsurl);
      entry.setContent(con);

      log.debug("Adding content element with url=" + bsurl);
    }
    catch (InvalidMediaTypeException e)
View Full Code Here

                System.out.println("There is no generator");
            }

            System.out.println( "Published: " + entry.getPublished());
     
      Content content = entry.getContent();
      if( content != null )
      {
         System.out.println(content.toString());
      }
      else
      {
         System.out.println("There is no content element.");
      }
View Full Code Here

TOP

Related Classes of org.purl.sword.atom.Content

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.