Package org.dspace.curate

Examples of org.dspace.curate.Curator


                }

                // Check for virus
                if (ConfigurationManager.getBooleanProperty("submission-curation", "virus-scan"))
                {
                    Curator curator = new Curator();
                    curator.addTask("vscan").curate(item);
                    int status = curator.getStatus("vscan");
                    if (status == Curator.CURATE_ERROR)
                    {
                        backoutBitstream(subInfo, b, item);
                        return STATUS_VIRUS_CHECKER_UNAVAILABLE;
                    }
View Full Code Here


                }

                // Check for virus
                if (ConfigurationManager.getBooleanProperty("submission-curation", "virus-scan"))
                {
                    Curator curator = new Curator();
                    curator.addTask("vscan").curate(item);
                    int status = curator.getStatus("vscan");
                    if (status == Curator.CURATE_ERROR)
                    {
                        backoutBitstream(subInfo, b, item);
                        return STATUS_VIRUS_CHECKER_UNAVAILABLE;
                    }
View Full Code Here

     */
        public static FlowResult processCurateCollection(Context context, int dsoID, Request request)
                                                                throws AuthorizeException, IOException, SQLException, Exception
  {
                String task = request.getParameter("curate_task");
                Curator curator = FlowCurationUtils.getCurator(task);
              
                try
                {
                    Collection collection = Collection.find(context, dsoID);
                    if (collection != null)
                    {
                        //Call curate(context,ID) to ensure a Task Performer (Eperson) is set in Curator
                        curator.curate(context, collection.getHandle());
                      
                    }
                    return FlowCurationUtils.getRunFlowResult(task, curator, true);
                }
    catch (Exception e)
                {
                    curator.setResult(task, e.getMessage());
                    return FlowCurationUtils.getRunFlowResult(task, curator, false);
    }
               
  }
View Full Code Here

         */
        public static FlowResult processQueueCollection(Context context, int dsoID, Request request)
                                                                throws AuthorizeException, IOException, SQLException, Exception
  {
                String task = request.getParameter("curate_task");
                Curator curator = FlowCurationUtils.getCurator(task);
                String objId = String.valueOf(dsoID);
                String taskQueueName = ConfigurationManager.getProperty("curate", "ui.queuename");
                boolean status = false;
                Collection collection = Collection.find(context, dsoID);
                if (collection != null)
                {
                    objId = collection.getHandle();
                    try
                    {
                        curator.queue(context, objId, taskQueueName);
                        status = true;
                    }
                    catch (IOException ioe)
                    {
                        // no-op
View Full Code Here

     */
        public static FlowResult processCurateCommunity(Context context, int dsoID, Request request)
                                                                throws AuthorizeException, IOException, SQLException, Exception
  {
                String task = request.getParameter("curate_task");
    Curator curator = FlowCurationUtils.getCurator(task);
                try
                {
                    Community community = Community.find(context, dsoID);
                    if (community != null)
                    {
                        //Call curate(context,ID) to ensure a Task Performer (Eperson) is set in Curator
                        curator.curate(context, community.getHandle());
                    }
                    return FlowCurationUtils.getRunFlowResult(task, curator, true);
                }
                catch (Exception e)
                {
                    curator.setResult(task, e.getMessage());
                    return FlowCurationUtils.getRunFlowResult(task, curator, false);
    }
  }
View Full Code Here

         */
        public static FlowResult processQueueCommunity(Context context, int dsoID, Request request)
                                                                throws AuthorizeException, IOException, SQLException, Exception
  {
                String task = request.getParameter("curate_task");
                Curator curator = FlowCurationUtils.getCurator(task);
                String objId = String.valueOf(dsoID);
                String taskQueueName = ConfigurationManager.getProperty("curate", "ui.queuename");
                boolean status = false;
                Community community = Community.find(context, dsoID);
                if (community != null)
                {
                    objId = community.getHandle();
                    try
                    {
                        curator.queue(context, objId, taskQueueName);
                        status = true;
                    }
                    catch (IOException ioe)
                    {
                        // no-op
View Full Code Here

    {
        if (taskName != null && taskName.length() == 0)
        {
            taskName = null;
        }
        Curator curator = new Curator();
        curator.addTask(taskName);
        curator.setInvoked(Curator.Invoked.INTERACTIVE);
        return curator;
    }
View Full Code Here

    public static FlowResult processCurateObject(Context context, Request request)
    {
        //get input values from Form (see org.dspace.app.xmlui.aspect.administrative.CurateForm)
        String task = request.getParameter("curate_task");
        String objHandle = request.getParameter("identifier");
        Curator curator = FlowCurationUtils.getCurator(task);

        FlowResult result = null;
        try
        {
            // Curate this object & return result
            curator.curate(context, objHandle);
            result = FlowCurationUtils.getRunFlowResult(task, curator, true);
        }
        catch (Exception e)
        {
            curator.setResult(task, e.getMessage());
            result = FlowCurationUtils.getRunFlowResult(task, curator, false);
        }
        //pass curation task name & identifier back in FlowResult (so it can be pre-populated on UI)
        result.setParameter("curate_task", task);
        result.setParameter("identifier", objHandle);
View Full Code Here

    {
        //get input values from Form (see org.dspace.app.xmlui.aspect.administrative.CurateForm)
        String task = request.getParameter("curate_task");
        String objHandle = request.getParameter("identifier");
       
        Curator curator = FlowCurationUtils.getCurator(task);
       
        String taskQueueName = ConfigurationManager.getProperty("curate", "ui.queuename");
        boolean status = false;
      
        if (objHandle != null)
        {
            try
            {
                //queue the task for later processing of this object
                curator.queue(context, objHandle, taskQueueName);
                status = true;
            }
            catch (IOException ioe)
            {
                // no-op (any error should be logged by the Curator itself)
View Full Code Here

         */
        public static FlowResult processCurateItem(Context context, int itemID, Request request)
                                                                throws AuthorizeException, IOException, SQLException, Exception
  {
                String task = request.getParameter("curate_task");
    Curator curator = FlowCurationUtils.getCurator(task);
                try
                {
                    Item item = Item.find(context, itemID);
                    if (item != null)
                    {
                        //Call curate(context,ID) to ensure a Task Performer (Eperson) is set in Curator
                        curator.curate(context, item.getHandle());
                    }
                    return FlowCurationUtils.getRunFlowResult(task, curator, true);
                }
                catch (Exception e)
                {
                    curator.setResult(task, e.getMessage());
                    return FlowCurationUtils.getRunFlowResult(task, curator, false);
    }
  }
View Full Code Here

TOP

Related Classes of org.dspace.curate.Curator

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.