Update of
/var/cvs/contributions/CMSContainer_Portlets/portlets-jforum/src/java/org/jahia/portlet/jforum
In directory
james.mmbase.org:/tmp/cvs-serv23342/portlets-jforum/src/java/org/jahia/portlet/jforum
Modified Files:
HttpServletResponseWrapper.java JForumSSO.java
ServletOutputStreamWrapper.java JForumPortletBridge.java
InstallAction.java ServletConfigWrapper.java
HttpSessionWrapper.java HttpServletRequestWrapper.java
PortalAutoConnectUserManager.java
Log Message:
CMSC-1091 improve code of JForum.
See also:
http://cvs.mmbase.org/viewcvs/contributions/CMSContainer_Portlets/portlets-jforum/src/java/org/jahia/portlet/jforum
See also: http://www.mmbase.org/jira/browse/CMSC-1091
Index: HttpServletResponseWrapper.java
===================================================================
RCS file:
/var/cvs/contributions/CMSContainer_Portlets/portlets-jforum/src/java/org/jahia/portlet/jforum/HttpServletResponseWrapper.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- HttpServletResponseWrapper.java 3 Jul 2008 11:15:15 -0000 1.2
+++ HttpServletResponseWrapper.java 15 Oct 2008 11:43:54 -0000 1.3
@@ -1,13 +1,16 @@
package org.jahia.portlet.jforum;
import javax.portlet.*;
+
import portlet.wrappers.ServletResponseWrapper;
+
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.Cookie;
import javax.servlet.ServletOutputStream;
import java.util.StringTokenizer;
import java.util.Enumeration;
+
import org.jahia.portlet.util.StringUtil;
import org.apache.log4j.Logger;
import net.jforum.util.preferences.SystemGlobals;
@@ -17,19 +20,19 @@
* HttpServletResponseWrapper that emulates a "jforum-servlet" response from
* a RenderResponse
*
- [EMAIL PROTECTED] Khaled TLILI
+ * @author Khaled TLILI
*/
public class HttpServletResponseWrapper extends ServletResponseWrapper
implements HttpServletResponse {
private RenderResponse pResponse;
private String redirect = null;
- private ServletOutputStream servletOutputStream ;
+ private ServletOutputStream servletOutputStream;
private static Logger logger =
Logger.getLogger(HttpServletResponseWrapper.class);
/**
* Constructor for the HttpServletResponseWrapper object
*
- [EMAIL PROTECTED] pResponse Description of Parameter
+ * @param pResponse Description of Parameter
*/
public HttpServletResponseWrapper(RenderResponse pResponse) {
super(pResponse);
@@ -38,14 +41,12 @@
}
-
-
/**
* Sets a response header with the given name and date-value.
*
- [EMAIL PROTECTED] name the name of the header to set
- [EMAIL PROTECTED] date the assigned date value
- [EMAIL PROTECTED] Implement this
javax.servlet.http.HttpServletResponse method
+ * @param name the name of the header to set
+ * @param date the assigned date value
+ * @todo Implement this javax.servlet.http.HttpServletResponse method
*/
public void setDateHeader(String name, long date) {
}
@@ -54,10 +55,10 @@
/**
* Sets a response header with the given name and value.
*
- [EMAIL PROTECTED] name the name of the header
- [EMAIL PROTECTED] value the header value If it contains octet
string, it should be
+ * @param name the name of the header
+ * @param value the header value If it contains octet string, it should be
* encoded according to RFC 2047
(http://www.ietf.org/rfc/rfc2047.txt)
- [EMAIL PROTECTED] Implement this
javax.servlet.http.HttpServletResponse method
+ * @todo Implement this javax.servlet.http.HttpServletResponse method
*/
public void setHeader(String name, String value) {
}
@@ -66,20 +67,20 @@
/**
* Sets a response header with the given name and integer value.
*
- [EMAIL PROTECTED] name the name of the header
- [EMAIL PROTECTED] value the assigned integer value
- [EMAIL PROTECTED] Implement this
javax.servlet.http.HttpServletResponse method
+ * @param name the name of the header
+ * @param value the assigned integer value
+ * @todo Implement this javax.servlet.http.HttpServletResponse method
*/
public void setIntHeader(String name, int value) {
}
/**
- [EMAIL PROTECTED] sc the status code
- [EMAIL PROTECTED] sm the status message
- [EMAIL PROTECTED] As of version 2.1, due to ambiguous meaning of
the message
+ * @param sc the status code
+ * @param sm the status message
+ * @todo Implement this javax.servlet.http.HttpServletResponse method
+ * @deprecated As of version 2.1, due to ambiguous meaning of the message
* parameter.
- [EMAIL PROTECTED] Implement this
javax.servlet.http.HttpServletResponse method
*/
public void setStatus(int sc, String sm) {
}
@@ -88,8 +89,8 @@
/**
* Sets the status code for this response.
*
- [EMAIL PROTECTED] sc the status code
- [EMAIL PROTECTED] Implement this
javax.servlet.http.HttpServletResponse method
+ * @param sc the status code
+ * @todo Implement this javax.servlet.http.HttpServletResponse method
*/
public void setStatus(int sc) {
}
@@ -98,7 +99,7 @@
/**
* Gets the Redirect attribute of the HttpServletResponseWrapper object
*
- [EMAIL PROTECTED] The Redirect value
+ * @return The Redirect value
*/
public boolean isRedirect() {
return redirect != null;
@@ -109,7 +110,7 @@
* Gets the EncodedRedirect attribute of the HttpServletResponseWrapper
* object
*
- [EMAIL PROTECTED] The EncodedRedirect value
+ * @return The EncodedRedirect value
*/
public String getEncodedRedirect() {
return encodeURL(redirect);
@@ -119,8 +120,8 @@
/**
* Gets the OutputStream attribute of the HttpServletResponseWrapper
object
*
- [EMAIL PROTECTED] The OutputStream value
- [EMAIL PROTECTED] IOException Description of Exception
+ * @return The OutputStream value
+ * @throws IOException Description of Exception
*/
public ServletOutputStream getOutputStream() throws IOException {
return servletOutputStream;
@@ -130,13 +131,12 @@
/**
* Description of the Method
*
- [EMAIL PROTECTED] url Description of Parameter
- [EMAIL PROTECTED] Description of the Returned Value
+ * @param url Description of Parameter
+ * @return Description of the Returned Value
*/
public String encodeURL(String url) {
logger.debug("Encode url: " + url);
-
// replace special graphe before parsing
url = StringUtil.replaceSpecialGraphics(url);
//remove anchor
@@ -145,8 +145,7 @@
Enumeration e = new StringTokenizer(url, "#");
url = (String) e.nextElement();
logger.debug("Found anchor: " + e.nextElement());
- }
- else {
+ } else {
logger.debug("No anchor in " + url);
}
@@ -159,7 +158,7 @@
logger.debug("Found uri: " + uri);
//add extension if not exist
-
if(!uri.endsWith(SystemGlobals.getValue(ConfigKeys.SERVLET_EXTENSION))){
+ if (!uri.endsWith(SystemGlobals.getValue(ConfigKeys.SERVLET_EXTENSION)))
{
uri = uri +
SystemGlobals.getValue(ConfigKeys.SERVLET_EXTENSION);
}
// set requestUri
@@ -190,8 +189,7 @@
logger.debug("Found param, " + name + " whith
value " + value);
}
- }
- else {
+ } else {
logger.debug("There is no query string");
}
@@ -202,7 +200,7 @@
/**
* Description of the Method
*
- [EMAIL PROTECTED] url Description of Parameter
+ * @param url Description of Parameter
*/
public void sendRedirect(String url) {
logger.debug("call redirect, new url is: " + url);
@@ -213,8 +211,8 @@
/**
* Adds the specified cookie to the response.
*
- [EMAIL PROTECTED] cookie the Cookie to return to the client
- [EMAIL PROTECTED] Implement this
javax.servlet.http.HttpServletResponse
+ * @param cookie the Cookie to return to the client
+ * @todo Implement this javax.servlet.http.HttpServletResponse
* method
*/
public void addCookie(Cookie cookie) {
@@ -224,9 +222,9 @@
/**
* Adds a response header with the given name and date-value.
*
- [EMAIL PROTECTED] name the name of the header to set
- [EMAIL PROTECTED] date the additional date value
- [EMAIL PROTECTED] Implement this
javax.servlet.http.HttpServletResponse method
+ * @param name the name of the header to set
+ * @param date the additional date value
+ * @todo Implement this javax.servlet.http.HttpServletResponse method
*/
public void addDateHeader(String name, long date) {
}
@@ -235,11 +233,11 @@
/**
* Adds a response header with the given name and value.
*
- [EMAIL PROTECTED] name the name of the header
- [EMAIL PROTECTED] value the additional header value If it contains
octet string, it
+ * @param name the name of the header
+ * @param value the additional header value If it contains octet string, it
* should be encoded according to RFC 2047
* (http://www.ietf.org/rfc/rfc2047.txt)
- [EMAIL PROTECTED] Implement this
javax.servlet.http.HttpServletResponse method
+ * @todo Implement this javax.servlet.http.HttpServletResponse method
*/
public void addHeader(String name, String value) {
}
@@ -248,9 +246,9 @@
/**
* Adds a response header with the given name and integer value.
*
- [EMAIL PROTECTED] name the name of the header
- [EMAIL PROTECTED] value the assigned integer value
- [EMAIL PROTECTED] Implement this
javax.servlet.http.HttpServletResponse method
+ * @param name the name of the header
+ * @param value the assigned integer value
+ * @todo Implement this javax.servlet.http.HttpServletResponse method
*/
public void addIntHeader(String name, int value) {
}
@@ -260,10 +258,10 @@
* Returns a boolean indicating whether the named response header has
* already been set.
*
- [EMAIL PROTECTED] name the header name
- [EMAIL PROTECTED] <code>true</code> if the named response header
has already
+ * @param name the header name
+ * @return <code>true</code> if the named response header has already
* been set; <code>false</code> otherwise
- [EMAIL PROTECTED] Implement this
javax.servlet.http.HttpServletResponse method
+ * @todo Implement this javax.servlet.http.HttpServletResponse method
*/
public boolean containsHeader(String name) {
return false;
@@ -274,10 +272,10 @@
* Encodes the specified URL for use in the <code>sendRedirect</code>
method
* or, if encoding is not needed, returns the URL unchanged.
*
- [EMAIL PROTECTED] url the url to be encoded.
- [EMAIL PROTECTED] the encoded URL if encoding is needed; the
unchanged URL
+ * @param url the url to be encoded.
+ * @return the encoded URL if encoding is needed; the unchanged URL
* otherwise.
- [EMAIL PROTECTED] Implement this
javax.servlet.http.HttpServletResponse method
+ * @todo Implement this javax.servlet.http.HttpServletResponse method
*/
public String encodeRedirectURL(String url) {
return url;
@@ -285,10 +283,10 @@
/**
- [EMAIL PROTECTED] url the url to be encoded.
- [EMAIL PROTECTED] the encoded URL if encoding is needed; the
unchanged URL
+ * @param url the url to be encoded.
+ * @return the encoded URL if encoding is needed; the unchanged URL
* otherwise.
- [EMAIL PROTECTED] Implement this
javax.servlet.http.HttpServletResponse method
+ * @todo Implement this javax.servlet.http.HttpServletResponse method
*/
public String encodeRedirectUrl(String url) {
return url;
@@ -296,10 +294,10 @@
/**
- [EMAIL PROTECTED] url the url to be encoded.
- [EMAIL PROTECTED] the encoded URL if encoding is needed; the
unchanged URL
+ * @param url the url to be encoded.
+ * @return the encoded URL if encoding is needed; the unchanged URL
* otherwise.
- [EMAIL PROTECTED] Implement this
javax.servlet.http.HttpServletResponse method
+ * @todo Implement this javax.servlet.http.HttpServletResponse method
*/
public String encodeUrl(String url) {
return encodeURL(url);
@@ -309,10 +307,10 @@
/**
* Sends an error response to the client using the specified status.
*
- [EMAIL PROTECTED] sc the error status code
- [EMAIL PROTECTED] msg the descriptive message
- [EMAIL PROTECTED] IOException If an input or output exception occurs
- [EMAIL PROTECTED] Implement this
javax.servlet.http.HttpServletResponse
+ * @param sc the error status code
+ * @param msg the descriptive message
+ * @throws IOException If an input or output exception occurs
+ * @todo Implement this javax.servlet.http.HttpServletResponse
* method
*/
public void sendError(int sc, String msg) throws IOException {
@@ -323,9 +321,9 @@
* Sends an error response to the client using the specified status
code and
* clearing the buffer.
*
- [EMAIL PROTECTED] sc the error status code
- [EMAIL PROTECTED] IOException If an input or output exception occurs
- [EMAIL PROTECTED] Implement this
javax.servlet.http.HttpServletResponse
+ * @param sc the error status code
+ * @throws IOException If an input or output exception occurs
+ * @todo Implement this javax.servlet.http.HttpServletResponse
* method
*/
public void sendError(int sc) throws IOException {
Index: JForumSSO.java
===================================================================
RCS file:
/var/cvs/contributions/CMSContainer_Portlets/portlets-jforum/src/java/org/jahia/portlet/jforum/JForumSSO.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- JForumSSO.java 9 Jul 2008 04:25:30 -0000 1.1
+++ JForumSSO.java 15 Oct 2008 11:43:54 -0000 1.2
@@ -18,7 +18,7 @@
return user;
}
- public boolean isSessionValid(UserSession userSession,RequestContext
requestContext) {
+ public boolean isSessionValid(UserSession userSession, RequestContext
requestContext) {
String remoteUser = null;
if (requestContext.getSessionContext().getAttribute("username") != null)
@@ -29,8 +29,8 @@
return false;
// user has since logged in
- }
- else if (remoteUser != null && userSession.getUserId() ==
SystemGlobals.getIntValue(ConfigKeys.ANONYMOUS_USER_ID)) {
+ } else
+ if (remoteUser != null && userSession.getUserId() ==
SystemGlobals.getIntValue(ConfigKeys.ANONYMOUS_USER_ID)) {
return false;
// user has changed user
Index: ServletOutputStreamWrapper.java
===================================================================
RCS file:
/var/cvs/contributions/CMSContainer_Portlets/portlets-jforum/src/java/org/jahia/portlet/jforum/ServletOutputStreamWrapper.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- ServletOutputStreamWrapper.java 17 Jan 2008 08:04:51 -0000 1.1
+++ ServletOutputStreamWrapper.java 15 Oct 2008 11:43:54 -0000 1.2
@@ -8,7 +8,7 @@
/**
* Outputstream Wrapper
*
- [EMAIL PROTECTED] Tlili Khaled
+ * @author Tlili Khaled
*/
public class ServletOutputStreamWrapper extends ServletOutputStream {
private ArrayList byteList = new ArrayList();
@@ -17,8 +17,8 @@
/**
* Gets the AsByteArray attribute of the ServletOutputStreamWrapper
object
*
- [EMAIL PROTECTED] The AsByteArray value
- [EMAIL PROTECTED] IOException Description of Exception
+ * @return The AsByteArray value
+ * @throws IOException Description of Exception
*/
public byte[] getAsByteArray() throws IOException {
byte[] bb = new byte[byteList.size()];
@@ -33,10 +33,10 @@
/**
* Writes the specified byte to this output stream.
*
- [EMAIL PROTECTED] b the <code>byte</code>.
- [EMAIL PROTECTED] IOException if an I/O error occurs. In particular,
an <code>IOException</code>
+ * @param b the <code>byte</code>.
+ * @throws IOException if an I/O error occurs. In particular, an
<code>IOException</code>
* may be thrown if the output stream has been closed.
- [EMAIL PROTECTED] Implement this java.io.OutputStream
method
+ * @todo Implement this java.io.OutputStream method
*/
public void write(int b) throws IOException {
byteList.add(new Byte(String.valueOf(b)));
Index: JForumPortletBridge.java
===================================================================
RCS file:
/var/cvs/contributions/CMSContainer_Portlets/portlets-jforum/src/java/org/jahia/portlet/jforum/JForumPortletBridge.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- JForumPortletBridge.java 3 Jul 2008 11:15:15 -0000 1.6
+++ JForumPortletBridge.java 15 Oct 2008 11:43:54 -0000 1.7
@@ -130,7 +130,7 @@
while (paramsName.hasMoreElements()) {
String name = (String) paramsName.nextElement();
String[] values = request.getParameterValues(name);
- response.setRenderParameter(name,values);
+ response.setRenderParameter(name, values);
}
String postBody = "";
@@ -337,14 +337,14 @@
if ("message".equals(item.getFieldName())) {
postBody = item.getString(encoding);
-
actionResponse.setRenderParameter(item.getFieldName(),"");
+ actionResponse.setRenderParameter(item.getFieldName(), "");
} else {
String fieldName = item.getFieldName();
String fieldValue = item.getString();
- if(StringUtils.isNotEmpty(fieldValue)) {
- if(fieldValue.indexOf("#") == -1) {
+ if (StringUtils.isNotEmpty(fieldValue)) {
+ if (fieldValue.indexOf("#") == -1) {
actionResponse.setRenderParameter(fieldName,
fieldValue);
}
}
@@ -474,16 +474,16 @@
if (!isAlreadyInstalled()) {
- Locale locale =
(Locale)(request.getPortletSession().getAttribute("javax.servlet.jsp.jstl.fmt.locale.session"));
+ Locale locale = (Locale)
(request.getPortletSession().getAttribute("javax.servlet.jsp.jstl.fmt.locale.session"));
String language = "en_US";
- String charset =
(String)request.getPortletSession().getAttribute("javax.servlet.jsp.jstl.fmt.request.charset");
+ String charset = (String)
request.getPortletSession().getAttribute("javax.servlet.jsp.jstl.fmt.request.charset");
- if(!locale.getLanguage().equals("en") &&
StringUtils.isEmpty(locale.getCountry())) {
+ if (!locale.getLanguage().equals("en") &&
StringUtils.isEmpty(locale.getCountry())) {
locale = Locale.getDefault();
- language = locale.getLanguage()+"_"+locale.getCountry();
+ language = locale.getLanguage() + "_" + locale.getCountry();
}
- install(respW, reqW,language,charset);
- PortletConfig config =
(PortletConfig)getPortletContext().getAttribute("config");
+ install(respW, reqW, language, charset);
+ PortletConfig config = (PortletConfig)
getPortletContext().getAttribute("config");
JForum instance = new JForum();
try {
instance.init(new ServletConfigWrapper(config));
@@ -492,7 +492,7 @@
ex.printStackTrace();
}
- getPortletContext().setAttribute(JFORUM_KEY,instance);
+ getPortletContext().setAttribute(JFORUM_KEY, instance);
getPortletContext().removeAttribute("config");
}
// get servlet object
@@ -524,18 +524,18 @@
}
- private void install(HttpServletResponseWrapper respW,
HttpServletRequestWrapper reqW,String language,String charset) {
+ private void install(HttpServletResponseWrapper respW,
HttpServletRequestWrapper reqW, String language, String charset) {
reqW.setAttribute("language", language);
- reqW.setAttribute("database",
StringUtils.isEmpty(SystemGlobals.getValue("database.driver.name"))?"mysql":SystemGlobals.getValue("database.driver.name"));
- reqW.setAttribute("dbencoding",
StringUtils.isEmpty(charset)?"utf-8":charset);
+ reqW.setAttribute("database",
StringUtils.isEmpty(SystemGlobals.getValue("database.driver.name")) ? "mysql" :
SystemGlobals.getValue("database.driver.name"));
+ reqW.setAttribute("dbencoding", StringUtils.isEmpty(charset) ? "utf-8" :
charset);
reqW.setAttribute("dbencoding_other", "");
reqW.setAttribute("use_pool", "true");
reqW.setAttribute("forum_link", "");
-
reqW.setAttribute("admin_pass1",StringUtils.isEmpty(SystemGlobals.getValue("admin.password"))?"admin2k":SystemGlobals.getValue("admin.password"));
+ reqW.setAttribute("admin_pass1",
StringUtils.isEmpty(SystemGlobals.getValue("admin.password")) ? "admin2k" :
SystemGlobals.getValue("admin.password"));
reqW.setAttribute("db_connection_type", "ds");
reqW.setAttribute("site_link", "");
- reqW.setAttribute("dbdatasource",
StringUtils.isEmpty(SystemGlobals.getValue("database.dbdatasource"))?"java:comp/env/jdbc/jforum":SystemGlobals.getValue("database.dbdatasource"));
+ reqW.setAttribute("dbdatasource",
StringUtils.isEmpty(SystemGlobals.getValue("database.dbdatasource")) ?
"java:comp/env/jdbc/jforum" : SystemGlobals.getValue("database.dbdatasource"));
try {
net.jforum.context.RequestContext requestContext = new
WebRequestContext(reqW);
ResponseContext responseContext = new WebResponseContext(respW);
@@ -548,7 +548,7 @@
false
);
JForumExecutionContext ex = JForumExecutionContext.get();
- ex.setForumContext( forumContext );
+ ex.setForumContext(forumContext);
JForumExecutionContext.set(ex);
@@ -577,7 +577,7 @@
command.finished();
}
catch (IOException e) {
- logger.debug("install io error: " +e.getMessage());
+ logger.debug("install io error: " + e.getMessage());
}
catch (Exception e) {
logger.debug("install error: " + e.getMessage());
Index: InstallAction.java
===================================================================
RCS file:
/var/cvs/contributions/CMSContainer_Portlets/portlets-jforum/src/java/org/jahia/portlet/jforum/InstallAction.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- InstallAction.java 3 Jul 2008 11:15:15 -0000 1.1
+++ InstallAction.java 15 Oct 2008 11:43:54 -0000 1.2
@@ -40,18 +40,19 @@
private static Logger logger = Logger.getLogger(InstallAction.class);
- public InstallAction(){
+ public InstallAction() {
}
- public InstallAction(RequestContext request,SimpleHash context) {
+ public InstallAction(RequestContext request, SimpleHash context) {
this.request = request;
this.context = context;
}
+
/**
* Description of the Method
*
- [EMAIL PROTECTED] Exception Description of Exception
+ * @throws Exception Description of Exception
*/
public void welcome() throws Exception {
this.checkLanguage();
@@ -75,7 +76,7 @@
/**
* Description of the Method
*
- [EMAIL PROTECTED] Exception Description of Exception
+ * @throws Exception Description of Exception
*/
public void doInstall() throws Exception {
Connection conn = null;
@@ -145,7 +146,7 @@
/**
* Description of the Method
*
- [EMAIL PROTECTED] Exception Description of Exception
+ * @throws Exception Description of Exception
*/
public void finished() throws Exception {
// this.setTemplateName(TemplateKeys.INSTALL_FINISHED);
@@ -173,7 +174,7 @@
/**
* Description of the Method
*
- [EMAIL PROTECTED] Exception Description of Exception
+ * @throws Exception Description of Exception
*/
public void checkInformation() throws Exception {
//this.setTemplateName(TemplateKeys.INSTALL_CHECK_INFO);
@@ -229,14 +230,12 @@
//this.context.put("moduleAction", "install_check_info.htm");
}
-
/**
[EMAIL PROTECTED] Exception
* @exception Exception Description of Exception
[EMAIL PROTECTED] net.jforum.Command#list()
*/
-
/**
[EMAIL PROTECTED] request Description of Parameter
[EMAIL PROTECTED] response Description of Parameter
@@ -249,8 +248,8 @@
/**
* Gets the FromSession attribute of the InstallAction object
*
- [EMAIL PROTECTED] key Description of Parameter
- [EMAIL PROTECTED] The FromSession value
+ * @param key Description of Parameter
+ * @return The FromSession value
*/
private String getFromSession(String key) {
return (String) this.request.getSessionContext().getAttribute(key);
@@ -260,7 +259,7 @@
/**
* Description of the Method
*
- [EMAIL PROTECTED] IOException Description of Exception
+ * @throws IOException Description of Exception
*/
private void checkLanguage() throws IOException {
String lang = this.request.getParameter("l");
@@ -353,7 +352,7 @@
/**
* Description of the Method
*
- [EMAIL PROTECTED] Exception Description of Exception
+ * @throws Exception Description of Exception
*/
private void configureSystemGlobals() throws Exception {
SystemGlobals.setValue(ConfigKeys.USER_HASH_SEQUENCE,
MD5.crypt(this.getFromSession("dbPassword")
@@ -372,9 +371,9 @@
/**
* Description of the Method
*
- [EMAIL PROTECTED] conn Description of Parameter
- [EMAIL PROTECTED] Description of the Returned Value
- [EMAIL PROTECTED] Exception Description of Exception
+ * @param conn Description of Parameter
+ * @return Description of the Returned Value
+ * @throws Exception Description of Exception
*/
private boolean importTablesData(Connection conn) throws Exception {
boolean status = true;
@@ -388,7 +387,7 @@
+ dbType
+ "/" + dbType + "_data_dump.sql");
- for (Iterator iter = statements.iterator(); iter.hasNext(); ) {
+ for (Iterator iter = statements.iterator(); iter.hasNext();) {
String query = (String) iter.next();
if (query == null || "".equals(query.trim())) {
@@ -403,11 +402,9 @@
if (query.startsWith("UPDATE") || query.startsWith("INSERT")
|| query.startsWith("SET")) {
s.executeUpdate(query);
- }
- else if (query.startsWith("SELECT")) {
+ } else if (query.startsWith("SELECT")) {
s.executeQuery(query);
- }
- else {
+ } else {
throw new Exception("Invalid query: " + query);
}
}
@@ -431,9 +428,9 @@
/**
* Description of the Method
*
- [EMAIL PROTECTED] conn Description of Parameter
- [EMAIL PROTECTED] Description of the Returned Value
- [EMAIL PROTECTED] Exception Description of Exception
+ * @param conn Description of Parameter
+ * @return Description of the Returned Value
+ * @throws Exception Description of Exception
*/
private boolean createTables(Connection conn) throws Exception {
logger.info("Going to create tables...");
@@ -441,8 +438,7 @@
if ("postgresql".equals(dbType)) {
this.dropPostgresqlTables(conn);
- }
- else if ("oracle".equals(dbType)) {
+ } else if ("oracle".equals(dbType)) {
this.dropOracleTables(conn);
}
@@ -453,7 +449,7 @@
+ dbType
+ "/" + dbType + "_db_struct.sql");
- for (Iterator iter = statements.iterator(); iter.hasNext(); ) {
+ for (Iterator iter = statements.iterator(); iter.hasNext();) {
String query = (String) iter.next();
if (query == null || "".equals(query.trim())) {
@@ -485,7 +481,7 @@
/**
* Description of the Method
*
- [EMAIL PROTECTED] conn Description of Parameter
+ * @param conn Description of Parameter
*/
private void dropOracleTables(Connection conn) {
Statement s = null;
@@ -494,7 +490,7 @@
List statements =
ParseDBStructFile.parse(SystemGlobals.getValue(ConfigKeys.CONFIG_DIR)
+ "/database/oracle/oracle_db_struct_drop.sql");
- for (Iterator iter = statements.iterator(); iter.hasNext(); ) {
+ for (Iterator iter = statements.iterator(); iter.hasNext();) {
try {
String query = (String) iter.next();
@@ -529,7 +525,7 @@
/**
* Description of the Method
*
- [EMAIL PROTECTED] Description of the Returned Value
+ * @return Description of the Returned Value
*/
private boolean checkForWritableDir() {
boolean canWriteToWebInf = this.canWriteToWebInf();
@@ -549,7 +545,7 @@
/**
* Description of the Method
*
- [EMAIL PROTECTED] Description of the Returned Value
+ * @return Description of the Returned Value
*/
private boolean canWriteToWebInf() {
return new File(SystemGlobals.getValue(ConfigKeys.CONFIG_DIR) +
"/modulesMapping.properties").canWrite();
@@ -559,7 +555,7 @@
/**
* Description of the Method
*
- [EMAIL PROTECTED] Description of the Returned Value
+ * @return Description of the Returned Value
*/
private boolean canWriteToIndex() {
return new File(SystemGlobals.getApplicationPath() +
"/index.htm").canWrite();
@@ -569,7 +565,7 @@
/**
* Description of the Method
*
- [EMAIL PROTECTED] Exception Description of Exception
+ * @throws Exception Description of Exception
*/
private void configureJDBCConnection() throws Exception {
String username = this.getFromSession("dbUser");
@@ -608,7 +604,7 @@
}
// Proceed to SystemGlobals / jforum-custom.conf configuration
- for (Enumeration e = p.keys(); e.hasMoreElements(); ) {
+ for (Enumeration e = p.keys(); e.hasMoreElements();) {
String key = (String) e.nextElement();
SystemGlobals.setValue(key, p.getProperty(key));
}
@@ -625,9 +621,9 @@
/**
* Description of the Method
*
- [EMAIL PROTECTED] from Description of Parameter
- [EMAIL PROTECTED] to Description of Parameter
- [EMAIL PROTECTED] Exception Description of Exception
+ * @param from Description of Parameter
+ * @param to Description of Parameter
+ * @throws Exception Description of Exception
*/
private void copyFile(String from, String to) throws Exception {
FileChannel source = new FileInputStream(new File(from)).getChannel();
@@ -642,8 +638,8 @@
/**
* Description of the Method
*
- [EMAIL PROTECTED] Description of the Returned Value
- [EMAIL PROTECTED] Exception Description of Exception
+ * @return Description of the Returned Value
+ * @throws Exception Description of Exception
*/
private Connection configureDatabase() throws Exception {
String database = this.getFromSession("database");
@@ -657,8 +653,7 @@
: "net.jforum.SimpleConnection";
this.configureJDBCConnection();
- }
- else {
+ } else {
isDs = true;
implementation = "net.jforum.DataSourceConnection";
SystemGlobals.setValue(ConfigKeys.DATABASE_DATASOURCE_NAME,
this.getFromSession("dbdatasource"));
@@ -682,8 +677,7 @@
if (!isDs) {
s = new SimpleConnection();
- }
- else {
+ } else {
s = new DataSourceConnection();
}
@@ -704,7 +698,7 @@
/**
* Description of the Method
*
- [EMAIL PROTECTED] Exception Description of Exception
+ * @throws Exception Description of Exception
*/
private void restartSystemGlobals() throws Exception {
String appPath = SystemGlobals.getApplicationPath();
@@ -720,9 +714,9 @@
/**
* Description of the Method
*
- [EMAIL PROTECTED] conn Description of Parameter
- [EMAIL PROTECTED] Description of the Returned Value
- [EMAIL PROTECTED] Exception Description of Exception
+ * @param conn Description of Parameter
+ * @return Description of the Returned Value
+ * @throws Exception Description of Exception
*/
private boolean updateAdminPassword(Connection conn) throws Exception {
logger.info("Going to update the administrator's password");
@@ -749,8 +743,8 @@
/**
* Description of the Method
*
- [EMAIL PROTECTED] conn Description of Parameter
- [EMAIL PROTECTED] Exception Description of Exception
+ * @param conn Description of Parameter
+ * @throws Exception Description of Exception
*/
private void dropPostgresqlTables(Connection conn) throws Exception {
String[] tables = {"jforum_banlist", "jforum_banlist_seq",
"jforum_categories",
@@ -793,8 +787,8 @@
* Adds a feature to the ToSessionAndContext attribute of the InstallAction
* object
*
- [EMAIL PROTECTED] key The feature to be added to the
ToSessionAndContext attribute
- [EMAIL PROTECTED] value The feature to be added to the
ToSessionAndContext attribute
+ * @param key The feature to be added to the ToSessionAndContext attribute
+ * @param value The feature to be added to the ToSessionAndContext attribute
*/
private void addToSessionAndContext(String key, String value) {
this.request.getSessionContext().setAttribute(key, value);
@@ -805,9 +799,9 @@
/**
* Description of the Method
*
- [EMAIL PROTECTED] value Description of Parameter
- [EMAIL PROTECTED] useDefault Description of Parameter
- [EMAIL PROTECTED] Description of the Returned Value
+ * @param value Description of Parameter
+ * @param useDefault Description of Parameter
+ * @return Description of the Returned Value
*/
private String notNullDefault(String value, String useDefault) {
if (value == null || value.trim().equals("")) {
@@ -816,6 +810,7 @@
return value;
}
+
public void ignoreAction() {
super.ignoreAction();
}
Index: ServletConfigWrapper.java
===================================================================
RCS file:
/var/cvs/contributions/CMSContainer_Portlets/portlets-jforum/src/java/org/jahia/portlet/jforum/ServletConfigWrapper.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- ServletConfigWrapper.java 17 Jan 2008 08:04:51 -0000 1.1
+++ ServletConfigWrapper.java 15 Oct 2008 11:43:54 -0000 1.2
@@ -4,10 +4,12 @@
import javax.servlet.*;
import javax.portlet.PortletConfig;
+
import portlet.wrappers.ServletContextWrapper;
public class ServletConfigWrapper implements ServletConfig {
private PortletConfig config;
+
public ServletConfigWrapper(PortletConfig config) {
this.config = config;
}
Index: HttpSessionWrapper.java
===================================================================
RCS file:
/var/cvs/contributions/CMSContainer_Portlets/portlets-jforum/src/java/org/jahia/portlet/jforum/HttpSessionWrapper.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- HttpSessionWrapper.java 17 Jan 2008 08:04:51 -0000 1.1
+++ HttpSessionWrapper.java 15 Oct 2008 11:43:54 -0000 1.2
@@ -25,7 +25,7 @@
return pSession.getAttribute(string, PortletSession.APPLICATION_SCOPE);
}
- public void removeAttribute(java.lang.String string){
- pSession.removeAttribute(string,PortletSession.APPLICATION_SCOPE);
+ public void removeAttribute(java.lang.String string) {
+ pSession.removeAttribute(string, PortletSession.APPLICATION_SCOPE);
}
}
Index: HttpServletRequestWrapper.java
===================================================================
RCS file:
/var/cvs/contributions/CMSContainer_Portlets/portlets-jforum/src/java/org/jahia/portlet/jforum/HttpServletRequestWrapper.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- HttpServletRequestWrapper.java 3 Jul 2008 11:15:15 -0000 1.3
+++ HttpServletRequestWrapper.java 15 Oct 2008 11:43:54 -0000 1.4
@@ -156,7 +156,7 @@
defaultHttpMethod = "GET";
}
s = defaultHttpMethod;
- logger.debug("Get default HttpMetod --> ["+s+"]");
+ logger.debug("Get default HttpMetod --> [" + s + "]");
}
return s;
}
@@ -177,7 +177,7 @@
* @return The Parameter value
*/
public String getParameter(String name) {
- if("message".equals(name)){
+ if ("message".equals(name)) {
return postBody;
}
String value = super.getParameter(name);
Index: PortalAutoConnectUserManager.java
===================================================================
RCS file:
/var/cvs/contributions/CMSContainer_Portlets/portlets-jforum/src/java/org/jahia/portlet/jforum/PortalAutoConnectUserManager.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- PortalAutoConnectUserManager.java 3 Jul 2008 11:15:15 -0000 1.2
+++ PortalAutoConnectUserManager.java 15 Oct 2008 11:43:54 -0000 1.3
@@ -10,7 +10,9 @@
import net.jforum.entities.User;
import net.jforum.util.MD5;
import org.jahia.portlet.util.StringUtil;
+
import java.security.Principal;
+
import net.jforum.entities.UserSession;
import net.jforum.SessionFacade;
import org.apache.log4j.Logger;
@@ -20,7 +22,7 @@
/**
* Manage Auto portal connect user to JForum
*
- [EMAIL PROTECTED] Khaled TLILI
+ * @author Khaled TLILI
*/
public class PortalAutoConnectUserManager {
@@ -40,8 +42,8 @@
/**
* Constructor for the PortalAutoConnectUserManager object
*
- [EMAIL PROTECTED] request Description of Parameter
- [EMAIL PROTECTED] response Description of Parameter
+ * @param request Description of Parameter
+ * @param response Description of Parameter
*/
public PortalAutoConnectUserManager(RenderRequest request,
RenderResponse response) {
this.request = request;
@@ -53,7 +55,7 @@
/**
* Gets the Registred attribute of the PortalAutoConnectUserManager
class
*
- [EMAIL PROTECTED] The Registred value
+ * @return The Registred value
*/
public boolean isRegistred() {
try {
@@ -72,7 +74,7 @@
* Gets the Administrator attribute of the PortalAutoConnectUserManager
* object
*
- [EMAIL PROTECTED] The Administrator value
+ * @return The Administrator value
*/
public boolean isAdministrator() {
return request.isUserInRole(ADMINISTRATOR_ROLE);
@@ -82,7 +84,7 @@
/**
* Gets the Redirect attribute of the PortalAutoConnectUserManager
object
*
- [EMAIL PROTECTED] The Redirect value
+ * @return The Redirect value
*/
public boolean isRedirect() {
return redirect;
@@ -93,7 +95,7 @@
* Gets the ValidConnection attribute of the
PortalAutoConnectUserManager
* object
*
- [EMAIL PROTECTED] The ValidConnection value
+ * @return The ValidConnection value
*/
public boolean isValidConnection() {
Principal user = request.getUserPrincipal();
@@ -110,8 +112,7 @@
if
(!connectPortalUser.equalsIgnoreCase(connectJForumUser)) {
return false;
}
- }
- else {
+ } else {
System.out.println("user session is null");
}
@@ -123,7 +124,7 @@
/**
* True if it's a not allowed user action. eg.g: logout for a portal
user
*
- [EMAIL PROTECTED] Description of the Returned Value
+ * @return Description of the Returned Value
*/
public boolean isNotAllowedAction() {
return isPortlatUser() && isLogoutUserAction();
@@ -133,7 +134,7 @@
/**
* Connect and register user thanks to jforum sso impl.
*
- [EMAIL PROTECTED] Description of the Returned Value
+ * @return Description of the Returned Value
*/
public boolean processSSO() {
// set pass to be used by sso
@@ -152,7 +153,7 @@
/**
* process auto actions (register, connect)
*
- [EMAIL PROTECTED] True if an auto action was performed
+ * @return True if an auto action was performed
*/
public boolean process() {
// validate lout action
@@ -180,29 +181,25 @@
doAutoRegisteUser();
doAutoConnectUser();
return true;
- }
- else {
+ } else {
logger.debug("Process: do not
register");
return false;
}
- }
- else {
+ } else {
// is already registred
if (hasToMakeLogin()) {
logger.debug("Process: do connect");
doAutoConnectUser();
return true;
- }
- else {
+ } else {
//already connected
logger.debug("Process: already
connected");
return false;
}
}
- }
- else {
+ } else {
logger.debug("User is not a portal user");
logger.debug("AutoConnect: do nothing");
// not a portal user --> do nothink
@@ -215,7 +212,7 @@
* Sets the JForumUsername attribute of the
PortalAutoConnectUserManager
* object
*
- [EMAIL PROTECTED] username The new JForumUsername value
+ * @param username The new JForumUsername value
*/
private void setJForumUsername(String username) {
request.getPortletSession().setAttribute("connectJForumUser",
username);
@@ -223,12 +220,11 @@
}
-
/**
* Gets the JForumUsername attribute of the
PortalAutoConnectUserManager
* object
*
- [EMAIL PROTECTED] The JForumUsername value
+ * @return The JForumUsername value
*/
private String getJForumUsername() {
String connectJForumUser = (String)
request.getPortletSession().getAttribute("connectJForumUser");
@@ -236,11 +232,10 @@
}
-
/**
* Gets the PortlatUser attribute of the PortalAutoConnectUserManager
object
*
- [EMAIL PROTECTED] The PortlatUser value
+ * @return The PortlatUser value
*/
private boolean isPortlatUser() {
String user = request.getRemoteUser();
@@ -253,12 +248,11 @@
}
-
/**
* Gets the PortalUserPassword attribute of the
PortalAutoConnectUserManager
* object
*
- [EMAIL PROTECTED] The PortalUserPassword value
+ * @return The PortalUserPassword value
*/
private String getPortalUserPassword() {
String username = request.getRemoteUser();
@@ -270,7 +264,7 @@
* Gets the RegisterUserAction attribute of the
PortalAutoConnectUserManager
* object
*
- [EMAIL PROTECTED] The RegisterUserAction value
+ * @return The RegisterUserAction value
*/
private boolean isRegisterUserAction() {
String moduleValue = request.getParameter("module");
@@ -288,7 +282,7 @@
* Gets the LoginUserAction attribute of the
PortalAutoConnectUserManager
* object
*
- [EMAIL PROTECTED] The LoginUserAction value
+ * @return The LoginUserAction value
*/
private boolean isLoginUserAction() {
String moduleValue = request.getParameter("module");
@@ -306,7 +300,7 @@
* Gets the LogoutUserAction attribute of the
PortalAutoConnectUserManager
* object
*
- [EMAIL PROTECTED] The LogoutUserAction value
+ * @return The LogoutUserAction value
*/
private boolean isLogoutUserAction() {
String moduleValue = request.getParameter("module");
@@ -329,7 +323,6 @@
}
-
/**
* Auto connect user
*/
@@ -359,7 +352,7 @@
/**
* Do a javascript redirection
*
- [EMAIL PROTECTED] redirectUrl Description of Parameter
+ * @param redirectUrl Description of Parameter
*/
private void doRedirection(String redirectUrl) {
String script = "<script> document.location='" + redirectUrl +
"'; </script>";
@@ -373,7 +366,6 @@
}
-
/**
* Auto register user
*/
@@ -439,7 +431,6 @@
}
-
/**
* Do auto logout
*/
@@ -468,7 +459,6 @@
}
-
/**
* Validate auto login
*/
@@ -488,7 +478,6 @@
}
-
/**
* Validate auto register
*/
@@ -497,11 +486,10 @@
}
-
/**
* True if autologin has to be performed
*
- [EMAIL PROTECTED] Description of the Returned Value
+ * @return Description of the Returned Value
*/
private boolean hasToMakeLogin() {
//return SessionFacade.isLogged();
@@ -509,8 +497,7 @@
Object o = session.getAttribute(AUTO_LOGIN_ATT);
if (o == null) {
return true;
- }
- else {
+ } else {
return false;
}
@@ -521,7 +508,7 @@
/**
* Check if there is a Jahia portal disconnection
*
- [EMAIL PROTECTED] True if there is a jahia portal disconnection
+ * @return True if there is a jahia portal disconnection
*/
private boolean hasToMakeLogout() {
return !isValidConnection() || checkJahiaEngineParam("logout");
@@ -531,8 +518,8 @@
/**
* Check value of jahia param engine
*
- [EMAIL PROTECTED] value value
- [EMAIL PROTECTED] true if jahai-egine-parma is value
+ * @param value value
+ * @return true if jahai-egine-parma is value
*/
private boolean checkJahiaEngineParam(String value) {
String engineParam = (String)
request.getParameter(JAHIA_PORTAL_ENGINE_PARAM);
@@ -543,11 +530,10 @@
}
-
/**
* True if autoregistering has to be performed
*
- [EMAIL PROTECTED] True if an autoRegistration is nested
+ * @return True if an autoRegistration is nested
*/
private boolean hasToMakeRegister() {
return !isRegisterUserAction();
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs