Clean up doc comments in JSPUI, XMLUI

This commit is contained in:
Mark H. Wood
2012-11-02 16:58:08 -04:00
parent 255288a367
commit 80fd26f8bc
17 changed files with 158 additions and 206 deletions

View File

@@ -40,11 +40,10 @@ public class DiscoverUtility
private static Logger log = Logger.getLogger(DiscoverUtility.class); private static Logger log = Logger.getLogger(DiscoverUtility.class);
/** /**
* Get the scope of the search using the parameter found in the request * Get the scope of the search using the parameter found in the request.
* *
* @param context * @param context
* @param request * @param request
* @return
* @throws IllegalStateException * @throws IllegalStateException
* @throws SQLException * @throws SQLException
*/ */
@@ -74,7 +73,7 @@ public class DiscoverUtility
* Build a DiscoverQuery object using the parameter in the request * Build a DiscoverQuery object using the parameter in the request
* *
* @param request * @param request
* @return * @return the query.
* @throws SearchServiceException * @throws SearchServiceException
*/ */
public static DiscoverQuery getDiscoverQuery(Context context, public static DiscoverQuery getDiscoverQuery(Context context,
@@ -107,7 +106,7 @@ public class DiscoverUtility
* @param context * @param context
* @param request * @param request
* @param scope * @param scope
* @return * @return the query.
*/ */
public static DiscoverQuery getDiscoverAutocomplete(Context context, public static DiscoverQuery getDiscoverAutocomplete(Context context,
HttpServletRequest request, DSpaceObject scope) HttpServletRequest request, DSpaceObject scope)

View File

@@ -465,19 +465,19 @@ public class DiscoverySearchRequestProcessor implements SearchRequestProcessor
/** /**
* Method for constructing the discovery advanced search form * Method for constructing the discovery advanced search form
* *
* @author Andrea Bollini * author: Andrea Bollini
*/ */
@Override @Override
public void doAdvancedSearch(Context context, HttpServletRequest request, public void doAdvancedSearch(Context context, HttpServletRequest request,
HttpServletResponse response) throws SearchProcessorException, HttpServletResponse response) throws SearchProcessorException,
IOException, ServletException IOException, ServletException
{ {
// just redirect to the simple search servlet. // just redirect to the simple search servlet.
// The advanced form is always displayed with Discovery togheter with // The advanced form is always displayed with Discovery togheter with
// the search result // the search result
// the first access to the advanced form performs a search for // the first access to the advanced form performs a search for
// "anythings" (SOLR *:*) // "anythings" (SOLR *:*)
response.sendRedirect(request.getContextPath() + "/simple-search"); response.sendRedirect(request.getContextPath() + "/simple-search");
} }
} }

View File

@@ -82,7 +82,7 @@ public class LuceneSearchProcessor implements SearchRequestProcessor
* location), a the ID of a community (e.g. "123"), or a community ID, then * location), a the ID of a community (e.g. "123"), or a community ID, then
* a slash, then a collection ID, e.g. "123/456". * a slash, then a collection ID, e.g. "123/456".
* *
* @author Robert Tansley * author: Robert Tansley
*/ */
@Override @Override
public void doSimpleSearch(Context context, HttpServletRequest request, public void doSimpleSearch(Context context, HttpServletRequest request,
@@ -465,7 +465,7 @@ public class LuceneSearchProcessor implements SearchRequestProcessor
/** /**
* Method for constructing the advanced search form * Method for constructing the advanced search form
* *
* @author gam * author: gam
*/ */
@Override @Override
public void doAdvancedSearch(Context context, HttpServletRequest request, public void doAdvancedSearch(Context context, HttpServletRequest request,
@@ -496,7 +496,7 @@ public class LuceneSearchProcessor implements SearchRequestProcessor
* parameters exactly match those of the SearchServlet. * parameters exactly match those of the SearchServlet.
* </p> * </p>
* *
* @author Richard Rodgers * author: Richard Rodgers
*/ */
@Override @Override
public void doOpenSearch(Context context, HttpServletRequest request, public void doOpenSearch(Context context, HttpServletRequest request,

View File

@@ -32,7 +32,6 @@ public interface StyleSelection
* The configuration has the following syntax: <code>schema.element[.qualifier|.*][(display-option)]</code> * The configuration has the following syntax: <code>schema.element[.qualifier|.*][(display-option)]</code>
* *
* @param style * @param style
* @return
*/ */
public String getConfigurationForStyle(String style); public String getConfigurationForStyle(String style);
} }

View File

@@ -28,9 +28,10 @@ import org.dspace.eperson.EPerson;
/** /**
* *
* This action simply records pipeline events that it sees, keeping track of the users and * This action simply records pipeline events that it sees, keeping track of
* pages they are viewing. Later the control panel's activity viewer can access this data to * the users and pages they are viewing. Later the control panel's activity
* get a realtime snap shot of current activity of the repository. * viewer can access this data to get a realtime snap shot of current activity
* of the repository.
* *
* @author Scott Phillips * @author Scott Phillips
*/ */
@@ -242,7 +243,6 @@ public class CurrentActivityAction extends AbstractAction
/** /**
* Is this event anonymous? * Is this event anonymous?
* @return
*/ */
public boolean isAnonymous() public boolean isAnonymous()
{ {
@@ -251,27 +251,27 @@ public class CurrentActivityAction extends AbstractAction
/** /**
* Is this event from a bot? * Is this event from a bot?
* @return
*/ */
public boolean isBot() public boolean isBot()
{ {
if (userAgent == null) if (userAgent == null)
{ {
return false; return false;
} }
String ua = userAgent.toLowerCase(); String ua = userAgent.toLowerCase();
return (ua.contains("google/") || return (ua.contains("google/") ||
ua.contains("msnbot/") || ua.contains("msnbot/") ||
ua.contains("googlebot/") || ua.contains("googlebot/") ||
ua.contains("webcrawler/") || ua.contains("webcrawler/") ||
ua.contains("inktomi") || ua.contains("inktomi") ||
ua.contains("teoma") || ua.contains("teoma") ||
ua.contains("bot")); ua.contains("bot"));
} }
/** /**
* Return the activity viewer's best guess as to what browser or bot was initiating the request. * Return the activity viewer's best guess as to what browser or bot
* was initiating the request.
* *
* @return A short name for the browser or bot. * @return A short name for the browser or bot.
*/ */

View File

@@ -328,64 +328,64 @@ public class FlowContainerUtils
* *
* @param context * @param context
* @param request * @param request
* @return
*/ */
public static FlowResult testOAISettings(Context context, Request request) public static FlowResult testOAISettings(Context context, Request request)
{ {
FlowResult result = new FlowResult(); FlowResult result = new FlowResult();
String oaiProvider = request.getParameter("oai_provider"); String oaiProvider = request.getParameter("oai_provider");
String oaiSetId = request.getParameter("oai_setid"); String oaiSetId = request.getParameter("oai_setid");
oaiSetId = request.getParameter("oai-set-setting"); oaiSetId = request.getParameter("oai-set-setting");
if(!"all".equals(oaiSetId)) if(!"all".equals(oaiSetId))
{ {
oaiSetId = request.getParameter("oai_setid"); oaiSetId = request.getParameter("oai_setid");
} }
String metadataKey = request.getParameter("metadata_format"); String metadataKey = request.getParameter("metadata_format");
String harvestType = request.getParameter("harvest_level"); String harvestType = request.getParameter("harvest_level");
int harvestTypeInt = 0; int harvestTypeInt = 0;
if (oaiProvider == null || oaiProvider.length() == 0) if (oaiProvider == null || oaiProvider.length() == 0)
{ {
result.addError("oai_provider"); result.addError("oai_provider");
} }
if (oaiSetId == null || oaiSetId.length() == 0) if (oaiSetId == null || oaiSetId.length() == 0)
{ {
result.addError("oai_setid"); result.addError("oai_setid");
} }
if (metadataKey == null || metadataKey.length() == 0) if (metadataKey == null || metadataKey.length() == 0)
{ {
result.addError("metadata_format"); result.addError("metadata_format");
} }
if (harvestType == null || harvestType.length() == 0) if (harvestType == null || harvestType.length() == 0)
{ {
result.addError("harvest_level"); result.addError("harvest_level");
} }
else else
{ {
harvestTypeInt = Integer.parseInt(harvestType); harvestTypeInt = Integer.parseInt(harvestType);
} }
if (result.getErrors() == null) { if (result.getErrors() == null) {
List<String> testErrors = OAIHarvester.verifyOAIharvester(oaiProvider, oaiSetId, metadataKey, (harvestTypeInt>1)); List<String> testErrors = OAIHarvester.verifyOAIharvester(oaiProvider, oaiSetId, metadataKey, (harvestTypeInt>1));
result.setErrors(testErrors); result.setErrors(testErrors);
} }
if (result.getErrors() == null || result.getErrors().isEmpty()) { if (result.getErrors() == null || result.getErrors().isEmpty()) {
result.setOutcome(true); result.setOutcome(true);
// On a successful test we still want to stay in the loop, not continue out of it // On a successful test we still want to stay in the loop,
//result.setContinue(true); // not continue out of it
result.setMessage(new Message("default","Harvesting settings are valid.")); //result.setContinue(true);
} result.setMessage(new Message("default","Harvesting settings are valid."));
else { }
result.setOutcome(false); else {
result.setContinue(false); result.setOutcome(false);
// don't really need a message when the errors are highlighted already result.setContinue(false);
//result.setMessage(new Message("default","Harvesting is not properly configured.")); // don't really need a message when the errors are highlighted already
} //result.setMessage(new Message("default","Harvesting is not properly configured."));
}
return result; return result;
} }
/** /**
@@ -1110,7 +1110,6 @@ public class FlowContainerUtils
* *
* @param context * @param context
* @param collectionID * @param collectionID
* @return
* @throws SQLException * @throws SQLException
* @throws AuthorizeException * @throws AuthorizeException
* @throws IOException * @throws IOException

View File

@@ -37,8 +37,9 @@ import java.text.SimpleDateFormat;
/** /**
* Transformer to display statistics data in XML UI. * Transformer to display statistics data in XML UI.
* *
* Unlike the JSP interface that pre-generates HTML and stores in the reports folder, * Unlike the JSP interface that pre-generates HTML and stores in the reports
* this class transforms the raw analysis data into a Wing representation * folder, this class transforms the raw analysis data into a Wing
* representation.
*/ */
public class StatisticsViewer extends AbstractDSpaceTransformer implements CacheableProcessingComponent public class StatisticsViewer extends AbstractDSpaceTransformer implements CacheableProcessingComponent
{ {
@@ -60,8 +61,7 @@ public class StatisticsViewer extends AbstractDSpaceTransformer implements Cache
private SourceValidity validity; private SourceValidity validity;
/** /**
* Get the caching key for this report * Get the caching key for this report.
* @return
*/ */
public Serializable getKey() public Serializable getKey()
{ {
@@ -76,8 +76,7 @@ public class StatisticsViewer extends AbstractDSpaceTransformer implements Cache
} }
/** /**
* Generate the validity for this cached entry * Generate the validity for this cached entry.
* @return
*/ */
public SourceValidity getValidity() public SourceValidity getValidity()
{ {
@@ -308,9 +307,7 @@ public class StatisticsViewer extends AbstractDSpaceTransformer implements Cache
} }
/** /**
* Get the header for the report - currently not supported * Get the header for the report - currently not supported.
*
* @return
*/ */
public String header() public String header()
{ {
@@ -324,8 +321,8 @@ public class StatisticsViewer extends AbstractDSpaceTransformer implements Cache
} }
/** /**
* Add the main title to the report * Add the main title to the report.
* @return * @return null.
*/ */
public String mainTitle() public String mainTitle()
{ {
@@ -341,8 +338,8 @@ public class StatisticsViewer extends AbstractDSpaceTransformer implements Cache
} }
/** /**
* Output the date range for this report * Output the date range for this report.
* @return * @return null.
*/ */
public String dateRange() public String dateRange()
{ {
@@ -381,9 +378,9 @@ public class StatisticsViewer extends AbstractDSpaceTransformer implements Cache
} }
/** /**
* Output the section header * Output the section header.
* @param title * @param title
* @return * @return null.
*/ */
public String sectionHeader(String title) public String sectionHeader(String title)
{ {
@@ -400,9 +397,9 @@ public class StatisticsViewer extends AbstractDSpaceTransformer implements Cache
} }
/** /**
* Output the current statistics block * Output the current statistics block.
* @param content * @param content
* @return * @return null.
*/ */
public String statBlock(Statistics content) public String statBlock(Statistics content)
{ {
@@ -472,9 +469,10 @@ public class StatisticsViewer extends AbstractDSpaceTransformer implements Cache
} }
/** /**
* Output any information about the lower boundary restriction for this section * Output any information about the lower boundary restriction for
* this section.
* @param floor * @param floor
* @return * @return null.
*/ */
public String floorInfo(int floor) public String floorInfo(int floor)
{ {
@@ -494,10 +492,10 @@ public class StatisticsViewer extends AbstractDSpaceTransformer implements Cache
} }
/** /**
* Output an explanation for this section * Output an explanation for this section.
* *
* @param explanation * @param explanation
* @return * @return null.
*/ */
public String blockExplanation(String explanation) public String blockExplanation(String explanation)
{ {
@@ -517,9 +515,9 @@ public class StatisticsViewer extends AbstractDSpaceTransformer implements Cache
} }
/** /**
* Output the footer * Output the footer.
* *
* @return * @return an empty string.
*/ */
public String footer() public String footer()
{ {
@@ -560,8 +558,8 @@ public class StatisticsViewer extends AbstractDSpaceTransformer implements Cache
} }
/** /**
* Render the statistics into an XML stream * Render the statistics into an XML stream.
* @return * @return null.
*/ */
public String render() public String render()
{ {
@@ -622,9 +620,11 @@ public class StatisticsViewer extends AbstractDSpaceTransformer implements Cache
/** /**
* Protect the display from excessively wrong data, typically this occures if a long word finds it's way * Protect the display from excessively wrong data. Typically this occurs
* into the data that is not breakable by the browser because there is no space, dash, period, or other * if a long word finds its way into the data that is not breakable by
* delimiter character. This just prevents the page from blowing up when bad data is being presented. * the browser because there is no space, dash, period, or other
* delimiter character. This just prevents the page from blowing up when
* bad data are being presented.
*/ */
private static final int MAX_ENTRY_LENGTH = 50; private static final int MAX_ENTRY_LENGTH = 50;
private static String entry(String entry) private static String entry(String entry)

View File

@@ -30,26 +30,26 @@ import org.dspace.authenticate.AuthenticationMethod;
*/ */
public class AuthenticationCountSelector implements Selector{ public class AuthenticationCountSelector implements Selector{
/** /**
* Returns true if the expression (in this case a number) is equal to the number * Returns true if the expression (in this case a number) is equal to the
* of AuthenticationMethods defined in the dspace.cfg file * number of AuthenticationMethods defined in the dspace.cfg file.
* @return * @return
*/ */
public boolean select(String expression, Map objectModel, Parameters parameters) { public boolean select(String expression, Map objectModel, Parameters parameters) {
// get an iterator of all the AuthenticationMethods defined // get an iterator of all the AuthenticationMethods defined
final Iterator<AuthenticationMethod> authMethods = AuthenticationManager final Iterator<AuthenticationMethod> authMethods = AuthenticationManager
.authenticationMethodIterator(); .authenticationMethodIterator();
final HttpServletResponse httpResponse = (HttpServletResponse) objectModel final HttpServletResponse httpResponse = (HttpServletResponse) objectModel
.get(HttpEnvironment.HTTP_RESPONSE_OBJECT); .get(HttpEnvironment.HTTP_RESPONSE_OBJECT);
final HttpServletRequest httpRequest = (HttpServletRequest) objectModel final HttpServletRequest httpRequest = (HttpServletRequest) objectModel
.get(HttpEnvironment.HTTP_REQUEST_OBJECT); .get(HttpEnvironment.HTTP_REQUEST_OBJECT);
int authMethodCount = 0; int authMethodCount = 0;
// iterate to count the methods // iterate to count the methods
while(authMethods.hasNext()){ while(authMethods.hasNext()){
AuthenticationMethod auth = authMethods.next(); AuthenticationMethod auth = authMethods.next();
try try
{ {
if (auth.loginPageURL( if (auth.loginPageURL(
ContextUtil.obtainContext(objectModel), httpRequest, ContextUtil.obtainContext(objectModel), httpRequest,
@@ -59,16 +59,15 @@ public class AuthenticationCountSelector implements Selector{
} }
catch (SQLException e) catch (SQLException e)
{ {
// mmm... we should not never go here, anyway we convert it in an unchecked exception // mmm... we should never go here, anyway we convert it to
// an unchecked exception.
throw new IllegalStateException(e); throw new IllegalStateException(e);
} }
}
final Integer exp = Integer.valueOf(expression);
return (authMethodCount == exp);
} }
final Integer exp = Integer.valueOf(expression);
return (authMethodCount == exp);
}
} }

View File

@@ -27,7 +27,6 @@ import java.util.Map;
* *
* @author "Ryan McGowan" ("mcgowan.98@osu.edu") * @author "Ryan McGowan" ("mcgowan.98@osu.edu")
* @author Peter Dietz (pdietz84@gmail.com) * @author Peter Dietz (pdietz84@gmail.com)
* @version
*/ */
public class ReportGenerator public class ReportGenerator
{ {
@@ -107,7 +106,6 @@ public class ReportGenerator
/** /**
* {@inheritDoc}
* @see org.dspace.app.xmlui.cocoon.DSpaceTransformer#addBody(Body) * @see org.dspace.app.xmlui.cocoon.DSpaceTransformer#addBody(Body)
*/ */
public void addReportGeneratorForm(Division parentDivision, Request request) { public void addReportGeneratorForm(Division parentDivision, Request request) {

View File

@@ -129,7 +129,7 @@ public class SAXFilter implements ContentHandler, LexicalHandler
* *
* @param minimumElementLevel * @param minimumElementLevel
* the minimum level required. * the minimum level required.
* @return * @return this SAXFilter instance.
*/ */
public SAXFilter allowElements(int minimumElementLevel) public SAXFilter allowElements(int minimumElementLevel)
{ {

View File

@@ -424,9 +424,10 @@ public class AuthenticationUtil
* The Cocoon object model * The Cocoon object model
* @param email * @param email
* The email address of the EPerson. * The email address of the EPerson.
* @return * @return true if allowed.
*/ */
public static boolean allowSetPassword(Map objectModel, String email) throws SQLException public static boolean allowSetPassword(Map objectModel, String email)
throws SQLException
{ {
final HttpServletRequest request = (HttpServletRequest) objectModel.get(HttpEnvironment.HTTP_REQUEST_OBJECT); final HttpServletRequest request = (HttpServletRequest) objectModel.get(HttpEnvironment.HTTP_REQUEST_OBJECT);
Context context = ContextUtil.obtainContext(objectModel); Context context = ContextUtil.obtainContext(objectModel);
@@ -435,8 +436,8 @@ public class AuthenticationUtil
} }
/** /**
* Construct a new, mostly blank, eperson for the given email address. This should * Construct a new, mostly blank, eperson for the given email address.
* only be called once the email address has been verified. * This should only be called once the email address has been verified.
* *
* @param objectModel * @param objectModel
* The Cocoon object model. * The Cocoon object model.
@@ -497,9 +498,9 @@ public class AuthenticationUtil
/** /**
* Interrupt the current request and store if for later resumption. This request will * Interrupt the current request and store if for later resumption. This
* send an HTTP redirect telling the client to authenticate first. Once that has been finished * request will send an HTTP redirect telling the client to authenticate
* then the request can be resumed. * first. Once that has been finished then the request can be resumed.
* *
* @param objectModel The Cocoon object Model * @param objectModel The Cocoon object Model
* @param header A message header (i18n tag) * @param header A message header (i18n tag)
@@ -536,7 +537,7 @@ public class AuthenticationUtil
* interrupted request. * interrupted request.
* *
* @param objectModel The Cocoon object Model * @param objectModel The Cocoon object Model
* @return * @return null.
*/ */
public static String resumeInterruptedRequest(Map objectModel) public static String resumeInterruptedRequest(Map objectModel)
{ {

View File

@@ -55,7 +55,7 @@ public class AttributeMap extends HashMap<String, String>
* The attribute's name. * The attribute's name.
* @param value * @param value
* The value of the attribute. * The value of the attribute.
* @return * @return previous value bound to the key, if any.
*/ */
public String put(String key, int value) public String put(String key, int value)
{ {
@@ -69,7 +69,7 @@ public class AttributeMap extends HashMap<String, String>
* *
* @param key * @param key
* @param value * @param value
* @return * @return previous value bound to the key, if any.
*/ */
public String put(String key, boolean value) public String put(String key, boolean value)
{ {

View File

@@ -51,8 +51,6 @@ public class WingContext
/** /**
* Return the current transformer's name. * Return the current transformer's name.
*
* @return
*/ */
public String getComponentName() public String getComponentName()
{ {
@@ -120,7 +118,6 @@ public class WingContext
* @param subName * @param subName
* An additional name to the original name to further identify it * An additional name to the original name to further identify it
* in cases when just the name alone does not accomplish this. * in cases when just the name alone does not accomplish this.
* @return
*/ */
public String generateID(String application, String name, String subName) public String generateID(String application, String name, String subName)
{ {

View File

@@ -158,11 +158,11 @@ public class Body extends AbstractWingElement implements WingMergeableElement
* The qualified name for this element * The qualified name for this element
* @param attributes * @param attributes
* The element's attributes * The element's attributes
* @return * @return the matching Division, or null.
*/ */
public WingMergeableElement mergeChild(String namespace, String localName, public WingMergeableElement mergeChild(String namespace, String localName,
String qName, Attributes attributes) throws SAXException, String qName, Attributes attributes)
WingException throws SAXException, WingException
{ {
Division found = null; Division found = null;
for (Division candidate : divisions) for (Division candidate : divisions)

View File

@@ -60,7 +60,7 @@ public class Figure extends TextContainer implements StructuralElement
* *
* @param context * @param context
* (Required) The context this element is contained in * (Required) The context this element is contained in
* @param Source * @param source
* (Required) The figure's image source. * (Required) The figure's image source.
* @param target * @param target
* (May be null) The figure's external reference, if present then * (May be null) The figure's external reference, if present then

View File

@@ -226,7 +226,7 @@ public abstract class RichTextContainer extends TextContainer
* @param target * @param target
* (May be null) The target reference for the image if the image * (May be null) The target reference for the image if the image
* is to operate as a link. * is to operate as a link.
* @title * @param title
* @param rend * @param rend
* (May be null) a rendering hint used to override the default * (May be null) a rendering hint used to override the default
* display of the element. * display of the element.
@@ -239,46 +239,6 @@ public abstract class RichTextContainer extends TextContainer
return figure; return figure;
} }
/** /**
* Add a button input control that when activated by the user will submit * Add a button input control that when activated by the user will submit
* the form, including all the fields, back to the server for processing. * the form, including all the fields, back to the server for processing.
@@ -466,7 +426,7 @@ public abstract class RichTextContainer extends TextContainer
* the element from its siblings within an interactive division. * the element from its siblings within an interactive division.
* This is the name of the field use when data is submitted back * This is the name of the field use when data is submitted back
* to the server. * to the server.
* @return * @return a new hidden field.
*/ */
public Hidden addHidden(String name) throws WingException public Hidden addHidden(String name) throws WingException
{ {

View File

@@ -79,7 +79,7 @@ public class Select extends Field
/** /**
* Set the event behavior attribute of the select item * Set the event behavior attribute of the select item
* *
* @param action * @param behavior
* javascript to instantiate on @evtbehavior * javascript to instantiate on @evtbehavior
*/ */
public void setEvtBehavior(String behavior) { public void setEvtBehavior(String behavior) {