shesmer 01/05/04 04:23:16
Modified: src/java/org/apache/jetspeed/modules/actions Tag:
portlet_api JLoginUser.java
Log:
portlet api 2 implementation
Revision Changes Path
No revision
No revision
1.10.2.1 +21 -18
jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/JLoginUser.java
Index: JLoginUser.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/JLoginUser.java,v
retrieving revision 1.10
retrieving revision 1.10.2.1
diff -u -r1.10 -r1.10.2.1
--- JLoginUser.java 2001/04/25 00:09:22 1.10
+++ JLoginUser.java 2001/05/04 11:23:10 1.10.2.1
@@ -58,6 +58,7 @@
// Java Core Classes
import java.sql.Connection;
import java.sql.SQLException;
+import java.util.Hashtable;
// Turbine Modules
import org.apache.turbine.modules.Action;
@@ -79,8 +80,11 @@
import com.workingdogs.village.TableDataSet;
import com.workingdogs.village.QueryDataSet;
import com.workingdogs.village.Record;
-import org.apache.jetspeed.services.resources.JetspeedResources;
-import org.apache.jetspeed.services.profiler.ProfileManager;
+
+// Jetspeed
+import org.apache.jetspeed.portletcontainer.invoker.*;
+import org.apache.jetspeed.portletcontainer.information.*;
+
/**
This class is responsible for logging a user into the system. It is also
responsible for making sure that the user has been marked as confirmed.
@@ -89,7 +93,9 @@
*/
public class JLoginUser extends Action
{
-
+ /** this is the value that is stored in the database for confirmed users */
+ private static final String CONFIRM_VALUE = "CONFIRMED";
+
public void doPerform( RunData data ) throws Exception
{
// This prevents a db hit on second Action call during page
@@ -142,7 +148,7 @@
// check to make sure the user entered the right confirmation
key
// if not, then send them to the ConfirmRegistration screen
String confirm_value = rec.getValue("CONFIRM_VALUE").asString();
- if ( ! secretkey.equals ( confirm_value ) && !
confirm_value.equals ( JetspeedResources.CONFIRM_VALUE ) )
+ if ( ! secretkey.equals ( confirm_value ) && !
confirm_value.equals ( CONFIRM_VALUE ) )
{
data.setMessage(Localization.getString("JLOGINUSER_KEYNOTVALID"));
data.setScreen("ConfirmRegistration");
@@ -150,9 +156,9 @@
}
// if the user is not confirmed
- if ( ! confirm_value.equals ( JetspeedResources.CONFIRM_VALUE )
)
+ if ( ! confirm_value.equals ( CONFIRM_VALUE ) )
{
- rec.setValue ( "CONFIRM_VALUE",
JetspeedResources.CONFIRM_VALUE );
+ rec.setValue ( "CONFIRM_VALUE", CONFIRM_VALUE );
rec.save();
// Asign this user the role of authenticated_user.
@@ -229,18 +235,6 @@
Log.note("User hasLoggedIn1: " + data.getUser().hasLoggedIn() );
if ( data.getUser().hasLoggedIn() )
{
- if (JetspeedResources.getBoolean("services.ProfileManager.enable",
false))
- {
- // As the user is already in the db, we better
- // send the email, no matter the error we get here
- try {
- String username = data.getParameters().getString("username");
- ProfileManager.createUserProfile(data, username);
- } catch (Throwable t) {
- Log.error(t);
- }
- }
-
// get a connection to the db
DBConnection db = TurbineDB.getConnection();
Connection connection = db.getConnection();
@@ -268,6 +262,15 @@
if ( qds != null ) qds.close();
TurbineDB.releaseConnection(db);
}
+
+ // SHESMER - Portlet API 2
+ PortletInvoker invoker = PortletInvokerImpl.getInstance();
+ Hashtable parameters = new Hashtable();
+ parameters.put("request",data.getRequest());
+ invoker.perform(
+
org.apache.jetspeed.portletcontainer.invoker.PortletInvoker.Event.USER_LOGGED_IN,
+ parameters);
+
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]