Author: chathura
Date: Wed Feb 6 23:02:49 2008
New Revision: 13376
Log:
Adding javadocs to all exposed classes and interfaces.
Modified:
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/Comment.java
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/Tag.java
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/TaggedResourcePath.java
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/MediaTypeHandler.java
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/queries/QueryProcessor.java
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/urlhandlers/URLHandler.java
branches/registry/1_0/modules/webapps/src/main/java/org/wso2/registry/web/utils/UserUtil.java
Modified:
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/Comment.java
==============================================================================
---
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/Comment.java
(original)
+++
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/Comment.java
Wed Feb 6 23:02:49 2008
@@ -21,16 +21,38 @@
import java.util.Date;
+/**
+ * Represents comments and its metadata. Note that only the Comment.text field
needs to be filled
+ * when adding new comments. All other attributes are ignored and they are
filled with appropriate
+ * values for the current context. Therefore, when contructing an instance of
this class outside
+ * the Regisrty impl, it is recommended to use new Comment("my comment text")
constructor.
+ */
public class Comment {
- /** Path of the comment. Each comment has a path in the form
/projects/esb/config.xml;comments:12 */
+ /**
+ * Path of the comment. Each comment has a path in the form
/projects/esb/config.xml;comments:12
+ *
+ */
private transient String commentPath;
+ /**
+ * Comment text. This may contain any string inclusing HTML segments.
+ */
private transient String text;
+
+ /**
+ * Username of the user who added this comment.
+ */
private transient String user;
+
+ /**
+ * Date and time at which this comment is added.
+ */
private transient Date time;
- /** Path of the resource on which this comment is made. */
+ /**
+ * Path of the resource on which this comment is made.
+ */
private transient String resourcePath;
public Comment() {
Modified:
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/Tag.java
==============================================================================
--- branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/Tag.java
(original)
+++ branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/Tag.java
Wed Feb 6 23:02:49 2008
@@ -16,10 +16,29 @@
package org.wso2.registry;
+/**
+ * Represents a tag and its metadata. Instances of this class is returned from
the Registry
+ * interface, when tags for a given resource path is queried.
+ */
public class Tag {
+ /**
+ * Name of the tag. This may contain spaces.
+ */
private String tagName;
+
+ /**
+ * Number of taggings done using this tag. If a Tag object is returned as
a result of a
+ * Registry.getTags(String resourcePath) method, then this contains the
number of users who
+ * tagged the given resource using this tag.
+ */
private long tagCount;
+
+ /**
+ * Tags are categorized according the tag count. Then the category
indicates the validity
+ * of the tag. See setTagCount(...) method to understand how category is
calculated based on
+ * the tag count. This is used in the WSO2 Registry web UI to generate the
tag cloud.
+ */
private int category = 1;
public String getTagName() {
Modified:
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/TaggedResourcePath.java
==============================================================================
---
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/TaggedResourcePath.java
(original)
+++
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/TaggedResourcePath.java
Wed Feb 6 23:02:49 2008
@@ -19,10 +19,30 @@
import java.util.HashMap;
import java.util.Map;
+/**
+ * Contains a resource path and tagging details of tags on that resource.
Instances of this class is
+ * returned from the tag searches. Tag searches may be performed on multiple
tags. This class
+ * only contains the tag counts for the tags that included in the search. e.g.
If the search is for
+ * tags java, jsp and programming and if the resource /books/computer/Java Web
Development matches
+ * the search, counts are only contained for the tags java, jsp and
programming although that
+ * resource may have many other tags like internet, web, servlets.
+ */
public class TaggedResourcePath {
+ /**
+ * Resource path for which the tag counts are associated.
+ */
private String resourcePath;
+
+ /**
+ * Tag counts in the form tag -> count
+ * Where tag is a string and count is a long.
+ */
private Map tagCounts = new HashMap();
+
+ /**
+ * This is deprecated. Included only for backward compatibility.
+ */
private long tagCount;
public String getResourcePath() {
Modified:
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/MediaTypeHandler.java
==============================================================================
---
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/MediaTypeHandler.java
(original)
+++
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/mediatypes/MediaTypeHandler.java
Wed Feb 6 23:02:49 2008
@@ -25,7 +25,7 @@
import javax.sql.DataSource;
/**
- * Base class of all media type handlers. It defines the three basic methods
to be implemented by
+ * Base class of all media type handlers. It defines the six basic methods to
be implemented by
* all media type handlers. This is initialized with the objects required for
handling media type
* specific operations, so that extending media type handlers can easily
access them. One such
* object is the instance of the MediaTypeManager.
@@ -59,7 +59,6 @@
protected MediaTypeManager mediaTypeManager;
/** ResourceDAO for directly accessing resources. */
- //protected ResourceDAO resourceDAO = new ResourceDAO();
protected VersionedResourceDAO resourceDAO = new VersionedResourceDAO();
/** Some common authorization tasks are implemented in this util. */
@@ -78,14 +77,18 @@
* Processes the GET action of the media type.
*
* @param path Path of the resource
+ *
* @param rawArtifact Raw artifact at the given path, which is retrieved
directly from the
* database. This can be used by media type handlers,
which need to alter
* contents of the raw artifact, etc.
+ *
* @return Resource instance if the media type handler processes the GET
action. If resource is
* returned it should perform all tasks to fulfill the GET
request. Returns null if the
* media type handler does not process the GET action. If null is
returned, get(...)
* method of the DefaultMediaTypeHandler will be invoked.
- * @throws RegistryException
+ *
+ * @throws RegistryException If the media type handler is supposed to
handle the get on the
+ * media type and if the get fails due a handler specific error
*/
public abstract Resource get(String path, Resource rawArtifact) throws
RegistryException;
@@ -98,7 +101,9 @@
* should perform all tasks to fulfill the PUT request. Returns
false if the media type
* handler does not process the PUT action. If false is returned,
put(...) method of the
* DefaultMediaTypeHandler will be invoked.
- * @throws RegistryException
+ *
+ * @throws RegistryException If the media type handler is supposed to
handle the put on the
+ * media type and if the put fails due a handler specific error
*/
public abstract boolean put(String path, Resource resource) throws
RegistryException;
@@ -112,7 +117,9 @@
* should perform all tasks to fulfill the import request. Returns
false if the media
* type handler does not process the import action. If false is
returned,
* importResource(...) method of the DefaultMediaTypeHandler will
be invoked.
- * @throws RegistryException
+ *
+ * @throws RegistryException If the media type handler is supposed to
handle the import on the
+ * media type and if the import fails due a handler specific error
*/
public abstract String importResource(String path, String sourceURL,
Resource metadata)
throws RegistryException;
@@ -125,7 +132,9 @@
* should perform all tasks to fulfill the DELETE request. Returns
false if the media
* type handler does not process the DELETE action. If false is
returned, delete(...)
* method of the DefaultMediaTypeHandler will be invoked.
- * @throws RegistryException
+ *
+ * @throws RegistryException If the media type handler is supposed to
handle the delete on the
+ * media type and if the delete fails due a handler specific error
*/
public abstract boolean delete(String path) throws RegistryException;
@@ -137,7 +146,9 @@
* @param resource Child resource
* @return True if the child resource is allowed to be added. False if the
child resource is
* rejected.
- * @throws RegistryException
+ *
+ * @throws RegistryException If the media type handler is supposed to
handle the putChild on the
+ * media type and if the putChild fails due a handler specific error
*/
public abstract boolean putChild(String childPath, Resource resource)
throws RegistryException;
@@ -149,7 +160,9 @@
* @param sourceURL URL to import child resource content
* @return True if the child resource is allowed to be imported. False if
the child resource is
* rejected.
- * @throws RegistryException
+ *
+ * @throws RegistryException If the media type handler is supposed to
handle the importChild
+ * on the media type and if the importChild fails due a handler specific
error
*/
public abstract boolean importChild(String childPath, String sourceURL)
throws RegistryException;
Modified:
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/queries/QueryProcessor.java
==============================================================================
---
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/queries/QueryProcessor.java
(original)
+++
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/queries/QueryProcessor.java
Wed Feb 6 23:02:49 2008
@@ -32,7 +32,16 @@
*/
public abstract class QueryProcessor {
+ /**
+ * Datasource of the registry database. URL handlers can access this to
contruct resources
+ * by combining various tables (e.g. comments).
+ */
protected DataSource dataSource;
+
+ /**
+ * Default realm of the user manager used in the registry. This can be
used by the URL handler
+ * implementations to check authorizations on resources.
+ */
protected Realm realm;
public QueryProcessor(DataSource dataSource, Realm realm) {
Modified:
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/urlhandlers/URLHandler.java
==============================================================================
---
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/urlhandlers/URLHandler.java
(original)
+++
branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/jdbc/urlhandlers/URLHandler.java
Wed Feb 6 23:02:49 2008
@@ -36,7 +36,16 @@
*/
public abstract class URLHandler {
+ /**
+ * Datasource of the registry database. URL handlers can access this to
contruct resources
+ * by combining various tables (e.g. comments).
+ */
protected DataSource dataSource;
+
+ /**
+ * Default realm of the user manager used in the registry. This can be
used by the URL handler
+ * implementations to check authorizations on resources.
+ */
protected Realm realm;
public URLHandler(DataSource dataSource, Realm realm) {
Modified:
branches/registry/1_0/modules/webapps/src/main/java/org/wso2/registry/web/utils/UserUtil.java
==============================================================================
---
branches/registry/1_0/modules/webapps/src/main/java/org/wso2/registry/web/utils/UserUtil.java
(original)
+++
branches/registry/1_0/modules/webapps/src/main/java/org/wso2/registry/web/utils/UserUtil.java
Wed Feb 6 23:02:49 2008
@@ -165,7 +165,7 @@
request.getSession().setAttribute(UIConstants.USER_BEAN,
userDetailsAction);
} catch (Exception e) {
-
+ request.getSession().setAttribute(UIConstants.ERROR_MESSAGE,
e.getMessage());
}
request.getRequestDispatcher(UIConstants.AJAX_USER_PASSWORD_JSP).forward(request,response);
}
_______________________________________________
Registry-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/registry-dev