public void reload() throws SubmissionConfigReaderException { collectionToSubmissionConfig = null; stepDefns = null; submitDefns = null; buildInputs(configDir + SUBMIT_DEF_FILE_PREFIX + SUBMIT_DEF_FILE_SUFFIX); }
@Override public void contextDestroyed(ServletContextEvent sce) { webApp.deregister(); } }
/** * Alternate way of calling isRepeatable() * * @return the repeatable flag */ public boolean getRepeatable() { return isRepeatable(); }
protected DCInput getDCInput(String formName, String schema, String element, String qualifier) throws DCInputsReaderException { List<DCInputSet> dcinputsets = new DCInputsReader().getInputsBySubmissionName(formName); for (DCInputSet dcinputset : dcinputsets) { for (DCInput[] dcrow : dcinputset.getFields()) { for (DCInput dcinput : dcrow) { if (dcinput.getSchema().equals(schema) && dcinput.getElement().equals(element) && ((dcinput.getQualifier() != null && dcinput .getQualifier().equals(qualifier)) || (dcinput.getQualifier() == null && qualifier == null))) { return dcinput; } } } } return null; }
protected SyndicationFeed getResults(Context context, String format, String query, int totalResults, int start, int pageSize, DSpaceObject scope, List<DSpaceObject> results, Map<String, String> labels) { // Encode results in requested format if ("rss".equals(format)) { format = "rss_2.0"; } else if ("atom".equals(format)) { format = "atom_1.0"; } SyndicationFeed feed = new SyndicationFeed(labels.get(SyndicationFeed.MSG_UITYPE)); feed.populate(null, context, scope, results, labels); feed.setType(format); feed.addModule(openSearchMarkup(query, totalResults, start, pageSize)); return feed; }
/** * Version of encodeBitstreamName with one parameter, uses default encoding * <P> * * @param stringIn input string to encode * @return the encoded string * @throws java.io.UnsupportedEncodingException if encoding error */ public static String encodeBitstreamName(String stringIn) throws java.io.UnsupportedEncodingException { return encodeBitstreamName(stringIn, Constants.DEFAULT_ENCODING); }
@Override public void init(Curator curator, String taskId) throws IOException { super.init(curator, taskId); try { reader = new DCInputsReader(); } catch (DCInputsReaderException dcrE) { throw new IOException(dcrE.getMessage(), dcrE); } }
/** * Ensure that the inputs reader has been initialized, this method may be * called multiple times with no ill-effect. */ private static void initializeInputsReader() throws DCInputsReaderException { if (INPUTS_READER == null) { INPUTS_READER = new DCInputsReader(); } }
@Override public void removeAdministrators(Context context, Collection collection) throws SQLException, AuthorizeException { // Check authorisation - Must be an Admin of the parent community to delete Admin Group AuthorizeUtil.authorizeRemoveAdminGroup(context, collection); Group admins = collection.getAdministrators(); // just return if there is no administrative group. if (admins == null) { return; } // Remove the link to the collection table. collection.setAdmins(null); }
/** * Returns whether or not there are more steps which follow the specified * "stepNum". For example, if you specify stepNum=4, then this method checks * to see if there is a Step #5. The first step is numbered "0". * * @param stepNum the current step. * @return true, if a step at "stepNum+1" exists. false, otherwise. */ public boolean hasMoreSteps(int stepNum) { return (getStep(stepNum + 1) != null); } }
/** * Does this set of inputs include an alternate title field? * * @return true if the current set has an alternate title field */ public boolean isDefinedMultTitles() { return isFieldPresent("dc.title.alternative"); }
@Override public Document getDescriptionDoc(String scope) throws IOException { return jDomToW3(getServiceDocument(scope)); }
public boolean isQualdropValue() { if ("qualdrop_value".equals(getInputType())) { return true; } return false; }
/** * Get full path starting from a top-level community via subcommunities down to a collection. * The full path will not be truncated. * * @param context The relevant DSpace Context. * @param col Get full path for this collection * @return Full path to the collection * @throws SQLException if database error */ public static String collectionPath(Context context, Collection col) throws SQLException { return CollectionDropDown.collectionPath(context, col, 0); }
public DCInputsReader(String fileName) throws DCInputsReaderException { buildInputs(fileName); }
@Override public boolean equals(Object o) { return o != null && o instanceof CollectionPathEntry && this.compareTo((CollectionPathEntry) o) == 0; }
private void init() { try { if (dci == null) { dci = new DCInputsReader(); } } catch (DCInputsReaderException e) { log.error("Failed reading DCInputs initialization: ", e); } }
@Override public void removeAdministrators(Context context, Community community) throws SQLException, AuthorizeException { // Check authorisation - Must be an Admin of the parent community (or system admin) to delete Admin group AuthorizeUtil.authorizeRemoveAdminGroup(context, community); // just return if there is no administrative group. if (community.getAdministrators() == null) { return; } // Remove the link to the community table. community.setAdmins(null); }
/** * Does this set of inputs include the previously published fields? * * @return true if the current set has all the prev. published fields */ public boolean isDefinedPubBefore() { return (isFieldPresent("dc.date.issued") && isFieldPresent("dc.identifier.citation") && isFieldPresent("dc.publisher")); }
/** * Load Submission Configuration from the * item-submission.xml configuration file * * @throws SubmissionConfigReaderException if servlet error */ public SubmissionConfigReader() throws SubmissionConfigReaderException { buildInputs(configDir + SUBMIT_DEF_FILE_PREFIX + SUBMIT_DEF_FILE_SUFFIX); }