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);
/**
* 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 request
* @return
* @throws IllegalStateException
* @throws SQLException
*/
@@ -74,7 +73,7 @@ public class DiscoverUtility
* Build a DiscoverQuery object using the parameter in the request
*
* @param request
* @return
* @return the query.
* @throws SearchServiceException
*/
public static DiscoverQuery getDiscoverQuery(Context context,
@@ -107,7 +106,7 @@ public class DiscoverUtility
* @param context
* @param request
* @param scope
* @return
* @return the query.
*/
public static DiscoverQuery getDiscoverAutocomplete(Context context,
HttpServletRequest request, DSpaceObject scope)

View File

@@ -465,19 +465,19 @@ public class DiscoverySearchRequestProcessor implements SearchRequestProcessor
/**
* Method for constructing the discovery advanced search form
*
* @author Andrea Bollini
* author: Andrea Bollini
*/
@Override
public void doAdvancedSearch(Context context, HttpServletRequest request,
HttpServletResponse response) throws SearchProcessorException,
IOException, ServletException
{
// just redirect to the simple search servlet.
// The advanced form is always displayed with Discovery togheter with
// the search result
// the first access to the advanced form performs a search for
// "anythings" (SOLR *:*)
response.sendRedirect(request.getContextPath() + "/simple-search");
}
{
// just redirect to the simple search servlet.
// The advanced form is always displayed with Discovery togheter with
// the search result
// the first access to the advanced form performs a search for
// "anythings" (SOLR *:*)
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
* a slash, then a collection ID, e.g. "123/456".
*
* @author Robert Tansley
* author: Robert Tansley
*/
@Override
public void doSimpleSearch(Context context, HttpServletRequest request,
@@ -465,7 +465,7 @@ public class LuceneSearchProcessor implements SearchRequestProcessor
/**
* Method for constructing the advanced search form
*
* @author gam
* author: gam
*/
@Override
public void doAdvancedSearch(Context context, HttpServletRequest request,
@@ -496,7 +496,7 @@ public class LuceneSearchProcessor implements SearchRequestProcessor
* parameters exactly match those of the SearchServlet.
* </p>
*
* @author Richard Rodgers
* author: Richard Rodgers
*/
@Override
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>
*
* @param style
* @return
*/
public String getConfigurationForStyle(String style);
}

View File

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

View File

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

View File

@@ -37,8 +37,9 @@ import java.text.SimpleDateFormat;
/**
* Transformer to display statistics data in XML UI.
*
* Unlike the JSP interface that pre-generates HTML and stores in the reports folder,
* this class transforms the raw analysis data into a Wing representation
* Unlike the JSP interface that pre-generates HTML and stores in the reports
* folder, this class transforms the raw analysis data into a Wing
* representation.
*/
public class StatisticsViewer extends AbstractDSpaceTransformer implements CacheableProcessingComponent
{
@@ -60,8 +61,7 @@ public class StatisticsViewer extends AbstractDSpaceTransformer implements Cache
private SourceValidity validity;
/**
* Get the caching key for this report
* @return
* Get the caching key for this report.
*/
public Serializable getKey()
{
@@ -76,8 +76,7 @@ public class StatisticsViewer extends AbstractDSpaceTransformer implements Cache
}
/**
* Generate the validity for this cached entry
* @return
* Generate the validity for this cached entry.
*/
public SourceValidity getValidity()
{
@@ -308,9 +307,7 @@ public class StatisticsViewer extends AbstractDSpaceTransformer implements Cache
}
/**
* Get the header for the report - currently not supported
*
* @return
* Get the header for the report - currently not supported.
*/
public String header()
{
@@ -324,8 +321,8 @@ public class StatisticsViewer extends AbstractDSpaceTransformer implements Cache
}
/**
* Add the main title to the report
* @return
* Add the main title to the report.
* @return null.
*/
public String mainTitle()
{
@@ -341,8 +338,8 @@ public class StatisticsViewer extends AbstractDSpaceTransformer implements Cache
}
/**
* Output the date range for this report
* @return
* Output the date range for this report.
* @return null.
*/
public String dateRange()
{
@@ -381,9 +378,9 @@ public class StatisticsViewer extends AbstractDSpaceTransformer implements Cache
}
/**
* Output the section header
* Output the section header.
* @param title
* @return
* @return null.
*/
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
* @return
* @return null.
*/
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
* @return
* @return null.
*/
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
* @return
* @return null.
*/
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()
{
@@ -560,8 +558,8 @@ public class StatisticsViewer extends AbstractDSpaceTransformer implements Cache
}
/**
* Render the statistics into an XML stream
* @return
* Render the statistics into an XML stream.
* @return null.
*/
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
* into the data that is not breakable by the browser because there is no space, dash, period, or other
* delimiter character. This just prevents the page from blowing up when bad data is being presented.
* Protect the display from excessively wrong data. Typically this occurs
* if a long word finds its way into the data that is not breakable by
* 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 String entry(String entry)

View File

@@ -30,26 +30,26 @@ import org.dspace.authenticate.AuthenticationMethod;
*/
public class AuthenticationCountSelector implements Selector{
/**
* Returns true if the expression (in this case a number) is equal to the number
* of AuthenticationMethods defined in the dspace.cfg file
* Returns true if the expression (in this case a number) is equal to the
* number of AuthenticationMethods defined in the dspace.cfg file.
* @return
*/
public boolean select(String expression, Map objectModel, Parameters parameters) {
// get an iterator of all the AuthenticationMethods defined
final Iterator<AuthenticationMethod> authMethods = AuthenticationManager
public boolean select(String expression, Map objectModel, Parameters parameters) {
// get an iterator of all the AuthenticationMethods defined
final Iterator<AuthenticationMethod> authMethods = AuthenticationManager
.authenticationMethodIterator();
final HttpServletResponse httpResponse = (HttpServletResponse) objectModel
.get(HttpEnvironment.HTTP_RESPONSE_OBJECT);
final HttpServletRequest httpRequest = (HttpServletRequest) objectModel
.get(HttpEnvironment.HTTP_REQUEST_OBJECT);
int authMethodCount = 0;
// iterate to count the methods
while(authMethods.hasNext()){
AuthenticationMethod auth = authMethods.next();
try
final HttpServletResponse httpResponse = (HttpServletResponse) objectModel
.get(HttpEnvironment.HTTP_RESPONSE_OBJECT);
final HttpServletRequest httpRequest = (HttpServletRequest) objectModel
.get(HttpEnvironment.HTTP_REQUEST_OBJECT);
int authMethodCount = 0;
// iterate to count the methods
while(authMethods.hasNext()){
AuthenticationMethod auth = authMethods.next();
try
{
if (auth.loginPageURL(
ContextUtil.obtainContext(objectModel), httpRequest,
@@ -59,16 +59,15 @@ public class AuthenticationCountSelector implements Selector{
}
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);
}
}
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 Peter Dietz (pdietz84@gmail.com)
* @version
*/
public class ReportGenerator
{
@@ -107,7 +106,6 @@ public class ReportGenerator
/**
* {@inheritDoc}
* @see org.dspace.app.xmlui.cocoon.DSpaceTransformer#addBody(Body)
*/
public void addReportGeneratorForm(Division parentDivision, Request request) {

View File

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

View File

@@ -424,9 +424,10 @@ public class AuthenticationUtil
* The Cocoon object model
* @param email
* 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);
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
* only be called once the email address has been verified.
* Construct a new, mostly blank, eperson for the given email address.
* This should only be called once the email address has been verified.
*
* @param objectModel
* The Cocoon object model.
@@ -497,9 +498,9 @@ public class AuthenticationUtil
/**
* Interrupt the current request and store if for later resumption. This request will
* send an HTTP redirect telling the client to authenticate first. Once that has been finished
* then the request can be resumed.
* Interrupt the current request and store if for later resumption. This
* request will send an HTTP redirect telling the client to authenticate
* first. Once that has been finished then the request can be resumed.
*
* @param objectModel The Cocoon object Model
* @param header A message header (i18n tag)
@@ -536,7 +537,7 @@ public class AuthenticationUtil
* interrupted request.
*
* @param objectModel The Cocoon object Model
* @return
* @return null.
*/
public static String resumeInterruptedRequest(Map objectModel)
{

View File

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

View File

@@ -51,8 +51,6 @@ public class WingContext
/**
* Return the current transformer's name.
*
* @return
*/
public String getComponentName()
{
@@ -120,7 +118,6 @@ public class WingContext
* @param subName
* An additional name to the original name to further identify it
* in cases when just the name alone does not accomplish this.
* @return
*/
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
* @param attributes
* The element's attributes
* @return
* @return the matching Division, or null.
*/
public WingMergeableElement mergeChild(String namespace, String localName,
String qName, Attributes attributes) throws SAXException,
WingException
String qName, Attributes attributes)
throws SAXException, WingException
{
Division found = null;
for (Division candidate : divisions)

View File

@@ -60,7 +60,7 @@ public class Figure extends TextContainer implements StructuralElement
*
* @param context
* (Required) The context this element is contained in
* @param Source
* @param source
* (Required) The figure's image source.
* @param target
* (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
* (May be null) The target reference for the image if the image
* is to operate as a link.
* @title
* @param title
* @param rend
* (May be null) a rendering hint used to override the default
* display of the element.
@@ -238,47 +238,7 @@ public abstract class RichTextContainer extends TextContainer
contents.add(figure);
return figure;
}
/**
* 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.
@@ -466,7 +426,7 @@ public abstract class RichTextContainer extends TextContainer
* the element from its siblings within an interactive division.
* This is the name of the field use when data is submitted back
* to the server.
* @return
* @return a new hidden field.
*/
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
*
* @param action
* @param behavior
* javascript to instantiate on @evtbehavior
*/
public void setEvtBehavior(String behavior) {