private List<Object> findOwningCommunities(Context context, int collId) throws SQLException { Collection coll = Collection.find(context, collId); List<Object> owningComms = new ArrayList<Object>(); for (int i = 0; i < coll.getCommunities().length; i++) { Community community = coll.getCommunities()[i]; findComms(community, owningComms); } return owningComms; }
Collection c = Collection.find(context, collID);
OAIHarvester harvester; List<String> testErrors = new ArrayList<String>(); Collection collection = Collection.find(context, collectionID); HarvestedCollection hc = HarvestedCollection.find(context, collectionID);
/** * queues curation tasks */ 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 } } return FlowCurationUtils.getQueueFlowResult(task, status, objId, taskQueueName); }
/** * Delete a collection's template item (which is not a member of the collection). * * @param context * @param collectionID * @return * @throws SQLException * @throws AuthorizeException * @throws IOException */ public static FlowResult processDeleteTemplateItem(Context context, int collectionID) throws SQLException, AuthorizeException, IOException { FlowResult result = new FlowResult(); Collection collection = Collection.find(context, collectionID); collection.removeTemplateItem(); context.commit(); result.setContinue(true); result.setOutcome(true); return result; }
Collection collection = Collection.find(context, collectionID);
Collection collection = Collection.find(context, dsoID); if (collection != null)
Collection collection = Collection.find(context,collectionID);
/** * Look up the id of the template item for a given collection. * * @param context The current DSpace context. * @param collectionID The collection id. * @return The id of the template item. * @throws IOException */ public static int getTemplateItemID(Context context, int collectionID) throws SQLException, AuthorizeException, IOException { Collection collection = Collection.find(context, collectionID); Item template = collection.getTemplateItem(); if (template == null) { collection.createTemplateItem(); template = collection.getTemplateItem(); collection.update(); template.update(); context.commit(); } return template.getID(); }
/** * Delete collection itself * * @param context The current DSpace context. * @param collectionID The collection id. * @return A process result's object. */ public static FlowResult processDeleteCollection(Context context, int collectionID) throws SQLException, AuthorizeException, IOException { FlowResult result = new FlowResult(); Collection collection = Collection.find(context, collectionID); Community[] parents = collection.getCommunities(); for (Community parent: parents) { parent.removeCollection(collection); parent.update(); } context.commit(); result.setContinue(true); result.setOutcome(true); result.setMessage(new Message("default","The collection was successfully deleted.")); return result; }
result.setContinue(false); Collection toCollection = Collection.find(context,collectionID);
Collection collection = Collection.find(context,collectionID); Group role = Group.find(context, groupID);
Collection collection = Collection.find(context, collectionID); HarvestedCollection hc = HarvestedCollection.find(context, collectionID);
result.setContinue(false); Collection toCollection = Collection.find(context,collectionID);
Collection collection = Collection.find(context,collectionID); Group role = Group.create(context); role.setName("COLLECTION_"+collection.getID() +"_DEFAULT_READ");
Collection collection = Collection.find(context,collectionID); Group role = Group.find(context, roleID); Group anonymous = Group.find(context,0);
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); Para buttonList = main.addPara(); buttonList.addButton("submit_confirm").setValue(T_submit_confirm); buttonList.addButton("submit_cancel").setValue(T_submit_cancel); main.addHidden("administrative-continue").setValue(knot.getId()); } }
if (collectionId != -1 && role != Role.none) Collection collection = Collection.find(context, collectionId);
public void addBody(Body body) throws WingException, SQLException, AuthorizeException Collection thisCollection = Collection.find(context, collectionID);
Collection collection = Collection.find(context,collectionID);