[pal-cvs 3394] [1128] set namespace.

svnno****@sourc***** svnno****@sourc*****
2008年 9月 5日 (金) 12:21:47 JST


Revision: 1128
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=1128
Author:   shinsuke
Date:     2008-09-05 12:21:47 +0900 (Fri, 05 Sep 2008)

Log Message:
-----------
set namespace.

Modified Paths:
--------------
    pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/action/EditorAction.java
    pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/form/EditorForm.java
    pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/portlet/WcmEditorPortlet.java
    pal-wcm/trunk/src/main/webapp/WEB-INF/view/editor/edit.jsp


-------------- next part --------------
Modified: pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/action/EditorAction.java
===================================================================
--- pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/action/EditorAction.java	2008-09-05 02:13:03 UTC (rev 1127)
+++ pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/action/EditorAction.java	2008-09-05 03:21:47 UTC (rev 1128)
@@ -19,6 +19,8 @@
 import java.util.List;
 
 import javax.portlet.PortletRequest;
+import javax.portlet.PortletResponse;
+import javax.portlet.RenderResponse;
 import javax.servlet.http.HttpServletRequest;
 
 import jp.sf.pal.wcm.WcmConstants;
@@ -51,6 +53,8 @@
 
     public List<String> localeItems;
 
+    public String namespace;
+
     @ActionForm
     private EditorForm editorForm;
 
@@ -284,6 +288,7 @@
         editorForm.encodedPath = PALWcmUtil.encodePath(editorForm.currentPath);
         editorForm.encodedPagePath = PALWcmUtil.encodePath(editorForm
                 .getPagePath());
+        namespace = editorForm.getFragmentId();
     }
 
     private void prerenderForPrefs() {

Modified: pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/form/EditorForm.java
===================================================================
--- pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/form/EditorForm.java	2008-09-05 02:13:03 UTC (rev 1127)
+++ pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/form/EditorForm.java	2008-09-05 03:21:47 UTC (rev 1128)
@@ -30,8 +30,6 @@
 
     public String encodedPagePath;
 
-    public String fragmentId;
-
     public String title;
 
     public String content;

Modified: pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/portlet/WcmEditorPortlet.java
===================================================================
--- pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/portlet/WcmEditorPortlet.java	2008-09-05 02:13:03 UTC (rev 1127)
+++ pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/portlet/WcmEditorPortlet.java	2008-09-05 03:21:47 UTC (rev 1128)
@@ -20,6 +20,7 @@
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
 import javax.portlet.PortletException;
+import javax.portlet.PortletSession;
 import javax.portlet.RenderRequest;
 import javax.portlet.RenderResponse;
 
@@ -77,6 +78,18 @@
         request.setAttribute(WcmConstants.PAGE_MANAGER, pageManager);
         request.setAttribute(WcmConstants.PORTLET_REGISTRY, portletRegistry);
         super.render(request, response);
+
+        // set user to session
+        String remoteUser = request.getRemoteUser();
+        if (remoteUser != null) {
+            request.getPortletSession().setAttribute(
+                    WcmConstants.LOGIN_USER_NAME, remoteUser,
+                    PortletSession.APPLICATION_SCOPE);
+        } else {
+            request.getPortletSession().removeAttribute(
+                    WcmConstants.LOGIN_USER_NAME,
+                    PortletSession.APPLICATION_SCOPE);
+        }
     }
 
 }

Modified: pal-wcm/trunk/src/main/webapp/WEB-INF/view/editor/edit.jsp
===================================================================
--- pal-wcm/trunk/src/main/webapp/WEB-INF/view/editor/edit.jsp	2008-09-05 02:13:03 UTC (rev 1127)
+++ pal-wcm/trunk/src/main/webapp/WEB-INF/view/editor/edit.jsp	2008-09-05 03:21:47 UTC (rev 1128)
@@ -36,11 +36,11 @@
 FCKeditor.Value = "${content}";
 FCKeditor.Height = 475;
 var url = '<%= request.getContextPath() %>/fckeditor/editor/filemanager/browser/default/browser.html';
-var connector = '<%= request.getContextPath() %>/fileconnector%3fnamespace=';
+var connector = '<%= request.getContextPath() %>/fileconnector%3fnamespace=${namespace}';
 FCKeditor.Config['LinkBrowserURL'] = url + '?Connector=' + connector + '&Type=Link';
 FCKeditor.Config['ImageBrowserURL'] = url + '?Connector=' + connector + '&Type=Image';
 FCKeditor.Config['FlashBrowserURL'] = url + '?Connector=' + connector + '&Type=Flash';
-url = '<%= request.getContextPath() %>/fileupload?namespace=';
+url = '<%= request.getContextPath() %>/fileupload?namespace=${namespace}';
 FCKeditor.Config['LinkUploadURL'] = url + '&type=Link';
 FCKeditor.Config['ImageUploadURL'] = url + '&type=Image';
 FCKeditor.Config['FlashUploadURL'] = url + '&type=Flash';


pal-cvs メーリングリストの案内