svnno****@sourc*****
svnno****@sourc*****
2007年 10月 22日 (月) 18:20:52 JST
Revision: 650 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=650 Author: shinsuke Date: 2007-10-22 18:20:52 +0900 (Mon, 22 Oct 2007) Log Message: ----------- added preference editor for layout and portlet. Modified Paths: -------------- pal-admin/trunk/src/main/java/jp/sf/pal/admin/logic/SiteEditorLogic.java pal-admin/trunk/src/main/java/jp/sf/pal/admin/service/SiteEditorService.java pal-admin/trunk/src/main/resources/PAMessages.properties pal-admin/trunk/src/main/resources/appMessages.properties pal-admin/trunk/src/main/resources/jp/sf/pal/admin/web/site/label.properties pal-admin/trunk/src/main/resources/jp/sf/pal/admin/web/site/label_ja.properties pal-admin/trunk/src/main/webapp/view/site/layoutAddPortletEditor.html pal-admin/trunk/src/main/webapp/view/site/layoutInfoEditor.html pal-admin/trunk/src/main/webapp/view/site/portletInfoEditor.html Added Paths: ----------- pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/site/LayoutPreferenceEditorPage.java pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/site/PortletPreferenceEditorPage.java pal-admin/trunk/src/main/webapp/view/site/layoutPreferenceEditor.html pal-admin/trunk/src/main/webapp/view/site/portletPreferenceEditor.html -------------- next part -------------- Modified: pal-admin/trunk/src/main/java/jp/sf/pal/admin/logic/SiteEditorLogic.java =================================================================== --- pal-admin/trunk/src/main/java/jp/sf/pal/admin/logic/SiteEditorLogic.java 2007-10-22 09:20:08 UTC (rev 649) +++ pal-admin/trunk/src/main/java/jp/sf/pal/admin/logic/SiteEditorLogic.java 2007-10-22 09:20:52 UTC (rev 650) @@ -31,6 +31,7 @@ import jp.sf.pal.admin.util.PortalComponentUtil; import jp.sf.pal.common.CommonException; +import org.apache.commons.lang.StringEscapeUtils; import org.apache.jetspeed.JetspeedActions; import org.apache.jetspeed.PortalReservedParameters; import org.apache.jetspeed.components.portletentity.PortletEntityAccessComponent; @@ -56,6 +57,7 @@ import org.apache.jetspeed.om.page.Page; import org.apache.jetspeed.om.page.PageSecurity; import org.apache.jetspeed.om.page.SecurityConstraintsDef; +import org.apache.jetspeed.om.preference.FragmentPreference; import org.apache.jetspeed.page.FolderNotUpdatedException; import org.apache.jetspeed.page.PageManager; import org.apache.jetspeed.page.PageNotFoundException; @@ -759,6 +761,68 @@ return list; } + public List<Map<String, Object>> createPreferenceListForLayout(String path) + throws CommonException { + + Page page = getPage(getFolderOrPagePath(path)); + List<Map<String, Object>> list = new ArrayList<Map<String, Object>>(); + if (page != null) { + String fid = getFragmentId(path); + Fragment fragment = page.getFragmentById(fid); + if (fragment != null && fragment.getPreferences() != null) { + for (Iterator<FragmentPreference> ite = fragment + .getPreferences().iterator(); ite.hasNext();) { + FragmentPreference fp = ite.next(); + Map<String, Object> map = new HashMap<String, Object>(); + map.put("preferenceName", fp.getName()); + //TODO handles multiple values + List valueList = fp.getValueList(); + if (valueList != null && !valueList.isEmpty()) { + map.put("preferenceValue", valueList.get(0)); + } else { + map.put("preferenceValue", ""); + } + list.add(map); + } + } else { + //TODO throw exception + } + } + + return list; + } + + public List<Map<String, Object>> createPreferenceListForPortlet(String path) + throws CommonException { + + Page page = getPage(getFolderOrPagePath(path)); + List<Map<String, Object>> list = new ArrayList<Map<String, Object>>(); + if (page != null) { + String fid = getFragmentId(path); + Fragment fragment = page.getFragmentById(fid); + if (fragment != null && fragment.getPreferences() != null) { + for (Iterator<FragmentPreference> ite = fragment + .getPreferences().iterator(); ite.hasNext();) { + FragmentPreference fp = ite.next(); + Map<String, Object> map = new HashMap<String, Object>(); + map.put("preferenceName", fp.getName()); + //TODO handles multiple values + List valueList = fp.getValueList(); + if (valueList != null && !valueList.isEmpty()) { + map.put("preferenceValue", valueList.get(0)); + } else { + map.put("preferenceValue", ""); + } + list.add(map); + } + } else { + //TODO throw exception + } + } + + return list; + } + public List<Map<String, String>> createPermissionsList() throws CommonException { List<Map<String, String>> list = new ArrayList<Map<String, String>>(); @@ -2393,4 +2457,193 @@ } } + public void addPreferenceToLayout(String path, String name, String value) + throws CommonException { + + Page page = getPage(getFolderOrPagePath(path)); + if (page == null) { + throw new CommonException("could.not.find.layout", + "Could not find a page: " + path); + } + + String fid = getFragmentId(path); + if (fid == null || fid.equals("")) { + throw new CommonException("could.not.find.layout", + "Could not find a page: " + path); + } + + Fragment fragment = page.getFragmentById(fid); + if (fragment == null) { + throw new CommonException("could.not.find.layout", + "Could not find a fragment: " + fid); + } + FragmentPreference fp = getFragmentPreferenceByName(fragment, name); + //TODO handles multiple values + if (fp == null) { + fp = pageManager.newFragmentPreference(); + fp.setName(name); + fp.setReadOnly(false); + List<Object> list = new ArrayList<Object>(); + list.add(StringEscapeUtils.escapeXml(value)); + fp.setValueList(list); + fragment.getPreferences().add(fp); + } else { + fp.getValueList().set(0, StringEscapeUtils.escapeXml(value)); + } + + try { + getPageManager().updatePage(page); + getPageManager().reset(); + } catch (PageNotUpdatedException e) { + throw new CommonException("could.not.update.layout", + "Could not update a layout: " + path, e); + } catch (NodeException e) { + throw new CommonException("could.not.update.layout", + "Could not update a layout: " + path, e); + } + } + + public void deletePreferenceFromLayout(String path, String name) + throws CommonException { + + Page page = getPage(getFolderOrPagePath(path)); + if (page == null) { + throw new CommonException("could.not.find.layout", + "Could not find a page: " + path); + } + + String fid = getFragmentId(path); + if (fid == null || fid.equals("")) { + throw new CommonException("could.not.find.layout", + "Could not find a page: " + path); + } + + Fragment fragment = page.getFragmentById(fid); + if (fragment == null) { + throw new CommonException("could.not.find.layout", + "Could not find a fragment: " + fid); + } + FragmentPreference fp = getFragmentPreferenceByName(fragment, name); + //TODO handles multiple values + if (fp == null) { + throw new CommonException("could.not.find.preference", + "Could not find a preference: " + fid + ":" + name); + } else { + fragment.getPreferences().remove(fp); + } + + try { + getPageManager().updatePage(page); + getPageManager().reset(); + } catch (PageNotUpdatedException e) { + throw new CommonException("could.not.update.layout", + "Could not update a layout: " + path, e); + } catch (NodeException e) { + throw new CommonException("could.not.update.layout", + "Could not update a layout: " + path, e); + } + } + + public void addPreferenceToPortlet(String path, String name, String value) + throws CommonException { + + Page page = getPage(getFolderOrPagePath(path)); + if (page == null) { + throw new CommonException("could.not.find.portlet", + "Could not find a page: " + path); + } + + String fid = getFragmentId(path); + if (fid == null || fid.equals("")) { + throw new CommonException("could.not.find.portlet", + "Could not find a page: " + path); + } + + Fragment fragment = page.getFragmentById(fid); + if (fragment == null) { + throw new CommonException("could.not.find.portlet", + "Could not find a fragment: " + fid); + } + FragmentPreference fp = getFragmentPreferenceByName(fragment, name); + //TODO handles multiple values + if (fp == null) { + fp = pageManager.newFragmentPreference(); + fp.setName(name); + fp.setReadOnly(false); + List<Object> list = new ArrayList<Object>(); + list.add(StringEscapeUtils.escapeXml(value)); + fp.setValueList(list); + fragment.getPreferences().add(fp); + } else { + fp.getValueList().set(0, StringEscapeUtils.escapeXml(value)); + } + + try { + getPageManager().updatePage(page); + getPageManager().reset(); + } catch (PageNotUpdatedException e) { + throw new CommonException("could.not.update.portlet", + "Could not update a portlet: " + path, e); + } catch (NodeException e) { + throw new CommonException("could.not.update.portlet", + "Could not update a portlet: " + path, e); + } + } + + public void deletePreferenceFromPortlet(String path, String name) + throws CommonException { + + Page page = getPage(getFolderOrPagePath(path)); + if (page == null) { + throw new CommonException("could.not.find.portlet", + "Could not find a page: " + path); + } + + String fid = getFragmentId(path); + if (fid == null || fid.equals("")) { + throw new CommonException("could.not.find.portlet", + "Could not find a page: " + path); + } + + Fragment fragment = page.getFragmentById(fid); + if (fragment == null) { + throw new CommonException("could.not.find.portlet", + "Could not find a fragment: " + fid); + } + FragmentPreference fp = getFragmentPreferenceByName(fragment, name); + //TODO handles multiple values + if (fp == null) { + throw new CommonException("could.not.find.preference", + "Could not find a preference: " + fid + ":" + name); + } else { + fragment.getPreferences().remove(fp); + } + + try { + getPageManager().updatePage(page); + getPageManager().reset(); + } catch (PageNotUpdatedException e) { + throw new CommonException("could.not.update.portlet", + "Could not update a portlet: " + path, e); + } catch (NodeException e) { + throw new CommonException("could.not.update.portlet", + "Could not update a portlet: " + path, e); + } + } + + private FragmentPreference getFragmentPreferenceByName(Fragment fragment, + String name) { + if (name == null) { + return null; + } + List preferences = fragment.getPreferences(); + for (Iterator ite = preferences.iterator(); ite.hasNext();) { + FragmentPreference fp = (FragmentPreference) ite.next(); + if (fp.getName() != null && fp.getName().equals(name)) { + return fp; + } + } + return null; + } + } Modified: pal-admin/trunk/src/main/java/jp/sf/pal/admin/service/SiteEditorService.java =================================================================== --- pal-admin/trunk/src/main/java/jp/sf/pal/admin/service/SiteEditorService.java 2007-10-22 09:20:08 UTC (rev 649) +++ pal-admin/trunk/src/main/java/jp/sf/pal/admin/service/SiteEditorService.java 2007-10-22 09:20:52 UTC (rev 650) @@ -19,11 +19,13 @@ import jp.sf.pal.admin.web.site.FolderSecurityEditorPage; import jp.sf.pal.admin.web.site.LayoutAddPortletEditorPage; import jp.sf.pal.admin.web.site.LayoutInfoEditorPage; +import jp.sf.pal.admin.web.site.LayoutPreferenceEditorPage; import jp.sf.pal.admin.web.site.LayoutPropertyEditorPage; import jp.sf.pal.admin.web.site.PageInfoEditorPage; import jp.sf.pal.admin.web.site.PageMetadataEditorPage; import jp.sf.pal.admin.web.site.PageSecurityEditorPage; import jp.sf.pal.admin.web.site.PortletInfoEditorPage; +import jp.sf.pal.admin.web.site.PortletPreferenceEditorPage; import jp.sf.pal.admin.web.site.PortletPropertyEditorPage; import jp.sf.pal.common.CommonException; import jp.sf.pal.common.util.LocaleUtil; @@ -240,6 +242,19 @@ page.getPath())); } + public void loadPage(LayoutPreferenceEditorPage page) + throws CommonException { + if (!getSiteEditorLogic().checkFolderOrPageViewAccess(page.getPath())) { + throw new CommonException("could.not.access.path", + "Could not access a path: " + page.getPath()); + } + + loadTree(page); + + page.setPreferenceItems(getSiteEditorLogic() + .createPreferenceListForLayout(page.getPath())); + } + public void loadPage(PortletInfoEditorPage page) throws CommonException { if (!getSiteEditorLogic().checkFolderOrPageViewAccess(page.getPath())) { throw new CommonException("could.not.access.path", @@ -270,6 +285,19 @@ .createPropertyListForPortlet(page.getPath())); } + public void loadPage(PortletPreferenceEditorPage page) + throws CommonException { + if (!getSiteEditorLogic().checkFolderOrPageViewAccess(page.getPath())) { + throw new CommonException("could.not.access.path", + "Could not access a path: " + page.getPath()); + } + + loadTree(page); + + page.setPreferenceItems(getSiteEditorLogic() + .createPreferenceListForPortlet(page.getPath())); + } + protected void loadTree(AbstractSiteEditorPage page) throws CommonException { String path = page.getPath(); if (path != null) { @@ -385,6 +413,30 @@ page.getPropertyName()); } + public void addPreference(LayoutPreferenceEditorPage page) + throws CommonException { + getSiteEditorLogic().addPreferenceToLayout(page.getPath(), + page.getNewPreferenceName(), page.getNewPreferenceValue()); + } + + public void deletePreference(LayoutPreferenceEditorPage page) + throws CommonException { + getSiteEditorLogic().deletePreferenceFromLayout(page.getPath(), + page.getPreferenceName()); + } + + public void addPreference(PortletPreferenceEditorPage page) + throws CommonException { + getSiteEditorLogic().addPreferenceToPortlet(page.getPath(), + page.getNewPreferenceName(), page.getNewPreferenceValue()); + } + + public void deletePreference(PortletPreferenceEditorPage page) + throws CommonException { + getSiteEditorLogic().deletePreferenceFromPortlet(page.getPath(), + page.getPreferenceName()); + } + public void deleteDocumentOrder(FolderOrderEditorPage page) throws CommonException { getSiteEditorLogic().deleteDocumentOrder(page.getPath(), Added: pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/site/LayoutPreferenceEditorPage.java =================================================================== --- pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/site/LayoutPreferenceEditorPage.java 2007-10-22 09:20:08 UTC (rev 649) +++ pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/site/LayoutPreferenceEditorPage.java 2007-10-22 09:20:52 UTC (rev 650) @@ -0,0 +1,237 @@ +/* + * Copyright 2005-2007 Portal Application Laboratory and the Others. + * + * 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 jp.sf.pal.admin.web.site; + +import java.io.Serializable; +import java.util.List; +import java.util.Map; + +import jp.sf.pal.admin.entity.NodeInfo; +import jp.sf.pal.common.CommonException; +import jp.sf.pal.common.util.FacesMessageUtil; + +import org.seasar.framework.log.Logger; +import org.seasar.teeda.extension.annotation.takeover.TakeOver; +import org.seasar.teeda.extension.annotation.takeover.TakeOverType; +import org.seasar.teeda.extension.annotation.validator.Required; + +public class LayoutPreferenceEditorPage extends AbstractSiteEditorPage + implements Serializable { + + /** + * + */ + private static final long serialVersionUID = 8040353172823831504L; + + /** + * Logger for this class + */ + private static final Logger logger = Logger + .getLogger(LayoutPreferenceEditorPage.class); + + private int propertyIndex; + + private List<Map<String, Object>> propertyItems; + + private String propertyName; + + private String propertyValue; + + @Required + private String newPreferenceName; + + private String newPreferenceValue; + + private String action; + + public Class<?> initialize() { + return null; + } + + public Class<?> prerender() { + // parse request parameters + parseRequestParameters(); + + if (getPath() == null) { + setPath("/"); + } + + if (getReturnPath() == null) { + setReturnPath("/"); + } + + // check node + int type = getSiteEditorService().getNodeInfoType(getPath()); + if (type == NodeInfo.FOLDER) { + return FolderInfoEditorPage.class; + } else if (type == NodeInfo.PAGE) { + return PageInfoEditorPage.class; + } + + if ("delete".equals(getAction())) { + // delete + if (getPreferenceName() != null) { + doDelete(); + } else { + FacesMessageUtil.addWarnMessage("could.not.find.property"); + } + + setPreferenceName(null); + setPreferenceValue(null); + } + + try { + getSiteEditorService().loadPage(this); + } catch (CommonException e) { + FacesMessageUtil.addErrorMessage(e.getMessageId()); + logger.log("EPA0018", new Object[] { this.toString() }, e); + } + + // render FacesMessages + FacesMessageUtil.renderMessages(); + return null; + } + + @TakeOver(type = TakeOverType.INCLUDE, properties = "mode,path,returnPath") + public Class<?> doAdd() { + try { + getSiteEditorService().addPreference(this); + FacesMessageUtil.addInfoMessage("added.property"); + return LayoutPreferenceEditorPage.class; + } catch (CommonException e) { + FacesMessageUtil.addErrorMessage(e.getMessageId()); + logger.log("EPA0019", new Object[] { this.toString() }, e); + } catch (Exception e) { + FacesMessageUtil.addErrorMessage("could.not.add.property"); + logger.log("EPA0020", new Object[] { this.toString() }, e); + } + return null; + } + + @TakeOver(type = TakeOverType.INCLUDE, properties = "mode,path,returnPath") + public Class<?> doDelete() { + try { + getSiteEditorService().deletePreference(this); + FacesMessageUtil.addInfoMessage("deleted.property"); + return LayoutPreferenceEditorPage.class; + } catch (CommonException e) { + FacesMessageUtil.addErrorMessage(e.getMessageId()); + logger.log("EPA0021", new Object[] { this.toString() }, e); + } catch (Exception e) { + FacesMessageUtil.addErrorMessage("could.not.delete.property"); + logger.log("EPA0022", new Object[] { this.toString() }, e); + } + return null; + } + + /** + * @return the propertyIndex + */ + public int getPreferenceIndex() { + return propertyIndex; + } + + /** + * @param propertyIndex the propertyIndex to set + */ + public void setPreferenceIndex(int propertyIndex) { + this.propertyIndex = propertyIndex; + } + + /** + * @return the propertyItems + */ + public List<Map<String, Object>> getPreferenceItems() { + return propertyItems; + } + + /** + * @param propertyItems the propertyItems to set + */ + public void setPreferenceItems(List<Map<String, Object>> propertyItems) { + this.propertyItems = propertyItems; + } + + /** + * @return the propertyName + */ + public String getPreferenceName() { + return propertyName; + } + + /** + * @param propertyName the propertyName to set + */ + public void setPreferenceName(String propertyName) { + this.propertyName = propertyName; + } + + /** + * @return the propertyValue + */ + public String getPreferenceValue() { + return propertyValue; + } + + /** + * @param propertyValue the propertyValue to set + */ + public void setPreferenceValue(String propertyValue) { + this.propertyValue = propertyValue; + } + + /** + * @return the newPreferenceName + */ + public String getNewPreferenceName() { + return newPreferenceName; + } + + /** + * @param newPreferenceName the newPreferenceName to set + */ + public void setNewPreferenceName(String newPreferenceName) { + this.newPreferenceName = newPreferenceName; + } + + /** + * @return the newPreferenceValue + */ + public String getNewPreferenceValue() { + return newPreferenceValue; + } + + /** + * @param newPreferenceValue the newPreferenceValue to set + */ + public void setNewPreferenceValue(String newPreferenceValue) { + this.newPreferenceValue = newPreferenceValue; + } + + /** + * @return the action + */ + public String getAction() { + return action; + } + + /** + * @param action the action to set + */ + public void setAction(String action) { + this.action = action; + } +} \ No newline at end of file Property changes on: pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/site/LayoutPreferenceEditorPage.java ___________________________________________________________________ Name: svn:eol-style + native Added: pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/site/PortletPreferenceEditorPage.java =================================================================== --- pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/site/PortletPreferenceEditorPage.java 2007-10-22 09:20:08 UTC (rev 649) +++ pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/site/PortletPreferenceEditorPage.java 2007-10-22 09:20:52 UTC (rev 650) @@ -0,0 +1,237 @@ +/* + * Copyright 2005-2007 Portal Application Laboratory and the Others. + * + * 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 jp.sf.pal.admin.web.site; + +import java.io.Serializable; +import java.util.List; +import java.util.Map; + +import jp.sf.pal.admin.entity.NodeInfo; +import jp.sf.pal.common.CommonException; +import jp.sf.pal.common.util.FacesMessageUtil; + +import org.seasar.framework.log.Logger; +import org.seasar.teeda.extension.annotation.takeover.TakeOver; +import org.seasar.teeda.extension.annotation.takeover.TakeOverType; +import org.seasar.teeda.extension.annotation.validator.Required; + +public class PortletPreferenceEditorPage extends AbstractSiteEditorPage + implements Serializable { + + /** + * + */ + private static final long serialVersionUID = -3291082572720400440L; + + /** + * Logger for this class + */ + private static final Logger logger = Logger + .getLogger(PortletPreferenceEditorPage.class); + + private int propertyIndex; + + private List<Map<String, Object>> propertyItems; + + private String propertyName; + + private String propertyValue; + + @Required + private String newPreferenceName; + + private String newPreferenceValue; + + private String action; + + public Class<?> initialize() { + return null; + } + + public Class<?> prerender() { + // parse request parameters + parseRequestParameters(); + + if (getPath() == null) { + setPath("/"); + } + + if (getReturnPath() == null) { + setReturnPath("/"); + } + + // check node + int type = getSiteEditorService().getNodeInfoType(getPath()); + if (type == NodeInfo.FOLDER) { + return FolderInfoEditorPage.class; + } else if (type == NodeInfo.PAGE) { + return PageInfoEditorPage.class; + } + + if ("delete".equals(getAction())) { + // delete + if (getPreferenceName() != null) { + doDelete(); + } else { + FacesMessageUtil.addWarnMessage("could.not.find.property"); + } + + setPreferenceName(null); + setPreferenceValue(null); + } + + try { + getSiteEditorService().loadPage(this); + } catch (CommonException e) { + FacesMessageUtil.addErrorMessage(e.getMessageId()); + logger.log("EPA0023", new Object[] { this.toString() }, e); + } + + // render FacesMessages + FacesMessageUtil.renderMessages(); + return null; + } + + @TakeOver(type = TakeOverType.INCLUDE, properties = "mode,path,returnPath") + public Class<?> doAdd() { + try { + getSiteEditorService().addPreference(this); + FacesMessageUtil.addInfoMessage("added.property"); + return PortletPreferenceEditorPage.class; + } catch (CommonException e) { + FacesMessageUtil.addErrorMessage(e.getMessageId()); + logger.log("EPA0024", new Object[] { this.toString() }, e); + } catch (Exception e) { + FacesMessageUtil.addErrorMessage("could.not.add.property"); + logger.log("EPA0025", new Object[] { this.toString() }, e); + } + return null; + } + + @TakeOver(type = TakeOverType.INCLUDE, properties = "mode,path,returnPath") + public Class<?> doDelete() { + try { + getSiteEditorService().deletePreference(this); + FacesMessageUtil.addInfoMessage("deleted.property"); + return PortletPreferenceEditorPage.class; + } catch (CommonException e) { + FacesMessageUtil.addErrorMessage(e.getMessageId()); + logger.log("EPA0026", new Object[] { this.toString() }, e); + } catch (Exception e) { + FacesMessageUtil.addErrorMessage("could.not.delete.property"); + logger.log("EPA0027", new Object[] { this.toString() }, e); + } + return null; + } + + /** + * @return the propertyIndex + */ + public int getPreferenceIndex() { + return propertyIndex; + } + + /** + * @param propertyIndex the propertyIndex to set + */ + public void setPreferenceIndex(int propertyIndex) { + this.propertyIndex = propertyIndex; + } + + /** + * @return the propertyItems + */ + public List<Map<String, Object>> getPreferenceItems() { + return propertyItems; + } + + /** + * @param propertyItems the propertyItems to set + */ + public void setPreferenceItems(List<Map<String, Object>> propertyItems) { + this.propertyItems = propertyItems; + } + + /** + * @return the propertyName + */ + public String getPreferenceName() { + return propertyName; + } + + /** + * @param propertyName the propertyName to set + */ + public void setPreferenceName(String propertyName) { + this.propertyName = propertyName; + } + + /** + * @return the propertyValue + */ + public String getPreferenceValue() { + return propertyValue; + } + + /** + * @param propertyValue the propertyValue to set + */ + public void setPreferenceValue(String propertyValue) { + this.propertyValue = propertyValue; + } + + /** + * @return the newPreferenceName + */ + public String getNewPreferenceName() { + return newPreferenceName; + } + + /** + * @param newPreferenceName the newPreferenceName to set + */ + public void setNewPreferenceName(String newPreferenceName) { + this.newPreferenceName = newPreferenceName; + } + + /** + * @return the newPreferenceValue + */ + public String getNewPreferenceValue() { + return newPreferenceValue; + } + + /** + * @param newPreferenceValue the newPreferenceValue to set + */ + public void setNewPreferenceValue(String newPreferenceValue) { + this.newPreferenceValue = newPreferenceValue; + } + + /** + * @return the action + */ + public String getAction() { + return action; + } + + /** + * @param action the action to set + */ + public void setAction(String action) { + this.action = action; + } +} \ No newline at end of file Property changes on: pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/site/PortletPreferenceEditorPage.java ___________________________________________________________________ Name: svn:eol-style + native Modified: pal-admin/trunk/src/main/resources/PAMessages.properties =================================================================== --- pal-admin/trunk/src/main/resources/PAMessages.properties 2007-10-22 09:20:08 UTC (rev 649) +++ pal-admin/trunk/src/main/resources/PAMessages.properties 2007-10-22 09:20:52 UTC (rev 650) @@ -16,4 +16,14 @@ EPA0015=Could not add a property. EPA0016=Could not delete a property. EPA0017=Could not delete a property. +EPA0018=Could not load a page. +EPA0019=Could not add a preference. +EPA0020=Could not add a preference. +EPA0021=Could not delete a preference. +EPA0022=Could not delete a preference. +EPA0023=Could not load a page. +EPA0024=Could not add a preference. +EPA0025=Could not add a preference. +EPA0026=Could not delete a preference. +EPA0027=Could not delete a preference. Modified: pal-admin/trunk/src/main/resources/appMessages.properties =================================================================== --- pal-admin/trunk/src/main/resources/appMessages.properties 2007-10-22 09:20:08 UTC (rev 649) +++ pal-admin/trunk/src/main/resources/appMessages.properties 2007-10-22 09:20:52 UTC (rev 650) @@ -202,3 +202,8 @@ deleted.property=Deleted the property. could.not.delete.property=Could not delete the property. If you see this error message again, please contact a site administrator. +could.not.find.preference=Could not find the preference. If you see this error message again, please contact a site administrator. +added.preference=Added the preference +could.not.add.preference=Could not add the preference. If you see this error message again, please contact a site administrator. +deleted.preference=Deleted the preference. +could.not.delete.preference=Could not delete the preference. If you see this error message again, please contact a site administrator. Modified: pal-admin/trunk/src/main/resources/jp/sf/pal/admin/web/site/label.properties =================================================================== --- pal-admin/trunk/src/main/resources/jp/sf/pal/admin/web/site/label.properties 2007-10-22 09:20:08 UTC (rev 649) +++ pal-admin/trunk/src/main/resources/jp/sf/pal/admin/web/site/label.properties 2007-10-22 09:20:52 UTC (rev 650) @@ -4,6 +4,7 @@ addTab=Add orderTab=Order propertyTab=Property +preferenceTab=Preference path=Path: finish=Finish @@ -126,3 +127,19 @@ portletPropertyEditor.newPropertyValue=Value: portletPropertyEditor.add=Add +layoutPreferenceEditor.name=Name +layoutPreferenceEditor.value=Value +layoutPreferenceEditor.action=Action +layoutPreferenceEditor.delete=Delete +layoutPreferenceEditor.newPreferenceName=Name: +layoutPreferenceEditor.newPreferenceValue=Value: +layoutPreferenceEditor.add=Add + +portletPreferenceEditor.name=Name +portletPreferenceEditor.value=Value +portletPreferenceEditor.action=Action +portletPreferenceEditor.delete=Delete +portletPreferenceEditor.newPreferenceName=Name: +portletPreferenceEditor.newPreferenceValue=Value: +portletPreferenceEditor.add=Add + Modified: pal-admin/trunk/src/main/resources/jp/sf/pal/admin/web/site/label_ja.properties =================================================================== --- pal-admin/trunk/src/main/resources/jp/sf/pal/admin/web/site/label_ja.properties 2007-10-22 09:20:08 UTC (rev 649) +++ pal-admin/trunk/src/main/resources/jp/sf/pal/admin/web/site/label_ja.properties 2007-10-22 09:20:52 UTC (rev 650) @@ -4,6 +4,7 @@ addTab=\u8ffd\u52a0 orderTab=\u9806\u5e8f propertyTab=\u30d7\u30ed\u30d1\u30c6\u30a3 +preferenceTab=\u30d7\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9 path=\u30d1\u30b9: finish=\u5b8c\u4e86 @@ -127,3 +128,20 @@ portletPropertyEditor.newPropertyName=\u540d\u524d: portletPropertyEditor.newPropertyValue=\u5024: portletPropertyEditor.add=\u8ffd\u52a0 + +layoutPreferenceEditor.name=\u540d\u524d +layoutPreferenceEditor.value=\u5024 +layoutPreferenceEditor.action=\u30a2\u30af\u30b7\u30e7\u30f3 +layoutPreferenceEditor.delete=\u524a\u9664 +layoutPreferenceEditor.newPreferenceName=\u540d\u524d: +layoutPreferenceEditor.newPreferenceValue=\u5024: +layoutPreferenceEditor.add=\u8ffd\u52a0 + +portletPreferenceEditor.name=\u540d\u524d +portletPreferenceEditor.value=\u5024 +portletPreferenceEditor.action=\u30a2\u30af\u30b7\u30e7\u30f3 +portletPreferenceEditor.delete=\u524a\u9664 +portletPreferenceEditor.newPreferenceName=\u540d\u524d: +portletPreferenceEditor.newPreferenceValue=\u5024: +portletPreferenceEditor.add=\u8ffd\u52a0 + Modified: pal-admin/trunk/src/main/webapp/view/site/layoutAddPortletEditor.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/site/layoutAddPortletEditor.html 2007-10-22 09:20:08 UTC (rev 649) +++ pal-admin/trunk/src/main/webapp/view/site/layoutAddPortletEditor.html 2007-10-22 09:20:52 UTC (rev 650) @@ -58,6 +58,9 @@ <a id="jumpLayoutPropertyEditor-tab" href="layoutPropertyEditor.html?mode=c&path=a&returnPath=b" style="text-decoration: none;"> <span id="propertyTabLabel" style="font-weight: bold;color:#ffffff;background-color:#999999;border:1px solid #000000; padding: 3px 5px 3px 5px; margin: 0px 0px;">Property</span> </a> + <a id="jumpLayoutPreferenceEditor-tab" href="layoutPreferenceEditor.html?mode=c&path=a&returnPath=b" style="text-decoration: none;"> + <span id="preferenceTabLabel" style="font-weight: bold;color:#ffffff;background-color:#999999;border:1px solid #000000; padding: 3px 5px 3px 5px; margin: 0px 0px;">Preference</span> + </a> </div> <div> <span id="allMessages" te:fatalClass="portlet-msg-error" te:errorClass="portlet-msg-error" te:warnClass="portlet-msg-alert" te:infoClass="portlet-msg-info"></span> Modified: pal-admin/trunk/src/main/webapp/view/site/layoutInfoEditor.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/site/layoutInfoEditor.html 2007-10-22 09:20:08 UTC (rev 649) +++ pal-admin/trunk/src/main/webapp/view/site/layoutInfoEditor.html 2007-10-22 09:20:52 UTC (rev 650) @@ -58,6 +58,9 @@ <a id="jumpLayoutPropertyEditor-tab" href="layoutPropertyEditor.html?mode=c&path=a&returnPath=b" style="text-decoration: none;"> <span id="propertyTabLabel" style="font-weight: bold;color:#ffffff;background-color:#999999;border:1px solid #000000; padding: 3px 5px 3px 5px; margin: 0px 0px;">Property</span> </a> + <a id="jumpLayoutPreferenceEditor-tab" href="layoutPreferenceEditor.html?mode=c&path=a&returnPath=b" style="text-decoration: none;"> + <span id="preferenceTabLabel" style="font-weight: bold;color:#ffffff;background-color:#999999;border:1px solid #000000; padding: 3px 5px 3px 5px; margin: 0px 0px;">Preference</span> + </a> </div> <div> <span id="allMessages" te:fatalClass="portlet-msg-error" te:errorClass="portlet-msg-error" te:warnClass="portlet-msg-alert" te:infoClass="portlet-msg-info"></span> Added: pal-admin/trunk/src/main/webapp/view/site/layoutPreferenceEditor.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/site/layoutPreferenceEditor.html 2007-10-22 09:20:08 UTC (rev 649) +++ pal-admin/trunk/src/main/webapp/view/site/layoutPreferenceEditor.html 2007-10-22 09:20:52 UTC (rev 650) @@ -0,0 +1,111 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xmlns:te="http://www.seasar.org/teeda/extension"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <link rel="stylesheet" type="text/css" href="../../css/global.css" /> + </head> + <body> + <form id="layoutPreferenceEditorForm"> + <input id="path" type="hidden"/> + <input id="returnPath" type="hidden"/> +<!-- tree: BEGIN --> + <div style="width: 28%;height: 400px;float: left;border: 1px solid #666666;overflow: auto;"> + <div id="nodeItems"> + <div id="isFolder" style="white-space: nowrap;"> + <a id="jumpFolderInfoEditor" href="folderInfoEditor.html?mode=c&path=a&returnPath=b" style=""> + <img id="folderIcon" src="" border="0" style="vertical-align:middle;" /> + <span id="name-folder">Name</span> + </a> + </div> + <div id="isPage" style="white-space: nowrap;"> + <a id="jumpPageInfoEditor" href="pageInfoEditor.html?mode=c&path=a&returnPath=b" style=""> + <img id="pageIcon" src="" border="0" style="vertical-align:middle;" /> + <span id="name-page">Name</span> + </a> + </div> + <div id="isPageLayout" style="white-space: nowrap;"> + <a id="jumpLayoutInfoEditor" href="layoutInfoEditor.html?mode=c&path=a&returnPath=b" style=""> + <img id="layoutIcon" src="" border="0" style="vertical-align:middle;" /> + <span id="name-layout">Name</span> + </a> + </div> + <div id="isPortlet" style="white-space: nowrap;"> + <a id="jumpPortletInfoEditor" href="portletInfoEditor.html?mode=c&path=a&returnPath=b" style=""> + <img id="portletIcon" src="" border="0" style="vertical-align:middle;" /> + <span id="name-portlet">Name</span> + </a> + </div> + </div> + </div> +<!-- tree: END --> +<!-- content: BEGIN --> + <div style="width: 70%;float: left;padding: 5px;margin: 0px;"> + <div style="height: 20px;margin-bottom: 5px;padding: 2px;border: 1px dotted black;"> + <div style="float: left;"> + <label id="pathLabel">Path:</label> + <span id="currentPath">/path/path</span> + </div> + <div style="float: right;width:50px;text-align: right;"> + <a id="returnPathLink" href="" style="text-decoration: none;"><span id="finishLabel">Finish</span></a> + </div> + </div> + <div style="clear: both;padding: 0px 0px 3px 10px; margin:10px 0px 5px 0px;border-bottom:1px solid #000000;"> + <a id="jumpLayoutInfoEditor-tab" href="layoutInfoEditor.html?mode=c&path=a&returnPath=b" style="text-decoration: none;"> + <span id="infoTabLabel" style="font-weight: bold;color:#ffffff;background-color:#999999;border:1px solid #000000; padding: 3px 5px 3px 5px; margin: 0px 0px;">Information</span> + </a> + <a id="jumpLayoutAddPortletEditor-tab" href="layoutAddPortletEditor.html?mode=c&path=a&returnPath=b" style="text-decoration: none;"> + <span id="addTabLabel" style="font-weight: bold;color:#ffffff;background-color:#999999;border:1px solid #000000; padding: 3px 5px 3px 5px; margin: 0px 0px;">Add</span> + </a> + <a id="jumpLayoutPropertyEditor-tab" href="layoutPropertyEditor.html?mode=c&path=a&returnPath=b" style="text-decoration: none;"> + <span id="propertyTabLabel" style="font-weight: bold;color:#ffffff;background-color:#999999;border:1px solid #000000; padding: 3px 5px 3px 5px; margin: 0px 0px;">Property</span> + </a> + <label id="preferenceTabLabel" style="border-top:1px solid #000000;border-right:1px solid #000000;border-bottom:1px solid #ffffff;border-left:1px solid #000000;padding: 3px 5px 3px 5px; margin: 0px 0px;">Preference</label> + </div> + <div> + <span id="allMessages" te:fatalClass="portlet-msg-error" te:errorClass="portlet-msg-error" te:warnClass="portlet-msg-alert" te:infoClass="portlet-msg-info"></span> + </div> + <div> + <table> + <thead> + <tr> + <td style="width: 80px;"><label id="nameLabel"></label></td> + <td style="width: 300px;"><label id="valueLabel"></label></td> + <td style="width: 100px;"><label id="actionLabel"></label></td> + </tr> + </thead> + <tbody id="preferenceItems"> + <tr> + <td><span id="preferenceName">N</span></td> + <td style="overflow: scroll;"><span id="preferenceValue">V</span></td> + <td> + <div id="isEditable-delete"> + <a id="goPagePreferenceEditor-delete" href="layoutPreferenceEditor.html?mode=c&path=a&returnPath=b&preferenceName=c&fixed_action=delete"> + <span id="deleteLabel">Delete</span> + </a> + </div> + </td> + </tr> + </tbody> + </table> + + <br/> + + <div style="clear:both;"> + <div style="width:120px;float: left;"><label id="newPreferenceNameLabel" for="newPreferenceName">Name:</label></div> + <input id="newPreferenceName" type="text" size="30"/> + </div> + <div style="clear:both;"> + <div style="width:120px;float: left;"><label id="newPreferenceValueLabel" for="newPreferenceValue">Value:</label></div> + <input id="newPreferenceValue" type="text" size="30"/> + </div> + <div id="isEditable-update" style="margin-top: 20px;text-align: center;"> + <input id="doAdd" type="button" value="Add"/> + </div> + </div> + </div> + <br style="clear: both;" /> +<!-- content: END --> + </form> + </body> +</html> Property changes on: pal-admin/trunk/src/main/webapp/view/site/layoutPreferenceEditor.html ___________________________________________________________________ Name: svn:eol-style + native Modified: pal-admin/trunk/src/main/webapp/view/site/portletInfoEditor.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/site/portletInfoEditor.html 2007-10-22 09:20:08 UTC (rev 649) +++ pal-admin/trunk/src/main/webapp/view/site/portletInfoEditor.html 2007-10-22 09:20:52 UTC (rev 650) @@ -55,6 +55,9 @@ <a id="jumpPortletPropertyEditor-tab" href="portletPropertyEditor.html?mode=c&path=a&returnPath=b" style="text-decoration: none;"> <span id="propertyTabLabel" style="font-weight: bold;color:#ffffff;background-color:#999999;border:1px solid #000000; padding: 3px 5px 3px 5px; margin: 0px 0px;">Property</span> </a> + <a id="jumpPortletPreferenceEditor-tab" href="portletPreferenceEditor.html?mode=c&path=a&returnPath=b" style="text-decoration: none;"> + <span id="preferenceTabLabel" style="font-weight: bold;color:#ffffff;background-color:#999999;border:1px solid #000000; padding: 3px 5px 3px 5px; margin: 0px 0px;">Preference</span> + </a> </div> <div> <span id="allMessages" te:fatalClass="portlet-msg-error" te:errorClass="portlet-msg-error" te:warnClass="portlet-msg-alert" te:infoClass="portlet-msg-info"></span> Added: pal-admin/trunk/src/main/webapp/view/site/portletPreferenceEditor.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/site/portletPreferenceEditor.html 2007-10-22 09:20:08 UTC (rev 649) +++ pal-admin/trunk/src/main/webapp/view/site/portletPreferenceEditor.html 2007-10-22 09:20:52 UTC (rev 650) @@ -0,0 +1,108 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xmlns:te="http://www.seasar.org/teeda/extension"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <link rel="stylesheet" type="text/css" href="../../css/global.css" /> + </head> + <body> + <form id="portletPreferenceEditorForm"> + <input id="path" type="hidden"/> + <input id="returnPath" type="hidden"/> +<!-- tree: BEGIN --> + <div style="width: 28%;height: 400px;float: left;border: 1px solid #666666;overflow: auto;"> + <div id="nodeItems"> + <div id="isFolder" style="white-space: nowrap;"> + <a id="jumpFolderInfoEditor" href="folderInfoEditor.html?mode=c&path=a&returnPath=b" style=""> + <img id="folderIcon" src="" border="0" style="vertical-align:middle;" /> + <span id="name-folder">Name</span> + </a> + </div> + <div id="isPage" style="white-space: nowrap;"> + <a id="jumpPageInfoEditor" href="pageInfoEditor.html?mode=c&path=a&returnPath=b" style=""> + <img id="pageIcon" src="" border="0" style="vertical-align:middle;" /> + <span id="name-page">Name</span> + </a> + </div> + <div id="isPageLayout" style="white-space: nowrap;"> + <a id="jumpLayoutInfoEditor" href="layoutInfoEditor.html?mode=c&path=a&returnPath=b" style=""> + <img id="layoutIcon" src="" border="0" style="vertical-align:middle;" /> + <span id="name-layout">Name</span> + </a> + </div> + <div id="isPortlet" style="white-space: nowrap;"> + <a id="jumpPortletInfoEditor" href="portletInfoEditor.html?mode=c&path=a&returnPath=b" style=""> + <img id="portletIcon" src="" border="0" style="vertical-align:middle;" /> + <span id="name-portlet">Name</span> + </a> + </div> + </div> + </div> +<!-- tree: END --> +<!-- content: BEGIN --> + <div style="width: 70%;float: left;padding: 5px;margin: 0px;"> + <div style="height: 20px;margin-bottom: 5px;padding: 2px;border: 1px dotted black;"> + <div style="float: left;"> + <label id="pathLabel">Path:</label> + <span id="currentPath">/path/path</span> + </div> + <div style="float: right;width:50px;text-align: right;"> + <a id="returnPathLink" href="" style="text-decoration: none;"><span id="finishLabel">Finish</span></a> + </div> + </div> + <div style="clear: both;padding: 0px 0px 3px 10px; margin:10px 0px 5px 0px;border-bottom:1px solid #000000;"> + <a id="jumpPortletInfoEditor-tab" href="portletInfoEditor.html?mode=c&path=a&returnPath=b" style="text-decoration: none;"> + <span id="infoTabLabel" style="font-weight: bold;color:#ffffff;background-color:#999999;border:1px solid #000000; padding: 3px 5px 3px 5px; margin: 0px 0px;">Information</span> + </a> + <a id="jumpPortletPropertyEditor-tab" href="portletPropertyEditor.html?mode=c&path=a&returnPath=b" style="text-decoration: none;"> + <span id="propertyTabLabel" style="font-weight: bold;color:#ffffff;background-color:#999999;border:1px solid #000000; padding: 3px 5px 3px 5px; margin: 0px 0px;">Property</span> + </a> + <label id="preferenceTabLabel" style="border-top:1px solid #000000;border-right:1px solid #000000;border-bottom:1px solid #ffffff;border-left:1px solid #000000;padding: 3px 5px 3px 5px; margin: 0px 0px;">Preference</label> + </div> + <div> + <span id="allMessages" te:fatalClass="portlet-msg-error" te:errorClass="portlet-msg-error" te:warnClass="portlet-msg-alert" te:infoClass="portlet-msg-info"></span> + </div> + <div> + <table> + <thead> + <tr> + <td style="width: 80px;"><label id="nameLabel"></label></td> + <td style="width: 300px;"><label id="valueLabel"></label></td> + <td style="width: 100px;"><label id="actionLabel"></label></td> + </tr> + </thead> + <tbody id="preferenceItems"> + <tr> + <td><span id="preferenceName">N</span></td> + <td style="overflow: scroll;"><span id="preferenceValue">V</span></td> + <td> + <div id="isEditable-delete"> + <a id="goPagePreferenceEditor-delete" href="portletPreferenceEditor.html?mode=c&path=a&returnPath=b&preferenceName=c&fixed_action=delete"> + <span id="deleteLabel">Delete</span> + </a> + </div> + </td> + </tr> + </tbody> + </table> + + <br/> + + <div style="clear:both;"> + <div style="width:120px;float: left;"><label id="newPreferenceNameLabel" for="newPreferenceName">Name:</label></div> + <input id="newPreferenceName" type="text" size="30"/> + </div> + <div style="clear:both;"> + <div style="width:120px;float: left;"><label id="newPreferenceValueLabel" for="newPreferenceValue">Value:</label></div> + <input id="newPreferenceValue" type="text" size="30"/> + </div> + <div id="isEditable-update" style="margin-top: 20px;text-align: center;"> + <input id="doAdd" type="button" value="Add"/> + </div> + </div> + </div> + <br style="clear: both;" /> +<!-- content: END --> + </form> + </body> +</html> Property changes on: pal-admin/trunk/src/main/webapp/view/site/portletPreferenceEditor.html ___________________________________________________________________ Name: svn:eol-style + native