private static void reportCollections(List<Collection> collections) { System.out.println("===================================="); System.out.println("This user is permitted to submit to the following collections."); for (Collection collection : collections) { System.out.println(" - " + collection.getHandle() + " -- " + collection.getName()); } System.out.println("Total: " + collections.size()); } }
/** * Obtain the deposit URL for the given collection. These URLs * should not be considered persistent, but will remain consistent * unless configuration changes are made to DSpace * * @param collection collection to query * @return The Deposit URL * @throws DSpaceSWORDException can be thrown by the internals of the DSpace SWORD implementation */ public String getLocation(Collection collection) throws DSpaceSWORDException { return this.getBaseUrl() + "/" + collection.getHandle(); }
/** * Obtain the deposit URL for the given collection. These URLs * should not be considered persistent, but will remain consistent * unless configuration changes are made to DSpace * * @param collection the collection to query * @return The Deposit URL * @throws DSpaceSWORDException can be thrown by the internals of the DSpace SWORD implementation */ public String getDepositLocation(Collection collection) throws DSpaceSWORDException { return this.getBaseDepositUrl() + "/" + collection.getHandle(); }
/** * Obtain the deposit URL for the given collection. These URLs * should not be considered persistent, but will remain consistent * unless configuration changes are made to DSpace * * @param collection target collection * @return The Deposit URL * @throws DSpaceSwordException can be thrown by the internals of the DSpace SWORD implementation */ public String getDepositLocation(Collection collection) throws DSpaceSwordException { return this.getBaseCollectionUrl() + "/" + collection.getHandle(); }
/** * Obtain the deposit URL for the given collection. These URLs * should not be considered persistent, but will remain consistent * unless configuration changes are made to DSpace * * @param collection * @return The Deposit URL * @throws DSpaceSWORDException */ public String getDepositLocation(Collection collection) throws DSpaceSWORDException { return this.getBaseDepositUrl() + "/" + collection.getHandle(); }
/** * Construct the service document URL for the given object, which will * be supplied in the sword:service element of other service document * entries. * * @param collection target collection * @return service document URL for the given object * @throws DSpaceSWORDException can be thrown by the internals of the DSpace SWORD implementation */ public String constructSubServiceUrl(Collection collection) throws DSpaceSWORDException { String base = this.getBaseServiceDocumentUrl(); String handle = collection.getHandle(); return base + "/" + handle; }
/** * Obtain the deposit URL for the given collection. These URLs * should not be considered persistent, but will remain consistent * unless configuration changes are made to DSpace * * @param collection * @return The Deposit URL * @throws DSpaceSWORDException */ public String getLocation(Collection collection) throws DSpaceSWORDException { return this.getBaseUrl() + "/" + collection.getHandle(); }
/** * Construct the service document URL for the given object, which will * be supplied in the sword:service element of other service document * entries. * * @param collection target collection * @return service document URL * @throws DSpaceSwordException can be thrown by the internals of the DSpace SWORD implementation */ public String constructSubServiceUrl(Collection collection) throws DSpaceSwordException { String base = this.getBaseServiceDocumentUrl(); String handle = collection.getHandle(); return base + "/" + handle; }
/** * Construct the service document url for the given object, which will * be supplied in the sword:service element of other service document entries * * @param collection * @return * @throws DSpaceSWORDException */ public String constructSubServiceUrl(Collection collection) throws DSpaceSWORDException { String base = this.getBaseServiceDocumentUrl(); String handle = collection.getHandle(); return base + "/" + handle; }
/** * Fill out the containers field of the HarvestedItemInfo object * * @param context DSpace context * @param itemInfo HarvestedItemInfo object to fill out * @throws SQLException if database error */ private static void fillCollections(Context context, HarvestedItemInfo itemInfo) throws SQLException { // Get the collection Handles from DB List<Collection> collections = itemInfo.item.getCollections(); itemInfo.collectionHandles = new ArrayList<>(); for (Collection collection : collections) { itemInfo.collectionHandles.add(collection.getHandle()); } }
@Override public String toSetSpec(Collection collection) throws InvalidSetSpecException { String handle = collection.getHandle(); String[] split = handle.split("/"); if (split.length != 2) { throw new InvalidSetSpecException("Invalid handle " + handle); } return String.format(getSetSpecFormat(Community.class), split[0], split[1]); }
protected FlowStep getFlowStep(BasicWorkflowItem wfi) { Collection coll = wfi.getCollection(); String key = tsMap.containsKey(coll.getHandle()) ? coll.getHandle() : "default"; TaskSet ts = tsMap.get(key); if (ts != null) { int myStep = state2step(wfi.getState()); for (FlowStep fstep : ts.steps) { if (fstep.step == myStep) { return fstep; } } } return null; }
public DSpaceSet(Collection c) { super("col_" + c.getHandle().replace('/', '_'), checkName(c.getName())); } }
@Override public void applyFiltersCollection(Context context, Collection collection) throws Exception { //only apply filters if collection not in skip-list if (!inSkipList(collection.getHandle())) { Iterator<Item> itemIterator = itemService.findAllByCollection(context, collection); while (itemIterator.hasNext() && processed < max2Process) { applyFiltersItem(context, itemIterator.next()); } } }
protected boolean isCitationEnabledThroughCollection(Context context, Bitstream bitstream) throws SQLException { //Reject quickly if no-enabled collections if (citationEnabledCollectionsList.size() == 0) { return false; } DSpaceObject owningDSO = bitstreamService.getParentObject(context, bitstream); if (owningDSO instanceof Item) { Item item = (Item) owningDSO; List<Collection> collections = item.getCollections(); for (Collection collection : collections) { if (citationEnabledCollectionsList.contains(collection.getHandle())) { return true; } } } // If previous logic didn't return true, then we're false return false; }
/** * Get the style using the owning collection handle */ public String getStyleForItem(Item item) throws SQLException { Collection c = item.getOwningCollection(); if(c!=null) { // Style specified & exists return getFromMap(c.getHandle()); } else { return "default"; //no specific style - item is an in progress Submission } }
public String getInputFormNameByCollectionAndField(Collection collection, String field) throws DCInputsReaderException { List<DCInputSet> inputSets = getInputsByCollectionHandle(collection.getHandle()); for (DCInputSet inputSet : inputSets) { String[] tokenized = Utils.tokenize(field); String schema = tokenized[0]; String element = tokenized[1]; String qualifier = tokenized[2]; if (StringUtils.isBlank(qualifier)) { qualifier = null; } String standardized = Utils.standardize(schema, element, qualifier, "."); if (inputSet.isFieldPresent(standardized)) { return inputSet.getFormName(); } } throw new DCInputsReaderException("No field configuration found!"); }
@Override public void addBody(Body body) throws SAXException, WingException, SQLException, IOException, AuthorizeException { Item item = workflowItem.getItem(); Collection collection = workflowItem.getCollection(); Request request = ObjectModelHelper.getRequest(objectModel); String actionURL = contextPath + "/handle/"+collection.getHandle() + "/xmlworkflow"; // Generate a from asking the user two questions: multiple // titles & published before. Division div = body.addInteractiveDivision("perform-task", actionURL, Division.METHOD_POST, "primary workflow"); div.setHead(T_HEAD); addWorkflowItemInformation(div, item, request); renderMainPage(div); div.addHidden("submission-continue").setValue(knot.getId()); }
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); List saveOrCancel = div.addList("submit-review", List.TYPE_FORM); saveOrCancel.setHead(T_head); saveOrCancel.addItem(T_info1); org.dspace.app.xmlui.wing.element.Item actions = saveOrCancel.addItem(); actions.addButton("submit_back").setValue(T_submit_back); actions.addButton("submit_save").setValue(T_submit_save); actions.addButton("submit_remove").setValue(T_submit_remove); } }