roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r225383 - in /incubator/roller/branches/roller_2.0: metadata/xdoclet/ src/org/roller/business/ src/org/roller/business/hibernate/ src/org/roller/model/ src/org/roller/pojos/ src/org/roller/presentation/ src/org/roller/presentation/tags/menu...
Date Tue, 26 Jul 2005 20:09:26 GMT
Author: snoopdave
Date: Tue Jul 26 13:09:08 2005
New Revision: 225383

URL: http://svn.apache.org/viewcvs?rev=225383&view=rev
Log:
Group blogging LIVES! Enough rough UI is in place to allow a user to have multiple websites
and a website to have multiple users. Next up: completing and polishing up the UI.

Added:
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/formbeans/InviteMemberForm.java
Modified:
    incubator/roller/branches/roller_2.0/metadata/xdoclet/global-forwards.xml
    incubator/roller/branches/roller_2.0/src/org/roller/business/UserManagerImpl.java
    incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateUserManagerImpl.java
    incubator/roller/branches/roller_2.0/src/org/roller/model/UserManager.java
    incubator/roller/branches/roller_2.0/src/org/roller/pojos/WebsiteObject.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/RollerSession.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/BaseRollerMenu.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/RollerMenuModel.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/PageModel.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/InviteMemberAction.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/MemberPermissionsAction.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/UserNewAction.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/YourWebsitesAction.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/formbeans/YourWebsitesForm.java
    incubator/roller/branches/roller_2.0/web/WEB-INF/classes/menu-tabbed.vm
    incubator/roller/branches/roller_2.0/web/WEB-INF/classes/navbar.vm
    incubator/roller/branches/roller_2.0/web/index.jsp
    incubator/roller/branches/roller_2.0/web/login-redirect.jsp
    incubator/roller/branches/roller_2.0/web/logout-redirect.jsp
    incubator/roller/branches/roller_2.0/web/theme/header.jsp
    incubator/roller/branches/roller_2.0/web/theme/status.jsp
    incubator/roller/branches/roller_2.0/web/website/InviteMember.jsp
    incubator/roller/branches/roller_2.0/web/website/NewWebsite.jsp
    incubator/roller/branches/roller_2.0/web/website/UserNew.jsp
    incubator/roller/branches/roller_2.0/web/website/YourWebsites.jsp

Modified: incubator/roller/branches/roller_2.0/metadata/xdoclet/global-forwards.xml
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/metadata/xdoclet/global-forwards.xml?rev=225383&r1=225382&r2=225383&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/metadata/xdoclet/global-forwards.xml (original)
+++ incubator/roller/branches/roller_2.0/metadata/xdoclet/global-forwards.xml Tue Jul 26 13:09:08
2005
@@ -8,8 +8,8 @@
 <forward name="page"                   path="/page"/>
 <forward name="main"                   path="/main.do"/>
 <forward name="home.page"              path="/main.do"/>
-<forward name="createUser"             path="/yourProfile.do?method=createUser"/>
-<forward name="registerUser"           path="/yourProfile.do?method=registerUser"/>
+<forward name="createUser"             path="/user.do?method=createUser"/>
+<forward name="registerUser"           path="/user.do?method=registerUser"/>
 
 <!--  editor and admin role actions -->
 <forward name="bookmarks"              path="/editor/bookmarks.do?method=selectFolder"/>

Modified: incubator/roller/branches/roller_2.0/src/org/roller/business/UserManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/business/UserManagerImpl.java?rev=225383&r1=225382&r2=225383&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/business/UserManagerImpl.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/business/UserManagerImpl.java Tue
Jul 26 13:09:08 2005
@@ -50,6 +50,12 @@
     {
     }
             
+    public PermissionsData retrievePermissionsData(String inviteId) 
+        throws RollerException
+    {
+        return (PermissionsData)mStrategy.load(inviteId, PermissionsData.class);
+    }
+    
     //--------------------------------------------------------------- Website
 
     public WebsiteData retrieveWebsite(String id) throws RollerException

Modified: incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateUserManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateUserManagerImpl.java?rev=225383&r1=225382&r2=225383&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateUserManagerImpl.java
(original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernateUserManagerImpl.java
Tue Jul 26 13:09:08 2005
@@ -73,6 +73,7 @@
             {
                 criteria.createAlias("permissions","permissions");
                 criteria.add(Expression.eq("permissions.user", user));
+                criteria.add(Expression.eq("permissions.pending", Boolean.FALSE));
             }
             if (enabled != null)
             {

Modified: incubator/roller/branches/roller_2.0/src/org/roller/model/UserManager.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/model/UserManager.java?rev=225383&r1=225382&r2=225383&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/model/UserManager.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/model/UserManager.java Tue Jul 26
13:09:08 2005
@@ -69,6 +69,9 @@
     public PermissionsData getPermissions(
             WebsiteData website, UserData user) throws RollerException;
     
+    public PermissionsData retrievePermissionsData(String inviteId) 
+        throws RollerException;
+
     /**
      * Invite user to join a website with specific permissions
      * @param website Website to be joined (persistent instance) 

Modified: incubator/roller/branches/roller_2.0/src/org/roller/pojos/WebsiteObject.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/pojos/WebsiteObject.java?rev=225383&r1=225382&r2=225383&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/pojos/WebsiteObject.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/pojos/WebsiteObject.java Tue Jul 26
13:09:08 2005
@@ -19,7 +19,7 @@
             return true;
         }
         if (getWebsite().hasUserPermissions(
-           roller.getUser(), (short)(PermissionsData.ADMIN|PermissionsData.AUTHOR)))
+           roller.getUser(), (short)(PermissionsData.AUTHOR)))
         {
             return true;
         }

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/RollerSession.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/RollerSession.java?rev=225383&r1=225382&r2=225383&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/RollerSession.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/RollerSession.java Tue
Jul 26 13:09:08 2005
@@ -75,20 +75,18 @@
     /** Create session's Roller instance */
     public void sessionCreated(HttpSessionEvent se)
     {
-        // put this in session, so that we get HttpSessionActivationListener callbacks
-        se.getSession().setAttribute(ROLLER_SESSION, this);
-        
-        RollerContext rctx = RollerContext.getRollerContext(
-            se.getSession().getServletContext());       
+        RollerSession rollerSession = new RollerSession();
+        se.getSession().setAttribute(ROLLER_SESSION, rollerSession);
+        RollerContext rctx = 
+            RollerContext.getRollerContext(se.getSession().getServletContext());        
  
         rctx.sessionCreated(se);           
     }    
 
     public void sessionDestroyed(HttpSessionEvent se)
     {
-        RollerContext rctx = RollerContext.getRollerContext(
-            se.getSession().getServletContext());
-        rctx.sessionDestroyed(se);           
-        
+        RollerContext rctx = 
+            RollerContext.getRollerContext(se.getSession().getServletContext());
+        rctx.sessionDestroyed(se);                 
         clearSession(se);        
     }
 
@@ -184,15 +182,6 @@
      */
     public WebsiteData getCurrentWebsite()
     {       
-        // ROLLER_2.0: allow user to pick current website instead of this...
-        /* if (currentWebsite == null) try 
-        {
-            Roller roller = RollerFactory.getRoller();
-            UserManager umgr = roller.getUserManager();
-            currentWebsite = (WebsiteData)
-                umgr.getWebsites(authenticatedUser, null).get(0);
-        }
-        catch (RollerException ignored) {} */
         return currentWebsite;
     }
 
@@ -224,20 +213,20 @@
         WebsiteData website = getCurrentWebsite();
         if (website != null && user != null) 
         {
-            return website.hasUserPermissions(user, 
-                (short)(PermissionsData.AUTHOR | PermissionsData.ADMIN));
+            return website.hasUserPermissions(user, (short)(PermissionsData.AUTHOR));
         }
         return false;
     }
 
     //--------------------------------------------------------------------- Innards
     
-    private  void clearSession( HttpSessionEvent se )
+    private void clearSession(HttpSessionEvent se)
     {
         HttpSession session = se.getSession();
         try
         {
-            session.removeAttribute( BREADCRUMB );
+            session.removeAttribute(BREADCRUMB);
+            session.removeAttribute(ROLLER_SESSION);
         }
         catch (Throwable e)
         {

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/BaseRollerMenu.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/BaseRollerMenu.java?rev=225383&r1=225382&r2=225383&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/BaseRollerMenu.java
(original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/BaseRollerMenu.java
Tue Jul 26 13:09:08 2005
@@ -113,9 +113,9 @@
             while (roles.hasNext())
             {
                 String role = (String)roles.next();
-                if (       role.equals("any") 
-                        || req.isUserInRole(role) 
-                        || (role.equals("admin") && rollerSession.isAdminUser()))
 
+                if (    req.isUserInRole(role) 
+                     || role.equals("any")
+                     || (role.equals("admin") && rollerSession.isAdminUser()))  
                 {
                     ret = true;
                     break;

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/RollerMenuModel.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/RollerMenuModel.java?rev=225383&r1=225382&r2=225383&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/RollerMenuModel.java
(original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/RollerMenuModel.java
Tue Jul 26 13:09:08 2005
@@ -163,13 +163,7 @@
 		RollerRequest rreq = RollerRequest.getRollerRequest(req);
 		try
 		{
-			UserData user = RollerSession.getRollerSession(req).getAuthenticatedUser();
-			String fid = 
-                rreq.getFolder()==null ? null : rreq.getFolder().getId();
-			if ( user != null ) 
-			{
-				params.put( RollerRequest.USERNAME_KEY, user.getUserName() );
-			}
+			String fid = rreq.getFolder()==null ? null : rreq.getFolder().getId();
 			if ( fid != null ) 
 			{
 				params.put( RollerRequest.FOLDERID_KEY, fid );

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/PageModel.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/PageModel.java?rev=225383&r1=225382&r2=225383&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/PageModel.java
(original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/PageModel.java
Tue Jul 26 13:09:08 2005
@@ -645,8 +645,8 @@
     {
         try
         {
-            RollerSession rollerSession = RollerSession.getRollerSession(
-                    mRollerReq.getRequest());
+            RollerSession rollerSession = 
+                RollerSession.getRollerSession(mRollerReq.getRequest());
             return rollerSession.isUserAuthorizedToEdit();
         }
         catch (Exception e)
@@ -654,6 +654,13 @@
             mLogger.warn("PageModel.isUserAuthorizedToEdit)", e);
         }
         return false;
+    }
+    
+    //------------------------------------------------------------------------
+    
+    public boolean isUserAuthenticated()
+    {
+        return (mRollerReq.getRequest().getUserPrincipal() != null);
     }
     
     //------------------------------------------------------------------------

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/InviteMemberAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/InviteMemberAction.java?rev=225383&r1=225382&r2=225383&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/InviteMemberAction.java
(original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/InviteMemberAction.java
Tue Jul 26 13:09:08 2005
@@ -8,21 +8,47 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.struts.action.ActionError;
+import org.apache.struts.action.ActionErrors;
 import org.apache.struts.action.ActionForm;
 import org.apache.struts.action.ActionForward;
 import org.apache.struts.action.ActionMapping;
+import org.apache.struts.action.ActionMessage;
+import org.apache.struts.action.ActionMessages;
 import org.apache.struts.actions.DispatchAction;
+import org.roller.model.RollerFactory;
+import org.roller.model.UserManager;
+import org.roller.pojos.PermissionsData;
+import org.roller.pojos.UserData;
+import org.roller.pojos.WebsiteData;
+import org.roller.presentation.RollerSession;
+import org.roller.presentation.website.formbeans.InviteMemberForm;
 
 /**
  * Allows website admin to invite new members to website.
  * 
- * @struts.action path="/editor/inviteMembers" parameter="method"
- * @struts.action-forward name="inviteMembers.page" path="/website/InviteMembers.jsp"
+ * @struts.action path="/editor/inviteMember" parameter="method" name="inviteMemberForm"
+ * @struts.action-forward name="inviteMembers.page" path="/website/InviteMember.jsp"
  */
 public class InviteMemberAction extends DispatchAction
 {
     private static Log mLogger =
         LogFactory.getFactory().getInstance(InviteMemberAction.class);
+
+    /** If method param is not specified, use HTTP verb to pick method to call */
+    public ActionForward unspecified(
+            ActionMapping       mapping,
+            ActionForm          actionForm,
+            HttpServletRequest  request,
+            HttpServletResponse response)
+            throws Exception
+    {
+        if (request.getMethod().equals("GET"))
+        {
+            return edit(mapping, actionForm, request, response);
+        }
+        return save(mapping, actionForm, request, response);
+    }
     
     public ActionForward edit(
         ActionMapping       mapping,
@@ -31,6 +57,52 @@
         HttpServletResponse response)
         throws IOException, ServletException
     {
+        ActionForward forward = mapping.findForward("inviteMembers.page");
+        return forward; 
+    }
+    
+    public ActionForward save(
+            ActionMapping       mapping,
+            ActionForm          actionForm,
+            HttpServletRequest  request,
+            HttpServletResponse response)
+            throws Exception
+    {
+        ActionMessages msgs = new ActionMessages();
+        ActionMessages errors = new ActionErrors();
+        InviteMemberForm form = (InviteMemberForm)actionForm;
+        UserManager umgr = RollerFactory.getRoller().getUserManager();
+        UserData user = umgr.getUser(form.getUserName());
+        if (user == null)
+        {
+            errors.add(ActionErrors.GLOBAL_ERROR, 
+                new ActionError("inviteMembers.error.userNotFound"));
+        }
+        else 
+        {
+            RollerSession rses = RollerSession.getRollerSession(request);
+            WebsiteData website = rses.getCurrentWebsite();
+            PermissionsData perms = umgr.getPermissions(website, user);
+            if (perms != null && perms.isPending())
+            {
+                errors.add(ActionErrors.GLOBAL_ERROR, 
+                    new ActionError("inviteMembers.error.userAlreadyInvited"));
+            }
+            else if (perms != null)
+            {
+                errors.add(ActionErrors.GLOBAL_ERROR, 
+                    new ActionError("inviteMembers.error.userAlreadyMember"));
+            }
+            else
+            {
+                umgr.inviteUser(website, user, PermissionsData.AUTHOR);
+                // ROLLER_2.0: notify user by email of invitation
+                msgs.add(ActionMessages.GLOBAL_MESSAGE, 
+                    new ActionMessage("inviteMembers.userInvited"));
+            }
+        }
+        if (!errors.isEmpty()) saveErrors(request, errors);
+        if (!msgs.isEmpty()) saveMessages(request, msgs);
         ActionForward forward = mapping.findForward("inviteMembers.page");
         return forward; 
     }

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/MemberPermissionsAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/MemberPermissionsAction.java?rev=225383&r1=225382&r2=225383&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/MemberPermissionsAction.java
(original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/MemberPermissionsAction.java
Tue Jul 26 13:09:08 2005
@@ -24,12 +24,38 @@
     private static Log mLogger =
         LogFactory.getFactory().getInstance(MemberPermissionsAction.class);
     
+    /** If method param is not specified, use HTTP verb to pick method to call */
+    public ActionForward unspecified(
+            ActionMapping       mapping,
+            ActionForm          actionForm,
+            HttpServletRequest  request,
+            HttpServletResponse response)
+            throws Exception
+    {
+        if (request.getMethod().equals("GET"))
+        {
+            return edit(mapping, actionForm, request, response);
+        }
+        return save(mapping, actionForm, request, response);
+    }
+    
     public ActionForward edit(
-        ActionMapping       mapping,
-        ActionForm          actionForm,
-        HttpServletRequest  request,
-        HttpServletResponse response)
-        throws IOException, ServletException
+            ActionMapping       mapping,
+            ActionForm          actionForm,
+            HttpServletRequest  request,
+            HttpServletResponse response)
+            throws IOException, ServletException
+    {
+        ActionForward forward = mapping.findForward("memberPermissions.page");
+        return forward;
+    }
+    
+    public ActionForward save(
+            ActionMapping       mapping,
+            ActionForm          actionForm,
+            HttpServletRequest  request,
+            HttpServletResponse response)
+            throws IOException, ServletException
     {
         ActionForward forward = mapping.findForward("memberPermissions.page");
         return forward;

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/UserNewAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/UserNewAction.java?rev=225383&r1=225382&r2=225383&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/UserNewAction.java
(original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/UserNewAction.java
Tue Jul 26 13:09:08 2005
@@ -80,7 +80,7 @@
             userForm.setPasswordText(null);
             userForm.setPasswordConfirm(null);            
             request.setAttribute(
-                    "model", new BasePageModel(request, response, mapping));
+                "model", new BasePageModel(request, response, mapping));
         }
         catch (Exception e)
         {

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/YourWebsitesAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/YourWebsitesAction.java?rev=225383&r1=225382&r2=225383&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/YourWebsitesAction.java
(original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/YourWebsitesAction.java
Tue Jul 26 13:09:08 2005
@@ -78,11 +78,53 @@
         if (selectedWebsite.hasUserPermissions(user, PermissionsData.LIMITED))
         {
             rollerSession.setCurrentWebsite(selectedWebsite);
-        }
+        }        
+        request.setAttribute("model",
+                new YourWebsitesPageModel(request, response, mapping));
+        ActionForward forward = mapping.findForward("yourWebsites.page");
+        return forward;
+    }
+        
+    public ActionForward accept(
+            ActionMapping       mapping,
+            ActionForm          actionForm,
+            HttpServletRequest  request,
+            HttpServletResponse response)
+            throws Exception
+    {
+        YourWebsitesForm form = (YourWebsitesForm)actionForm;
+        Roller roller = RollerFactory.getRoller();
+        PermissionsData perms = 
+            roller.getUserManager().retrievePermissionsData(form.getInviteId());
+        
+        perms.setPending(false);
+        // ROLLER_2.0: notify inviter that invitee has accepted invitation  
+        roller.commit();
+        
+        request.setAttribute("model",
+                new YourWebsitesPageModel(request, response, mapping));
+        ActionForward forward = mapping.findForward("yourWebsites.page");
+        return forward;
+    }
+        
+    public ActionForward decline(
+            ActionMapping       mapping,
+            ActionForm          actionForm,
+            HttpServletRequest  request,
+            HttpServletResponse response)
+            throws Exception
+    {
+        YourWebsitesForm form = (YourWebsitesForm)actionForm;
+        Roller roller = RollerFactory.getRoller();
+        PermissionsData perms = 
+            roller.getUserManager().retrievePermissionsData(form.getInviteId());
+        
+        perms.remove();
+        // ROLLER_2.0: notify inviter that invitee has declined invitation  
+        roller.commit();
         
         request.setAttribute("model",
                 new YourWebsitesPageModel(request, response, mapping));
-
         ActionForward forward = mapping.findForward("yourWebsites.page");
         return forward;
     }

Added: incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/formbeans/InviteMemberForm.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/formbeans/InviteMemberForm.java?rev=225383&view=auto
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/formbeans/InviteMemberForm.java
(added)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/formbeans/InviteMemberForm.java
Tue Jul 26 13:09:08 2005
@@ -0,0 +1,20 @@
+package org.roller.presentation.website.formbeans;
+
+import org.apache.struts.action.ActionForm;
+
+/**
+ * @struts.form name="inviteMemberForm"
+ * @author Dave M Johnson
+ */
+public class InviteMemberForm extends ActionForm
+{
+    private String userName;
+    public String getUserName()
+    {
+        return userName;
+    }
+    public void setUserName(String userName)
+    {
+        this.userName = userName;
+    }
+}

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/formbeans/YourWebsitesForm.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/formbeans/YourWebsitesForm.java?rev=225383&r1=225382&r2=225383&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/formbeans/YourWebsitesForm.java
(original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/formbeans/YourWebsitesForm.java
Tue Jul 26 13:09:08 2005
@@ -8,6 +8,7 @@
  */
 public class YourWebsitesForm extends ActionForm
 {
+    private String inviteId; 
     private String websiteId; 
     public String getWebsiteId()
     {
@@ -16,5 +17,13 @@
     public void setWebsiteId(String websiteId)
     {
         this.websiteId = websiteId;
+    }
+    public String getInviteId()
+    {
+        return inviteId;
+    }
+    public void setInviteId(String inviteId)
+    {
+        this.inviteId = inviteId;
     }
 }

Modified: incubator/roller/branches/roller_2.0/web/WEB-INF/classes/menu-tabbed.vm
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/web/WEB-INF/classes/menu-tabbed.vm?rev=225383&r1=225382&r2=225383&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/web/WEB-INF/classes/menu-tabbed.vm (original)
+++ incubator/roller/branches/roller_2.0/web/WEB-INF/classes/menu-tabbed.vm Tue Jul 26 13:09:08
2005
@@ -37,7 +37,6 @@
           #if ( $count > 0 )
             &nbsp;|&nbsp; 
           #end
-    
           #if ( $item.isSelected( $req ) )
           <a class="tmItemLinkSelected" href="$item.getUrl($ctx)">$text.get( $item.getName()
)</a> 
     	      #else

Modified: incubator/roller/branches/roller_2.0/web/WEB-INF/classes/navbar.vm
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/web/WEB-INF/classes/navbar.vm?rev=225383&r1=225382&r2=225383&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/web/WEB-INF/classes/navbar.vm (original)
+++ incubator/roller/branches/roller_2.0/web/WEB-INF/classes/navbar.vm Tue Jul 26 13:09:08
2005
@@ -86,20 +86,22 @@
 
     ## strutsUrlHelper( useIds, isAction, path, val1, val2)
     #if( $model.isUserAuthorizedToEdit() )
-        #set( $editUrl = $rawUrl )
         #set( $editUrl = $pageHelper.strutsUrlHelper(false, true, "weblogCreate", "tabbedmenu.weblog",
"tabbedmenu.weblog.newEntry") )
         #printNavLink( $editUrl $text.get("navigationBar.newEntry") $useCSS $vertical $delimiter
)
 
-        #set( $editUrl = $rawUrl )
         #set( $editUrl = $pageHelper.strutsUrlHelper(false, true, "editWebsite", "tabbedmenu.website",
"tabbedmenu.website.settings") )
         #printNavLink( $editUrl $text.get("navigationBar.settings") $useCSS $vertical $delimiter
)
 
-        #set( $editUrl = $rawUrl )
         #set( $editUrl = $pageHelper.strutsUrlHelper(false, true, "logout-redirect", "",
"") )
         #printNavLink( $editUrl $text.get("navigationBar.logout") $useCSS $vertical $delimiter
)
     #else
-        #set( $editUrl = $pageHelper.strutsUrlHelper(false, true, "login-redirect", "", "")
)
-        #printNavLink( $editUrl $text.get("navigationBar.login") $useCSS $vertical $delimiter
)
+        #if( $model.isUserAuthenticated() )
+           #set( $editUrl = $pageHelper.strutsUrlHelper(false, true, "logout-redirect", "",
"") )
+           #printNavLink( $editUrl $text.get("navigationBar.logout") $useCSS $vertical $delimiter
)
+        #else
+           #set( $editUrl = $pageHelper.strutsUrlHelper(false, true, "login-redirect", "",
"") )
+           #printNavLink( $editUrl $text.get("navigationBar.login") $useCSS $vertical $delimiter
)
+        #end
     #end
     </$container >
 #end

Modified: incubator/roller/branches/roller_2.0/web/index.jsp
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/web/index.jsp?rev=225383&r1=225382&r2=225383&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/web/index.jsp (original)
+++ incubator/roller/branches/roller_2.0/web/index.jsp Tue Jul 26 13:09:08 2005
@@ -1,5 +1,2 @@
-<%@ page language="java" %>	
-<jsp:forward page="editor/yourWebsites.do?rmik=tabbedmenu.main&rmk=tabbedmenu.yourWebsites"
/>
-<%--
-<jsp:forward page="main.do?rmik=tabbedmenu.main&rmk=tabbedmenu.main" />
---%>
\ No newline at end of file
+<%@ page language="java" %>	
+<jsp:forward page="main.do?rmik=tabbedmenu.main&rmk=tabbedmenu.main" />
\ No newline at end of file

Modified: incubator/roller/branches/roller_2.0/web/login-redirect.jsp
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/web/login-redirect.jsp?rev=225383&r1=225382&r2=225383&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/web/login-redirect.jsp (original)
+++ incubator/roller/branches/roller_2.0/web/login-redirect.jsp Tue Jul 26 13:09:08 2005
@@ -6,8 +6,9 @@
 <c:if test='${secure_login == "true"}' >
   <roller:secure mode="unsecured" />
 </c:if>
-<%
-String dest = "editor/weblog.do?method=create&rmk=tabbedmenu.weblog&rmik=tabbedmenu.weblog.newEntry";
+<%
+// ROLLER_2.0: if user has one website, then go to editor page instead (as before)
+String dest = "editor/yourWebsites.do?method=edit&rmik=tabbedmenu.user.websites";
 response.sendRedirect(dest);
 %>
 

Modified: incubator/roller/branches/roller_2.0/web/logout-redirect.jsp
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/web/logout-redirect.jsp?rev=225383&r1=225382&r2=225383&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/web/logout-redirect.jsp (original)
+++ incubator/roller/branches/roller_2.0/web/logout-redirect.jsp Tue Jul 26 13:09:08 2005
@@ -1,6 +1,8 @@
-
-<%
-request.getSession().invalidate();
-response.sendRedirect("index.jsp");
+<%@ page language="java" contentType="text/html; charset=UTF-8" %>
+<%@ page import="org.roller.presentation.RollerSession" %>
+<% 
+request.getSession().removeAttribute(RollerSession.ROLLER_SESSION);
+request.getSession().invalidate(); 
+response.sendRedirect("index.jsp"); 
 %>
 

Modified: incubator/roller/branches/roller_2.0/web/theme/header.jsp
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/web/theme/header.jsp?rev=225383&r1=225382&r2=225383&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/web/theme/header.jsp (original)
+++ incubator/roller/branches/roller_2.0/web/theme/header.jsp Tue Jul 26 13:09:08 2005
@@ -29,11 +29,11 @@
         </div>
     </div>
 
-    <%-- <div id="left" class="left">
+    <div id="left" class="left">
         <c:if test="${!empty leftPage}">
             <c:import url="${leftPage}" />
         </c:if>
-    </div> --%>
+    </div>
 
     <div id="content">
     <% 

Modified: incubator/roller/branches/roller_2.0/web/theme/status.jsp
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/web/theme/status.jsp?rev=225383&r1=225382&r2=225383&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/web/theme/status.jsp (original)
+++ incubator/roller/branches/roller_2.0/web/theme/status.jsp Tue Jul 26 13:09:08 2005
@@ -5,12 +5,10 @@
     <html:link forward="logout-redirect"><fmt:message key="navigationBar.logout"/></html:link>
 </logic:present>
 
-
 <logic:present name="allowNewUsers" scope="request" >
     <html:link forward="login-redirect"><fmt:message key="navigationBar.login"/></html:link><br
/><br />
     <html:link forward="registerUser"><fmt:message key="navigationBar.register"/></html:link>
 </logic:present>
-
 
 <logic:notPresent name="loggedIn">
     <logic:notPresent name="allowNewUsers">

Modified: incubator/roller/branches/roller_2.0/web/website/InviteMember.jsp
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/web/website/InviteMember.jsp?rev=225383&r1=225382&r2=225383&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/web/website/InviteMember.jsp (original)
+++ incubator/roller/branches/roller_2.0/web/website/InviteMember.jsp Tue Jul 26 13:09:08
2005
@@ -1,6 +1,19 @@
 <%@ include file="/taglibs.jsp" %><%@ include file="/theme/header.jsp" %>
 
 <h1><fmt:message key="inviteMember.title" /></h1>
+
+<html:form action="/editor/inviteMember" method="post" focus="handle">
+
+    <div class="formrow">
+       <label for="userName" class="formrow" /><fmt:message key="inviteMember.userName"
/></label>
+       <html:text property="userName" size="30" maxlength="30" />
+    </div>
+
+    <div class="control">
+       <html:submit /></input>
+    </div>
+    
+</html:form>
     
 <%@ include file="/theme/footer.jsp" %>
 

Modified: incubator/roller/branches/roller_2.0/web/website/NewWebsite.jsp
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/web/website/NewWebsite.jsp?rev=225383&r1=225382&r2=225383&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/web/website/NewWebsite.jsp (original)
+++ incubator/roller/branches/roller_2.0/web/website/NewWebsite.jsp Tue Jul 26 13:09:08 2005
@@ -55,6 +55,7 @@
     <div class="control">
        <html:submit /></input>
     </div>
+    
 </html:form>
 
 <%@ include file="/theme/footer.jsp" %>

Modified: incubator/roller/branches/roller_2.0/web/website/UserNew.jsp
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/web/website/UserNew.jsp?rev=225383&r1=225382&r2=225383&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/web/website/UserNew.jsp (original)
+++ incubator/roller/branches/roller_2.0/web/website/UserNew.jsp Tue Jul 26 13:09:08 2005
@@ -58,27 +58,13 @@
     </div>
 
     <div class="formrow">
-       <label for="timezone" class="formrow" /><fmt:message key="userSettings.timezone"
/></label>
-       <html:select property="timezone" size="1" >
+       <label for="timeZone" class="formrow" /><fmt:message key="userSettings.timezone"
/></label>
+       <html:select property="timeZone" size="1" >
            <html:options collection="timezones" property="value" labelProperty="label"/>
        </html:select>
     </div>
-
     <br />
-    
-    <div class="formrow">
-       <label for="theme" class="formrow" /><fmt:message key="newuser.theme" /></label>
-       <html:select property="theme" size="1" onchange="previewImage(this[selectedIndex].value)">
-           <html:options name="themes"/>
-       </html:select>
-    </div>
-    
-    <div class="formrow">
-       <label for="preview" class="formrow" />&nbsp;</label>
-       <img name="preview" 
-          src="<%= ctxPath %>/images/preview/sm-theme-basic.png" height="268" width="322"
/>
-    </div>
-    
+        
     <div class="control">
        <html:submit /></input>
     </div>

Modified: incubator/roller/branches/roller_2.0/web/website/YourWebsites.jsp
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/web/website/YourWebsites.jsp?rev=225383&r1=225382&r2=225383&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/web/website/YourWebsites.jsp (original)
+++ incubator/roller/branches/roller_2.0/web/website/YourWebsites.jsp Tue Jul 26 13:09:08
2005
@@ -4,24 +4,52 @@
     
 <script type="text/javascript">
 <!--
-function selectWebsite(id) {
+function selectWebsite(id) 
+{
     document.yourWebsitesForm.websiteId.value = id;
     document.yourWebsitesForm.submit();
 } 
+function acceptInvite(id) 
+{
+    document.yourWebsitesForm.method.value = "accept";
+    document.yourWebsitesForm.inviteId.value = id;
+    document.yourWebsitesForm.submit();
+} 
+function declineInvite(id) 
+{
+    document.yourWebsitesForm.method.value = "decline";
+    document.yourWebsitesForm.inviteId.value = id;
+    document.yourWebsitesForm.submit();
+} 
 -->
 </script>
 
 <html:form action="/editor/yourWebsites" method="post">
+    <input type="hidden" name="inviteId" value="" />
     <input type="hidden" name="websiteId" value="" />
     <input type="hidden" name="method" value="select" />		  
-</html:form>
 
-<c:forEach var="website" items="${model.websites}">
-    <a href='javascript:selectWebsite("<c:out value='${website.id}'/>")'>
-        <c:out value="${website.handle}" /><br />
-    </a>
-</c:forEach>
+    <c:if test="${!empty model.pendings}">
+        <fmt:message key="yourWebsites.invitations" /><br />
+	    <c:forEach var="invite" items="${model.pendings}">
+            <c:out value="${invite.website.handle}" />
+            <a href='javascript:acceptInvite("<c:out value='${invite.id}'/>")'>
+                <fmt:message key="yourWebsites.accept" />
+            </a> 
+            &nbsp;|&nbsp;
+            <a href='javascript:acceptInvite("<c:out value='${invite.id}'/>")'>
+                <fmt:message key="yourWebsites.decline" />
+            </a><br />
+	    </c:forEach>
+    </c:if>
 
-<%@ include file="/theme/footer.jsp" %>
+    <p><fmt:message key="yourWebsites.websites" /></p>
+    <c:forEach var="website" items="${model.websites}">
+        <a href='javascript:selectWebsite("<c:out value='${website.id}'/>")'>
+            <c:out value="${website.handle}" /><br />
+        </a>
+    </c:forEach>
 
+</html:form>
 
+<%@ include file="/theme/footer.jsp" %>



Mime
View raw message