You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by ta...@apache.org on 2015/01/01 02:55:18 UTC
svn commit: r1648792 [1/2] - in
/portals/jetspeed-2/applications/jsaudit/trunk: ./
src/main/java/org/apache/jetspeed/portlets/audit/
src/main/java/org/apache/jetspeed/portlets/util/ src/main/resources/
src/webapp/WEB-INF/ src/webapp/WEB-INF/reports/
Author: taylor
Date: Thu Jan 1 01:55:17 2015
New Revision: 1648792
URL: http://svn.apache.org/r1648792
Log:
JS2-1197: Audit reports are now building and operational again
Added:
portals/jetspeed-2/applications/jsaudit/trunk/LICENSE
- copied unchanged from r1648781, portals/applications/webcontent/trunk/LICENSE
portals/jetspeed-2/applications/jsaudit/trunk/NOTICE
- copied unchanged from r1648452, portals/jetspeed-2/applications/j2-admin/trunk/NOTICE
portals/jetspeed-2/applications/jsaudit/trunk/src/main/resources/
portals/jetspeed-2/applications/jsaudit/trunk/src/main/resources/log4j.properties
- copied, changed from r1648448, portals/applications/rss/trunk/rss-war/src/main/webapp/WEB-INF/classes/log4j.properties
Modified:
portals/jetspeed-2/applications/jsaudit/trunk/pom.xml
portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/AdminActivityAbstractReport.java
portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/AdminActivityActionListener.java
portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/AuditDatabaseInteraction.java
portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/AuditPhaseListener.java
portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/AuditReportExcelExport.java
portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/DataScrollerActionListener.java
portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/PasswordResetActionListener.java
portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/PortalUserJetspeedInteraction.java
portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/PortalUserReportPortlet.java
portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/SSOFailedLoginActionListener.java
portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/SSOLockedUserActionListener.java
portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/SSOOptOutActionListener.java
portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/SSOSuccessLoginActionListener.java
portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/SSOSystemSecurityActionListener.java
portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/SSOUserStatusActionListener.java
portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/SystemSecurityActionListener.java
portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/SystemSecurityReport.java
portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/UserCreationActionListener.java
portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/UserDeletionActionListener.java
portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/UserStatusActionListener.java
portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/UserStatusReport.java
portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/util/SecurityHelper.java
portals/jetspeed-2/applications/jsaudit/trunk/src/webapp/WEB-INF/faces-config.xml
portals/jetspeed-2/applications/jsaudit/trunk/src/webapp/WEB-INF/reports/passwordResetReport.jsp
portals/jetspeed-2/applications/jsaudit/trunk/src/webapp/WEB-INF/web.xml
Modified: portals/jetspeed-2/applications/jsaudit/trunk/pom.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/jsaudit/trunk/pom.xml?rev=1648792&r1=1648791&r2=1648792&view=diff
==============================================================================
--- portals/jetspeed-2/applications/jsaudit/trunk/pom.xml (original)
+++ portals/jetspeed-2/applications/jsaudit/trunk/pom.xml Thu Jan 1 01:55:17 2015
@@ -22,22 +22,27 @@ limitations under the License.
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
- <prerequisites>
- <maven>2.0.4</maven>
- </prerequisites>
-
- <!-- POM Identification -->
<artifactId>jsaudit</artifactId>
<groupId>org.apache.portals.jetspeed-2</groupId>
- <version>2.2-SNAPSHOT</version>
+ <version>2.3.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>Jetspeed Audit Reports Portlet Application</name>
-
+
+ <parent>
+ <groupId>org.apache.portals</groupId>
+ <artifactId>portals-pom</artifactId>
+ <version>1.3</version>
+ </parent>
+
<properties>
- <jetspeed.version>2.1.3</jetspeed.version>
- <bridges.version>1.0.4</bridges.version>
- </properties>
+ <jetspeed.version>2.3.0-SNAPSHOT</jetspeed.version>
+ <bridges.version>2.1-SNAPSHOT</bridges.version>
+ <jsf.bridge.version>1.0.5-SNAPSHOT</jsf.bridge.version>
+ <slf4j.version>1.5.6</slf4j.version>
+ <myfaces.version>1.1.5</myfaces.version>
+ <tomahawk.version>1.1.6</tomahawk.version>
+ </properties>
<!-- Dependencies -->
@@ -56,13 +61,6 @@ limitations under the License.
<scope>provided</scope>
</dependency>
- <!-- Pluto Container -->
- <dependency>
- <groupId>org.apache.pluto</groupId>
- <artifactId>pluto</artifactId>
- <version>1.0.1</version>
- <scope>provided</scope>
- </dependency>
<dependency>
<groupId>org.apache.portals.bridges</groupId>
@@ -73,37 +71,38 @@ limitations under the License.
<dependency>
<groupId>org.apache.portals.bridges</groupId>
<artifactId>portals-bridges-jsf</artifactId>
- <version>${bridges.version}</version>
+ <version>${jsf.bridge.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.1.2</version>
+ <!--<scope>provided</scope>-->
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.3</version>
+ <artifactId>javax.servlet-api</artifactId>
+ <version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>myfaces</groupId>
+ <groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-impl</artifactId>
- <version>1.1.5</version>
+ <version>${myfaces.version}</version>
</dependency>
<dependency>
- <groupId>myfaces</groupId>
+ <groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-api</artifactId>
- <version>1.1.5</version>
+ <version>${myfaces.version}</version>
</dependency>
<dependency>
<groupId>org.apache.myfaces.tomahawk</groupId>
<artifactId>tomahawk</artifactId>
- <version>1.1.6</version>
+ <version>${tomahawk.version}</version>
</dependency>
<dependency>
- <groupId>portlet-api</groupId>
- <artifactId>portlet-api</artifactId>
+ <groupId>org.apache.portals</groupId>
+ <artifactId>portlet-api_2.0_spec</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
@@ -139,8 +138,25 @@ limitations under the License.
<artifactId>oro</artifactId>
<version>2.0.8</version>
<scope>runtime</scope>
- </dependency>
-
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>${slf4j.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
+ <version>${slf4j.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>javax.el-api</artifactId>
+ <version>2.2.5</version>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
@@ -154,6 +170,9 @@ limitations under the License.
<!-- Resources -->
<resources>
<resource>
+ <directory>${basedir}/src/main/resources</directory>
+ </resource>
+ <resource>
<directory>${basedir}/src/main/java</directory>
<excludes>
<exclude>**/*.java</exclude>
@@ -179,16 +198,37 @@ limitations under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
+ <version>3.1</version>
<configuration>
- <source>1.5</source>
- <target>1.5</target>
+ <source>1.7</source>
+ <target>1.7</target>
<debug>true</debug>
<showDeprecation>true</showDeprecation>
<showWarnings>true</showWarnings>
<optimize>false</optimize>
</configuration>
</plugin>
-
+ <!--
+ workaround for war processing of m-r-r-plugin causing the generated NOTICE and LICENSE file to be put under
+ WEB-INF/classes/META-INF
+ -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-remote-resources-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>process</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${project.build.directory}/${project.build.finalName}</outputDirectory>
+ <attached>false</attached>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+
</plugins>
</build>
Modified: portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/AdminActivityAbstractReport.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/AdminActivityAbstractReport.java?rev=1648792&r1=1648791&r2=1648792&view=diff
==============================================================================
--- portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/AdminActivityAbstractReport.java (original)
+++ portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/AdminActivityAbstractReport.java Thu Jan 1 01:55:17 2015
@@ -16,6 +16,11 @@
*/
package org.apache.jetspeed.portlets.audit;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.faces.context.FacesContext;
+import javax.portlet.PortletRequest;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
@@ -24,12 +29,10 @@ import java.util.Map;
import java.util.SortedMap;
import java.util.zip.DataFormatException;
-import javax.faces.context.FacesContext;
-
-import javax.portlet.PortletRequest;
-
public abstract class AdminActivityAbstractReport extends AdminActivityList implements AuditReport
{
+ protected Logger log = LoggerFactory.getLogger(AdminActivityAbstractReport.class);
+
PortalUserJetspeedInteraction jsi;
AuditDatabaseInteraction ai;
@@ -95,8 +98,7 @@ public abstract class AdminActivityAbstr
}
catch (DataFormatException e)
{
- System.err.println("Internal error while joining Jetspeed and Activity data; results will be invalid.");
- System.err.println("Received error: " + e.toString() );
+ log.error("Internal error while joining Jetspeed and Activity data; results will be invalid.", e);
}
}
// Make the activities user-readable.
@@ -113,7 +115,7 @@ public abstract class AdminActivityAbstr
}
else
{
- System.out.println( this.getClass().getName() + ".doView unknown request type " + ( contextRequest == null ? "null" : contextRequest.getClass().getName() ) );
+ log.error( this.getClass().getName() + ".doView unknown request type " + ( contextRequest == null ? "null" : contextRequest.getClass().getName() ) );
}
//Map requestAttributes = FacesContext.getCurrentInstance().getExternalContext().getRequestMap();
@@ -121,8 +123,7 @@ public abstract class AdminActivityAbstr
}
catch (Exception e)
{
- // TODO: throw your own exception wrappers
- e.printStackTrace();
+ log.error("Error in AdminActivity Report: " + e.getMessage(), e);
}
}
Modified: portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/AdminActivityActionListener.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/AdminActivityActionListener.java?rev=1648792&r1=1648791&r2=1648792&view=diff
==============================================================================
--- portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/AdminActivityActionListener.java (original)
+++ portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/AdminActivityActionListener.java Thu Jan 1 01:55:17 2015
@@ -16,7 +16,8 @@
*/
package org.apache.jetspeed.portlets.audit;
-import java.util.Map;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -24,11 +25,13 @@ import javax.faces.el.VariableResolver;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.ActionEvent;
import javax.faces.event.ActionListener;
+import java.util.Map;
public class AdminActivityActionListener implements ActionListener
{
Map searchParams = null;
-
+ protected Logger log = LoggerFactory.getLogger(AdminActivityActionListener.class);
+
public void processAction( ActionEvent event ) throws AbortProcessingException
{
FacesContext facesContext = FacesContext.getCurrentInstance();
@@ -39,7 +42,7 @@ public class AdminActivityActionListener
if ( form == null )
{
- System.out.println("Ack! Tried to resolve a variable that doesn't exist!");
+ log.error("Ack! Tried to resolve a variable that doesn't exist!");
return;
}
Modified: portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/AuditDatabaseInteraction.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/AuditDatabaseInteraction.java?rev=1648792&r1=1648791&r2=1648792&view=diff
==============================================================================
--- portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/AuditDatabaseInteraction.java (original)
+++ portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/AuditDatabaseInteraction.java Thu Jan 1 01:55:17 2015
@@ -16,25 +16,29 @@
*/
package org.apache.jetspeed.portlets.audit;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.sql.DataSource;
import java.io.IOException;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
+import java.util.HashMap;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-import java.util.HashMap;
import java.util.Properties;
import java.util.Set;
-import javax.sql.DataSource;
-
public abstract class AuditDatabaseInteraction
-{
+{
+ protected Logger log = LoggerFactory.getLogger(AuditDatabaseInteraction.class);
+
private LinkedList rows;
private Map table;
private DataSource ds;
@@ -72,7 +76,7 @@ public abstract class AuditDatabaseInter
}
catch (IOException e)
{
- e.printStackTrace();
+ log.error("IO Exception in Database init: " + e.getMessage(), e);
}
finally
{
@@ -84,8 +88,7 @@ public abstract class AuditDatabaseInter
}
catch (IOException e)
{
- // TODO Auto-generated catch block
- e.printStackTrace();
+ log.error("IO Exception in Database close: " + e.getMessage(), e);
}
}
}
@@ -132,9 +135,8 @@ public abstract class AuditDatabaseInter
{
rs.close();
}
- catch (Exception e)
- {
- System.err.println("Warning: could not close ResultSet for " + this.getClass().getName() + ".");
+ catch (Exception e) {
+ log.error("Warning: could not close ResultSet for " + this.getClass().getName() + ".", e);
}
}
if (stmt != null)
@@ -143,9 +145,8 @@ public abstract class AuditDatabaseInter
{
stmt.close();
}
- catch (Exception e)
- {
- System.err.println("Warning: could not close Statement for " + this.getClass().getName() + ".");
+ catch (Exception e) {
+ log.error("Warning: could not close Statement for " + this.getClass().getName() + ".", e);
}
}
if (conn != null)
@@ -154,9 +155,8 @@ public abstract class AuditDatabaseInter
{
conn.close();
}
- catch (Exception e)
- {
- System.err.println("Warning: could not close Connection for " + this.getClass().getName() + ".");
+ catch (Exception e) {
+ log.error("Warning: could not close Connection for " + this.getClass().getName() + ".", e);
}
}
}
@@ -226,7 +226,9 @@ public abstract class AuditDatabaseInter
}
}
}
- System.out.println( "SQL Statement: " + query.toString() );
+ if (log.isDebugEnabled()) {
+ log.debug("SQL Statement: " + query.toString());
+ }
return query.toString();
}
Modified: portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/AuditPhaseListener.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/AuditPhaseListener.java?rev=1648792&r1=1648791&r2=1648792&view=diff
==============================================================================
--- portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/AuditPhaseListener.java (original)
+++ portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/AuditPhaseListener.java Thu Jan 1 01:55:17 2015
@@ -16,35 +16,35 @@
*/
package org.apache.jetspeed.portlets.audit;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import javax.portlet.RenderResponse;
-import javax.portlet.RenderRequest;
-
+import org.apache.jetspeed.PortalReservedParameters;
+import org.apache.jetspeed.request.RequestContext;
import org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils;
-import javax.faces.context.FacesContext;
-import javax.faces.event.PhaseListener;
-import javax.faces.event.PhaseEvent;
-import javax.faces.event.PhaseId;
-
-import javax.faces.component.UIColumn;
-import javax.faces.component.UIComponent;
-import javax.faces.component.ValueHolder;
-import javax.faces.component.html.HtmlDataTable;
-
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
-import org.apache.jetspeed.request.RequestContext;
-import org.apache.jetspeed.PortalReservedParameters;
+import javax.faces.component.UIColumn;
+import javax.faces.component.UIComponent;
+import javax.faces.component.ValueHolder;
+import javax.faces.component.html.HtmlDataTable;
+import javax.faces.context.FacesContext;
+import javax.faces.event.PhaseEvent;
+import javax.faces.event.PhaseId;
+import javax.faces.event.PhaseListener;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
public class AuditPhaseListener implements PhaseListener
{
+ protected Logger log = LoggerFactory.getLogger(getClass());
+
// NOTE: this class is not currently used - AuditReportExcelExport is used instead
// the approach to excel generation used here would be better, but I could not get response.reset() to clear the jsp content,
// which resulted in html content followed by excel binary
@@ -61,7 +61,9 @@ public class AuditPhaseListener implemen
{
PhaseId pId = event.getPhaseId();
FacesContext facesContext = event.getFacesContext();
- System.out.println( "beforePhase phaseId=" + ( pId == null ? "null" : pId.toString() ) + " facesContext=" + ( facesContext == null ? "null" : facesContext.toString() ) );
+ if (log.isDebugEnabled()) {
+ log.debug("beforePhase phaseId=" + (pId == null ? "null" : pId.toString()) + " facesContext=" + (facesContext == null ? "null" : facesContext.toString()));
+ }
}
// Handle a notification that the processing for a particular phase has just been completed.
@@ -70,7 +72,9 @@ public class AuditPhaseListener implemen
PhaseId pId = phaseEvent.getPhaseId();
FacesContext facesContext = phaseEvent.getFacesContext();
- System.out.println( "afterPhase phaseId=" + ( pId == null ? "null" : pId.toString() ) + " facesContext=" + ( facesContext == null ? "null" : facesContext.toString() ) );
+ if (log.isDebugEnabled()) {
+ log.debug("afterPhase phaseId=" + (pId == null ? "null" : pId.toString()) + " facesContext=" + (facesContext == null ? "null" : facesContext.toString()));
+ }
Map requestParameters = facesContext.getExternalContext().getRequestParameterMap();
//Map requestAttributes = facesContext.getExternalContext().getRequestMap();
@@ -78,7 +82,9 @@ public class AuditPhaseListener implemen
Object useContentType = requestParameters.get( PortalUserReportPortlet.PARAM_ALT_CONTENT_TYPE );
if ( useContentType != null && useContentType.equals( PortalUserReportPortlet.ALT_CONTENT_TYPE_EXCEL ) )
{
- System.out.println( this.getClass().getName() + ".afterPhase() observing request attribute " + PortalUserReportPortlet.ATTRIBUTE_ALT_CONTENT_TYPE + "=" + useContentType.toString() );
+ if (log.isDebugEnabled()) {
+ log.debug(this.getClass().getName() + ".afterPhase() observing request attribute " + PortalUserReportPortlet.ATTRIBUTE_ALT_CONTENT_TYPE + "=" + useContentType.toString());
+ }
String tableId = "data"; // (String) map.get("excelExportTableId");
String filename = "export.xls"; // (String) map.get("excelExportFileName");
@@ -86,11 +92,15 @@ public class AuditPhaseListener implemen
try
{
UIComponent containerForm = facesContext.getViewRoot().findComponent( "dataForm" );
- System.out.println( this.getClass().getName() + ".afterPhase() form(dataForm): " + ( containerForm == null ? "null" : containerForm.toString() ) );
+ if (log.isDebugEnabled()) {
+ log.debug(this.getClass().getName() + ".afterPhase() form(dataForm): " + (containerForm == null ? "null" : containerForm.toString()));
+ }
if ( containerForm != null )
{
HtmlDataTable dataTable = (HtmlDataTable) containerForm.findComponent( tableId );
- System.out.println( this.getClass().getName() + ".afterPhase() dataTable(" + tableId + "): " + ( dataTable == null ? "null" : dataTable.toString() ) );
+ if (log.isDebugEnabled()) {
+ log.debug(this.getClass().getName() + ".afterPhase() dataTable(" + tableId + "): " + (dataTable == null ? "null" : dataTable.toString()));
+ }
if ( dataTable != null )
{
HSSFWorkbook generatedExcel = generateExcel( facesContext, dataTable );
@@ -122,14 +132,15 @@ public class AuditPhaseListener implemen
//facesContext.getApplication().getStateManager().saveSerializedView( facesContext );
//facesContext.responseComplete();
- System.out.println( this.getClass().getName() + ".afterPhase() special handling of " + PortalUserReportPortlet.ATTRIBUTE_ALT_CONTENT_TYPE + "=" + useContentType.toString() + " completed" );
+ if (log.isDebugEnabled()) {
+ log.debug(this.getClass().getName() + ".afterPhase() special handling of " + PortalUserReportPortlet.ATTRIBUTE_ALT_CONTENT_TYPE + "=" + useContentType.toString() + " completed");
+ }
}
}
catch ( Exception e )
{
- System.out.println( this.getClass().getName() + " error-inner " + e.getClass().getName() + " - " + e.getMessage() );
- e.printStackTrace();
+ log.error(this.getClass().getName() + " error-inner " + e.getClass().getName() + " - " + e.getMessage(), e);
throw new RuntimeException( e );
}
}
@@ -137,8 +148,7 @@ public class AuditPhaseListener implemen
}
catch ( Exception e )
{
- System.out.println( this.getClass().getName() + " error-outer " + e.getClass().getName() + " - " + e.getMessage() );
- e.printStackTrace();
+ log.error(this.getClass().getName() + " error-outer " + e.getClass().getName() + " - " + e.getMessage(), e);
throw new RuntimeException( e );
}
}
Modified: portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/AuditReportExcelExport.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/AuditReportExcelExport.java?rev=1648792&r1=1648791&r2=1648792&view=diff
==============================================================================
--- portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/AuditReportExcelExport.java (original)
+++ portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/AuditReportExcelExport.java Thu Jan 1 01:55:17 2015
@@ -16,6 +16,13 @@
*/
package org.apache.jetspeed.portlets.audit;
+import org.apache.poi.hssf.usermodel.HSSFCell;
+import org.apache.poi.hssf.usermodel.HSSFRow;
+import org.apache.poi.hssf.usermodel.HSSFSheet;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import java.beans.BeanInfo;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
@@ -29,17 +36,11 @@ import java.util.Iterator;
import java.util.List;
import java.util.Properties;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.poi.hssf.usermodel.HSSFCell;
-import org.apache.poi.hssf.usermodel.HSSFRow;
-import org.apache.poi.hssf.usermodel.HSSFSheet;
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
-
public class AuditReportExcelExport
{
- protected final Log logger = LogFactory.getLog( this.getClass() );
+ protected Logger log = LoggerFactory.getLogger(this.getClass());
+
private static final String DATE_OUTPUT_PATTERN = "M/d/yyyy";
private Properties audit_messages;
@@ -64,7 +65,7 @@ public class AuditReportExcelExport
}
catch (IOException e)
{
- e.printStackTrace();
+ log.error("IO Exception in properties init: " + e.getMessage(), e);
}
finally
{
@@ -76,7 +77,7 @@ public class AuditReportExcelExport
}
catch (IOException e)
{
- e.printStackTrace();
+ log.error("IO Exception in properties init close: " + e.getMessage(), e);
}
}
}
@@ -263,9 +264,9 @@ public class AuditReportExcelExport
protected void print(String str)
{
- System.out.println(str);
- logger.debug(str);
- //logger.debug(str);
+ if (log.isDebugEnabled()) {
+ log.debug(str);
+ }
}
public static final class Identifier
Modified: portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/DataScrollerActionListener.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/DataScrollerActionListener.java?rev=1648792&r1=1648791&r2=1648792&view=diff
==============================================================================
--- portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/DataScrollerActionListener.java (original)
+++ portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/DataScrollerActionListener.java Thu Jan 1 01:55:17 2015
@@ -18,6 +18,9 @@
*/
package org.apache.jetspeed.portlets.audit;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import javax.faces.event.AbortProcessingException;
import javax.faces.event.ActionEvent;
import javax.faces.event.ActionListener;
@@ -28,13 +31,16 @@ import javax.faces.event.ActionListener;
*/
public class DataScrollerActionListener implements ActionListener
{
+ protected Logger log = LoggerFactory.getLogger(getClass());
/**
* @see javax.faces.event.ActionListener#processAction(javax.faces.event.ActionEvent)
*/
public void processAction(ActionEvent actionEvent) throws AbortProcessingException
{
- System.out.println("process dataScroller ActionEvent");
+ if (log.isDebugEnabled()) {
+ log.debug("process dataScroller ActionEvent");
+ }
}
}
Modified: portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/PasswordResetActionListener.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/PasswordResetActionListener.java?rev=1648792&r1=1648791&r2=1648792&view=diff
==============================================================================
--- portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/PasswordResetActionListener.java (original)
+++ portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/PasswordResetActionListener.java Thu Jan 1 01:55:17 2015
@@ -16,7 +16,8 @@
*/
package org.apache.jetspeed.portlets.audit;
-import java.util.Map;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -24,9 +25,12 @@ import javax.faces.el.VariableResolver;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.ActionEvent;
import javax.faces.event.ActionListener;
+import java.util.Map;
public class PasswordResetActionListener implements ActionListener
{
+ protected Logger log = LoggerFactory.getLogger(getClass());
+
Map searchParams = null;
public void processAction( ActionEvent event ) throws AbortProcessingException
@@ -39,7 +43,7 @@ public class PasswordResetActionListener
if ( form == null )
{
- System.out.println("Ack! Tried to resolve a variable that doesn't exist!");
+ log.error("Ack! Tried to resolve a variable that doesn't exist!");
return;
}
Modified: portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/PortalUserJetspeedInteraction.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/PortalUserJetspeedInteraction.java?rev=1648792&r1=1648791&r2=1648792&view=diff
==============================================================================
--- portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/PortalUserJetspeedInteraction.java (original)
+++ portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/PortalUserJetspeedInteraction.java Thu Jan 1 01:55:17 2015
@@ -16,6 +16,18 @@
*/
package org.apache.jetspeed.portlets.audit;
+import org.apache.jetspeed.Jetspeed;
+import org.apache.jetspeed.audit.AuditActivity;
+import org.apache.jetspeed.portlets.util.SecurityHelper;
+import org.apache.jetspeed.security.SecurityException;
+import org.apache.jetspeed.security.User;
+import org.apache.jetspeed.security.UserCredential;
+import org.apache.jetspeed.security.UserManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.security.auth.Subject;
+import javax.sql.DataSource;
import java.security.Principal;
import java.util.Date;
import java.util.Hashtable;
@@ -23,26 +35,15 @@ import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-import java.util.prefs.Preferences;
-
-import javax.sql.DataSource;
-
-import org.apache.jetspeed.Jetspeed;
-import org.apache.jetspeed.audit.AuditActivity;
-import org.apache.jetspeed.portlets.util.SecurityHelper;
-import org.apache.jetspeed.security.PasswordCredential;
-import org.apache.jetspeed.security.SecurityException;
-import org.apache.jetspeed.security.User;
-import org.apache.jetspeed.security.UserManager;
public class PortalUserJetspeedInteraction
{
-
+ protected Logger log = LoggerFactory.getLogger(getClass());
private LinkedList rows;
private Map table;
private AuditActivity audit;
private UserManager um;
-
+
public PortalUserBean getUserBean(String userid)
{
@@ -53,9 +54,8 @@ public class PortalUserJetspeedInteracti
}
catch (Exception e)
{
- //e.printStackTrace();
- // TODO: logging
- }
+ log.error("Failed to get User Bean: " + e.getMessage(), e);
+ }
return null;
}
@@ -72,53 +72,69 @@ public class PortalUserJetspeedInteracti
if ( filter == null )
filter = "*";
- Iterator umIter = um.getUsers(filter);
- while ( umIter.hasNext() )
+ List<User> users = um.getUsers(filter);
+ for (User user : users)
{
- User u = (User)umIter.next();
- PortalUserBean bean = getBeanFromUser(u);
+ PortalUserBean bean = getBeanFromUser(user);
rows.add( (PortalUserBean)bean );
}
}
- protected PortalUserBean getBeanFromUser(User u)
+ protected String getValueWithDefault(Map<String,String> map, String key, String defaultValue) {
+ String result = map.get(key);
+ return (result == null) ? defaultValue : result;
+ }
+
+ protected PortalUserBean getBeanFromUser(User user)
{
PortalUserBean bean = new PortalUserBean();
- Preferences p = u.getUserAttributes();
+// Preferences p = u.getUserAttributes();
+ Map<String,String> info = user.getInfoMap();
// This hideous two lines of code is due to a hideous oversight in the Jetspeed API!
- Principal principal = SecurityHelper.getUserPrincipal(u.getSubject());
+ Subject subject = null;
+ try {
+ subject = um.getSubject(user);
+ }
+ catch (Exception e) {
+ log.error("Exception in requesting subject: " + e.getMessage(), e);
+ }
+ Principal principal = SecurityHelper.getUserPrincipal(subject);
bean.setUserid(principal.getName());
- bean.setFirstName( p.get("user.name.given", "") );
- bean.setLastName( p.get("user.name.family", "") );
- String userEmail = p.get("user.email", "" );
+ bean.setFirstName( getValueWithDefault(info, "user.name.given", "") );
+ bean.setLastName( getValueWithDefault(info, "user.name.family", "") );
+ String userEmail = getValueWithDefault(info, "user.email", "" );
if ( userEmail == null || userEmail.length() == 0 )
{
- userEmail = p.get("user.business-info.online.email", "" );
+ userEmail = getValueWithDefault(info, "user.business-info.online.email", "");
if ( userEmail == null || userEmail.length() == 0 )
{
- userEmail = p.get("user.home-info.online.email", "" );
+ userEmail = getValueWithDefault(info, "user.home-info.online.email", "");
}
}
bean.setEmail( userEmail );
- bean.setCompanyName( p.get("bus_id", "") );
- bean.setCheckImage( p.get( "activeview_image_access", "" ) );
- bean.setStatementImage( p.get( "activeview_statement_access", "" ) );
- bean.setPositivePay( p.get( "ppay_acccess", "" ) );
- bean.setRemoteDepositCapture( p.get( "rdc_access", "" ) );
- bean.setAch( p.get( "ach_access", "" ) );
-
- PasswordCredential credential = SecurityHelper.getCredential(u);
- if ( credential != null )
- {
- bean.setUserStatus( credential.isEnabled() ? "enabled" : "disabled" );
- Date pswdExpire = credential.getExpirationDate();
- //if ( pswdExpire == null )
- // pswdExpire = new Date();
- bean.setPasswordExpirationDate( pswdExpire );
- bean.setAuthenticationFailureCount( credential.getAuthenticationFailures() );
- }
+ bean.setCompanyName(getValueWithDefault(info, "bus_id", ""));
+ bean.setCheckImage( getValueWithDefault(info, "activeview_image_access", "" ) );
+ bean.setStatementImage(getValueWithDefault(info, "activeview_statement_access", ""));
+ bean.setPositivePay( getValueWithDefault(info, "ppay_acccess", "" ) );
+ bean.setRemoteDepositCapture(getValueWithDefault(info, "rdc_access", ""));
+ bean.setAch( getValueWithDefault(info, "ach_access", "" ) );
+
+ try {
+ UserCredential credential = SecurityHelper.getCredential(um, user);
+ if (credential != null) {
+ bean.setUserStatus(credential.isEnabled() ? "enabled" : "disabled");
+ Date pswdExpire = credential.getExpirationDate();
+ //if ( pswdExpire == null )
+ // pswdExpire = new Date();
+ bean.setPasswordExpirationDate(pswdExpire);
+ bean.setAuthenticationFailureCount(credential.getAuthenticationFailures());
+ }
+ }
+ catch (Exception e) {
+ log.error("Exception in requesting credentials: " + e.getMessage(), e);
+ }
return bean;
}
Modified: portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/PortalUserReportPortlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/PortalUserReportPortlet.java?rev=1648792&r1=1648791&r2=1648792&view=diff
==============================================================================
--- portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/PortalUserReportPortlet.java (original)
+++ portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/PortalUserReportPortlet.java Thu Jan 1 01:55:17 2015
@@ -16,40 +16,34 @@
*/
package org.apache.jetspeed.portlets.audit;
+import org.apache.jetspeed.PortalReservedParameters;
+import org.apache.jetspeed.request.RequestContext;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.portals.bridges.jsf.FacesPortlet;
+import org.apache.portals.bridges.util.PortletWindowUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
import javax.portlet.PortletConfig;
+import javax.portlet.PortletContext;
import javax.portlet.PortletException;
+import javax.portlet.PortletRequest;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.PortletRequest;
-import javax.portlet.PortletResponse;
-import javax.portlet.PortletContext;
-
import java.io.IOException;
import java.net.URLEncoder;
-import java.util.List;
import java.util.ArrayList;
+import java.util.List;
-import org.apache.portals.bridges.jsf.FacesPortlet;
-
-import org.apache.jetspeed.CommonPortletServices;
-import org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite;
-import org.apache.jetspeed.request.RequestContext;
-import org.apache.jetspeed.container.window.PortletWindowAccessor;
-import org.apache.jetspeed.PortalReservedParameters;
-
-import org.apache.portals.bridges.util.PortletWindowUtils;
-import org.apache.portals.messaging.PortletMessaging;
-
-import org.apache.pluto.om.window.PortletWindow;
-import org.apache.pluto.om.entity.PortletEntity;
-import org.apache.pluto.om.portlet.PortletDefinition;
-
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+//import org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite;
+//import org.apache.jetspeed.container.window.PortletWindowAccessor;
public class PortalUserReportPortlet extends FacesPortlet
{
+ protected Logger log = LoggerFactory.getLogger(getClass());
+
public static final String PARAM_ALT_CONTENT_TYPE = "contenttype";
public static final String ATTRIBUTE_ALT_CONTENT_TYPE = "altcontenttype";
@@ -59,14 +53,16 @@ public class PortalUserReportPortlet ext
public static final String ALT_CONTENT_TYPE_EXCEL = "excel";
public static final String ALT_CONTENT_TYPE_PDF = "pdf";
-
- private PortletWindowAccessor windowAccess;
+
+ protected boolean excelEnabled = false;
+
+ // private PortletWindowAccessor windowAccess;
public void init(PortletConfig config) throws PortletException
{
super.init(config);
PortletContext context = getPortletContext();
- windowAccess = (PortletWindowAccessor)context.getAttribute(CommonPortletServices.CPS_WINDOW_ACCESS_COMPONENT);
+ // windowAccess = (PortletWindowAccessor)context.getAttribute(CommonPortletServices.CPS_WINDOW_ACCESS_COMPONENT);
}
protected void setPortletIdentityAttributes( PortletRequest request )
@@ -76,19 +72,20 @@ public class PortalUserReportPortlet ext
try
{
portletEntityId = PortletWindowUtils.getPortletWindowId( request.getPortletSession( true ) );
- PortletWindow pw = windowAccess.getPortletWindow( portletEntityId );
- portletUniqueName = ((PortletDefinitionComposite)pw.getPortletEntity().getPortletDefinition() ).getUniqueName();
- portletAppContext = pw.getPortletEntity().getPortletDefinition().getPortletApplicationDefinition().getWebApplicationDefinition().getContextRoot();
+// PortletWindow pw = windowAccess.getPortletWindow( portletEntityId );
+// portletUniqueName = ((PortletDefinition)pw.getPortletEntity().getPortletDefinition() ).getName();
+// portletAppContext = pw.getPortletEntity().getPortletDefinition().getPortletApplicationDefinition().getWebApplicationDefinition().getContextRoot();
request.setAttribute( "portletEntityId", portletEntityId );
request.setAttribute( "portletUniqueName", portletUniqueName );
}
catch ( Exception ex )
{
- System.out.println( this.getClass().getName() + ".setPortletIdentityAttributes() error " + ex.getClass().getName() + " - " + ex.getMessage() );
- ex.printStackTrace();
+ log.error(this.getClass().getName() + ".setPortletIdentityAttributes() error " + ex.getClass().getName() + " - " + ex.getMessage());
+ }
+ if (log.isDebugEnabled()) {
+ log.debug(this.getClass().getName() + ".doView() portlet-entity-id=" + portletEntityId + " portlet-unique-name=" + portletUniqueName + " portlet-app-context=" + (portletAppContext == null ? "null" : portletAppContext.toString()));
}
- System.out.println( this.getClass().getName() + ".doView() portlet-entity-id=" + portletEntityId + " portlet-unique-name=" + portletUniqueName + " portlet-app-context=" + ( portletAppContext == null ? "null" : portletAppContext.toString() ) );
}
protected void setExcelExportUrl( RenderRequest request )
@@ -96,21 +93,19 @@ public class PortalUserReportPortlet ext
String portletEntityId = null, portletUniqueName = null;
portletEntityId = (String)request.getAttribute( "portletEntityId" );
portletUniqueName = (String)request.getAttribute( "portletUniqueName" );
- try
- {
- RequestContext jsReqContext = (RequestContext)request.getAttribute( PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE );
- String portalBasePath = jsReqContext.getPortalURL().getBasePath();
- int servletPathPos = portalBasePath.lastIndexOf( jsReqContext.getRequest().getServletPath() );
- if ( servletPathPos > 0 )
- portalBasePath = portalBasePath.substring( 0, servletPathPos );
- String excelQueryPortletUrl = portalBasePath + "/portlet?entity=" + URLEncoder.encode( portletEntityId, "UTF-8" ) + "&" + "portlet=" + URLEncoder.encode( portletUniqueName, "UTF-8" ) + "&" + PARAM_ALT_CONTENT_TYPE + "=" + ALT_CONTENT_TYPE_EXCEL;
- request.setAttribute( "excelExport", excelQueryPortletUrl );
- }
- catch ( Exception ex )
- {
- System.out.println( this.getClass().getName() + ".setExcelExportUrl() error " + ex.getClass().getName() + " - " + ex.getMessage() );
- ex.printStackTrace();
- }
+ if (excelEnabled) {
+ try {
+ RequestContext jsReqContext = (RequestContext) request.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
+ String portalBasePath = jsReqContext.getPortalURL().getBasePath();
+ int servletPathPos = portalBasePath.lastIndexOf(jsReqContext.getRequest().getServletPath());
+ if (servletPathPos > 0)
+ portalBasePath = portalBasePath.substring(0, servletPathPos);
+ String excelQueryPortletUrl = portalBasePath + "/portlet?entity=" + URLEncoder.encode(portletEntityId, "UTF-8") + "&" + "portlet=" + URLEncoder.encode(portletUniqueName, "UTF-8") + "&" + PARAM_ALT_CONTENT_TYPE + "=" + ALT_CONTENT_TYPE_EXCEL;
+ request.setAttribute("excelExport", excelQueryPortletUrl);
+ } catch (Exception ex) {
+ log.error(this.getClass().getName() + ".setExcelExportUrl() error " + ex.getClass().getName() + " - " + ex.getMessage(), ex);
+ }
+ }
}
public static List getLastDataRows( PortletRequest request )
@@ -149,15 +144,19 @@ public class PortalUserReportPortlet ext
if ( useContentType != null && useContentType.equals( ALT_CONTENT_TYPE_EXCEL ) )
{
request.setAttribute( ATTRIBUTE_ALT_CONTENT_TYPE, useContentType );
- System.out.println( this.getClass().getName() + ".doView() observing request attribute " + ATTRIBUTE_ALT_CONTENT_TYPE + "=" + useContentType.toString() );
+ if (log.isDebugEnabled()) {
+ log.debug(this.getClass().getName() + ".doView() observing request attribute " + ATTRIBUTE_ALT_CONTENT_TYPE + "=" + useContentType.toString());
+ }
RequestContext jsReqContext = (RequestContext)request.getAttribute( PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE );
jsReqContext.getResponse().reset();
response.setContentType( "application/vnd.ms-excel" ); // this is just to avoid no content-type is set error
jsReqContext.getResponse().setHeader( "Content-Type", "application/vnd.ms-excel" );
jsReqContext.getResponse().setHeader( "Content-Disposition", "inline; filename=thedata.xls" );
-
- System.out.println( this.getClass().getName() + " setup response for " + PARAM_ALT_CONTENT_TYPE + "=" + ALT_CONTENT_TYPE_EXCEL );
+
+ if (log.isDebugEnabled()) {
+ log.debug(this.getClass().getName() + " setup response for " + PARAM_ALT_CONTENT_TYPE + "=" + ALT_CONTENT_TYPE_EXCEL);
+ }
if ( lastDataRows == null )
lastDataRows = new ArrayList();
Modified: portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/SSOFailedLoginActionListener.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/SSOFailedLoginActionListener.java?rev=1648792&r1=1648791&r2=1648792&view=diff
==============================================================================
--- portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/SSOFailedLoginActionListener.java (original)
+++ portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/SSOFailedLoginActionListener.java Thu Jan 1 01:55:17 2015
@@ -16,7 +16,8 @@
*/
package org.apache.jetspeed.portlets.audit;
-import java.util.Map;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -24,11 +25,13 @@ import javax.faces.el.VariableResolver;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.ActionEvent;
import javax.faces.event.ActionListener;
+import java.util.Map;
public class SSOFailedLoginActionListener implements ActionListener
{
Map searchParams = null;
-
+ protected Logger log = LoggerFactory.getLogger(getClass());
+
public void processAction( ActionEvent event ) throws AbortProcessingException
{
FacesContext facesContext = FacesContext.getCurrentInstance();
@@ -39,7 +42,7 @@ public class SSOFailedLoginActionListene
if ( form == null )
{
- System.out.println("Ack! Tried to resolve a variable that doesn't exist!");
+ log.error("Ack! Tried to resolve a variable that doesn't exist!");
return;
}
Modified: portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/SSOLockedUserActionListener.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/SSOLockedUserActionListener.java?rev=1648792&r1=1648791&r2=1648792&view=diff
==============================================================================
--- portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/SSOLockedUserActionListener.java (original)
+++ portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/SSOLockedUserActionListener.java Thu Jan 1 01:55:17 2015
@@ -16,7 +16,8 @@
*/
package org.apache.jetspeed.portlets.audit;
-import java.util.Map;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -24,9 +25,11 @@ import javax.faces.el.VariableResolver;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.ActionEvent;
import javax.faces.event.ActionListener;
+import java.util.Map;
public class SSOLockedUserActionListener implements ActionListener
{
+ protected Logger log = LoggerFactory.getLogger(getClass());
Map searchParams = null;
public void processAction( ActionEvent event ) throws AbortProcessingException
@@ -39,7 +42,7 @@ public class SSOLockedUserActionListener
if ( form == null )
{
- System.out.println("Ack! Tried to resolve a variable that doesn't exist!");
+ log.error("Ack! Tried to resolve a variable that doesn't exist!");
return;
}
Modified: portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/SSOOptOutActionListener.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/SSOOptOutActionListener.java?rev=1648792&r1=1648791&r2=1648792&view=diff
==============================================================================
--- portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/SSOOptOutActionListener.java (original)
+++ portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/SSOOptOutActionListener.java Thu Jan 1 01:55:17 2015
@@ -16,7 +16,8 @@
*/
package org.apache.jetspeed.portlets.audit;
-import java.util.Map;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -24,9 +25,11 @@ import javax.faces.el.VariableResolver;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.ActionEvent;
import javax.faces.event.ActionListener;
+import java.util.Map;
public class SSOOptOutActionListener implements ActionListener
{
+ protected Logger log = LoggerFactory.getLogger(getClass());
Map searchParams = null;
public void processAction( ActionEvent event ) throws AbortProcessingException
@@ -39,7 +42,7 @@ public class SSOOptOutActionListener imp
if ( form == null )
{
- System.out.println("Ack! Tried to resolve a variable that doesn't exist!");
+ log.error("Ack! Tried to resolve a variable that doesn't exist!");
return;
}
Modified: portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/SSOSuccessLoginActionListener.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/SSOSuccessLoginActionListener.java?rev=1648792&r1=1648791&r2=1648792&view=diff
==============================================================================
--- portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/SSOSuccessLoginActionListener.java (original)
+++ portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/SSOSuccessLoginActionListener.java Thu Jan 1 01:55:17 2015
@@ -16,7 +16,8 @@
*/
package org.apache.jetspeed.portlets.audit;
-import java.util.Map;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -24,9 +25,11 @@ import javax.faces.el.VariableResolver;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.ActionEvent;
import javax.faces.event.ActionListener;
+import java.util.Map;
public class SSOSuccessLoginActionListener implements ActionListener
{
+ protected Logger log = LoggerFactory.getLogger(getClass());
Map searchParams = null;
public void processAction( ActionEvent event ) throws AbortProcessingException
@@ -39,7 +42,7 @@ public class SSOSuccessLoginActionListen
if ( form == null )
{
- System.out.println("Ack! Tried to resolve a variable that doesn't exist!");
+ log.error("Ack! Tried to resolve a variable that doesn't exist!");
return;
}
Modified: portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/SSOSystemSecurityActionListener.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/SSOSystemSecurityActionListener.java?rev=1648792&r1=1648791&r2=1648792&view=diff
==============================================================================
--- portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/SSOSystemSecurityActionListener.java (original)
+++ portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/SSOSystemSecurityActionListener.java Thu Jan 1 01:55:17 2015
@@ -16,7 +16,8 @@
*/
package org.apache.jetspeed.portlets.audit;
-import java.util.Map;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -24,9 +25,11 @@ import javax.faces.el.VariableResolver;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.ActionEvent;
import javax.faces.event.ActionListener;
+import java.util.Map;
public class SSOSystemSecurityActionListener implements ActionListener
{
+ protected Logger log = LoggerFactory.getLogger(getClass());
Map searchParams = null;
public void processAction( ActionEvent event ) throws AbortProcessingException
@@ -39,7 +42,7 @@ public class SSOSystemSecurityActionList
if ( form == null )
{
- System.out.println("Ack! Tried to resolve a variable that doesn't exist!");
+ log.error("Ack! Tried to resolve a variable that doesn't exist!");
return;
}
Modified: portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/SSOUserStatusActionListener.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/SSOUserStatusActionListener.java?rev=1648792&r1=1648791&r2=1648792&view=diff
==============================================================================
--- portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/SSOUserStatusActionListener.java (original)
+++ portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/SSOUserStatusActionListener.java Thu Jan 1 01:55:17 2015
@@ -16,7 +16,8 @@
*/
package org.apache.jetspeed.portlets.audit;
-import java.util.Map;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -24,9 +25,11 @@ import javax.faces.el.VariableResolver;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.ActionEvent;
import javax.faces.event.ActionListener;
+import java.util.Map;
public class SSOUserStatusActionListener implements ActionListener
{
+ protected Logger log = LoggerFactory.getLogger(getClass());
Map searchParams = null;
public void processAction( ActionEvent event ) throws AbortProcessingException
@@ -39,7 +42,7 @@ public class SSOUserStatusActionListener
if ( form == null )
{
- System.out.println("Ack! Tried to resolve a variable that doesn't exist!");
+ log.error("Ack! Tried to resolve a variable that doesn't exist!");
return;
}
Modified: portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/SystemSecurityActionListener.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/SystemSecurityActionListener.java?rev=1648792&r1=1648791&r2=1648792&view=diff
==============================================================================
--- portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/SystemSecurityActionListener.java (original)
+++ portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/SystemSecurityActionListener.java Thu Jan 1 01:55:17 2015
@@ -16,7 +16,8 @@
*/
package org.apache.jetspeed.portlets.audit;
-import java.util.Map;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -24,9 +25,11 @@ import javax.faces.el.VariableResolver;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.ActionEvent;
import javax.faces.event.ActionListener;
+import java.util.Map;
public class SystemSecurityActionListener implements ActionListener
{
+ protected Logger log = LoggerFactory.getLogger(getClass());
Map searchParams = null;
public void processAction( ActionEvent event ) throws AbortProcessingException
@@ -39,7 +42,7 @@ public class SystemSecurityActionListene
if ( form == null )
{
- System.out.println("Ack! Tried to resolve a variable that doesn't exist!");
+ log.error("Ack! Tried to resolve a variable that doesn't exist!");
return;
}
Modified: portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/SystemSecurityReport.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/SystemSecurityReport.java?rev=1648792&r1=1648791&r2=1648792&view=diff
==============================================================================
--- portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/SystemSecurityReport.java (original)
+++ portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/SystemSecurityReport.java Thu Jan 1 01:55:17 2015
@@ -16,20 +16,24 @@
*/
package org.apache.jetspeed.portlets.audit;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.faces.context.FacesContext;
+import javax.portlet.PortletRequest;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.SortedMap;
-import javax.faces.context.FacesContext;
-import javax.portlet.PortletRequest;
-
/**
* @author lmpeters
*
*/
public class SystemSecurityReport extends SystemSecurityList implements AuditReport
{
+ protected Logger log = LoggerFactory.getLogger(getClass());
+
PortalUserJetspeedInteraction jsi;
LinkedList rows;
@@ -72,13 +76,12 @@ public class SystemSecurityReport extend
}
else
{
- System.out.println( this.getClass().getName() + ".doView unknown request type " + ( contextRequest == null ? "null" : contextRequest.getClass().getName() ) );
+ log.error( this.getClass().getName() + ".doView unknown request type " + ( contextRequest == null ? "null" : contextRequest.getClass().getName() ) );
}
}
catch (Exception e)
{
- // TODO: throw your own exception wrappers
- e.printStackTrace();
+ log.error("Fatal error in System Security Report: " + e.getMessage(), e);
}
}
Modified: portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/UserCreationActionListener.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/UserCreationActionListener.java?rev=1648792&r1=1648791&r2=1648792&view=diff
==============================================================================
--- portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/UserCreationActionListener.java (original)
+++ portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/UserCreationActionListener.java Thu Jan 1 01:55:17 2015
@@ -16,7 +16,8 @@
*/
package org.apache.jetspeed.portlets.audit;
-import java.util.Map;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -24,9 +25,11 @@ import javax.faces.el.VariableResolver;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.ActionEvent;
import javax.faces.event.ActionListener;
+import java.util.Map;
public class UserCreationActionListener implements ActionListener
{
+ protected Logger log = LoggerFactory.getLogger(getClass());
Map searchParams = null;
public void processAction( ActionEvent event ) throws AbortProcessingException
@@ -39,7 +42,7 @@ public class UserCreationActionListener
if ( form == null )
{
- System.out.println("Ack! Tried to resolve a variable that doesn't exist!");
+ log.error("Ack! Tried to resolve a variable that doesn't exist!");
return;
}
Modified: portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/UserDeletionActionListener.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/UserDeletionActionListener.java?rev=1648792&r1=1648791&r2=1648792&view=diff
==============================================================================
--- portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/UserDeletionActionListener.java (original)
+++ portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/UserDeletionActionListener.java Thu Jan 1 01:55:17 2015
@@ -16,7 +16,8 @@
*/
package org.apache.jetspeed.portlets.audit;
-import java.util.Map;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -24,9 +25,11 @@ import javax.faces.el.VariableResolver;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.ActionEvent;
import javax.faces.event.ActionListener;
+import java.util.Map;
public class UserDeletionActionListener implements ActionListener
{
+ protected Logger log = LoggerFactory.getLogger(getClass());
Map searchParams = null;
public void processAction( ActionEvent event ) throws AbortProcessingException
@@ -39,7 +42,7 @@ public class UserDeletionActionListener
if ( form == null )
{
- System.out.println("Ack! Tried to resolve a variable that doesn't exist!");
+ log.error("Ack! Tried to resolve a variable that doesn't exist!");
return;
}
Modified: portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/UserStatusActionListener.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/UserStatusActionListener.java?rev=1648792&r1=1648791&r2=1648792&view=diff
==============================================================================
--- portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/UserStatusActionListener.java (original)
+++ portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/UserStatusActionListener.java Thu Jan 1 01:55:17 2015
@@ -16,7 +16,8 @@
*/
package org.apache.jetspeed.portlets.audit;
-import java.util.Map;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -24,9 +25,11 @@ import javax.faces.el.VariableResolver;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.ActionEvent;
import javax.faces.event.ActionListener;
+import java.util.Map;
public class UserStatusActionListener implements ActionListener
{
+ protected Logger log = LoggerFactory.getLogger(getClass());
Map searchParams = null;
public void processAction( ActionEvent event ) throws AbortProcessingException
@@ -39,7 +42,7 @@ public class UserStatusActionListener im
if ( form == null )
{
- System.out.println("Ack! Tried to resolve a variable that doesn't exist!");
+ log.error("Ack! Tried to resolve a variable that doesn't exist!");
return;
}
Modified: portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/UserStatusReport.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/UserStatusReport.java?rev=1648792&r1=1648791&r2=1648792&view=diff
==============================================================================
--- portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/UserStatusReport.java (original)
+++ portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/audit/UserStatusReport.java Thu Jan 1 01:55:17 2015
@@ -16,6 +16,11 @@
*/
package org.apache.jetspeed.portlets.audit;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.faces.context.FacesContext;
+import javax.portlet.PortletRequest;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
@@ -24,15 +29,14 @@ import java.util.Map;
import java.util.SortedMap;
import java.util.zip.DataFormatException;
-import javax.faces.context.FacesContext;
-import javax.portlet.PortletRequest;
-
/**
* @author lmpeters
*
*/
public class UserStatusReport extends UserStatusList implements AuditReport
{
+ protected Logger log = LoggerFactory.getLogger(getClass());
+
PortalUserJetspeedInteraction jsi;
UserActivityDatabaseInteraction ai;
@@ -90,8 +94,7 @@ public class UserStatusReport extends Us
}
catch (DataFormatException e)
{
- System.err.println("Internal error while joining Jetspeed and Activity data; results will be invalid.");
- System.err.println("Received error: " + e.toString() );
+ log.error("Internal error while joining Jetspeed and Activity data; results will be invalid: " + e.getMessage(), e);
}
}
Object contextRequest = FacesContext.getCurrentInstance().getExternalContext().getRequest();
@@ -103,13 +106,12 @@ public class UserStatusReport extends Us
}
else
{
- System.out.println( this.getClass().getName() + ".doView unknown request type " + ( contextRequest == null ? "null" : contextRequest.getClass().getName() ) );
+ log.error(this.getClass().getName() + ".doView unknown request type " + (contextRequest == null ? "null" : contextRequest.getClass().getName()));
}
}
catch (Exception e)
{
- // TODO: throw your own exception wrappers
- e.printStackTrace();
+ log.error("Failed to Exec Query: " + e.getMessage(), e);
}
}
Modified: portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/util/SecurityHelper.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/util/SecurityHelper.java?rev=1648792&r1=1648791&r2=1648792&view=diff
==============================================================================
--- portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/util/SecurityHelper.java (original)
+++ portals/jetspeed-2/applications/jsaudit/trunk/src/main/java/org/apache/jetspeed/portlets/util/SecurityHelper.java Thu Jan 1 01:55:17 2015
@@ -18,26 +18,20 @@
*/
package org.apache.jetspeed.portlets.util;
+import org.apache.jetspeed.security.User;
+import org.apache.jetspeed.security.UserCredential;
+import org.apache.jetspeed.security.UserManager;
+
+import javax.security.auth.Subject;
import java.security.Principal;
import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
import java.util.Set;
-import javax.security.auth.Subject;
-
-import org.apache.jetspeed.security.PasswordCredential;
-import org.apache.jetspeed.security.RolePrincipal;
-import org.apache.jetspeed.security.User;
-import org.apache.jetspeed.security.UserPrincipal;
-
-
-
public final class SecurityHelper
{
public static Principal getUserPrincipal(Subject subject)
{
- final Class classe = UserPrincipal.class;
+ final Class classe = User.class;
Principal principal = null;
Set principalList = subject.getPrincipals();
if (principalList != null)
@@ -55,43 +49,46 @@ public final class SecurityHelper
}
return principal;
}
-
- public static PasswordCredential getCredential(User user)
+
+ public static UserCredential getCredential(UserManager um, User user)
+ throws org.apache.jetspeed.security.SecurityException
{
- PasswordCredential credential = null;
- Set credentials = user.getSubject().getPrivateCredentials();
+ UserCredential credential = null;
+
+ Subject subject = um.getSubject(user);
+ Set credentials = subject.getPrivateCredentials();
Iterator iter = credentials.iterator();
while (iter.hasNext())
{
Object o = iter.next();
- if (o instanceof PasswordCredential)
+ if (o instanceof UserCredential)
{
- credential = (PasswordCredential)o;
+ credential = (UserCredential)o;
break;
}
}
return credential;
}
- public static List getRoles(User user)
- {
- List roles = new LinkedList();
- Subject subject = user.getSubject();
- Set principalList = subject.getPrincipals();
- if (principalList != null)
- {
- Iterator principals = subject.getPrincipals().iterator();
- while (principals.hasNext())
- {
- Principal p = (Principal) principals.next();
- if (p instanceof RolePrincipal)
- {
- roles.add(p);
- }
- }
- }
- return roles;
- }
+// public static List getRoles(User user)
+// {
+// List roles = new LinkedList();
+// Subject subject = user.getSubject();
+// Set principalList = subject.getPrincipals();
+// if (principalList != null)
+// {
+// Iterator principals = subject.getPrincipals().iterator();
+// while (principals.hasNext())
+// {
+// Principal p = (Principal) principals.next();
+// if (p instanceof RolePrincipal)
+// {
+// roles.add(p);
+// }
+// }
+// }
+// return roles;
+// }
}
\ No newline at end of file
Copied: portals/jetspeed-2/applications/jsaudit/trunk/src/main/resources/log4j.properties (from r1648448, portals/applications/rss/trunk/rss-war/src/main/webapp/WEB-INF/classes/log4j.properties)
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/jsaudit/trunk/src/main/resources/log4j.properties?p2=portals/jetspeed-2/applications/jsaudit/trunk/src/main/resources/log4j.properties&p1=portals/applications/rss/trunk/rss-war/src/main/webapp/WEB-INF/classes/log4j.properties&r1=1648448&r2=1648792&rev=1648792&view=diff
==============================================================================
--- portals/applications/rss/trunk/rss-war/src/main/webapp/WEB-INF/classes/log4j.properties (original)
+++ portals/jetspeed-2/applications/jsaudit/trunk/src/main/resources/log4j.properties Thu Jan 1 01:55:17 2015
@@ -41,20 +41,9 @@ log4j.additivity.velocity = false
#
########################################################################
-#
-# rss.log
-#
log4j.appender.pa = org.apache.log4j.FileAppender
-log4j.appender.pa.file = ${org.apache.portals.logdir}/rss.log
+log4j.appender.pa.file = ${org.apache.portals.logdir}/audit.log
log4j.appender.pa.layout = org.apache.log4j.PatternLayout
log4j.appender.pa.layout.conversionPattern = %d [%t] %-5p %c - %m%n
log4j.appender.pa.append = false
-#
-# rss-velocity.log
-#
-log4j.appender.velocity = org.apache.log4j.FileAppender
-log4j.appender.velocity.file = ${org.apache.portals.logdir}/rss-velocity.log
-log4j.appender.velocity.layout = org.apache.log4j.PatternLayout
-log4j.appender.velocity.layout.conversionPattern = %d [%t] %-5p %c - %m%n
-log4j.appender.velocity.append = false
Modified: portals/jetspeed-2/applications/jsaudit/trunk/src/webapp/WEB-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/jsaudit/trunk/src/webapp/WEB-INF/faces-config.xml?rev=1648792&r1=1648791&r2=1648792&view=diff
==============================================================================
--- portals/jetspeed-2/applications/jsaudit/trunk/src/webapp/WEB-INF/faces-config.xml (original)
+++ portals/jetspeed-2/applications/jsaudit/trunk/src/webapp/WEB-INF/faces-config.xml Thu Jan 1 01:55:17 2015
@@ -16,25 +16,29 @@ See the License for the specific languag
limitations under the License.
-->
-<!DOCTYPE faces-config PUBLIC
- "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
- "http://java.sun.com/dtd/web-facesconfig_1_1.dtd" >
+<faces-config
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+ http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
+ version="2.0">
-<faces-config>
<application>
<locale-config>
<default-locale>en</default-locale>
</locale-config>
</application>
-
+
<navigation-rule>
+ <from-view-id>/WEB-INF/reports/adminActivityReport.jsp</from-view-id>
<navigation-case>
<from-outcome>queryAdminActivity</from-outcome>
<to-view-id>/WEB-INF/reports/adminActivityReport.jsp</to-view-id>
</navigation-case>
</navigation-rule>
-
+
<navigation-rule>
+ <from-view-id>/WEB-INF/reports/userStatusReport.jsp</from-view-id>
<navigation-case>
<from-outcome>queryUserStatus</from-outcome>
<to-view-id>/WEB-INF/reports/userStatusReport.jsp</to-view-id>
@@ -42,6 +46,7 @@ limitations under the License.
</navigation-rule>
<navigation-rule>
+ <from-view-id>/WEB-INF/reports/systemSecurityReport.jsp</from-view-id>
<navigation-case>
<from-outcome>querySystemSecurity</from-outcome>
<to-view-id>/WEB-INF/reports/systemSecurityReport.jsp</to-view-id>
@@ -49,6 +54,7 @@ limitations under the License.
</navigation-rule>
<navigation-rule>
+ <from-view-id>/WEB-INF/reports/passwordResetReport.jsp</from-view-id>
<navigation-case>
<from-outcome>queryPasswordReset</from-outcome>
<to-view-id>/WEB-INF/reports/passwordResetReport.jsp</to-view-id>
@@ -56,6 +62,7 @@ limitations under the License.
</navigation-rule>
<navigation-rule>
+ <from-view-id>/WEB-INF/reports/userDeletionReport.jsp</from-view-id>
<navigation-case>
<from-outcome>queryUserDeletion</from-outcome>
<to-view-id>/WEB-INF/reports/userDeletionReport.jsp</to-view-id>
@@ -63,53 +70,55 @@ limitations under the License.
</navigation-rule>
<navigation-rule>
+ <from-view-id>/WEB-INF/reports/userCreationReport.jsp</from-view-id>
<navigation-case>
<from-outcome>queryUserCreation</from-outcome>
<to-view-id>/WEB-INF/reports/userCreationReport.jsp</to-view-id>
</navigation-case>
</navigation-rule>
- <navigation-rule>
- <navigation-case>
- <from-outcome>querySSOUserStatus</from-outcome>
- <to-view-id>/WEB-INF/reports/ssoUserStatusReport.jsp</to-view-id>
- </navigation-case>
- </navigation-rule>
-
- <navigation-rule>
- <navigation-case>
- <from-outcome>querySSOFailedLogin</from-outcome>
- <to-view-id>/WEB-INF/reports/ssoFailedLoginReport.jsp</to-view-id>
- </navigation-case>
- </navigation-rule>
-
- <navigation-rule>
- <navigation-case>
- <from-outcome>querySSOLockedUser</from-outcome>
- <to-view-id>/WEB-INF/reports/ssoLockedUserReport.jsp</to-view-id>
- </navigation-case>
- </navigation-rule>
-
- <navigation-rule>
- <navigation-case>
- <from-outcome>querySSOSuccessLogin</from-outcome>
- <to-view-id>/WEB-INF/reports/ssoSuccessLoginReport.jsp</to-view-id>
- </navigation-case>
- </navigation-rule>
- <navigation-rule>
- <navigation-case>
- <from-outcome>querySSOOptOut</from-outcome>
- <to-view-id>/WEB-INF/reports/ssoOptOutReport.jsp</to-view-id>
- </navigation-case>
- </navigation-rule>
-
- <navigation-rule>
- <navigation-case>
- <from-outcome>querySSOSystemSecurity</from-outcome>
- <to-view-id>/WEB-INF/reports/ssoSystemSecurityReport.jsp</to-view-id>
- </navigation-case>
- </navigation-rule>
+ <!--<navigation-rule>-->
+ <!--<navigation-case>-->
+ <!--<from-outcome>querySSOUserStatus</from-outcome>-->
+ <!--<to-view-id>/WEB-INF/reports/ssoUserStatusReport.jsp</to-view-id>-->
+ <!--</navigation-case>-->
+ <!--</navigation-rule>-->
+
+ <!--<navigation-rule>-->
+ <!--<navigation-case>-->
+ <!--<from-outcome>querySSOFailedLogin</from-outcome>-->
+ <!--<to-view-id>/WEB-INF/reports/ssoFailedLoginReport.jsp</to-view-id>-->
+ <!--</navigation-case>-->
+ <!--</navigation-rule>-->
+
+ <!--<navigation-rule>-->
+ <!--<navigation-case>-->
+ <!--<from-outcome>querySSOLockedUser</from-outcome>-->
+ <!--<to-view-id>/WEB-INF/reports/ssoLockedUserReport.jsp</to-view-id>-->
+ <!--</navigation-case>-->
+ <!--</navigation-rule>-->
+
+ <!--<navigation-rule>-->
+ <!--<navigation-case>-->
+ <!--<from-outcome>querySSOSuccessLogin</from-outcome>-->
+ <!--<to-view-id>/WEB-INF/reports/ssoSuccessLoginReport.jsp</to-view-id>-->
+ <!--</navigation-case>-->
+ <!--</navigation-rule>-->
+
+ <!--<navigation-rule>-->
+ <!--<navigation-case>-->
+ <!--<from-outcome>querySSOOptOut</from-outcome>-->
+ <!--<to-view-id>/WEB-INF/reports/ssoOptOutReport.jsp</to-view-id>-->
+ <!--</navigation-case>-->
+ <!--</navigation-rule>-->
+
+ <!--<navigation-rule>-->
+ <!--<navigation-case>-->
+ <!--<from-outcome>querySSOSystemSecurity</from-outcome>-->
+ <!--<to-view-id>/WEB-INF/reports/ssoSystemSecurityReport.jsp</to-view-id>-->
+ <!--</navigation-case>-->
+ <!--</navigation-rule>-->
<managed-bean>
@@ -154,41 +163,41 @@ limitations under the License.
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
- <managed-bean>
- <managed-bean-name>ssoUserStatusUsers</managed-bean-name>
- <managed-bean-class>org.apache.jetspeed.portlets.audit.SSOUserStatusReport</managed-bean-class>
- <managed-bean-scope>session</managed-bean-scope>
- </managed-bean>
-
- <managed-bean>
- <managed-bean-name>ssoFailedLoginUsers</managed-bean-name>
- <managed-bean-class>org.apache.jetspeed.portlets.audit.SSOFailedLoginReport</managed-bean-class>
- <managed-bean-scope>session</managed-bean-scope>
- </managed-bean>
-
- <managed-bean>
- <managed-bean-name>ssoLockedUsers</managed-bean-name>
- <managed-bean-class>org.apache.jetspeed.portlets.audit.SSOLockedUserReport</managed-bean-class>
- <managed-bean-scope>session</managed-bean-scope>
- </managed-bean>
-
- <managed-bean>
- <managed-bean-name>ssoSuccessLoginUsers</managed-bean-name>
- <managed-bean-class>org.apache.jetspeed.portlets.audit.SSOSuccessLoginReport</managed-bean-class>
- <managed-bean-scope>session</managed-bean-scope>
- </managed-bean>
-
- <managed-bean>
- <managed-bean-name>ssoOptOutUsers</managed-bean-name>
- <managed-bean-class>org.apache.jetspeed.portlets.audit.SSOOptOutReport</managed-bean-class>
- <managed-bean-scope>session</managed-bean-scope>
- </managed-bean>
-
- <managed-bean>
- <managed-bean-name>ssoSystemSecurityUsers</managed-bean-name>
- <managed-bean-class>org.apache.jetspeed.portlets.audit.SSOSystemSecurityReport</managed-bean-class>
- <managed-bean-scope>session</managed-bean-scope>
- </managed-bean>
+ <!--<managed-bean>-->
+ <!--<managed-bean-name>ssoUserStatusUsers</managed-bean-name>-->
+ <!--<managed-bean-class>org.apache.jetspeed.portlets.audit.SSOUserStatusReport</managed-bean-class>-->
+ <!--<managed-bean-scope>session</managed-bean-scope>-->
+ <!--</managed-bean>-->
+
+ <!--<managed-bean>-->
+ <!--<managed-bean-name>ssoFailedLoginUsers</managed-bean-name>-->
+ <!--<managed-bean-class>org.apache.jetspeed.portlets.audit.SSOFailedLoginReport</managed-bean-class>-->
+ <!--<managed-bean-scope>session</managed-bean-scope>-->
+ <!--</managed-bean>-->
+
+ <!--<managed-bean>-->
+ <!--<managed-bean-name>ssoLockedUsers</managed-bean-name>-->
+ <!--<managed-bean-class>org.apache.jetspeed.portlets.audit.SSOLockedUserReport</managed-bean-class>-->
+ <!--<managed-bean-scope>session</managed-bean-scope>-->
+ <!--</managed-bean>-->
+
+ <!--<managed-bean>-->
+ <!--<managed-bean-name>ssoSuccessLoginUsers</managed-bean-name>-->
+ <!--<managed-bean-class>org.apache.jetspeed.portlets.audit.SSOSuccessLoginReport</managed-bean-class>-->
+ <!--<managed-bean-scope>session</managed-bean-scope>-->
+ <!--</managed-bean>-->
+
+ <!--<managed-bean>-->
+ <!--<managed-bean-name>ssoOptOutUsers</managed-bean-name>-->
+ <!--<managed-bean-class>org.apache.jetspeed.portlets.audit.SSOOptOutReport</managed-bean-class>-->
+ <!--<managed-bean-scope>session</managed-bean-scope>-->
+ <!--</managed-bean>-->
+
+ <!--<managed-bean>-->
+ <!--<managed-bean-name>ssoSystemSecurityUsers</managed-bean-name>-->
+ <!--<managed-bean-class>org.apache.jetspeed.portlets.audit.SSOSystemSecurityReport</managed-bean-class>-->
+ <!--<managed-bean-scope>session</managed-bean-scope>-->
+ <!--</managed-bean>-->
<!--
<lifecycle>
<phase-listener>org.apache.jetspeed.portlets.audit.AuditPhaseListener</phase-listener>
Modified: portals/jetspeed-2/applications/jsaudit/trunk/src/webapp/WEB-INF/reports/passwordResetReport.jsp
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/jsaudit/trunk/src/webapp/WEB-INF/reports/passwordResetReport.jsp?rev=1648792&r1=1648791&r2=1648792&view=diff
==============================================================================
--- portals/jetspeed-2/applications/jsaudit/trunk/src/webapp/WEB-INF/reports/passwordResetReport.jsp (original)
+++ portals/jetspeed-2/applications/jsaudit/trunk/src/webapp/WEB-INF/reports/passwordResetReport.jsp Thu Jan 1 01:55:17 2015
@@ -138,7 +138,7 @@ limitations under the License.
<h:column>
<f:facet name="header">
<t:commandSortHeader columnName="modified_date" arrow="true" immediate="false">
- <h:outputText value="#{audit_messages['sort_modified_date]}" />
+ <h:outputText value="#{audit_messages['sort_modified_date']}" />
</t:commandSortHeader>
</f:facet>
<h:outputText value="#{adminActivity.modifiedDate}" />
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org