Package org.dspace.content

Examples of org.dspace.content.Collection


 
 
  public void addBody(Body body) throws WingException, SQLException, AuthorizeException
  {
    int collectionID = parameters.getParameterAsInteger("collectionID", -1);
    Collection thisCollection = Collection.find(context, collectionID);
    Request request = ObjectModelHelper.getRequest(objectModel);
   
    HarvestedCollection hc = HarvestedCollection.find(context, collectionID);
    String baseURL = contextPath + "/admin/collection?administrative-continue=" + knot.getId();
   
    String errorString = parameters.getParameter("errors",null);
    String[] errors = errorString.split(",");
    HashMap<String,String> errorMap = new HashMap<String,String>();
    for (String error : errors) {
      //System.out.println(errorString);
      String[] errorPieces = error.split(":",2);
     
      if (errorPieces.length > 1)
        errorMap.put(errorPieces[0], errorPieces[1]);
      else
        errorMap.put(errorPieces[0], errorPieces[0]);
    }
   
   
    String oaiProviderValue;
    String oaiSetIdValue;
    String metadataFormatValue;
    int harvestLevelValue;
       
    if (hc != null && request.getParameter("submit_test") == null) {
      oaiProviderValue = hc.getOaiSource();
      oaiSetIdValue = hc.getOaiSetId();
      metadataFormatValue = hc.getHarvestMetadataConfig();
      harvestLevelValue = hc.getHarvestType();     
    }
    else {
      oaiProviderValue = parameters.getParameter("oaiProviderValue", "");
      oaiSetIdValue = parameters.getParameter("oaiSetAll", "");
            if(!"all".equals(oaiSetIdValue))
          oaiSetIdValue = parameters.getParameter("oaiSetIdValue", null);
      metadataFormatValue = parameters.getParameter("metadataFormatValue", "");
      String harvestLevelString = parameters.getParameter("harvestLevelValue","0");
      if (harvestLevelString.length() == 0)
        harvestLevelValue = 0;
      else
        harvestLevelValue = Integer.parseInt(harvestLevelString);
    }
   
    // DIVISION: main
      Division main = body.addInteractiveDivision("collection-harvesting-setup",contextPath+"/admin/collection",Division.METHOD_MULTIPART,"primary administrative collection");
      main.setHead(T_main_head.parameterize(thisCollection.getMetadata("name")));  
     
      List options = main.addList("options",List.TYPE_SIMPLE,"horizontal");
      options.addItem().addXref(baseURL+"&submit_metadata",T_options_metadata);
      options.addItem().addXref(baseURL+"&submit_roles",T_options_roles);
      options.addItem().addHighlight("bold").addXref(baseURL+"&submit_harvesting",T_options_harvest);
View Full Code Here


        // DIVISION: edit-container-policies
        Division main = body.addInteractiveDivision("edit-container-policies",contextPath+"/admin/authorize",Division.METHOD_POST,"primary administrative authorization");
   
    if (containerType == Constants.COLLECTION)
      {
      Collection col = Collection.find(context, containerID);
      main.setHead(T_main_head_collection.parameterize(col.getMetadata("name"),col.getHandle(),col.getID()));
      policies = (ArrayList<ResourcePolicy>)AuthorizeManager.getPolicies(context, col);
      }
    else
    {
      Community com = Community.find(context, containerID);
View Full Code Here

            return;
        }
       
        // Get a list of all files in the original bundle
    Item item = submission.getItem();
    Collection collection = submission.getCollection();
    String actionURL = contextPath + "/handle/"+collection.getHandle() + "/submit/" + knot.getId() + ".continue";
    boolean workflow = submission instanceof WorkflowItem;
    Bundle[] bundles = item.getBundles("ORIGINAL");
    Bitstream[] bitstreams = new Bitstream[0];
    if (bundles.length > 0)
    {
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);
   
    String baseURL = contextPath + "/admin/collection?administrative-continue=" + knot.getId();
   
    Group admins = thisCollection.getAdministrators();
    Group wfStep1 = thisCollection.getWorkflowGroup(1);
    Group wfStep2 = thisCollection.getWorkflowGroup(2);
    Group wfStep3 = thisCollection.getWorkflowGroup(3);
    Group submitters = thisCollection.getSubmitters();

    Group defaultRead = null;
    int defaultReadID = FlowContainerUtils.getCollectionDefaultRead(context, collectionID);
    if (defaultReadID >= 0)
      defaultRead = Group.find(context, defaultReadID);
   
    // DIVISION: main
      Division main = body.addInteractiveDivision("collection-assign-roles",contextPath+"/admin/collection",Division.METHOD_POST,"primary administrative collection");
      main.setHead(T_main_head.parameterize(thisCollection.getMetadata("name")));
     
      List options = main.addList("options", List.TYPE_SIMPLE, "horizontal");
      options.addItem().addXref(baseURL+"&submit_metadata",T_options_metadata);
      options.addItem().addHighlight("bold").addXref(baseURL+"&submit_roles",T_options_roles);
      options.addItem().addXref(baseURL+"&submit_harvesting",T_options_harvest);
View Full Code Here

                                    + " workflow_step_3 = ? OR "
                                    + " submitter =  ? OR " + " admin = ?",
                            getID(), getID(), getID(), getID(), getID());
            if (qResult != null)
            {
                Collection collection = Collection.find(myContext, qResult
                        .getIntColumn("collection_id"));
               
                if ((qResult.getIntColumn("workflow_step_1") == getID() ||
                        qResult.getIntColumn("workflow_step_2") == getID() ||
                        qResult.getIntColumn("workflow_step_3") == getID()))
                {
                    if (AuthorizeConfiguration.canCollectionAdminManageWorkflows())
                    {
                        return collection;
                    }
                    else if (AuthorizeConfiguration.canCommunityAdminManageCollectionWorkflows())
                    {
                        return collection.getParentObject();
                    }
                }
                if (qResult.getIntColumn("submitter") == getID())
                {
                    if (AuthorizeConfiguration.canCollectionAdminManageSubmitters())
                    {
                        return collection;
                    }
                    else if (AuthorizeConfiguration.canCommunityAdminManageCollectionSubmitters())
                    {
                        return collection.getParentObject();
                    }
                }
                if (qResult.getIntColumn("admin") == getID())
                {
                    if (AuthorizeConfiguration.canCollectionAdminManageAdminGroup())
                    {
                        return collection;
                    }
                    else if (AuthorizeConfiguration.canCommunityAdminManageCollectionAdminGroup())
                    {
                        return collection.getParentObject();
                    }
                }
            }
            // is the group releated to a community and community admin allowed
            // to manage it?
View Full Code Here

    public static WorkflowItem start(Context c, WorkspaceItem wsi)
            throws SQLException, AuthorizeException, IOException
    {
        // FIXME Check auth
        Item myitem = wsi.getItem();
        Collection collection = wsi.getCollection();

        log.info(LogManager.getHeader(c, "start_workflow", "workspace_item_id="
                + wsi.getID() + "item_id=" + myitem.getID() + "collection_id="
                + collection.getID()));

        // record the start of the workflow w/provenance message
        recordStart(c, myitem);

        // create the WorkflowItem
View Full Code Here

    // returns true if archived
    private static boolean doState(Context c, WorkflowItem wi, int newstate,
            EPerson newowner) throws SQLException, IOException,
            AuthorizeException
    {
        Collection mycollection = wi.getCollection();
        Group mygroup = null;
        boolean archived = false;

        wi.setState(newstate);

        switch (newstate)
        {
        case WFSTATE_STEP1POOL:

            // any reviewers?
            // if so, add them to the tasklist
            wi.setOwner(null);

            // get reviewers (group 1 )
            mygroup = mycollection.getWorkflowGroup(1);

            if ((mygroup != null) && !(mygroup.isEmpty()))
            {
                // get a list of all epeople in group (or any subgroups)
                EPerson[] epa = Group.allMembers(c, mygroup);
               
                // there were reviewers, change the state
                //  and add them to the list
                createTasks(c, wi, epa);
                wi.update();

                // email notification
                notifyGroupOfTask(c, wi, mygroup, epa);
            }
            else
            {
                // no reviewers, skip ahead
                archived = doState(c, wi, WFSTATE_STEP2POOL, null);
            }

            break;

        case WFSTATE_STEP1:

            // remove reviewers from tasklist
            // assign owner
            deleteTasks(c, wi);
            wi.setOwner(newowner);

            break;

        case WFSTATE_STEP2POOL:

            // clear owner
            // any approvers?
            // if so, add them to tasklist
            // if not, skip to next state
            wi.setOwner(null);

            // get approvers (group 2)
            mygroup = mycollection.getWorkflowGroup(2);

            if ((mygroup != null) && !(mygroup.isEmpty()))
            {
                //get a list of all epeople in group (or any subgroups)
                EPerson[] epa = Group.allMembers(c, mygroup);
               
                // there were approvers, change the state
                //  timestamp, and add them to the list
                createTasks(c, wi, epa);

                // email notification
                notifyGroupOfTask(c, wi, mygroup, epa);
            }
            else
            {
                // no reviewers, skip ahead
                archived = doState(c, wi, WFSTATE_STEP3POOL, null);
            }

            break;

        case WFSTATE_STEP2:

            // remove admins from tasklist
            // assign owner
            deleteTasks(c, wi);
            wi.setOwner(newowner);

            break;

        case WFSTATE_STEP3POOL:

            // any editors?
            // if so, add them to tasklist
            wi.setOwner(null);
            mygroup = mycollection.getWorkflowGroup(3);

            if ((mygroup != null) && !(mygroup.isEmpty()))
            {
                // get a list of all epeople in group (or any subgroups)
                EPerson[] epa = Group.allMembers(c, mygroup);
View Full Code Here

        Element[] elements = new Element[collections.getLength()];
       
        for (int i = 0; i < collections.getLength(); i++)
        {
            Element element = new Element("collection");
            Collection collection = parent.createCollection();
           
            // default the short description to the empty string
            collection.setMetadata("short_description", " ");
           
            // import the rest of the metadata
            Node tn = collections.item(i);
            Enumeration keys = collectionMap.keys();
            while (keys.hasMoreElements())
            {
                Node node = null;
                String key = (String) keys.nextElement();
                NodeList nl = XPathAPI.selectNodeList(tn, key);
                if (nl.getLength() == 1)
                {
                    node = nl.item(0);
                    collection.setMetadata((String) collectionMap.get(key), getStringValue(node));
                }
            }
           
            collection.update();
           
            element.setAttribute("identifier", collection.getHandle());
           
            Element nameElement = new Element("name");
            nameElement.setText(collection.getMetadata("name"));
            element.addContent(nameElement);
           
            if (collection.getMetadata("short_description") != null)
            {
                Element descriptionElement = new Element("description");
                descriptionElement.setText(collection.getMetadata("short_description"));
                element.addContent(descriptionElement);
            }
           
            if (collection.getMetadata("introductory_text") != null)
            {
                Element introElement = new Element("intro");
                introElement.setText(collection.getMetadata("introductory_text"));
                element.addContent(introElement);
            }
           
            if (collection.getMetadata("copyright_text") != null)
            {
                Element copyrightElement = new Element("copyright");
                copyrightElement.setText(collection.getMetadata("copyright_text"));
                element.addContent(copyrightElement);
            }
           
            if (collection.getMetadata("side_bar_text") != null)
            {
                Element sidebarElement = new Element("sidebar");
                sidebarElement.setText(collection.getMetadata("side_bar_text"));
                element.addContent(sidebarElement);
            }
           
            if (collection.getMetadata("license") != null)
            {
                Element sidebarElement = new Element("license");
                sidebarElement.setText(collection.getMetadata("license"));
                element.addContent(sidebarElement);
            }
           
            if (collection.getMetadata("provenance_description") != null)
            {
                Element sidebarElement = new Element("provenance");
                sidebarElement.setText(collection.getMetadata("provenance_description"));
                element.addContent(sidebarElement);
            }
           
            elements[i] = element;
        }
View Full Code Here

        // get the item and current page
        Item item = subInfo.getSubmissionItem().getItem();
        int currentPage = getCurrentPage(request);

        // lookup applicable inputs
        Collection c = subInfo.getSubmissionItem().getCollection();
        DCInput[] inputs = null;
        try
        {
            inputs = inputsReader.getInputs(c.getHandle()).getPageRows(
                    currentPage - 1,
                    subInfo.getSubmissionItem().hasMultipleTitles(),
                    subInfo.getSubmissionItem().isPublishedBefore());
        }
        catch (DCInputsReaderException e)
View Full Code Here

        {
            return STATUS_NO_COLLECTION;
        }

        // try to load the collection
        Collection col = Collection.find(context, id);

        // Show an error if the collection is invalid
        if (col == null)
        {
            return STATUS_INVALID_COLLECTION;
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.