Author: ruchith
Date: Wed Dec  5 22:44:49 2007
New Revision: 10598

Log:

Fixed IDENTITY-139 and IDENTITY-65

Added:
   trunk/solutions/identity/modules/identity-provider/conf/log4j.properties
   
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/action/RemoveRelyingPartyAction.java
Modified:
   trunk/solutions/identity/modules/distribution/src/assemble/assembly-bin.xml
   
trunk/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/admin/RelyingPartyAdmin.java
   
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/action/ShowMainAction.java
   trunk/solutions/identity/modules/user-ui/src/main/resources/struts.xml
   trunk/solutions/identity/modules/user-ui/src/main/webapp/jsp/main.jsp

Modified: 
trunk/solutions/identity/modules/distribution/src/assemble/assembly-bin.xml
==============================================================================
--- trunk/solutions/identity/modules/distribution/src/assemble/assembly-bin.xml 
(original)
+++ trunk/solutions/identity/modules/distribution/src/assemble/assembly-bin.xml 
Wed Dec  5 22:44:49 2007
@@ -84,6 +84,7 @@
                 <exclude>**/conf/server.xml</exclude>
                 <exclude>**/conf/**.jks</exclude>
                 <exclude>**/conf/**.jks</exclude>
+                               <exclude>**/conf/log4j.properties</exclude>
                 <exclude>**/rampart/**</exclude>
                 <exclude>**/samples/**</exclude>
                 <exclude>**/lib/rampart-**</exclude>
@@ -220,6 +221,11 @@
             <filtered>true</filtered>
             <destName>server.xml</destName>
         </file>
+        <file>
+            <source>../identity-provider/conf/log4j.properties</source>
+            
<outputDirectory>${identity.solution.home.dir}/conf</outputDirectory>
+                       <destName>log4j.properties</destName>
+               </file>
 
 
         <file>

Added: trunk/solutions/identity/modules/identity-provider/conf/log4j.properties
==============================================================================
--- (empty file)
+++ trunk/solutions/identity/modules/identity-provider/conf/log4j.properties    
Wed Dec  5 22:44:49 2007
@@ -0,0 +1,86 @@
+#
+# Copyright 2005-2007 WSO2, Inc. (http://wso2.com)
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+#
+# This is the log4j configuration file used by WSO2 WSAS
+#
+# IMPORTANT : Please do not remove or change the names of any
+# of the Appenders defined here. The layout pattern & log file
+# can be changed using the WSO2 WSAS Management Console, and those
+# settings will override the settings in this file.
+#
+
+log4j.rootLogger=INFO, WSO2WSAS_CONSOLE, WSO2WSAS_LOGFILE, WSO2WSAS_MEMORY, 
WSO2WSAS_SYS_LOG
+
+log4j.logger.org.apache.axis2.wsdl.codegen.writer.PrettyPrinter=ERROR, 
WSO2WSAS_LOGFILE, WSO2WSAS_MEMORY
+log4j.logger.org.apache.axis2.clustering=DEBUG, WSO2WSAS_CONSOLE, 
WSO2WSAS_LOGFILE
+log4j.logger.org.apache=ERROR, WSO2WSAS_LOGFILE, WSO2WSAS_MEMORY
+log4j.logger.org.wso2.solutions.identity=ERROR, WSO2WSAS_LOGFILE, 
WSO2WSAS_MEMORY
+log4j.logger.org.apache.catalina=WARN
+log4j.logger.org.apache.coyote=WARN
+log4j.logger.org.hibernate=ERROR, WSO2WSAS_LOGFILE, WSO2WSAS_MEMORY
+log4j.logger.org.mortbay=ERROR, WSO2WSAS_LOGFILE, WSO2WSAS_MEMORY
+log4j.logger.net.sf=ERROR
+log4j.logger.org.wso2=INFO
+log4j.logger.org.apache.axis2.enterprise=FATAL, WSO2WSAS_LOGFILE, 
WSO2WSAS_MEMORY
+log4j.logger.de.hunsicker.jalopy.io=FATAL, WSO2WSAS_LOGFILE, WSO2WSAS_MEMORY
+
+log4j.logger.trace.messages=TRACE,WSO2WSAS_TRACE_LOGFILE
+
+log4j.additivity.org.apache.axis2.clustering=false
+
+# WSO2WSAS_CONSOLE is set to be a ConsoleAppender using a PatternLayout.
+log4j.appender.WSO2WSAS_CONSOLE=org.apache.log4j.ConsoleAppender
+log4j.appender.WSO2WSAS_CONSOLE.layout=org.apache.log4j.PatternLayout
+# ConversionPattern will be overridden by the configuration setting in the DB
+log4j.appender.WSO2WSAS_CONSOLE.layout.ConversionPattern=%5p [%d] %x %m%n
+log4j.appender.WSO2WSAS_CONSOLE.threshold=DEBUG
+
+
+# WSO2WSAS_MEMORY is set to be a MemoryAppender using a PatternLayout.
+log4j.appender.WSO2WSAS_MEMORY=org.wso2.utils.MemoryAppender
+log4j.appender.WSO2WSAS_MEMORY.layout=org.apache.log4j.PatternLayout
+log4j.appender.WSO2WSAS_MEMORY.bufferSize=200
+# ConversionPattern will be overridden by the configuration setting in the DB
+log4j.appender.WSO2WSAS_MEMORY.layout.ConversionPattern=%5p [%d] %x %m%n
+log4j.appender.WSO2WSAS_MEMORY.threshold=DEBUG
+
+# WSO2WSAS_LOGFILE is set to be a DailyRollingFileAppender using a 
PatternLayout.
+log4j.appender.WSO2WSAS_LOGFILE=org.apache.log4j.DailyRollingFileAppender
+# Log file will be overridden by the configuration setting in the DB
+# This path should be relative to WSO2 WSAS Home
+log4j.appender.WSO2WSAS_LOGFILE.File=logs/wso2wsas.log
+log4j.appender.WSO2WSAS_LOGFILE.Append=true
+log4j.appender.WSO2WSAS_LOGFILE.layout=org.apache.log4j.PatternLayout
+# ConversionPattern will be overridden by the configuration setting in the DB
+log4j.appender.WSO2WSAS_LOGFILE.layout.ConversionPattern=%5p [%d] %x %m%n
+log4j.appender.WSO2WSAS_LOGFILE.threshold=DEBUG
+
+log4j.appender.WSO2WSAS_SYS_LOG = org.apache.log4j.net.SyslogAppender
+log4j.appender.WSO2WSAS_SYS_LOG.layout=org.apache.log4j.PatternLayout
+log4j.appender.WSO2WSAS_SYS_LOG.layout.ConversionPattern=%5p [%d] %x %m%n
+log4j.appender.WSO2WSAS_SYS_LOG.SyslogHost=localhost
+log4j.appender.WSO2WSAS_SYS_LOG.Facility=USER
+log4j.appender.WSO2WSAS_SYS_LOG.threshold=DEBUG
+
+# Appender config to WSO2WSAS_TRACE_LOGFILE
+log4j.appender.WSO2WSAS_TRACE_LOGFILE=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.WSO2WSAS_TRACE_LOGFILE.File=logs/wso2wsas-trace-messages.log
+log4j.appender.WSO2WSAS_TRACE_LOGFILE.Append=true
+log4j.appender.WSO2WSAS_TRACE_LOGFILE.layout=org.apache.log4j.PatternLayout
+log4j.appender.WSO2WSAS_TRACE_LOGFILE.layout.ConversionPattern=%5p [%d] %x %m%n
+log4j.appender.WSO2WSAS_TRACE_LOGFILE.threshold=TRACE
+log4j.additivity.trace.messages=false

Modified: 
trunk/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/admin/RelyingPartyAdmin.java
==============================================================================
--- 
trunk/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/admin/RelyingPartyAdmin.java
   (original)
+++ 
trunk/solutions/identity/modules/identity-provider/src/main/java/org/wso2/solutions/identity/admin/RelyingPartyAdmin.java
   Wed Dec  5 22:44:49 2007
@@ -92,4 +92,18 @@
         return dbMan.getAllPersonalRelyingParties(userId);
     }
 
+    /**
+     * Remove a personal relying party
+     * @param user
+     * @param hostName
+     */
+    public void removePersonalRelyingParty(String user, String hostName)
+            throws IdentityProviderException {
+        UserPersonalRelyingPartyDO rpDO = dbMan.getPersonalRelyingParty(user, 
hostName);
+        dbMan.delete(rpDO);
+
+        KeystoreUtilAdmin ksAdmin = new KeystoreUtilAdmin();
+        ksAdmin.removeCertEntry(hostName);
+    }
+
 }
\ No newline at end of file

Added: 
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/action/RemoveRelyingPartyAction.java
==============================================================================
--- (empty file)
+++ 
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/action/RemoveRelyingPartyAction.java
     Wed Dec  5 22:44:49 2007
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2005-2007 WSO2, Inc. (http://wso2.com)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.wso2.solutions.identity.user.ui.action;
+
+import org.wso2.solutions.identity.admin.RelyingPartyAdmin;
+import org.wso2.solutions.identity.user.ui.UIConstants;
+
+import java.util.Map;
+
+import com.opensymphony.xwork2.ActionContext;
+
+public class RemoveRelyingPartyAction extends ManagedAction {
+
+    private static final long serialVersionUID = 636026822150779012L;
+
+    private String hostName;
+    
+    @Override
+    public String execute() throws Exception {
+        
+        Map session = ActionContext.getContext().getSession();
+        String user = (String) session.get(UIConstants.USER);
+        
+        RelyingPartyAdmin admin = new RelyingPartyAdmin();
+        admin.removePersonalRelyingParty(user, hostName);
+        
+        return SUCCESS;
+    }
+
+    public String getHostName() {
+        return hostName;
+    }
+
+    public void setHostName(String hostName) {
+        this.hostName = hostName;
+    }
+    
+}

Modified: 
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/action/ShowMainAction.java
==============================================================================
--- 
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/action/ShowMainAction.java
       (original)
+++ 
trunk/solutions/identity/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/action/ShowMainAction.java
       Wed Dec  5 22:44:49 2007
@@ -16,9 +16,7 @@
 
 package org.wso2.solutions.identity.user.ui.action;
 
-import org.wso2.solutions.identity.IdentityProviderConstants;
 import org.wso2.solutions.identity.admin.ClaimsAdmin;
-import org.wso2.solutions.identity.admin.ParameterAdmin;
 import org.wso2.solutions.identity.admin.RegisteredInfoCardInfoAdmin;
 import org.wso2.solutions.identity.admin.RelyingPartyAdmin;
 import org.wso2.solutions.identity.persistence.dataobject.ClaimDO;
@@ -40,14 +38,14 @@
     private List claims;
 
     private List registeredInformationCards;
-    
+
     public String execute() throws Exception {
 
         RelyingPartyAdmin admin = new RelyingPartyAdmin();
 
         Map session = ActionContext.getContext().getSession();
         String user = (String) session.get(UIConstants.USER);
-                
+
         this.personalRPs = Arrays.asList((UserPersonalRelyingPartyDO[]) admin
                 .getAllPersonalRelyingParties(user));
 
@@ -56,10 +54,11 @@
         this.claims = Arrays.asList((ClaimDO[]) claimDOs);
 
         RegisteredInfoCardInfoAdmin regCardInfoAdmin = new 
RegisteredInfoCardInfoAdmin();
-        this.registeredInformationCards = 
regCardInfoAdmin.getAllRegisteredInfoCards(user);
+        this.registeredInformationCards = regCardInfoAdmin
+                .getAllRegisteredInfoCards(user);
 
         this.loadMessages();
-        
+
         return SUCCESS;
     }
 

Modified: trunk/solutions/identity/modules/user-ui/src/main/resources/struts.xml
==============================================================================
--- trunk/solutions/identity/modules/user-ui/src/main/resources/struts.xml      
(original)
+++ trunk/solutions/identity/modules/user-ui/src/main/resources/struts.xml      
Wed Dec  5 22:44:49 2007
@@ -83,6 +83,12 @@
             <result name="error" type="redirect">ShowMain.action</result>
         </action>
 
+        <action name="RemoveRelyingParty"
+                
class="org.wso2.solutions.identity.user.ui.action.RemoveRelyingPartyAction">
+            <result name="success" type="redirect">ShowMain.action</result>
+            <result name="error" type="redirect">ShowMain.action</result>
+        </action>
+
         <action name="RequestRegisterInfoCard"
                 
class="org.wso2.solutions.identity.user.ui.action.RequestRegisterInfoCardAction">
             <result name="success">jsp/infocardrequest.jsp</result>

Modified: trunk/solutions/identity/modules/user-ui/src/main/webapp/jsp/main.jsp
==============================================================================
--- trunk/solutions/identity/modules/user-ui/src/main/webapp/jsp/main.jsp       
(original)
+++ trunk/solutions/identity/modules/user-ui/src/main/webapp/jsp/main.jsp       
Wed Dec  5 22:44:49 2007
@@ -141,7 +141,10 @@
                        <div class="relying-parties-title">Personal Trusted 
Relying Parties</div>
                        <table cellpadding="0" cellspacing="0" border="0" 
class="data-table">
                                <s:iterator value="personalRPs">
-                                       <tr><td><s:property 
value="identifier.hostName" /></td></tr>
+                                       <s:url id="removeRP" namespace="/" 
action="RemoveRelyingParty">
+                            <s:param name="hostName" 
value="identifier.hostName" />
+                        </s:url>
+                                       <tr><td><s:property 
value="identifier.hostName"/></td><td><s:a 
href="%{removeRP}">Remove</s:a></td></tr>
                                </s:iterator>
                        </table>
                        

_______________________________________________
Identity-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/identity-dev

Reply via email to