Package org.dspace.content

Examples of org.dspace.content.Collection


     * the collection, if not, bail out.
     */
    private Collection resolveCollection(String collectionID) {
     
      DSpaceObject dso;
      Collection targetCollection = null;
     
      try {
        // is the ID a handle?
          if (collectionID.indexOf('/') != -1)
          {
View Full Code Here


   
   
    private void configureCollection(String collectionID, int type, String oaiSource, String oaiSetId, String mdConfigId) {
      System.out.println("Running: configure collection");
    
      Collection collection = resolveCollection(collectionID);
      System.out.println(collection.getID());
           
      try {
        HarvestedCollection hc = HarvestedCollection.find(context, collection.getID());
          if (hc == null) {
            hc = HarvestedCollection.create(context, collection.getID());
          }
       
        context.turnOffAuthorisationSystem();
        hc.setHarvestParams(type, oaiSource, oaiSetId, mdConfigId);
        hc.setHarvestStatus(HarvestedCollection.STATUS_READY);
View Full Code Here

     * @param collectionID
     * @param email
     */
    private void purgeCollection(String collectionID, String email) {
      System.out.println("Purging collection of all items and reseting last_harvested and harvest_message: " + collectionID);
      Collection collection = resolveCollection(collectionID);
    
      try
      {
        EPerson eperson = EPerson.findByEmail(context, email);
          context.setCurrentUser(eperson);
        context.turnOffAuthorisationSystem();
       
        ItemIterator it = collection.getAllItems();
        IndexBrowse ib = new IndexBrowse(context);
        int i=0;
        while (it.hasNext()) {
          i++;
          Item item = it.next();
          System.out.println("Deleting: " + item.getHandle());
          ib.itemRemoved(item);
          collection.removeItem(item);
          // commit every 50 items
          if (i%50 == 0) {
            context.commit();
            i=0;
          }
        }
       
        HarvestedCollection hc = HarvestedCollection.find(context, collection.getID());
        if (hc != null) {
          hc.setHarvestResult(null,"");
          hc.setHarvestStatus(HarvestedCollection.STATUS_READY);
          hc.setHarvestStartTime(null);
          hc.update();
View Full Code Here

      System.out.println("Running: a harvest cycle on " + collectionID);
     
      System.out.print("Initializing the harvester... ");
      OAIHarvester harvester = null;
      try {
        Collection collection = resolveCollection(collectionID);
          HarvestedCollection hc = HarvestedCollection.find(context, collection.getID());
        harvester = new OAIHarvester(context, collection, hc);
        System.out.println("success. ");
      }
      catch (HarvestingException hex) {
        System.out.print("failed. ");
View Full Code Here

  public void addBody(Body body) throws SAXException, WingException,
  UIException, SQLException, IOException, AuthorizeException
  {
    // Get any metadata that may be removed by unselecting one of these options.
    Item item = submission.getItem();
    Collection collection = submission.getCollection();
    String actionURL = contextPath + "/handle/"+collection.getHandle() + "/submit/" + knot.getId() + ".continue";

    Request request = ObjectModelHelper.getRequest(objectModel);
    String showfull = request.getParameter("showfull");

    // if the user selected showsimple, remove showfull.
View Full Code Here

        }
      }
      if (errors.size() <= 0)
        message = T_item_export_success;
    } else if (request.getParameter("collectionID") != null) {
      Collection col = null;
      try {
        col = Collection.find(context, Integer.parseInt(request
            .getParameter("collectionID")));
      } catch (Exception e) {
        errors.add(T_export_bad_col_id);
View Full Code Here

  }
   
  public void addBody(Body body) throws SAXException, WingException,
  UIException, SQLException, IOException, AuthorizeException
 
    Collection collection = submission.getCollection();
    String actionURL = contextPath + "/handle/"+collection.getHandle() + "/submit/" + knot.getId() + ".continue";

    Division div = body.addInteractiveDivision("submit-save-or-cancel",actionURL, Division.METHOD_POST,"primary submission");
    div.setHead(T_submission_head);
    addSubmissionProgressList(div);
   
View Full Code Here

        // If this group is related to a collection, then un-link it.
        int collectionId = getCollectionId(groupDeleted.getName());
        Role role = getCollectionRole(groupDeleted.getName());
        if (collectionId != -1 && role != Role.none)
        {
          Collection collection = Collection.find(context, collectionId);
         
          if (collection != null)
          {
            if (role == Role.Administrators)
            {
              collection.removeAdministrators();
              collection.update();
            }
            else if (role == Role.Submitters)
            {
              collection.removeSubmitters();
              collection.update();
            }
            else if (role == Role.WorkflowStep1)
            {
              collection.setWorkflowGroup(1, null);
              collection.update();
            }
            else if (role == Role.WorkflowStep2)
            {
              collection.setWorkflowGroup(2, null);
              collection.update();
            }
            else if (role == Role.WorkflowStep3)
            {
              collection.setWorkflowGroup(3, null);
              collection.update();
            }
            else if (role == Role.DefaultRead)
            {
              // Nothing special needs to happen.
            }
View Full Code Here

    }
 
  public void addBody(Body body) throws WingException, SQLException, AuthorizeException
  {
    int collectionID = parameters.getParameterAsInteger("collectionID", -1);
    Collection thisCollection = Collection.find(context, collectionID);
   
    // DIVISION: main
      Division main = body.addInteractiveDivision("collection-confirm-delete",contextPath+"/admin/collection",Division.METHOD_POST,"primary administrative collection");
      main.setHead(T_main_head.parameterize(collectionID));
      main.addPara(T_main_para.parameterize(thisCollection.getMetadata("name")));     
      List deleteConfirmHelp = main.addList("consequences",List.TYPE_BULLETED);
      deleteConfirmHelp.addItem(T_confirm_item1);
      deleteConfirmHelp.addItem(T_confirm_item2);
      deleteConfirmHelp.addItem(T_confirm_item3);
     
View Full Code Here

    private static Item archive(Context c, WorkflowItem wfi)
            throws SQLException, IOException, AuthorizeException
    {
        // FIXME: Check auth
        Item item = wfi.getItem();
        Collection collection = wfi.getCollection();

        log.info(LogManager.getHeader(c, "archive_item", "workflow_item_id="
                + wfi.getID() + "item_id=" + item.getID() + "collection_id="
                + collection.getID()));

        InstallItem.installItem(c, wfi);

        // Log the event
        log.info(LogManager.getHeader(c, "install_item", "workflow_id="
View Full Code Here

TOP

Related Classes of org.dspace.content.Collection

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.