[pal-cvs 2373] [105] supported multi-language.

svnno****@sourc***** svnno****@sourc*****
2007年 5月 11日 (金) 18:15:44 JST


Revision: 105
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=105
Author:   shinsuke
Date:     2007-05-11 18:15:44 +0900 (Fri, 11 May 2007)

Log Message:
-----------
supported multi-language.

Modified Paths:
--------------
    pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/PALWcmConstants.java
    pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/portlet/PALWcmPortlet.java
    pal-wcm/trunk/src/main/webapp/view/wcm/wcmEdit.jsp

Added Paths:
-----------
    pal-wcm/trunk/NOTICE.txt
    pal-wcm/trunk/src/main/webapp/images/
    pal-wcm/trunk/src/main/webapp/images/icons/
    pal-wcm/trunk/src/main/webapp/images/icons/add.png
    pal-wcm/trunk/src/main/webapp/images/icons/arrow_refresh.png
    pal-wcm/trunk/src/main/webapp/images/icons/cog.png
    pal-wcm/trunk/src/main/webapp/images/icons/cross.png
    pal-wcm/trunk/src/main/webapp/images/icons/delete.png
    pal-wcm/trunk/src/main/webapp/images/icons/page_edit.png
    pal-wcm/trunk/src/main/webapp/view/wcm/wcmPreferences.jsp


-------------- next part --------------
Added: pal-wcm/trunk/NOTICE.txt
===================================================================
--- pal-wcm/trunk/NOTICE.txt	2007-05-11 09:15:17 UTC (rev 104)
+++ pal-wcm/trunk/NOTICE.txt	2007-05-11 09:15:44 UTC (rev 105)
@@ -0,0 +1,14 @@
+Web Content Management Portlet
+Copyright 2005-2007 Portal Application Laboratory Project
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+This software contains codes and resources derived from:
+
+ Silk icon set 1.3
+ Mark James
+ http://www.famfamfam.com/lab/icons/silk/
+ Creative Commons Attribution 2.5 License
+
+


Property changes on: pal-wcm/trunk/NOTICE.txt
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/PALWcmConstants.java
===================================================================
--- pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/PALWcmConstants.java	2007-05-11 09:15:17 UTC (rev 104)
+++ pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/PALWcmConstants.java	2007-05-11 09:15:44 UTC (rev 105)
@@ -45,4 +45,29 @@
 
     public static final String NEW_FOLDER_NAME_FCKEDITOR_PARAM = "NewFolderName";
 
+    public static final String ADD_LOCALE = PREFIX + "AddLocale";
+
+    public static final String DELETE_LOCALE = PREFIX + "DeleteLocale";
+
+    public static final String CHANGE_LOCALE = PREFIX + "ChangeLocale";
+
+    public static final String EDIT_LOCALE = PREFIX + "EditLocale";
+
+    public static final String TARGET_LOCALE = PREFIX + "TargetLocale";
+
+    public static final String SELECTED_LOCALE = PREFIX + "SelectedLocale";
+
+    public static final String EDIT_TYPE = PREFIX + "EditType";
+
+    public static final String CONTENT_EDIT_TYPE = PREFIX + "ContentEditType";
+
+    public static final String PREFERENCES_EDIT_TYPE = PREFIX
+            + "PreferencesEditType";
+
+    public static final String LOCALE_LIST = PREFIX + "LocaleList";
+
+    public static final String LOCALE_SEPARETER = "-";
+
+    public static final String MESSAGE = PREFIX + "Message";
+
 }

Modified: pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/portlet/PALWcmPortlet.java
===================================================================
--- pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/portlet/PALWcmPortlet.java	2007-05-11 09:15:17 UTC (rev 104)
+++ pal-wcm/trunk/src/main/java/jp/sf/pal/wcm/portlet/PALWcmPortlet.java	2007-05-11 09:15:44 UTC (rev 105)
@@ -17,8 +17,11 @@
 
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Locale;
+import java.util.StringTokenizer;
 
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
@@ -88,10 +91,32 @@
         response.setContentType("text/html");
 
         Fragment fragment = getCurrentFragment(request);
+
+        Locale currentLocale = request.getLocale();
+        List localeList = getLocaleList(fragment);
+        String localeName = "";
+        String language = currentLocale.getLanguage();
+        String country = currentLocale.getCountry();
+        String variant = currentLocale.getVariant();
+        if (localeList.contains(language + "_" + country + "_" + variant))
+        {
+            localeName = PALWcmConstants.LOCALE_SEPARETER + language + "_"
+                    + country + "_" + variant;
+        }
+        else if (localeList.contains(language + "_" + country))
+        {
+            localeName = PALWcmConstants.LOCALE_SEPARETER + language + "_"
+                    + country;
+        }
+        else if (localeList.contains(language))
+        {
+            localeName = PALWcmConstants.LOCALE_SEPARETER + language;
+        }
+
         String title = getFragmentPreferenceValue(fragment,
-                PALWcmConstants.TITLE, "");
+                PALWcmConstants.TITLE + localeName, "");
         String content = getFragmentPreferenceValue(fragment,
-                PALWcmConstants.CONTENT, "");
+                PALWcmConstants.CONTENT + localeName, "");
 
         response.setTitle(title);
         request.setAttribute(PALWcmConstants.CONTENT, content);
@@ -109,19 +134,56 @@
     {
         response.setContentType("text/html");
 
+        String msg = request.getParameter(PALWcmConstants.MESSAGE);
+        if (msg != null)
+        {
+            request.setAttribute(PALWcmConstants.MESSAGE, msg);
+        }
+        else
+        {
+            request.setAttribute(PALWcmConstants.MESSAGE, "");
+        }
+
         storeLoginStatus(request);
 
+        String editType = request.getParameter(PALWcmConstants.EDIT_TYPE);
+        if (PALWcmConstants.CONTENT_EDIT_TYPE.equals(editType))
+        {
+            doContentEdit(request, response);
+        }
+        else if (PALWcmConstants.PREFERENCES_EDIT_TYPE.equals(editType))
+        {
+            doPreferencesEdit(request, response);
+        }
+        else
+        {
+            doContentEdit(request, response);
+        }
+    }
+
+    protected void doContentEdit(RenderRequest request, RenderResponse response)
+            throws PortletException, IOException
+    {
+        String localeName = getEditLocaleName(request);
+        String selectedLocale = localeName;
+        if (!localeName.equals(""))
+        {
+            localeName = PALWcmConstants.LOCALE_SEPARETER + localeName;
+        }
+
         Fragment fragment = getCurrentFragment(request);
         String title = getFragmentPreferenceValue(fragment,
-                PALWcmConstants.TITLE, "");
+                PALWcmConstants.TITLE + localeName, "");
         String content = getFragmentPreferenceValue(fragment,
-                PALWcmConstants.CONTENT, "");
+                PALWcmConstants.CONTENT + localeName, "");
+        String localeOptions = getLocaleOptionString(fragment, selectedLocale);
         String fragmentId = fragment.getId();
 
         response.setTitle(title);
         request.setAttribute(PALWcmConstants.TITLE, title);
         request.setAttribute(PALWcmConstants.CONTENT, StringEscapeUtils
                 .escapeJavaScript(content));
+        request.setAttribute(PALWcmConstants.LOCALE_LIST, localeOptions);
         request.setAttribute(PALWcmConstants.FRAGMENT_ID, fragmentId);
         request.setAttribute(PALWcmConstants.PORTAL_CONTEXT_PATH,
                 getPortalContextPath(request));
@@ -129,8 +191,88 @@
         PortletRequestDispatcher rd = getPortletContext().getRequestDispatcher(
                 "/view/wcm/wcmEdit.jsp");
         rd.include(request, response);
+
     }
 
+    protected String getEditLocaleName(PortletRequest request)
+    {
+        PortletSession portletSession = request.getPortletSession();
+        Object locale = portletSession
+                .getAttribute(PALWcmConstants.EDIT_LOCALE);
+        if (locale != null)
+        {
+            return locale.toString();
+        }
+        return "";
+    }
+
+    protected void setEditLocaleName(PortletRequest request, String localeName)
+    {
+        PortletSession portletSession = request.getPortletSession();
+        portletSession.setAttribute(PALWcmConstants.EDIT_LOCALE, localeName);
+    }
+
+    protected void doPreferencesEdit(RenderRequest request,
+            RenderResponse response) throws PortletException, IOException
+    {
+        Fragment fragment = getCurrentFragment(request);
+        String fragmentId = fragment.getId();
+
+        request.setAttribute(PALWcmConstants.FRAGMENT_ID, fragmentId);
+        request.setAttribute(PALWcmConstants.LOCALE_LIST,
+                getLocaleOptionString(fragment, null));
+
+        PortletRequestDispatcher rd = getPortletContext().getRequestDispatcher(
+                "/view/wcm/wcmPreferences.jsp");
+        rd.include(request, response);
+
+    }
+
+    private String getLocaleOptionString(Fragment fragment, String localeName)
+    {
+        List locales = getLocaleList(fragment);
+        StringBuffer localesStr = new StringBuffer();
+        for (Iterator ite = locales.iterator(); ite.hasNext();)
+        {
+            String lc = ite.next().toString();
+            localesStr.append("<option value=\"").append(lc).append("\"");
+            if (lc.equals(localeName))
+            {
+                localesStr.append(" selected");
+            }
+            localesStr.append(">").append(lc).append("</option>");
+        }
+        return localesStr.toString();
+    }
+
+    private List getLocaleList(Fragment fragment)
+    {
+        List locales = new ArrayList();
+        //        List preferences = fragment.getPreferences();
+        //        for (Iterator ite = preferences.iterator(); ite.hasNext();)
+        //        {
+        //            FragmentPreference fp = (FragmentPreference) ite.next();
+        //            if (fp.getName() != null
+        //                    && fp.getName().startsWith(PALWcmConstants.TITLE))
+        //            {
+        //                locales.add(fp.getName().substring(
+        //                        PALWcmConstants.TITLE.length() + 1));
+        //            }
+        //        }
+
+        String localeNames = getFragmentPreferenceValue(fragment,
+                PALWcmConstants.LOCALE_LIST, null);
+        if (localeNames != null)
+        {
+            StringTokenizer st = new StringTokenizer(localeNames, ",");
+            while (st.hasMoreTokens())
+            {
+                locales.add(st.nextToken());
+            }
+        }
+        return locales;
+    }
+
     /* (non-Javadoc)
      * @see javax.portlet.Portlet#processAction(javax.portlet.ActionRequest, javax.portlet.ActionResponse)
      */
@@ -160,34 +302,229 @@
     protected void processEdit(ActionRequest request, ActionResponse response)
             throws PortletException, IOException
     {
+        String editType = request.getParameter(PALWcmConstants.EDIT_TYPE);
+        if (PALWcmConstants.CONTENT_EDIT_TYPE.equals(editType))
+        {
+            processContentEdit(request, response);
+            response.setRenderParameter(PALWcmConstants.EDIT_TYPE,
+                    PALWcmConstants.CONTENT_EDIT_TYPE);
+        }
+        else if (PALWcmConstants.PREFERENCES_EDIT_TYPE.equals(editType))
+        {
+            processPreferencesEdit(request, response);
+            response.setRenderParameter(PALWcmConstants.EDIT_TYPE,
+                    PALWcmConstants.PREFERENCES_EDIT_TYPE);
+        }
+        else
+        {
+            //TODO print error
+            processContentEdit(request, response);
+            response.setRenderParameter(PALWcmConstants.EDIT_TYPE,
+                    PALWcmConstants.CONTENT_EDIT_TYPE);
+        }
+    }
+
+    protected void processContentEdit(ActionRequest request,
+            ActionResponse response) throws PortletException, IOException
+    {
+        String localeName = request.getParameter(PALWcmConstants.EDIT_LOCALE);
+        setEditLocaleName(request, localeName);
+        if (request.getParameter(PALWcmConstants.CHANGE_LOCALE) != null)
+        {
+            // no save 
+            return;
+        }
+
         String title = request.getParameter(PALWcmConstants.TITLE);
         String content = request.getParameter(PALWcmConstants.CONTENT);
         String fragmentId = request.getParameter(PALWcmConstants.FRAGMENT_ID);
 
+        if (localeName == null)
+        {
+            localeName = "";
+        }
+        else if (!localeName.equals(""))
+        {
+            localeName = PALWcmConstants.LOCALE_SEPARETER + localeName;
+        }
+
         // TODO check above
 
         ContentPage page = getCurrentPage(request);
         Fragment fragment = page.getFragmentById(fragmentId);
 
-        setFragmentPreferenceValue(fragment, PALWcmConstants.TITLE, title);
-        setFragmentPreferenceValue(fragment, PALWcmConstants.CONTENT, content);
+        setFragmentPreferenceValue(fragment,
+                PALWcmConstants.TITLE + localeName, title);
+        setFragmentPreferenceValue(fragment, PALWcmConstants.CONTENT
+                + localeName, content);
 
         try
         {
             pageManager.updatePage(page);
+            request.setAttribute(PALWcmConstants.MESSAGE,
+                    "Failed to update data. ");
         }
         catch (PageNotUpdatedException e)
         {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
+            log.error("Failed to update data. ", e);
+            //TODO i18n
+            request.setAttribute(PALWcmConstants.MESSAGE,
+                    "Failed to update data. ");
         }
         catch (NodeException e)
         {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
+            log.error("Failed to update data. ", e);
+            //TODO i18n
+            request.setAttribute(PALWcmConstants.MESSAGE,
+                    "Failed to update data. ");
         }
     }
 
+    protected void processPreferencesEdit(ActionRequest request,
+            ActionResponse response) throws PortletException, IOException
+    {
+
+        if (request.getParameter(PALWcmConstants.ADD_LOCALE) != null)
+        {
+            // add locale
+            String fragmentId = request
+                    .getParameter(PALWcmConstants.FRAGMENT_ID);
+            ContentPage page = getCurrentPage(request);
+            Fragment fragment = page.getFragmentById(fragmentId);
+
+            // TODO check above
+
+            String targetLocale = request
+                    .getParameter(PALWcmConstants.TARGET_LOCALE);
+            if (targetLocale == null || targetLocale.equals(""))
+            {
+                //TODO i18n
+                request
+                        .setAttribute(PALWcmConstants.MESSAGE,
+                                "Failed to add a locale. The specified locale is empty. ");
+                return;
+            }
+
+            List locales = getLocaleList(fragment);
+            if (locales.contains(targetLocale))
+            {
+                //TODO i18n
+                request
+                        .setAttribute(PALWcmConstants.MESSAGE,
+                                "Failed to add the locale. The specified locale has been already added. ");
+                return;
+            }
+
+            locales.add(targetLocale);
+            Object[] objs = locales.toArray();
+            Arrays.sort(objs);
+            StringBuffer localeNames = new StringBuffer();
+            for (int i = 0; i < objs.length; i++)
+            {
+                if (i != 0)
+                {
+                    localeNames.append(",");
+                }
+                localeNames.append(objs[i].toString());
+            }
+            setFragmentPreferenceValue(fragment, PALWcmConstants.LOCALE_LIST,
+                    localeNames.toString());
+
+            try
+            {
+                pageManager.updatePage(page);
+                //TODO i18n
+                request.setAttribute(PALWcmConstants.MESSAGE,
+                        "Added the locale. ");
+            }
+            catch (PageNotUpdatedException e)
+            {
+                log.error("Failed to add the locale. ", e);
+                //TODO i18n
+                request.setAttribute(PALWcmConstants.MESSAGE,
+                        "Failed to add the locale. ");
+            }
+            catch (NodeException e)
+            {
+                log.error("Failed to add the locale. ", e);
+                //TODO i18n
+                request.setAttribute(PALWcmConstants.MESSAGE,
+                        "Failed to add the locale. ");
+            }
+        }
+        else if (request.getParameter(PALWcmConstants.DELETE_LOCALE) != null)
+        {
+            // delete locale
+            String fragmentId = request
+                    .getParameter(PALWcmConstants.FRAGMENT_ID);
+            ContentPage page = getCurrentPage(request);
+            Fragment fragment = page.getFragmentById(fragmentId);
+
+            // TODO check above
+
+            String selectedLocale = request
+                    .getParameter(PALWcmConstants.SELECTED_LOCALE);
+            if (selectedLocale == null || selectedLocale.equals(""))
+            {
+                //TODO i18n
+                request
+                        .setAttribute(PALWcmConstants.MESSAGE,
+                                "Failed to delete a locale. The specified locale is empty. ");
+                return;
+            }
+
+            List locales = getLocaleList(fragment);
+            if (!locales.contains(selectedLocale))
+            {
+                //TODO i18n
+                request
+                        .setAttribute(PALWcmConstants.MESSAGE,
+                                "Failed to delete the locale. The specified locale is not included. ");
+                return;
+            }
+
+            locales.remove(selectedLocale);
+            Object[] objs = locales.toArray();
+            StringBuffer localeNames = new StringBuffer();
+            for (int i = 0; i < objs.length; i++)
+            {
+                if (i != 0)
+                {
+                    localeNames.append(",");
+                }
+                localeNames.append(objs[i].toString());
+            }
+            setFragmentPreferenceValue(fragment, PALWcmConstants.LOCALE_LIST,
+                    localeNames.toString());
+            removeFragmentPreferenceValue(fragment, PALWcmConstants.TITLE
+                    + PALWcmConstants.LOCALE_SEPARETER + selectedLocale);
+            removeFragmentPreferenceValue(fragment, PALWcmConstants.CONTENT
+                    + PALWcmConstants.LOCALE_SEPARETER + selectedLocale);
+
+            try
+            {
+                pageManager.updatePage(page);
+                //TODO i18n
+                request.setAttribute(PALWcmConstants.MESSAGE,
+                        "Deleted the locale. ");
+            }
+            catch (PageNotUpdatedException e)
+            {
+                log.error("Failed to delete the locale. ", e);
+                //TODO i18n
+                request.setAttribute(PALWcmConstants.MESSAGE,
+                        "Failed to delete the locale. ");
+            }
+            catch (NodeException e)
+            {
+                log.error("Failed to delete the locale. ", e);
+                //TODO i18n
+                request.setAttribute(PALWcmConstants.MESSAGE,
+                        "Failed to delete the locale. ");
+            }
+        }
+    }
+
     private String getPortalContextPath(PortletRequest request)
     {
         RequestContext requestContext = (RequestContext) request
@@ -247,6 +584,12 @@
         }
     }
 
+    private void removeFragmentPreferenceValue(Fragment fragment, String name)
+    {
+        FragmentPreference fp = getFragmentPreferenceByName(fragment, name);
+        fragment.getPreferences().remove(fp);
+    }
+
     private String getFragmentPreferenceValue(Fragment fragment, String name,
             String defaultValue)
     {

Added: pal-wcm/trunk/src/main/webapp/images/icons/add.png
===================================================================
(Binary files differ)


Property changes on: pal-wcm/trunk/src/main/webapp/images/icons/add.png
___________________________________________________________________
Name: svn:mime-type
   + image/png

Added: pal-wcm/trunk/src/main/webapp/images/icons/arrow_refresh.png
===================================================================
(Binary files differ)


Property changes on: pal-wcm/trunk/src/main/webapp/images/icons/arrow_refresh.png
___________________________________________________________________
Name: svn:mime-type
   + image/png

Added: pal-wcm/trunk/src/main/webapp/images/icons/cog.png
===================================================================
(Binary files differ)


Property changes on: pal-wcm/trunk/src/main/webapp/images/icons/cog.png
___________________________________________________________________
Name: svn:mime-type
   + image/png

Added: pal-wcm/trunk/src/main/webapp/images/icons/cross.png
===================================================================
(Binary files differ)


Property changes on: pal-wcm/trunk/src/main/webapp/images/icons/cross.png
___________________________________________________________________
Name: svn:mime-type
   + image/png

Added: pal-wcm/trunk/src/main/webapp/images/icons/delete.png
===================================================================
(Binary files differ)


Property changes on: pal-wcm/trunk/src/main/webapp/images/icons/delete.png
___________________________________________________________________
Name: svn:mime-type
   + image/png

Added: pal-wcm/trunk/src/main/webapp/images/icons/page_edit.png
===================================================================
(Binary files differ)


Property changes on: pal-wcm/trunk/src/main/webapp/images/icons/page_edit.png
___________________________________________________________________
Name: svn:mime-type
   + image/png

Modified: pal-wcm/trunk/src/main/webapp/view/wcm/wcmEdit.jsp
===================================================================
--- pal-wcm/trunk/src/main/webapp/view/wcm/wcmEdit.jsp	2007-05-11 09:15:17 UTC (rev 104)
+++ pal-wcm/trunk/src/main/webapp/view/wcm/wcmEdit.jsp	2007-05-11 09:15:44 UTC (rev 105)
@@ -16,22 +16,35 @@
 --%>
 <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
 <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
-<%@page import="jp.sf.pal.wcm.PALWcmConstants"%>
+<%@ page import="jp.sf.pal.wcm.PALWcmConstants"%>
 <portlet:defineObjects/>
 <portlet:renderURL var="closeUrl" portletMode="view"></portlet:renderURL>
+<portlet:renderURL var="preferencesEditUrl" portletMode="edit">
+  <portlet:param name="jp.sf.pal.wcm.EditType" value="jp.sf.pal.wcm.PreferencesEditType"/>
+</portlet:renderURL>
 
-<div style="z-index:100;border-left:1px solid #999999;border-top:1px solid #999999;border-bottom:4px solid #999999;border-right:4px solid #999999;width:750px;height:500px;position:absolute; top:30px; left:30px;background-color:white;">
+<div style="z-index:10000;border-left:1px solid #999999;border-top:1px solid #999999;border-bottom:4px solid #999999;border-right:4px solid #999999;width:750px;height:500px;position:absolute; top:30px; left:30px;background-color:white;">
   <form id="<portlet:namespace/>FCKeditorForm" action="<portlet:actionURL />" method="POST">
+  <input type="hidden" name="<%= PALWcmConstants.EDIT_TYPE %>" value="<%= PALWcmConstants.CONTENT_EDIT_TYPE %>"/>
   <input type="hidden" name="<%= PALWcmConstants.FRAGMENT_ID %>" 
-    value="<%= renderRequest.getAttribute(jp.sf.pal.wcm.PALWcmConstants.FRAGMENT_ID) %>"/>
-  <div style="float:left;height:20px">
-    Title:
-    <input type="text" name="<%= PALWcmConstants.TITLE %>" 
-      value="<%= renderRequest.getAttribute(jp.sf.pal.wcm.PALWcmConstants.TITLE) %>" />
+    value="<%= renderRequest.getAttribute(PALWcmConstants.FRAGMENT_ID) %>"/>
+  <div style="width:100%;height:25px;background-color:#efefde;">
+    <div style="float:left;height:25px;font-size:10pt;font-family:sans-serif;color:#666666;padding-left:5px;">
+      Title:
+      <input type="text" name="<%= PALWcmConstants.TITLE %>" 
+        value="<%= renderRequest.getAttribute(PALWcmConstants.TITLE) %>" />
+      <select size="1" name="<%= PALWcmConstants.EDIT_LOCALE %>">
+        <option value="">DEFAULT</option>
+        <%= renderRequest.getAttribute(PALWcmConstants.LOCALE_LIST) %>
+      </select>
+      <button style="height:22px;font-size:9px;" type="submit" name="<%= PALWcmConstants.CHANGE_LOCALE %>"><img style="vertical-align:middle;" src="<%= renderRequest.getContextPath() %>/images/icons/arrow_refresh.png"/>Reload</button>
+      <span><%= renderRequest.getAttribute(PALWcmConstants.MESSAGE) %></span>
+    </div>
+    <div style="float:right;height:25px">
+      <a href="<%= preferencesEditUrl %>"><img src="<%= renderRequest.getContextPath() %>/images/icons/cog.png" alt="Preferences" style="border: 0px;"/></a>
+      <a href="<%= closeUrl %>"><img src="<%= renderRequest.getContextPath() %>/images/icons/cross.png" alt="Close" style="border: 0px;"/></a>
+    </div>
   </div>
-  <div style="float:right;height:20px">
-    <a href="<%= closeUrl %>">Close</a>
-  </div>
   
   <div style="clear:both;">
 <script type="text/javascript" src="<%= renderRequest.getContextPath() %>/fckeditor/fckeditor.js"></script>
@@ -40,7 +53,7 @@
 var <portlet:namespace/>FCKeditor = new FCKeditor("<%= PALWcmConstants.CONTENT %>");
 <portlet:namespace/>FCKeditor.BasePath = "<%= renderRequest.getContextPath() %>/fckeditor/";
 <portlet:namespace/>FCKeditor.Value = "<%= renderRequest.getAttribute(PALWcmConstants.CONTENT) %>";
-<portlet:namespace/>FCKeditor.Height = 480;
+<portlet:namespace/>FCKeditor.Height = 475;
 var url = '<%= renderRequest.getContextPath() %>/fckeditor/editor/filemanager/browser/default/browser.html';
 var connector = '<%= renderRequest.getContextPath() %>/fileconnector%3fnamespace=<portlet:namespace/>';
 <portlet:namespace/>FCKeditor.Config['LinkBrowserURL'] = url + '?Connector=' + connector + '&Type=Link';

Added: pal-wcm/trunk/src/main/webapp/view/wcm/wcmPreferences.jsp
===================================================================
--- pal-wcm/trunk/src/main/webapp/view/wcm/wcmPreferences.jsp	2007-05-11 09:15:17 UTC (rev 104)
+++ pal-wcm/trunk/src/main/webapp/view/wcm/wcmPreferences.jsp	2007-05-11 09:15:44 UTC (rev 105)
@@ -0,0 +1,70 @@
+<%--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You 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.
+--%>
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
+<%@ page import="jp.sf.pal.wcm.PALWcmConstants"%>
+<portlet:defineObjects/>
+
+<portlet:renderURL var="closeUrl" portletMode="view"></portlet:renderURL>
+<portlet:renderURL var="contentEditUrl" portletMode="edit">
+  <portlet:param name="jp.sf.pal.wcm.EditType" value="jp.sf.pal.wcm.ContentEditType"/>
+</portlet:renderURL>
+
+<div style="z-index:10000;border-left:1px solid #999999;border-top:1px solid #999999;border-bottom:4px solid #999999;border-right:4px solid #999999;width:750px;height:500px;position:absolute; top:30px; left:30px;background-color:white;">
+  <form id="<portlet:namespace/>PreferencesForm" action="<portlet:actionURL />" method="POST">
+  <input type="hidden" name="<%= PALWcmConstants.EDIT_TYPE %>" value="<%= PALWcmConstants.PREFERENCES_EDIT_TYPE %>"/>
+  <input type="hidden" name="<%= PALWcmConstants.FRAGMENT_ID %>" 
+    value="<%= renderRequest.getAttribute(PALWcmConstants.FRAGMENT_ID) %>"/>
+  <div style="width:100%;height:20px;background-color:#efefde;border-bottom:1px solid #999999;">
+    <div style="float:left;height:20px;font-size:10pt;font-family:sans-serif;color:#666666;padding-left:5px;">
+      Preferences
+    </div>
+    <div style="float:right;height:20px">
+      <a href="<%= contentEditUrl %>"><img src="<%= renderRequest.getContextPath() %>/images/icons/page_edit.png" alt="Preferences" style="border: 0px;"/></a>
+      <a href="<%= closeUrl %>"><img src="<%= renderRequest.getContextPath() %>/images/icons/cross.png" alt="Close" style="border: 0px;"/></a>
+    </div>
+  </div>
+  
+  <div style="clear:both;">
+
+  <span><%= renderRequest.getAttribute(PALWcmConstants.MESSAGE) %></span>
+
+  <div style="margin:10px;">
+
+  <div style="font-size:10pt;font-family:sans-serif;pading:5px;">
+    <h3>Language</h3>
+    <div>
+      <label for="<portlet:namespace/>TargetLocale">Locale</label>
+      <input type="text" id="<portlet:namespace/>TargetLocale" name="<%= PALWcmConstants.TARGET_LOCALE %>" size="10"/>
+      <button type="submit" name="<%= PALWcmConstants.ADD_LOCALE %>"><img style="vertical-align:middle;" src="<%= renderRequest.getContextPath() %>/images/icons/add.png"/>Add</button>
+      <br/>
+      <span style="color:#999999;">The format of Locale is xx_XX(ex. ja_JP).</span>
+    </div>
+    <br/>
+    <div>
+      <label for="<portlet:namespace/>SelectedLocale">Locale List</label><br/>
+      <select style="width:150px;" size="5" id="<portlet:namespace/>SelectedLocale" name="<%= PALWcmConstants.SELECTED_LOCALE %>">
+        <%= renderRequest.getAttribute(PALWcmConstants.LOCALE_LIST) %>
+      </select>
+      <button type="submit" name="<%= PALWcmConstants.DELETE_LOCALE %>"><img style="vertical-align:middle;" src="<%= renderRequest.getContextPath() %>/images/icons/delete.png"/>Delete</button>
+    </div>
+  </div>
+
+  </div>
+  
+  </form>
+</div>


Property changes on: pal-wcm/trunk/src/main/webapp/view/wcm/wcmPreferences.jsp
___________________________________________________________________
Name: svn:eol-style
   + native


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