[pal-cvs 2424] [156] modified layout customization.

svnno****@sourc***** svnno****@sourc*****
2007年 5月 25日 (金) 12:26:45 JST


Revision: 156
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=156
Author:   shinsuke
Date:     2007-05-25 12:26:45 +0900 (Fri, 25 May 2007)

Log Message:
-----------
modified layout customization.

Modified Paths:
--------------
    pal-portal/trunk/build.properties
    pal-portal/trunk/portal/patches/src/webapp/WEB-INF/templates/layout/html/columns/layout.vm

Added Paths:
-----------
    pal-portal/trunk/NOTICE.txt
    pal-portal/trunk/portal/files/src/webapp/decorations/images/
    pal-portal/trunk/portal/files/src/webapp/decorations/images/edit.gif
    pal-portal/trunk/portal/files/src/webapp/decorations/images/help.gif
    pal-portal/trunk/portal/files/src/webapp/decorations/images/view.gif
    pal-portal/trunk/portal/patches/layout-portlets/src/java/
    pal-portal/trunk/portal/patches/layout-portlets/src/java/org/
    pal-portal/trunk/portal/patches/layout-portlets/src/java/org/apache/
    pal-portal/trunk/portal/patches/layout-portlets/src/java/org/apache/jetspeed/
    pal-portal/trunk/portal/patches/layout-portlets/src/java/org/apache/jetspeed/portlets/
    pal-portal/trunk/portal/patches/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/
    pal-portal/trunk/portal/patches/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/MultiColumnPortlet.java
    pal-portal/trunk/portal/patches/src/webapp/WEB-INF/jetspeed_macros.vm


-------------- next part --------------
Added: pal-portal/trunk/NOTICE.txt
===================================================================
--- pal-portal/trunk/NOTICE.txt	2007-05-22 08:12:11 UTC (rev 155)
+++ pal-portal/trunk/NOTICE.txt	2007-05-25 03:26:45 UTC (rev 156)
@@ -0,0 +1,13 @@
+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-portal/trunk/NOTICE.txt
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: pal-portal/trunk/build.properties
===================================================================
--- pal-portal/trunk/build.properties	2007-05-22 08:12:11 UTC (rev 155)
+++ pal-portal/trunk/build.properties	2007-05-25 03:26:45 UTC (rev 156)
@@ -169,11 +169,14 @@
 components/security/src/java/org/apache/jetspeed/security/spi/impl/SecurityAccessImpl.java,\
 applications/j2-admin/src/java/org/apache/jetspeed/portlets/registration/UserRegistrationPortlet.java,\
 applications/j2-admin/src/webapp/WEB-INF/portlet.xml,\
+layout-portlets/src/java/org/apache/jetspeed/portlets/layout/MultiColumnPortlet.java,\
 layout-portlets/src/webapp/WEB-INF/portlet.xml,\
 src/webapp/WEB-INF/assembly/jetspeed-services.xml,\
 src/webapp/WEB-INF/assembly/portal-url-generation.xml,\
 src/webapp/WEB-INF/assembly/pipelines.xml,\
+src/webapp/WEB-INF/jetspeed_macros.vm,\
 src/webapp/WEB-INF/templates/login/html/login.jsp,\
+src/webapp/WEB-INF/templates/layout/html/columns/layout.vm,\
 src/webapp/WEB-INF/templates/layout/html/maximized/layout.vm,\
 src/webapp/decorations/portlet/decorator.vm,\
 project.properties,\
@@ -187,8 +190,12 @@
 
 portal.delete.files=\
 src/webapp/WEB-INF/conf/override.properties,\
+src/webapp/decorations/images/edit.gif,\
+src/webapp/decorations/images/view.gif,\
+src/webapp/decorations/images/help.gif,\
 
 
+
 portal.delete.directories=\
 src/webapp/WEB-INF/pages/,\
 src/webapp/desktop-themes/sky/,\

Added: pal-portal/trunk/portal/files/src/webapp/decorations/images/edit.gif
===================================================================
(Binary files differ)


Property changes on: pal-portal/trunk/portal/files/src/webapp/decorations/images/edit.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: pal-portal/trunk/portal/files/src/webapp/decorations/images/help.gif
===================================================================
(Binary files differ)


Property changes on: pal-portal/trunk/portal/files/src/webapp/decorations/images/help.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: pal-portal/trunk/portal/files/src/webapp/decorations/images/view.gif
===================================================================
(Binary files differ)


Property changes on: pal-portal/trunk/portal/files/src/webapp/decorations/images/view.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: pal-portal/trunk/portal/patches/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/MultiColumnPortlet.java
===================================================================
--- pal-portal/trunk/portal/patches/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/MultiColumnPortlet.java	2007-05-22 08:12:11 UTC (rev 155)
+++ pal-portal/trunk/portal/patches/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/MultiColumnPortlet.java	2007-05-25 03:26:45 UTC (rev 156)
@@ -0,0 +1,1782 @@
+Index: layout-portlets/src/java/org/apache/jetspeed/portlets/layout/MultiColumnPortlet.java
+===================================================================
+--- layout-portlets/src/java/org/apache/jetspeed/portlets/layout/MultiColumnPortlet.java	(リビジョン 539124)
++++ layout-portlets/src/java/org/apache/jetspeed/portlets/layout/MultiColumnPortlet.java	(作業コピー)
+@@ -55,21 +55,32 @@
+     protected final static Log log = LogFactory.getLog(MultiColumnPortlet.class);
+ 
+     protected final static String PARAM_NUM_COLUMN = "columns";
++
+     protected final static int DEFAULT_NUM_COLUMN = 2;
++
+     protected final static String PARAM_COLUMN_SIZES = "sizes";
++
+     protected final static String DEFAULT_ONE_COLUMN_SIZES = "100%";
++
+     protected final static String DEFAULT_TWO_COLUMN_SIZES = "50%,50%";
++
+     protected final static String DEFAULT_THREE_COLUMN_SIZES = "34%,33%,33%";
+ 
+     private int numColumns = 0;
++
+     private String columnSizes = null;
++
+     private String portletName = null;
++
+     private String layoutType;
++
+     private String editorType = null;
++
+     protected DecorationFactory decorators;
++
+     protected JetspeedDesktop desktop;
+ 
+-    public void init( PortletConfig config ) throws PortletException
++    public void init(PortletConfig config) throws PortletException
+     {
+         super.init(config);
+         this.portletName = config.getPortletName();
+@@ -89,50 +100,57 @@
+         {
+             switch (this.numColumns)
+             {
+-            case 1: this.columnSizes = DEFAULT_ONE_COLUMN_SIZES; break;
+-            case 2: this.columnSizes = DEFAULT_TWO_COLUMN_SIZES; break;
+-            case 3: this.columnSizes = DEFAULT_THREE_COLUMN_SIZES; break;
+-            default: this.columnSizes = null; break;
++                case 1:
++                    this.columnSizes = DEFAULT_ONE_COLUMN_SIZES;
++                    break;
++                case 2:
++                    this.columnSizes = DEFAULT_TWO_COLUMN_SIZES;
++                    break;
++                case 3:
++                    this.columnSizes = DEFAULT_THREE_COLUMN_SIZES;
++                    break;
++                default:
++                    this.columnSizes = null;
++                    break;
+             }
+         }
+         if (this.columnSizes == null)
+         {
+-            throw new PortletException("Column sizes cannot be defaulted for " + this.numColumns + " columns and are not specified for " + this.portletName);
++            throw new PortletException("Column sizes cannot be defaulted for " + this.numColumns
++                    + " columns and are not specified for " + this.portletName);
+         }
+-       
+-        this.decorators = (DecorationFactory)getPortletContext().getAttribute(CommonPortletServices.CPS_DECORATION_FACTORY);
++
++        this.decorators = (DecorationFactory) getPortletContext().getAttribute(CommonPortletServices.CPS_DECORATION_FACTORY);
+         if (null == this.decorators)
+         {
+             throw new PortletException("Failed to find the Decoration Factory on portlet initialization");
+         }
+-        
+-        this.desktop = (JetspeedDesktop)getPortletContext().getAttribute(CommonPortletServices.CPS_DESKTOP);
++
++        this.desktop = (JetspeedDesktop) getPortletContext().getAttribute(CommonPortletServices.CPS_DESKTOP);
+     }
+ 
+-    public void doView( RenderRequest request, RenderResponse response ) throws PortletException, IOException
++    public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException
+     {
+         RequestContext context = getRequestContext(request);
+ 
+-        ContentPage requestPage = context.getPage();       
+-        PageEditAccess pageEditAccess = (PageEditAccess)context.getAttribute(PortalReservedParameters.PAGE_EDIT_ACCESS_ATTRIBUTE);
+-        if ( requestPage == null || pageEditAccess == null )
++        ContentPage requestPage = context.getPage();
++        PageEditAccess pageEditAccess = (PageEditAccess) context.getAttribute(PortalReservedParameters.PAGE_EDIT_ACCESS_ATTRIBUTE);
++        if (requestPage == null || pageEditAccess == null)
+         {
+             // Targetting this portlet REQUIRES that the ProfilerValve has been invoked!
+             throw new PortletException("Current request page or PageEditAccess not available.");
+         }
+-        
+-        Boolean editing = ( pageEditAccess.isEditing() && 
+-                            PortletMode.VIEW.equals(request.getPortletMode()) && 
+-                            request.isPortletModeAllowed(PortletMode.EDIT))
+-                          ? Boolean.TRUE : Boolean.FALSE;
+-                                         
++
++        Boolean editing = (pageEditAccess.isEditing() && PortletMode.VIEW.equals(request.getPortletMode()) && request
++                .isPortletModeAllowed(PortletMode.EDIT)) ? Boolean.TRUE : Boolean.FALSE;
++
+         PortletWindow window = context.getPortalURL().getNavigationalState().getMaximizedWindow();
+         if (window != null)
+         {
+             super.doView(request, response);
+             return;
+         }
+-        
++
+         // get fragment column sizes
+         Fragment f = getFragment(request, false);
+         String fragmentColumnSizes = columnSizes;
+@@ -141,7 +159,7 @@
+         {
+             fragmentColumnSizes = fragmentColumnSizesProperty;
+         }
+-        String [] fragmentColumnSizesArray = fragmentColumnSizes.split("\\,");
++        String[] fragmentColumnSizesArray = fragmentColumnSizes.split("\\,");
+         List fragmentColumnSizesList = new ArrayList(fragmentColumnSizesArray.length);
+         for (int i = 0; (i < fragmentColumnSizesArray.length); i++)
+         {
+@@ -157,16 +175,35 @@
+         }
+         catch (LayoutEventException e1)
+         {
+-            throw new PortletException("Failed to build ColumnLayout "+e1.getMessage(), e1);
++            throw new PortletException("Failed to build ColumnLayout " + e1.getMessage(), e1);
+         }
+ 
++        String prefName = request.getParameter("preferenceName");
++        if (prefName != null)
++        {
++            request.setAttribute("preferenceName", prefName);
++        }
++        else
++        {
++            request.setAttribute("preferenceName", "");
++        }
++        String prefState = request.getParameter("preferenceState");
++        if (prefState != null)
++        {
++            request.setAttribute("preferenceState", prefState);
++        }
++        else
++        {
++            request.setAttribute("preferenceState", "hide");
++        }
++
+         // invoke the JSP associated with this portlet
+         request.setAttribute("columnLayout", layout);
+         request.setAttribute("numberOfColumns", new Integer(numColumns));
+         request.setAttribute("decorationFactory", this.decorators);
+         request.setAttribute("columnSizes", fragmentColumnSizesList);
+-        request.setAttribute("editing",editing);
+-        request.setAttribute("fragmentNestingLevel",new Integer(getFragmentNestingLevel(requestPage,f.getId())));
++        request.setAttribute("editing", editing);
++        request.setAttribute("fragmentNestingLevel", new Integer(getFragmentNestingLevel(requestPage, f.getId())));
+         super.doView(request, response);
+         request.removeAttribute("decorationFactory");
+         request.removeAttribute("columnLayout");
+@@ -176,794 +213,956 @@
+         request.removeAttribute(("fragmentNestingLevel"));
+     }
+ 
+-    public void processAction(ActionRequest request, ActionResponse response) throws PortletException, IOException
++    protected void addLayout(ActionRequest request, ActionResponse response) throws PortletException
+     {
+-        RequestContext requestContext = (RequestContext)request.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
+-        
+-        ContentPage requestPage = requestContext.getPage();       
+-        PageEditAccess pageEditAccess = (PageEditAccess)requestContext.getAttribute(PortalReservedParameters.PAGE_EDIT_ACCESS_ATTRIBUTE);
+-        if ( requestPage == null || pageEditAccess == null )
++        RequestContext requestContext = (RequestContext) request.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
++        ContentPage requestPage = requestContext.getPage();
++        String layout = request.getParameter("layout");
++        if (layout != null && layout.length() > 0)
+         {
+-            // Targetting this portlet with an ActionRequest REQUIRES that the ProfilerValve has been invoked!
+-            throw new PortletException("Current request page or PageEditAccess not available.");
++            PortletWindow window = requestContext.getActionWindow();
++            ContentFragment targetFragment = requestPage.getContentFragmentById(window.getId().toString());
++
++            if (targetFragment == null)
++            {
++                // ignore no longer consistent page definition
++                return;
++            }
++
++            try
++            {
++                Fragment fragment = pageManager.newFragment();
++                fragment.setType(Fragment.LAYOUT);
++                fragment.setName(layout);
++
++                targetFragment.getFragments().add(fragment);
++                pageManager.updatePage(requestPage);
++            }
++            catch (Exception e)
++            {
++                throw new PortletException("failed to add portlet " + layout + " to page: " + requestPage + ": " + e.getMessage(),
++                        e);
++            }
+         }
+-        
+-        String pageMode = request.getParameter("pageMode");
+-        if ( pageMode != null )
++
++    }
++
++    protected void changeLayout(ActionRequest request, ActionResponse response) throws PortletException
++    {
++        RequestContext requestContext = (RequestContext) request.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
++        ContentPage requestPage = requestContext.getPage();
++        String layout = request.getParameter("layout");
++        if (layout != null && layout.length() > 0)
+         {
+-            if ( "view".equals(pageMode) )
++            PortletWindow window = requestContext.getActionWindow();
++            ContentFragment targetFragment = requestPage.getContentFragmentById(window.getId().toString());
++
++            if (targetFragment == null)
+             {
+-                pageEditAccess.setEditing(false);
++                // ignore no longer consistent page definition
++                return;
+             }
+-            else if ( "edit".equals(pageMode) && pageEditAccess.isEditAllowed() )
++
++            if (!layout.equals(targetFragment.getName()))
+             {
+-                if ( this.editorType != null && this.editorType.equals( "desktop" ) )
++                try
+                 {
+-                    String redirectUrl = this.desktop.getPortalUrl( requestContext, requestContext.getPath() );
+-                    redirectUrl += "?editPage=true&portal=true";
+-                    response.sendRedirect( redirectUrl );
++                    // layout portlet change
++                    targetFragment.setName(layout);
++                    pageManager.updatePage(requestPage);
++                    entityAccess.updatePortletEntity(window.getPortletEntity(), targetFragment);
++                    entityAccess.storePortletEntity(window.getPortletEntity());
++
++                    windowAccess.createPortletWindow(window.getPortletEntity(), targetFragment.getId());
++                    return;
+                 }
+-                else
++                catch (Exception e)
+                 {
+-                    pageEditAccess.setEditing(true);
++                    throw new PortletException("Unable to update page: " + e.getMessage(), e);
+                 }
+             }
+-            return;
+         }
+-        
+-        if ( pageEditAccess.isEditAllowed() && request.isPortletModeAllowed(PortletMode.EDIT) )
++
++    }
++
++    protected void addPage(ActionRequest request, ActionResponse response) throws PortletException
++    {
++        RequestContext requestContext = (RequestContext) request.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
++        ContentPage requestPage = requestContext.getPage();
++
++        String jsPageName = request.getParameter("jsNewPageName");
++        String jsPageTitle = request.getParameter("jsNewPageTitle");
++        String jsPageShortTitle = request.getParameter("jsNewPageShortTitle");
++        if (jsPageName != null && jsPageName.length() > 0 && jsPageName.indexOf(Folder.PATH_SEPARATOR) == -1)
+         {
+-            String layout = null;
+-            
+-            boolean addLayout = request.getParameter("jsAddLayout") != null;
+-            if ( addLayout || request.getParameter("jsChangeLayout") != null )
++            try
+             {
+-                layout = request.getParameter("layout");
+-                if ( layout != null && layout.length() > 0 )
++                Folder parent = (Folder) requestPage.getParent();
++                if (parent != null)
+                 {
+-                    PortletWindow window = requestContext.getActionWindow();
+-                    ContentFragment targetFragment = requestPage.getContentFragmentById(window.getId().toString());
+-                    
+-                    if ( targetFragment == null )
++                    String path = parent.getPath();
++                    if (path.endsWith(Folder.PATH_SEPARATOR))
+                     {
+-                        // ignore no longer consistent page definition
+-                        return;
++                        path = path + getEscapedName(jsPageName);
+                     }
+-                    
+-                    if ( addLayout )
++                    else
+                     {
+-                        try
+-                        {
+-                            Fragment fragment = pageManager.newFragment();
+-                            fragment.setType(Fragment.LAYOUT);
+-                            fragment.setName(layout);
+-                            
+-                            targetFragment.getFragments().add(fragment);
+-                            pageManager.updatePage(requestPage);            
+-                        }
+-                        catch (Exception e)
+-                        {
+-                            throw new PortletException("failed to add portlet " + layout + " to page: " + requestPage+": "+e.getMessage(), e);
+-                        }
++                        path = path + Folder.PATH_SEPARATOR + getEscapedName(jsPageName);
+                     }
+-                    else if ( !layout.equals(targetFragment.getName()) )
++                    Page page = pageManager.newPage(path);
++                    String layout = requestPage.getRootFragment().getName();
++                    page.getRootFragment().setName(layout);
++                    page.setDefaultDecorator(requestPage.getDefaultDecorator(Fragment.LAYOUT), Fragment.LAYOUT);
++                    page.setDefaultDecorator(requestPage.getDefaultDecorator(Fragment.PORTLET), Fragment.PORTLET);
++                    page.setTitle(jsPageTitle != null && !jsPageTitle.equals("") ? jsPageTitle : jsPageName);
++                    page.setShortTitle(jsPageShortTitle != null && !jsPageShortTitle.equals("") ? jsPageShortTitle : jsPageName);
++                    pageManager.updatePage(page);
++
++                    List orderList = parent.getDocumentOrder();
++                    if (orderList != null)
+                     {
+-                        try
++                        String name = page.getName();
++                        if (orderList.indexOf(name) < 0)
+                         {
+-                            // layout portlet change
+-                            targetFragment.setName(layout);
+-                            pageManager.updatePage(requestPage);
+-                            entityAccess.updatePortletEntity(window.getPortletEntity(), targetFragment);
+-                            entityAccess.storePortletEntity(window.getPortletEntity());
+-
+-                            windowAccess.createPortletWindow(window.getPortletEntity(), targetFragment.getId());
+-                            return;
++                            orderList.add(name);
++                            parent.setDocumentOrder(orderList);
++                            pageManager.updateFolder(parent);
+                         }
+-                        catch (Exception e)
+-                        {
+-                            throw new PortletException("Unable to update page: "+e.getMessage(), e);
+-                        }
+                     }
+                 }
+-                return;
+             }
++            catch (Exception e)
++            {
++                throw new PortletException("Unable to access page for editing: " + e.getMessage(), e);
++            }
++        }
+ 
+-            if ( request.getParameter("jsSubmitPage" ) != null )
++    }
++
++    protected void updatePage(ActionRequest request, ActionResponse response) throws PortletException
++    {
++        RequestContext requestContext = (RequestContext) request.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
++        ContentPage requestPage = requestContext.getPage();
++
++        String jsPageTitle = request.getParameter("jsPageTitle");
++        String jsPageShortTitle = request.getParameter("jsPageShortTitle");
++        try
++        {
++            if (jsPageTitle != null && !jsPageTitle.equals(""))
+             {
+-                String jsPageName = request.getParameter("jsPageName");
+-                String jsPageTitle = request.getParameter("jsPageTitle");
+-                String jsPageShortTitle = request.getParameter("jsPageShortTitle");
+-                if ( jsPageName != null && jsPageName.length() > 0 && jsPageName.indexOf(Folder.PATH_SEPARATOR) == -1 )
+-                {
+-                    try
+-                    {                
+-                        Folder parent = (Folder)requestPage.getParent();
+-                        if (parent != null)
+-                        {
+-                            String path = parent.getPath();
+-                            if (path.endsWith(Folder.PATH_SEPARATOR))
+-                            {
+-                                path = path + getEscapedName(jsPageName);
+-                            }
+-                            else
+-                            {
+-                                path = path + Folder.PATH_SEPARATOR
+-                                        + getEscapedName(jsPageName);
+-                            }
+-                            Page page = pageManager.newPage(path);
+-                            if ( layout == null || layout.length() == 0 )
+-                            {
+-                                layout = requestPage.getRootFragment().getName();
+-                            }
+-                            page.getRootFragment().setName(layout);
+-                            page.setDefaultDecorator(requestPage.getDefaultDecorator(Fragment.LAYOUT), Fragment.LAYOUT);
+-                            page.setDefaultDecorator(requestPage.getDefaultDecorator(Fragment.PORTLET), Fragment.PORTLET);
+-                            page.setTitle(jsPageTitle != null && !jsPageTitle.equals("") ? jsPageTitle : jsPageName);
+-                            page.setShortTitle(jsPageShortTitle != null
+-                                            && !jsPageShortTitle.equals("") ? jsPageShortTitle
+-                                            : jsPageName);
+-                            pageManager.updatePage(page);
+-
+-                            List orderList = parent.getDocumentOrder();
+-                            if (orderList != null)
+-                            {
+-                                String name = page.getName();
+-                                if (orderList.indexOf(name) < 0)
+-                                {
+-                                    orderList.add(name);
+-                                    parent.setDocumentOrder(orderList);
+-                                    pageManager.updateFolder(parent);
+-                                }
+-                            }
+-                        }
+-                    }
+-                    catch (Exception e)
+-                    {
+-                        throw new PortletException("Unable to access page for editing: "+e.getMessage(), e);
+-                    }                        
+-                }
+-                return;
++                requestPage.setTitle(jsPageTitle);
+             }
++            if (jsPageShortTitle != null && !jsPageShortTitle.equals(""))
++            {
++                requestPage.setShortTitle(jsPageShortTitle);
++            }
++            pageManager.updatePage(requestPage);
++        }
++        catch (Exception e)
++        {
++            throw new PortletException("Unable to access page for editing: " + e.getMessage(), e);
++        }
+ 
+-            if (request.getParameter("jsChangePageName") != null)
++    }
++
++    protected void deletePage(ActionRequest request, ActionResponse response) throws PortletException
++    {
++        RequestContext requestContext = (RequestContext) request.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
++        ContentPage requestPage = requestContext.getPage();
++
++        try
++        {
++            Folder parent = (Folder) requestPage.getParent();
++            if (parent != null)
+             {
+-                String jsPageTitle = request.getParameter("jsPageTitle");
+-                String jsPageShortTitle = request
+-                        .getParameter("jsPageShortTitle");
+-                try
++                List orderList = parent.getDocumentOrder();
++                if (orderList != null)
+                 {
+-                    if (jsPageTitle != null && !jsPageTitle.equals(""))
++                    String name = requestPage.getName();
++                    if (orderList.indexOf(name) > -1)
+                     {
+-                        requestPage.setTitle(jsPageTitle);
++                        orderList.remove(name);
++                        parent.setDocumentOrder(orderList);
++                        pageManager.updateFolder(parent);
+                     }
+-                    if (jsPageShortTitle != null
+-                            && !jsPageShortTitle.equals(""))
+-                    {
+-                        requestPage.setShortTitle(jsPageShortTitle);
+-                    }
+-                    pageManager.updatePage(requestPage);
+                 }
+-                catch (Exception e)
+-                {
+-                    throw new PortletException(
+-                            "Unable to access page for editing: "
+-                                    + e.getMessage(), e);
+-                }
+-                return;
+             }
+ 
+-            if ( request.getParameter("jsDeletePage" ) != null )
++            pageManager.removePage(requestPage);
++        }
++        catch (Exception e)
++        {
++            throw new PortletException("Unable to access page for removing: " + e.getMessage(), e);
++        }
++
++    }
++
++    protected void movePageToLeft(ActionRequest request, ActionResponse response) throws PortletException
++    {
++        RequestContext requestContext = (RequestContext) request.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
++        ContentPage requestPage = requestContext.getPage();
++
++        try
++        {
++            Folder parent = (Folder) requestPage.getParent();
++            if (parent != null)
+             {
+-                try
++                List orderList = parent.getDocumentOrder();
++                String name = requestPage.getName();
++                if (orderList != null)
+                 {
+-                    Folder parent = (Folder)requestPage.getParent();
+-                    if (parent != null)
++                    int index = orderList.indexOf(name);
++                    if (index > -1)
+                     {
+-                        List orderList = parent.getDocumentOrder();
+-                        if (orderList != null)
++                        String type = requestPage.getType();
++                        int i = index - 1;
++                        while (i >= 0)
+                         {
+-                            String name = requestPage.getName();
+-                            if (orderList.indexOf(name) > -1)
++                            String value = (String) orderList.get(i);
++                            if (value.endsWith(type))
+                             {
+-                                orderList.remove(name);
++                                orderList.remove(index);
++                                orderList.add(i, name);
+                                 parent.setDocumentOrder(orderList);
+                                 pageManager.updateFolder(parent);
++                                break;
+                             }
++                            i--;
+                         }
+                     }
+-
+-                    pageManager.removePage(requestPage);
++                    else
++                    {
++                        orderList.add(name);
++                        parent.setDocumentOrder(orderList);
++                        pageManager.updateFolder(parent);
++                    }
+                 }
+-                catch (Exception e)
++                else
+                 {
+-                    throw new PortletException("Unable to access page for removing: "+e.getMessage(), e);
++                    orderList = new ArrayList(4);
++                    orderList.add(name);
++                    parent.setDocumentOrder(orderList);
++                    pageManager.updateFolder(parent);
+                 }
+-                return;
+             }
++        }
++        catch (Exception e)
++        {
++            throw new PortletException("Unable to access page for changing the document order: " + e.getMessage(), e);
++        }
+ 
+-            if (request.getParameter("jsMovePageLeft") != null)
++    }
++
++    protected void movePageToRight(ActionRequest request, ActionResponse response) throws PortletException
++    {
++        RequestContext requestContext = (RequestContext) request.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
++        ContentPage requestPage = requestContext.getPage();
++
++        try
++        {
++            Folder parent = (Folder) requestPage.getParent();
++            if (parent != null)
+             {
+-                try
++                List orderList = parent.getDocumentOrder();
++                String name = requestPage.getName();
++                if (orderList != null)
+                 {
+-                    Folder parent = (Folder) requestPage.getParent();
+-                    if (parent != null)
++                    int index = orderList.indexOf(name);
++                    if (index > -1)
+                     {
+-                        List orderList = parent.getDocumentOrder();
+-                        String name = requestPage.getName();
+-                        if (orderList != null)
++                        String type = requestPage.getType();
++                        int i = index + 1;
++                        while (i < orderList.size())
+                         {
+-                            int index = orderList.indexOf(name);
+-                            if (index > -1)
++                            String value = (String) orderList.get(i);
++                            if (value.endsWith(type))
+                             {
+-                                String type = requestPage.getType();
+-                                int i = index - 1;
+-                                while (i >= 0)
+-                                {
+-                                    String value = (String) orderList.get(i);
+-                                    if (value.endsWith(type))
+-                                    {
+-                                        orderList.remove(index);
+-                                        orderList.add(i, name);
+-                                        parent.setDocumentOrder(orderList);
+-                                        pageManager.updateFolder(parent);
+-                                        break;
+-                                    }
+-                                    i--;
+-                                }
+-                            }
+-                            else
+-                            {
+-                                orderList.add(name);
++                                orderList.remove(index);
++                                orderList.add(i, name);
+                                 parent.setDocumentOrder(orderList);
+                                 pageManager.updateFolder(parent);
++                                break;
+                             }
++                            i++;
+                         }
+-                        else
+-                        {
+-                            orderList = new ArrayList(4);
+-                            orderList.add(name);
+-                            parent.setDocumentOrder(orderList);
+-                            pageManager.updateFolder(parent);
+-                        }
+                     }
++                    else
++                    {
++                        orderList.add(name);
++                        parent.setDocumentOrder(orderList);
++                        pageManager.updateFolder(parent);
++                    }
+                 }
+-                catch (Exception e)
++                else
+                 {
+-                    throw new PortletException(
+-                            "Unable to access page for changing the document order: "
+-                                    + e.getMessage(), e);
++                    orderList = new ArrayList(4);
++                    orderList.add(name);
++                    parent.setDocumentOrder(orderList);
++                    pageManager.updateFolder(parent);
+                 }
+-                return;
+             }
++        }
++        catch (Exception e)
++        {
++            throw new PortletException("Unable to access page for changing the document order: " + e.getMessage(), e);
++        }
+ 
+-            if (request.getParameter("jsMovePageRight") != null)
++    }
++
++    protected void addFolder(ActionRequest request, ActionResponse response) throws PortletException
++    {
++        RequestContext requestContext = (RequestContext) request.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
++        ContentPage requestPage = requestContext.getPage();
++
++        String jsFolderName = request.getParameter("jsNewFolderName");
++        String jsFolderTitle = request.getParameter("jsNewFolderTitle");
++        String jsFolderShortTitle = request.getParameter("jsNewFolderShortTitle");
++        if (jsFolderName != null && jsFolderName.length() > 0 && jsFolderName.indexOf(Folder.PATH_SEPARATOR) == -1)
++        {
++            try
+             {
+-                try
++                Folder parent = (Folder) requestPage.getParent();
++                if (parent != null)
+                 {
+-                    Folder parent = (Folder) requestPage.getParent();
+-                    if (parent != null)
++                    String path = parent.getPath();
++                    if (path.endsWith(Folder.PATH_SEPARATOR))
+                     {
+-                        List orderList = parent.getDocumentOrder();
+-                        String name = requestPage.getName();
+-                        if (orderList != null)
++                        path = path + getEscapedName(jsFolderName);
++                    }
++                    else
++                    {
++                        path = path + Folder.PATH_SEPARATOR + getEscapedName(jsFolderName);
++                    }
++                    Folder folder = pageManager.newFolder(path);
++                    String layout = requestPage.getRootFragment().getName();
++                    folder.setDefaultDecorator(requestPage.getDefaultDecorator(Fragment.LAYOUT), Fragment.LAYOUT);
++                    folder.setDefaultDecorator(requestPage.getDefaultDecorator(Fragment.PORTLET), Fragment.PORTLET);
++                    folder.setTitle(jsFolderTitle != null && !jsFolderTitle.equals("") ? jsFolderTitle : jsFolderName);
++                    folder.setShortTitle(jsFolderShortTitle != null && !jsFolderShortTitle.equals("") ? jsFolderShortTitle
++                            : jsFolderName);
++                    pageManager.updateFolder(folder);
++
++                    List orderList = parent.getDocumentOrder();
++                    if (orderList != null)
++                    {
++                        String name = folder.getName();
++                        if (orderList.indexOf(name) < 0)
+                         {
+-                            int index = orderList.indexOf(name);
+-                            if (index > -1)
+-                            {
+-                                String type = requestPage.getType();
+-                                int i = index + 1;
+-                                while (i < orderList.size())
+-                                {
+-                                    String value = (String) orderList.get(i);
+-                                    if (value.endsWith(type))
+-                                    {
+-                                        orderList.remove(index);
+-                                        orderList.add(i, name);
+-                                        parent.setDocumentOrder(orderList);
+-                                        pageManager.updateFolder(parent);
+-                                        break;
+-                                    }
+-                                    i++;
+-                                }
+-                            }
+-                            else
+-                            {
+-                                orderList.add(name);
+-                                parent.setDocumentOrder(orderList);
+-                                pageManager.updateFolder(parent);
+-                            }
+-                        }
+-                        else
+-                        {
+-                            orderList = new ArrayList(4);
+                             orderList.add(name);
+                             parent.setDocumentOrder(orderList);
+                             pageManager.updateFolder(parent);
+                         }
+                     }
+-                }
+-                catch (Exception e)
+-                {
+-                    throw new PortletException(
+-                            "Unable to access page for changing the document order: "
+-                                    + e.getMessage(), e);
+-                }
+-                return;
+-            }            
+ 
+-            if (request.getParameter("jsSubmitFolder") != null)
+-            {
+-                String jsFolderName = request.getParameter("jsFolderName");
+-                String jsFolderTitle = request.getParameter("jsFolderTitle");
+-                String jsFolderShortTitle = request.getParameter("jsFolderShortTitle");
+-                if (jsFolderName != null && jsFolderName.length() > 0
+-                        && jsFolderName.indexOf(Folder.PATH_SEPARATOR) == -1)
+-                {
+-                    try
++                    // add default page
++                    path = folder.getPath();
++                    if (path.endsWith(Folder.PATH_SEPARATOR))
+                     {
+-                        Folder parent = (Folder) requestPage.getParent();
+-                        if (parent != null)
++                        path = path + getEscapedName("default-page");
++                    }
++                    else
++                    {
++                        path = path + Folder.PATH_SEPARATOR + getEscapedName("default-page");
++                    }
++                    Page page = pageManager.newPage(path);
++                    if (layout == null || layout.length() == 0)
++                    {
++                        layout = requestPage.getRootFragment().getName();
++                    }
++                    page.getRootFragment().setName(layout);
++                    page.setDefaultDecorator(requestPage.getDefaultDecorator(Fragment.LAYOUT), Fragment.LAYOUT);
++                    page.setDefaultDecorator(requestPage.getDefaultDecorator(Fragment.PORTLET), Fragment.PORTLET);
++                    page.setTitle(jsFolderName);
++                    pageManager.updatePage(page);
++
++                    orderList = folder.getDocumentOrder();
++                    if (orderList != null)
++                    {
++                        String name = page.getName();
++                        if (orderList.indexOf(name) < 0)
+                         {
+-                            String path = parent.getPath();
+-                            if (path.endsWith(Folder.PATH_SEPARATOR))
+-                            {
+-                                path = path + getEscapedName(jsFolderName);
+-                            }
+-                            else
+-                            {
+-                                path = path + Folder.PATH_SEPARATOR
+-                                        + getEscapedName(jsFolderName);
+-                            }
+-                            Folder folder = pageManager.newFolder(path);
+-                            if (layout == null || layout.length() == 0)
+-                            {
+-                                layout = requestPage.getRootFragment()
+-                                        .getName();
+-                            }
+-                            folder.setDefaultDecorator(requestPage
+-                                    .getDefaultDecorator(Fragment.LAYOUT),
+-                                    Fragment.LAYOUT);
+-                            folder.setDefaultDecorator(requestPage
+-                                    .getDefaultDecorator(Fragment.PORTLET),
+-                                    Fragment.PORTLET);
+-                            folder
+-                                    .setTitle(jsFolderTitle != null
+-                                            && !jsFolderTitle.equals("") ? jsFolderTitle
+-                                            : jsFolderName);
+-                            folder
+-                                    .setShortTitle(jsFolderShortTitle != null
+-                                            && !jsFolderShortTitle.equals("") ? jsFolderShortTitle
+-                                            : jsFolderName);
++                            orderList.add(name);
++                            folder.setDocumentOrder(orderList);
+                             pageManager.updateFolder(folder);
+-
+-                            List orderList = parent.getDocumentOrder();
+-                            if (orderList != null)
+-                            {
+-                                String name = folder.getName();
+-                                if (orderList.indexOf(name) < 0)
+-                                {
+-                                    orderList.add(name);
+-                                    parent.setDocumentOrder(orderList);
+-                                    pageManager.updateFolder(parent);
+-                                }
+-                            }
+-
+-                            // add default page
+-                            path = folder.getPath();
+-                            if (path.endsWith(Folder.PATH_SEPARATOR))
+-                            {
+-                                path = path + getEscapedName("default-page");
+-                            }
+-                            else
+-                            {
+-                                path = path + Folder.PATH_SEPARATOR
+-                                        + getEscapedName("default-page");
+-                            }
+-                            Page page = pageManager.newPage(path);
+-                            if (layout == null || layout.length() == 0)
+-                            {
+-                                layout = requestPage.getRootFragment()
+-                                        .getName();
+-                            }
+-                            page.getRootFragment().setName(layout);
+-                            page.setDefaultDecorator(requestPage
+-                                    .getDefaultDecorator(Fragment.LAYOUT),
+-                                    Fragment.LAYOUT);
+-                            page.setDefaultDecorator(requestPage
+-                                    .getDefaultDecorator(Fragment.PORTLET),
+-                                    Fragment.PORTLET);
+-                            page.setTitle(jsFolderName);
+-                            pageManager.updatePage(page);
+-
+-                            orderList = folder.getDocumentOrder();
+-                            if (orderList != null)
+-                            {
+-                                String name = page.getName();
+-                                if (orderList.indexOf(name) < 0)
+-                                {
+-                                    orderList.add(name);
+-                                    folder.setDocumentOrder(orderList);
+-                                    pageManager.updateFolder(folder);
+-                                }
+-                            }
+                         }
+                     }
+-                    catch (Exception e)
+-                    {
+-                        throw new PortletException(
+-                                "Unable to access folder for editing: "
+-                                        + e.getMessage(), e);
+-                    }
+                 }
+-                return;
+             }
++            catch (Exception e)
++            {
++                throw new PortletException("Unable to access folder for editing: " + e.getMessage(), e);
++            }
++        }
+ 
+-            if (request.getParameter("jsChangeFolderName") != null)
++    }
++
++    protected void updateFolder(ActionRequest request, ActionResponse response) throws PortletException
++    {
++        RequestContext requestContext = (RequestContext) request.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
++        ContentPage requestPage = requestContext.getPage();
++
++        String jsFolderTitle = request.getParameter("jsFolderTitle");
++        String jsFolderShortTitle = request.getParameter("jsFolderShortTitle");
++        try
++        {
++            Folder parent = (Folder) requestPage.getParent();
++            if (parent != null)
+             {
+-                String jsFolderTitle = request.getParameter("jsFolderTitle");
+-                String jsFolderShortTitle = request
+-                        .getParameter("jsFolderShortTitle");
+-                try
++                if (jsFolderTitle != null && !jsFolderTitle.equals(""))
+                 {
+-                    Folder parent = (Folder) requestPage.getParent();
+-                    if (parent != null)
+-                    {
+-                        if (jsFolderTitle != null && !jsFolderTitle.equals(""))
+-                        {
+-                            parent.setTitle(jsFolderTitle);
+-                        }
+-                        if (jsFolderShortTitle != null
+-                                && !jsFolderShortTitle.equals(""))
+-                        {
+-                            parent.setShortTitle(jsFolderShortTitle);
+-                        }
+-                        pageManager.updateFolder(parent);
+-                    }
+-
++                    parent.setTitle(jsFolderTitle);
+                 }
+-                catch (Exception e)
++                if (jsFolderShortTitle != null && !jsFolderShortTitle.equals(""))
+                 {
+-                    throw new PortletException(
+-                            "Unable to access folder for editing: "
+-                                    + e.getMessage(), e);
++                    parent.setShortTitle(jsFolderShortTitle);
+                 }
+-                return;
++                pageManager.updateFolder(parent);
+             }
+-            
+-            if (request.getParameter("jsDeleteFolder") != null)
++
++        }
++        catch (Exception e)
++        {
++            throw new PortletException("Unable to access folder for editing: " + e.getMessage(), e);
++        }
++
++    }
++
++    protected void deleteFolder(ActionRequest request, ActionResponse response) throws PortletException
++    {
++        RequestContext requestContext = (RequestContext) request.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
++        ContentPage requestPage = requestContext.getPage();
++
++        try
++        {
++            Folder targetFolder = (Folder) requestPage.getParent();
++            Folder parent = (Folder) targetFolder.getParent();
++            if (parent != null)
+             {
+-                try
++                List orderList = parent.getDocumentOrder();
++                if (orderList != null)
+                 {
+-                    Folder targetFolder = (Folder) requestPage.getParent();
+-                    Folder parent = (Folder) targetFolder.getParent();
+-                    if (parent != null)
++                    String name = targetFolder.getName();
++                    if (orderList.indexOf(name) > -1)
+                     {
+-                        List orderList = parent.getDocumentOrder();
+-                        if (orderList != null)
+-                        {
+-                            String name = targetFolder.getName();
+-                            if (orderList.indexOf(name) > -1)
+-                            {
+-                                orderList.remove(name);
+-                                parent.setDocumentOrder(orderList);
+-                                pageManager.updateFolder(parent);
+-                            }
+-                        }
+-
+-                        // do not remove if the folder is root.
+-                        pageManager.removeFolder(targetFolder);
++                        orderList.remove(name);
++                        parent.setDocumentOrder(orderList);
++                        pageManager.updateFolder(parent);
+                     }
+                 }
+-                catch (Exception e)
+-                {
+-                    throw new PortletException(
+-                            "Unable to access folder for removing: "
+-                                    + e.getMessage(), e);
+-                }
+-                return;
++
++                // do not remove if the folder is root.
++                pageManager.removeFolder(targetFolder);
+             }
++        }
++        catch (Exception e)
++        {
++            throw new PortletException("Unable to access folder for removing: " + e.getMessage(), e);
++        }
+ 
+-            if (request.getParameter("jsMoveFolderLeft") != null)
++    }
++
++    protected void moveFolderToLeft(ActionRequest request, ActionResponse response) throws PortletException
++    {
++        RequestContext requestContext = (RequestContext) request.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
++        ContentPage requestPage = requestContext.getPage();
++
++        try
++        {
++            Folder targetFolder = (Folder) requestPage.getParent();
++            Folder parent = (Folder) targetFolder.getParent();
++            if (parent != null)
+             {
+-                try
++                List orderList = parent.getDocumentOrder();
++                String name = targetFolder.getName();
++                if (orderList != null)
+                 {
+-                    Folder targetFolder = (Folder) requestPage.getParent();
+-                    Folder parent = (Folder) targetFolder.getParent();
+-                    if (parent != null)
++                    int index = orderList.indexOf(name);
++                    if (index > -1)
+                     {
+-                        List orderList = parent.getDocumentOrder();
+-                        String name = targetFolder.getName();
+-                        if (orderList != null)
++                        int i = index - 1;
++                        while (i >= 0)
+                         {
+-                            int index = orderList.indexOf(name);
+-                            if (index > -1)
++                            String value = (String) orderList.get(i);
++                            if (!value.endsWith(".psml") && !value.endsWith(".link"))
+                             {
+-                                int i = index - 1;
+-                                while (i >= 0)
+-                                {
+-                                    String value = (String) orderList.get(i);
+-                                    if (!value.endsWith(".psml")
+-                                            && !value.endsWith(".link"))
+-                                    {
+-                                        orderList.remove(index);
+-                                        orderList.add(i, name);
+-                                        parent.setDocumentOrder(orderList);
+-                                        pageManager.updateFolder(parent);
+-                                        break;
+-                                    }
+-                                    i--;
+-                                }
+-                            }
+-                            else
+-                            {
+-                                orderList.add(name);
++                                orderList.remove(index);
++                                orderList.add(i, name);
+                                 parent.setDocumentOrder(orderList);
+                                 pageManager.updateFolder(parent);
++                                break;
+                             }
++                            i--;
+                         }
+-                        else
+-                        {
+-                            orderList = new ArrayList(4);
+-                            orderList.add(name);
+-                            parent.setDocumentOrder(orderList);
+-                            pageManager.updateFolder(parent);
+-                        }
+                     }
++                    else
++                    {
++                        orderList.add(name);
++                        parent.setDocumentOrder(orderList);
++                        pageManager.updateFolder(parent);
++                    }
+                 }
+-                catch (Exception e)
++                else
+                 {
+-                    throw new PortletException(
+-                            "Unable to access folder for changing the document order: "
+-                                    + e.getMessage(), e);
++                    orderList = new ArrayList(4);
++                    orderList.add(name);
++                    parent.setDocumentOrder(orderList);
++                    pageManager.updateFolder(parent);
+                 }
+-                return;
+             }
++        }
++        catch (Exception e)
++        {
++            throw new PortletException("Unable to access folder for changing the document order: " + e.getMessage(), e);
++        }
+ 
+-            if (request.getParameter("jsMoveFolderRight") != null)
++    }
++
++    protected void moveFolderToRight(ActionRequest request, ActionResponse response) throws PortletException
++    {
++        RequestContext requestContext = (RequestContext) request.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
++        ContentPage requestPage = requestContext.getPage();
++
++        try
++        {
++            Folder targetFolder = (Folder) requestPage.getParent();
++            Folder parent = (Folder) targetFolder.getParent();
++            if (parent != null)
+             {
+-                try
++                List orderList = parent.getDocumentOrder();
++                String name = targetFolder.getName();
++                if (orderList != null)
+                 {
+-                    Folder targetFolder = (Folder) requestPage.getParent();
+-                    Folder parent = (Folder) targetFolder.getParent();
+-                    if (parent != null)
++                    int index = orderList.indexOf(name);
++                    if (index > -1)
+                     {
+-                        List orderList = parent.getDocumentOrder();
+-                        String name = targetFolder.getName();
+-                        if (orderList != null)
++                        int i = index + 1;
++                        while (i < orderList.size())
+                         {
+-                            int index = orderList.indexOf(name);
+-                            if (index > -1)
++                            String value = (String) orderList.get(i);
++                            if (!value.endsWith(".psml") && !value.endsWith(".link"))
+                             {
+-                                int i = index + 1;
+-                                while (i < orderList.size())
+-                                {
+-                                    String value = (String) orderList.get(i);
+-                                    if (!value.endsWith(".psml")
+-                                            && !value.endsWith(".link"))
+-                                    {
+-                                        orderList.remove(index);
+-                                        orderList.add(i, name);
+-                                        parent.setDocumentOrder(orderList);
+-                                        pageManager.updateFolder(parent);
+-                                        break;
+-                                    }
+-                                    i++;
+-                                }
+-                            }
+-                            else
+-                            {
+-                                orderList.add(name);
++                                orderList.remove(index);
++                                orderList.add(i, name);
+                                 parent.setDocumentOrder(orderList);
+                                 pageManager.updateFolder(parent);
++                                break;
+                             }
++                            i++;
+                         }
+-                        else
+-                        {
+-                            orderList = new ArrayList(4);
+-                            orderList.add(name);
+-                            parent.setDocumentOrder(orderList);
+-                            pageManager.updateFolder(parent);
+-                        }
+                     }
++                    else
++                    {
++                        orderList.add(name);
++                        parent.setDocumentOrder(orderList);
++                        pageManager.updateFolder(parent);
++                    }
+                 }
+-                catch (Exception e)
++                else
+                 {
+-                    throw new PortletException(
+-                            "Unable to access folder for changing the document order: "
+-                                    + e.getMessage(), e);
++                    orderList = new ArrayList(4);
++                    orderList.add(name);
++                    parent.setDocumentOrder(orderList);
++                    pageManager.updateFolder(parent);
+                 }
++            }
++        }
++        catch (Exception e)
++        {
++            throw new PortletException("Unable to access folder for changing the document order: " + e.getMessage(), e);
++        }
++
++    }
++
++    protected void updateDefaultLayoutDecorator(ActionRequest request, ActionResponse response) throws PortletException
++    {
++        RequestContext requestContext = (RequestContext) request.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
++        ContentPage requestPage = requestContext.getPage();
++
++        String theme = request.getParameter("theme");
++
++        requestPage.setDefaultDecorator(theme, Fragment.LAYOUT);
++        try
++        {
++            pageManager.updatePage(requestPage);
++        }
++        catch (Exception e)
++        {
++            throw new PortletException("Unable to update page: " + e.getMessage(), e);
++        }
++    }
++
++    protected void moveFragment(ActionRequest request, ActionResponse response) throws PortletException
++    {
++        RequestContext requestContext = (RequestContext) request.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
++        ContentPage requestPage = requestContext.getPage();
++
++        String fragmentId = request.getParameter("fragment");
++        String move = request.getParameter("move");
++
++        int moveCode = Integer.parseInt(move);
++        PortletWindow window = requestContext.getActionWindow();
++        Fragment currentFragment = requestPage.getFragmentById(window.getId().toString());
++        Fragment fragmentToMove = requestPage.getFragmentById(fragmentId);
++
++        if (currentFragment == null || fragmentToMove == null)
++        {
++            // ignore no longer consistent page definition
++            return;
++        }
++
++        ColumnLayout columnLayout;
++        try
++        {
++            columnLayout = new ColumnLayout(numColumns, layoutType, currentFragment.getFragments(), null);
++            columnLayout.addLayoutEventListener(new PageManagerLayoutEventListener(pageManager, requestPage, layoutType));
++        }
++        catch (LayoutEventException e1)
++        {
++            throw new PortletException("Failed to build ColumnLayout " + e1.getMessage(), e1);
++        }
++
++        try
++        {
++            switch (moveCode)
++            {
++                case LayoutEvent.MOVED_UP:
++                    columnLayout.moveUp(fragmentToMove);
++                    break;
++                case LayoutEvent.MOVED_DOWN:
++                    columnLayout.moveDown(fragmentToMove);
++                    break;
++                case LayoutEvent.MOVED_RIGHT:
++                    columnLayout.moveRight(fragmentToMove);
++                    break;
++                case LayoutEvent.MOVED_LEFT:
++                    columnLayout.moveLeft(fragmentToMove);
++                    break;
++                default:
++                    throw new PortletException("Invalid movement code " + moveCode);
++            }
++
++        }
++        catch (SecurityException se)
++        {
++            // ignore page security constraint violations, only
++            // permitted users can edit managed pages; page
++            // update will remain transient
++            log.info("Unable to update page " + requestPage.getId() + " layout due to security permission/constraint.", se);
++        }
++        catch (Exception e)
++        {
++            if (e instanceof PortletException)
++            {
++                throw (PortletException) e;
++            }
++            else
++            {
++                throw new PortletException("Unable to process layout for page " + requestPage.getId() + " layout: " + e.toString(),
++                        e);
++            }
++        }
++
++    }
++
++    protected void removeFragment(ActionRequest request, ActionResponse response) throws PortletException
++    {
++        RequestContext requestContext = (RequestContext) request.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
++        ContentPage requestPage = requestContext.getPage();
++
++        String fragmentId = request.getParameter("fragment");
++
++        Page page = null;
++        try
++        {
++            // TODO: for now retrieve the real Page instead of ContentPage
++            //       because removing fragments isn't working through the ContentFragment wrapping
++            page = pageManager.getPage(requestPage.getPath());
++        }
++        catch (Exception e)
++        {
++            throw new PortletException("Unable to retrieve page " + requestPage.getId(), e);
++        }
++
++        PortletWindow window = requestContext.getActionWindow();
++        Fragment currentFragment = page.getFragmentById(window.getId().toString());
++
++        if (currentFragment == null)
++        {
++            // ignore no longer consistent page definition
++            return;
++        }
++
++        removeFragment(page, currentFragment, fragmentId);
++
++    }
++
++    protected void updateFragmentDecorator(ActionRequest request, ActionResponse response) throws PortletException
++    {
++        RequestContext requestContext = (RequestContext) request.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
++        ContentPage requestPage = requestContext.getPage();
++
++        String fragmentId = request.getParameter("fragment");
++        String decorator = request.getParameter("decorator");
++
++        Fragment fragment = requestPage.getFragmentById(fragmentId);
++
++        if (fragment == null)
++        {
++            // ignore no longer consistent page definition
++            return;
++        }
++
++        if (decorator.trim().length() == 0)
++            fragment.setDecorator(null);
++        else
++            fragment.setDecorator(decorator);
++        try
++        {
++            pageManager.updatePage(requestPage);
++        }
++        catch (Exception e)
++        {
++            throw new PortletException("Unable to update page for fragment decorator: " + e.getMessage(), e);
++        }
++
++    }
++
++    protected void updateFragmentDecorators(ActionRequest request, ActionResponse response) throws PortletException
++    {
++        RequestContext requestContext = (RequestContext) request.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
++        ContentPage requestPage = requestContext.getPage();
++
++        String decorators = request.getParameter("decorators");
++
++        Iterator fragmentsIter = requestPage.getRootFragment().getFragments().iterator();
++        while (fragmentsIter.hasNext())
++        {
++            Fragment fragment = (Fragment) fragmentsIter.next();
++            if (fragment == null)
++            {
++                // ignore no longer consistent page definition
+                 return;
+             }
+ 
+-            String theme = request.getParameter("theme");
+-            if ( theme != null && theme.length() > 0 && !theme.equals(requestPage.getDefaultDecorator(Fragment.LAYOUT)) )
++            if (decorators.trim().length() == 0)
++                fragment.setDecorator(null);
++            else
++                fragment.setDecorator(decorators);
++        }
++        try
++        {
++            pageManager.updatePage(requestPage);
++        }
++        catch (Exception e)
++        {
++            throw new PortletException("Unable to update page for fragment decorator: " + e.getMessage(), e);
++        }
++
++    }
++
++    protected void updatePreferenceWindowState(ActionRequest request, ActionResponse response)
++    {
++        String prefName = request.getParameter("preferenceName");
++        if (prefName != null)
++        {
++            response.setRenderParameter("preferenceName", prefName);
++        }
++        String prefState = request.getParameter("preferenceState");
++        if (prefState != null)
++        {
++            response.setRenderParameter("preferenceState", prefState);
++        }
++    }
++
++    public void processAction(ActionRequest request, ActionResponse response) throws PortletException, IOException
++    {
++        // pass preferenceName and preferenceState to render
++        updatePreferenceWindowState(request, response);
++
++        RequestContext requestContext = (RequestContext) request.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
++
++        ContentPage requestPage = requestContext.getPage();
++        PageEditAccess pageEditAccess = (PageEditAccess) requestContext
++                .getAttribute(PortalReservedParameters.PAGE_EDIT_ACCESS_ATTRIBUTE);
++        if (requestPage == null || pageEditAccess == null)
++        {
++            // Targetting this portlet with an ActionRequest REQUIRES that the ProfilerValve has been invoked!
++            throw new PortletException("Current request page or PageEditAccess not available.");
++        }
++
++        String pageMode = request.getParameter("pageMode");
++        if (pageMode != null)
++        {
++            if ("view".equals(pageMode))
+             {
+-                requestPage.setDefaultDecorator(theme, Fragment.LAYOUT);
+-                try
++                pageEditAccess.setEditing(false);
++            }
++            else if ("edit".equals(pageMode) && pageEditAccess.isEditAllowed())
++            {
++                if (this.editorType != null && this.editorType.equals("desktop"))
+                 {
+-                    pageManager.updatePage(requestPage);
++                    String redirectUrl = this.desktop.getPortalUrl(requestContext, requestContext.getPath());
++                    redirectUrl += "?editPage=true&portal=true";
++                    response.sendRedirect(redirectUrl);
+                 }
+-                catch (Exception e)
++                else
+                 {
+-                    throw new PortletException("Unable to update page: "+e.getMessage(), e);
++                    pageEditAccess.setEditing(true);
+                 }
++            }
++            return;
++        }
++
++        if (pageEditAccess.isEditAllowed() && request.isPortletModeAllowed(PortletMode.EDIT))
++        {
++
++            // Add Layout
++            if (request.getParameter("jsAddLayout") != null)
++            {
++                addLayout(request, response);
+                 return;
+             }
+-            
++
++            // Change Layout
++            if (request.getParameter("jsChangeLayout") != null)
++            {
++                changeLayout(request, response);
++                return;
++            }
++
++            // Add Page
++            if (request.getParameter("jsSubmitPage") != null)
++            {
++                addPage(request, response);
++                return;
++            }
++
++            // Update Page
++            if (request.getParameter("jsChangePageName") != null)
++            {
++                updatePage(request, response);
++                return;
++            }
++
++            // Delete Page
++            if (request.getParameter("jsDeletePage") != null)
++            {
++                deletePage(request, response);
++                return;
++            }
++
++            // Move Page To Left
++            if (request.getParameter("jsMovePageLeft") != null)
++            {
++                movePageToLeft(request, response);
++                return;
++            }
++
++            // Move Page To Right
++            if (request.getParameter("jsMovePageRight") != null)
++            {
++                movePageToRight(request, response);
++                return;
++            }
++
++            // Add Folder
++            if (request.getParameter("jsSubmitFolder") != null)
++            {
++                addFolder(request, response);
++                return;
++            }
++
++            // Update Folder
++            if (request.getParameter("jsChangeFolderName") != null)
++            {
++                updateFolder(request, response);
++                return;
++            }
++
++            // Delete Folder
++            if (request.getParameter("jsDeleteFolder") != null)
++            {
++                deleteFolder(request, response);
++                return;
++            }
++
++            // Move Folder To Left
++            if (request.getParameter("jsMoveFolderLeft") != null)
++            {
++                moveFolderToLeft(request, response);
++                return;
++            }
++
++            // Move Folder To Right
++            if (request.getParameter("jsMoveFolderRight") != null)
++            {
++                moveFolderToRight(request, response);
++                return;
++            }
++
++            // Update Default Layout Decorator
++            String theme = request.getParameter("theme");
++            if (theme != null && theme.length() > 0 && !theme.equals(requestPage.getDefaultDecorator(Fragment.LAYOUT)))
++            {
++                updateDefaultLayoutDecorator(request, response);
++                return;
++            }
++
+             String fragmentId = request.getParameter("fragment");
+-            if ( fragmentId != null && fragmentId.length() > 0 )
++            if (fragmentId != null && fragmentId.length() > 0)
+             {
+                 String move = request.getParameter("move");
+-                if ( move != null && move.length() > 0 )
++                if (move != null && move.length() > 0)
+                 {
+-                    int moveCode = Integer.parseInt(move);                    
+-                    PortletWindow window = requestContext.getActionWindow();
+-                    Fragment currentFragment = requestPage.getFragmentById(window.getId().toString());
+-                    Fragment fragmentToMove = requestPage.getFragmentById(fragmentId);
+-                    
+-                    if ( currentFragment == null || fragmentToMove == null )
+-                    {
+-                        // ignore no longer consistent page definition
+-                        return;
+-                    }
+-                    
+-                    ColumnLayout columnLayout;
+-                    try
+-                    {
+-                        columnLayout = new ColumnLayout(numColumns, layoutType, currentFragment.getFragments(), null);
+-                        columnLayout.addLayoutEventListener(new PageManagerLayoutEventListener(pageManager, requestPage, layoutType));
+-                    }
+-                    catch (LayoutEventException e1)
+-                    {
+-                        throw new PortletException("Failed to build ColumnLayout "+e1.getMessage(), e1);
+-                    }
+-
+-                    try
+-                    {                
+-                        switch (moveCode)
+-                        {
+-                        case LayoutEvent.MOVED_UP:
+-                            columnLayout.moveUp(fragmentToMove);
+-                            break;
+-                        case LayoutEvent.MOVED_DOWN:
+-                            columnLayout.moveDown(fragmentToMove);
+-                            break;
+-                        case LayoutEvent.MOVED_RIGHT:
+-                            columnLayout.moveRight(fragmentToMove);
+-                            break;
+-                        case LayoutEvent.MOVED_LEFT:
+-                            columnLayout.moveLeft(fragmentToMove);
+-                            break;
+-                        default:
+-                            throw new PortletException("Invalid movement code " + moveCode);
+-                        }
+-                       
+-                    }
+-                    catch (SecurityException se)
+-                    {
+-                        // ignore page security constraint violations, only
+-                        // permitted users can edit managed pages; page
+-                        // update will remain transient
+-                        log.info("Unable to update page " + requestPage.getId() + " layout due to security permission/constraint.", se);
+-                    }
+-                    catch (Exception e)
+-                    {
+-                        if (e instanceof PortletException)
+-                        {
+-                            throw (PortletException)e;
+-                        }
+-                        else
+-                        {
+-                            throw new PortletException("Unable to process layout for page " + requestPage.getId() + " layout: " + e.toString(), e);
+-                        }
+-                    }
++                    // Move Fragment
++                    moveFragment(request, response);
+                     return;
+                 }
+-                
++
+                 String remove = request.getParameter("remove");
+-                if ( remove != null && remove.length() > 0 )
++                if (remove != null && remove.length() > 0)
+                 {
+-                    Page page = null;
+-                    try
+-                    {
+-                        // TODO: for now retrieve the real Page instead of ContentPage
+-                        //       because removing fragments isn't working through the ContentFragment wrapping
+-                        page = pageManager.getPage(requestPage.getPath());
+-                    }
+-                    catch (Exception e)
+-                    {
+-                        throw new PortletException("Unable to retrieve page "+requestPage.getId(),e);
+-                    }
+-
+-                    PortletWindow window = requestContext.getActionWindow();
+-                    Fragment currentFragment = page.getFragmentById(window.getId().toString());
+-
+-                    if ( currentFragment == null )
+-                    {
+-                        // ignore no longer consistent page definition
+-                        return;
+-                    }
+-                    
+-                    removeFragment(page, currentFragment, fragmentId);
++                    // Remove Fragment
++                    removeFragment(request, response);
+                     return;
+                 }
+-                
++
+                 String decorator = request.getParameter("decorator");
+-                if ( decorator != null )
++                if (decorator != null)
+                 {
+-                    Fragment fragment = requestPage.getFragmentById(fragmentId);
+-
+-                    if ( fragment == null )
+-                    {
+-                        // ignore no longer consistent page definition
+-                        return;
+-                    }
+-                    
+-                    if (decorator.trim().length() == 0)
+-                        fragment.setDecorator(null);
+-                    else
+-                        fragment.setDecorator(decorator);
+-                    try
+-                    {
+-                        pageManager.updatePage(requestPage);
+-                    }
+-                    catch (Exception e)
+-                    {
+-                        throw new PortletException("Unable to update page for fragment decorator: "+e.getMessage(), e);
+-                    }
++                    // Update Fragment Decorator
++                    updateFragmentDecorator(request, response);
+                     return;
+                 }
+                 // evlach
+                 String decorators = request.getParameter("decorators");
+-                if ( decorators != null )
++                if (decorators != null)
+                 {
+-                    Iterator fragmentsIter = requestPage.getRootFragment().getFragments().iterator();
+-                    while(fragmentsIter.hasNext())
+-                    {
+-                    	Fragment fragment = (Fragment) fragmentsIter.next();
+-                    	if ( fragment == null )
+-                        {
+-                            // ignore no longer consistent page definition
+-                            return;
+-                        }
+-                        
+-                        if (decorators.trim().length() == 0)
+-                            fragment.setDecorator(null);
+-                        else
+-                            fragment.setDecorator(decorators);
+-                    }
+-                    try
+-                    {
+-                        pageManager.updatePage(requestPage);
+-                    }
+-                    catch (Exception e)
+-                    {
+-                        throw new PortletException("Unable to update page for fragment decorator: "+e.getMessage(), e);
+-                    }
++                    updateFragmentDecorators(request, response);
+                     return;
+-                }                
++                }
+                 //end evlach
+             }
+-            
++
+             String portlets = request.getParameter("portlets");
+-            if ( portlets != null && portlets.length() > 0 )
++            if (portlets != null && portlets.length() > 0)
+             {
+                 PortletWindow window = requestContext.getActionWindow();
+                 Fragment targetFragment = requestPage.getFragmentById(window.getId().toString());
+ 
+-                if ( targetFragment == null )
++                if (targetFragment == null)
+                 {
+                     // ignore no longer consistent page definition
+                     return;
+                 }
+-                
+-                StringTokenizer tokenizer = new StringTokenizer(portlets, ",");            
++
++                StringTokenizer tokenizer = new StringTokenizer(portlets, ",");
+                 while (tokenizer.hasMoreTokens())
+                 {
+                     String portlet = tokenizer.nextToken();
+                     if (portlet.startsWith("box_"))
+                     {
+-                        portlet = portlet.substring("box_".length());                        
++                        portlet = portlet.substring("box_".length());
+                         addPortletToPage(requestPage, targetFragment, portlet);
+                     }
+                 }
+@@ -971,11 +1170,11 @@
+             }
+         }
+     }
+-        
++
+     protected int getFragmentNestingLevel(Page page, String fragmentId)
+     {
+         Fragment root = page.getRootFragment();
+-        if ( root.getId().equals(fragmentId) )
++        if (root.getId().equals(fragmentId))
+         {
+             return 0;
+         }
+@@ -984,23 +1183,23 @@
+             return getFragmentNestingLevel(root, 1, fragmentId);
+         }
+     }
+-    
++
+     protected int getFragmentNestingLevel(Fragment parent, int level, String fragmentId)
+     {
+         Iterator iter = parent.getFragments().iterator();
+         Fragment child;
+         int childLevel;
+-        while ( iter.hasNext() )
++        while (iter.hasNext())
+         {
+-            child = (Fragment)iter.next();
++            child = (Fragment) iter.next();
+             if (child.getId().equals(fragmentId))
+             {
+                 return level;
+             }
+             else
+             {
+-                childLevel = getFragmentNestingLevel(child, level+1, fragmentId);
+-                if ( childLevel != -1 )
++                childLevel = getFragmentNestingLevel(child, level + 1, fragmentId);
++                if (childLevel != -1)
+                 {
+                     return childLevel;
+                 }


Property changes on: pal-portal/trunk/portal/patches/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/MultiColumnPortlet.java
___________________________________________________________________
Name: svn:eol-style
   + native

Added: pal-portal/trunk/portal/patches/src/webapp/WEB-INF/jetspeed_macros.vm
===================================================================
--- pal-portal/trunk/portal/patches/src/webapp/WEB-INF/jetspeed_macros.vm	2007-05-22 08:12:11 UTC (rev 155)
+++ pal-portal/trunk/portal/patches/src/webapp/WEB-INF/jetspeed_macros.vm	2007-05-25 03:26:45 UTC (rev 156)
@@ -0,0 +1,29 @@
+Index: src/webapp/WEB-INF/jetspeed_macros.vm
+===================================================================
+--- src/webapp/WEB-INF/jetspeed_macros.vm	(リビジョン 539124)
++++ src/webapp/WEB-INF/jetspeed_macros.vm	(作業コピー)
+@@ -134,13 +134,18 @@
+   Dispalys the standard action bar for this page.
+ *#
+ #macro (PageActionBar)
+- #set($_actions = $layoutDecoration.actions)
+-  <div id="portal-page-actions" >        
+-    #if($_actions.size() >0)
+-    #foreach ($_action in $_actions)   
+-     <a href="${_action.Action}" title="${_action.Name}" class="action pageAction" ><img src="$request.contextPath/${_action.Link}" alt="${_action.Alt}" border="0" /></a>
++  #set($_actions = $layoutDecoration.actions)
++  <div id="portal-page-actions" >
++  #if($_actions.size() >0)
++    <a id="${namespace}PreferenceWindowLink" href="javascript:${namespace}ShowPreferenceWindow();" class="action pageAction" style="display:none;"><img src="$request.contextPath/decorations/images/edit.gif" alt="Preference" border="0">Show Preference</a>
++    #if($allowAddPortlet)
++#set ($chooser = "${jetspeed.basePath}/system/customizer/selector.psml?jspage=${profiledPage}&jslayoutid=$myFragment.id")
++    <a href="$response.encodeURL($chooser)" class="action pageAction"><img src="#GetPageResource('images/select.gif')" border="0" title="$messages.getString("portal.page.editing.addportlet")"/>$messages.getString("portal.page.editing.addportlet")</a>
++      #end
++    #foreach ($_action in $_actions)
++     <a href="${_action.Action}" title="${_action.Name}" class="action pageAction" ><img src="$request.contextPath/${_action.Link}" alt="${_action.Alt}" border="0" />${_action.Name}</a>
+     #end   
+-    #end
++  #end
+  </div>
+ #end
+ 

Modified: pal-portal/trunk/portal/patches/src/webapp/WEB-INF/templates/layout/html/columns/layout.vm
===================================================================
--- pal-portal/trunk/portal/patches/src/webapp/WEB-INF/templates/layout/html/columns/layout.vm	2007-05-22 08:12:11 UTC (rev 155)
+++ pal-portal/trunk/portal/patches/src/webapp/WEB-INF/templates/layout/html/columns/layout.vm	2007-05-25 03:26:45 UTC (rev 156)
@@ -1,30 +1,559 @@
 Index: src/webapp/WEB-INF/templates/layout/html/columns/layout.vm
 ===================================================================
---- src/webapp/WEB-INF/templates/layout/html/columns/layout.vm	(リビジョン 453273)
+--- src/webapp/WEB-INF/templates/layout/html/columns/layout.vm	(リビジョン 539124)
 +++ src/webapp/WEB-INF/templates/layout/html/columns/layout.vm	(作業コピー)
-@@ -1,4 +1,3 @@
--<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- #*
- Copyright 2004 The Apache Software Foundation
+@@ -23,6 +23,8 @@
+ #set($actions = $myFragment.decoration.actions)
+ #set($messages = $portletConfig.getResourceBundle($renderRequest.Locale))
+ #set($rootDecorator = $myPage.getRootFragment().decoration)
++#set($namespace="${renderResponse.namespace}")
++#getBoolProperty($allowAddPortlet $rootDecorator "allow.add.portlet" true)
  
-@@ -87,6 +86,7 @@
-               <option value='$td' #if($rootDecorator.Name == $td) SELECTED #end>$td
+ #if($myFragment.getDecorator())
+   #set($decorator = $myFragment.getDecorator())
+@@ -37,6 +39,13 @@
+   #set($lastColumn = $renderRequest.getAttribute("numberOfColumns") - 1)  
+ #end    
+    
++#set($layoutType =$portletConfig.getInitParameter("layoutType"))
++#set($columnLayout = $renderRequest.getAttribute("columnLayout"))
++#set($decorationFactory = $renderRequest.getAttribute("decorationFactory"))
++#set($rc = $renderRequest.getAttribute("org.apache.jetspeed.request.RequestContext"))
++#set($psrc = $rc.getAttribute("org.apache.jetspeed.portalsite.PortalSiteRequestContext"))
++#set($profiledPage = $psrc.Page.Path)
++
+ <!-- Decorator  $decorator  ${decoTop} - ${decoBottom}-->
+ #if ($isRoot)
+   #parse($myFragment.decoration.header)
+@@ -46,17 +55,9 @@
+    #set($layoutClass = "portal-layout")
+ #end
+ 
+-#set($layoutType =$portletConfig.getInitParameter("layoutType"))
+-#set($columnLayout = $renderRequest.getAttribute("columnLayout"))
+-#set($decorationFactory = $renderRequest.getAttribute("decorationFactory"))
+-#set($rc = $renderRequest.getAttribute("org.apache.jetspeed.request.RequestContext"))
+-#set($psrc = $rc.getAttribute("org.apache.jetspeed.portalsite.PortalSiteRequestContext"))
+-#set($profiledPage = $psrc.Page.Path)
+-
+ <div id="$renderResponse.namespace" class="${layoutClass} ${layoutClass}-${layoutType}">
+ 
+ #if($editing)
+-  <div class="layout-edit-bar">
+     #if($isRoot)
+       #getBoolProperty($allowChangePageTheme $rootDecorator "allow.change.page.theme" true)
+       #getBoolProperty($allowAddPage $rootDecorator "allow.add.page" true)
+@@ -89,68 +90,321 @@
+     #end
+      
+     #getBoolProperty($allowChangeLayout $rootDecorator "allow.change.layout" true)
+-    #getBoolProperty($allowAddPortlet $rootDecorator "allow.add.portlet" true)
+-    <fieldset>    
+-    <div class="layout-edit-bar-left">
+-        <div class="layout-title"><b>$messages.getString("portal.page.customizer.name")</b></div>
+-    </div>
+-    <div class="layout-edit-bar-right">
+-      #if($allowAddPortlet)
+-        <label>$messages.getString("portal.page.editing.portlet")</label>
+-          #set ($chooser = "${jetspeed.basePath}/system/customizer/selector.psml?jspage=${profiledPage}&jslayoutid=$myFragment.id")  
+-          <a href="$response.encodeURL($chooser)">
+-          <img src="#GetPageResource('images/select.gif')" border="0" title="$messages.getString("portal.page.editing.addportlet")"/>
+-        </a>
+-      #end
+-    </div>
+-    </fieldset>
++
+       #set($form="f${renderResponse.namespace}")
+       #set($formAction = "$renderResponse.createActionURL()")
+       #set($submit = ".submit()")
+ 
+-    <form name="$form" action="$formAction" method='post'>
+-    <fieldset>
+-    <div class="layout-edit-bar-left">
+-        #if($allowAddLayout||$allowChangeLayout)
+-      <div class="layout-title"><b>$messages.getString("portal.page.editing.layoutConfiguration")</b></div>
+-      <div class="layout-content">
+-        #end
+-        #if ($allowChangePageTheme)
+-        <div>
+-          <label for="theme">$messages.getString("portal.page.editing.theme")</label>
+-          <select id='theme' name='theme' onChange="$form$submit">
+-            #foreach($td in $decorationFactory.getPageDecorations($rc))
+-            <option value='$td' #if($rootDecorator.Name == $td) SELECTED #end>$td
++
++#* Preferences *#
++  <div id="${namespace}PreferenceWindow" 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:650px;height:450px;position:absolute;top:30px;left:30px;background-color:#efefde;">
++    <div style="z-index:10010;position:absolute;top:5px;left:10px;width:150px;height:380px;">
++      <span style="font-family:sans-serif;font-size:11pt;">Preferences</span>
++    </div>
++    <div style="z-index:10010;border:1px solid #999999;position:absolute;top:30px;left:10px;width:150px;height:380px;background-color:#ffffff;">
++<script language="JavaScript"><!--
++function ${namespace}UpdatePreference(id) {
++  if(id=="${namespace}PageProperties"){
++    document.getElementById("${namespace}PageProperties").style.display="block";
++    document.getElementById("${namespace}PreferenceName").value=id;
++    document.getElementById("${namespace}PreferenceTitle").innerHTML="Page Properties";
++  }else{
++    document.getElementById("${namespace}PageProperties").style.display="none";
++  }
++  if(id=="${namespace}AddPage"){
++    document.getElementById("${namespace}AddPage").style.display="block";
++    document.getElementById("${namespace}PreferenceName").value=id;
++    document.getElementById("${namespace}PreferenceTitle").innerHTML="Add Page";
++  }else{
++    document.getElementById("${namespace}AddPage").style.display="none";
++  }
++  if(id=="${namespace}FolderProperties"){
++    document.getElementById("${namespace}FolderProperties").style.display="block";
++    document.getElementById("${namespace}PreferenceName").value=id;
++    document.getElementById("${namespace}PreferenceTitle").innerHTML="Folder Properties";
++  }else{
++    document.getElementById("${namespace}FolderProperties").style.display="none";
++  }
++  if(id=="${namespace}AddFolder"){
++    document.getElementById("${namespace}AddFolder").style.display="block";
++    document.getElementById("${namespace}PreferenceName").value=id;
++    document.getElementById("${namespace}PreferenceTitle").innerHTML="Add Folder";
++  }else{
++    document.getElementById("${namespace}AddFolder").style.display="none";
++  }
++  if(id=="${namespace}ChangeLayout"){
++    document.getElementById("${namespace}ChangeLayout").style.display="block";
++    document.getElementById("${namespace}PreferenceName").value=id;
++    document.getElementById("${namespace}PreferenceTitle").innerHTML="Change Layout";
++  }else{
++    document.getElementById("${namespace}ChangeLayout").style.display="none";
++  }
++  if(id=="${namespace}AddLayout"){
++    document.getElementById("${namespace}AddLayout").style.display="block";
++    document.getElementById("${namespace}PreferenceName").value=id;
++    document.getElementById("${namespace}PreferenceTitle").innerHTML="Add Layout";
++  }else{
++    document.getElementById("${namespace}AddLayout").style.display="none";
++  }
++  if(id=="${namespace}ChangeTheme"){
++    document.getElementById("${namespace}ChangeTheme").style.display="block";
++    document.getElementById("${namespace}PreferenceName").value=id;
++    document.getElementById("${namespace}PreferenceTitle").innerHTML="Change Theme";
++  }else{
++    document.getElementById("${namespace}ChangeTheme").style.display="none";
++  }
++}
++function ${namespace}HidePreferenceWindow(){
++    document.getElementById("${namespace}PreferenceWindow").style.display="none";
++    document.getElementById("${namespace}PreferenceState").value="hide";
++    document.getElementById("${namespace}PreferenceWindowLink").style.display="inline";
++}
++function ${namespace}ShowPreferenceWindow(){
++    document.getElementById("${namespace}PreferenceWindow").style.display="block";
++    document.getElementById("${namespace}PreferenceState").value="show";
++    document.getElementById("${namespace}PreferenceWindowLink").style.display="none";
++}
++// --></script>
++#* Menu *#
++      <div style="z-index:10020;width:150px;height:25px;vertical-align:middle;">
++        <a href="javascript:${namespace}UpdatePreference('${namespace}PageProperties');" style="margin-left:3px;text-decoration:none;"><span style="font-family:sans-serif;font-size:11pt;">Page Properties</span></a>
++      </div>
++      <div style="z-index:10020;width:150px;height:25px;vertical-align:middle;">
++        <a href="javascript:${namespace}UpdatePreference('${namespace}AddPage');" style="margin-left:3px;text-decoration:none;"><span style="font-family:sans-serif;font-size:11pt;">Add Page</span></a>
++      </div>
++      <div style="z-index:10020;width:150px;height:25px;vertical-align:middle;">
++        <a href="javascript:${namespace}UpdatePreference('${namespace}FolderProperties');" style="margin-left:3px;text-decoration:none;"><span style="font-family:sans-serif;font-size:11pt;">Folder Properties</span></a>
++      </div>
++      <div style="z-index:10020;width:150px;height:25px;vertical-align:middle;">
++        <a href="javascript:${namespace}UpdatePreference('${namespace}AddFolder');" style="margin-left:3px;text-decoration:none;"><span style="font-family:sans-serif;font-size:11pt;">Add Folder</span></a>
++      </div>
++      <div style="z-index:10020;width:150px;height:25px;vertical-align:middle;">
++        <a href="javascript:${namespace}UpdatePreference('${namespace}ChangeLayout');" style="margin-left:3px;text-decoration:none;"><span style="font-family:sans-serif;font-size:11pt;">Change Layout</span></a>
++      </div>
++      <div style="z-index:10020;width:150px;height:25px;vertical-align:middle;">
++        <a href="javascript:${namespace}UpdatePreference('${namespace}AddLayout');" style="margin-left:3px;text-decoration:none;"><span style="font-family:sans-serif;font-size:11pt;">Add Layout</span></a>
++      </div>
++      <div style="z-index:10020;width:150px;height:25px;vertical-align:middle;">
++        <a href="javascript:${namespace}UpdatePreference('${namespace}ChangeTheme');" style="margin-left:3px;text-decoration:none;"><span style="font-family:sans-serif;font-size:11pt;">Change Theme</span></a>
++      </div>
++    </div>
++    <div style="z-index:10010;border:1px solid #999999;position:absolute;top:30px;left:170px;width:470px;height:380px;background-color:#ffffff;">
++      <div style="z-index:10020;width:450px;height:20px;vertical-align:middle;border-bottom:1px solid #999999;margin:5px;padding-left:5px;">
++        <span id="${namespace}PreferenceTitle" style="font-family:sans-serif;font-size:11pt;">Title</span>
++      </div>
++
++      <form name="$form" action="$formAction" method='post'>
++        <input id="${namespace}PreferenceName" type="hidden" name="preferenceName" value="${preferenceName}"/>
++        <input id="${namespace}PreferenceState" type="hidden" name="preferenceState" value="${preferenceState}"/>
++
++#* Page Properties *#
++#if($allowChangePageName||$allowNavigatePage||$allowDeletePage)
++      <div id="${namespace}PageProperties" style="z-index:10020;width:450px;margin:5px;padding-left:5px;">
++#if($allowChangePageName)
++        <fieldset>
++          <legend>$messages.getString("portal.page.editing.pageConfiguration")</legend>
++          <div class="page-content">
++            <div>
++              <label for="pagename">$messages.getString("portal.page.editing.page")</label>
++              <input id='pagename' name='jsPageName'/>
++            </div>
++            <div>
++              <label for="pagetitle">$messages.getString("portal.page.editing.page.title")</label>
++              <input id='pagetitle' name='jsPageTitle'/>
++            </div>
++            <div>
++              <label for="pageshorttitle">$messages.getString("portal.page.editing.page.shorttitle")</label>
++              <input id='pageshorttitle' name='jsPageShortTitle'/>
++            </div>
++<!-- TODO:Locale -->
++            <div>
++              <input type="submit" name="jsChangePageName" value="$messages.getString("portal.page.editing.changepagename")"/>
++            </div>
++          </div>
++        </fieldset>
++#end
++<br/>
++#if($allowNavigatePage)
++        <fieldset>
++          <legend>Page Navigation</legend>
++          <div>
++            <label>$messages.getString("portal.page.editing.pagenavigation")</label>
++            <input id="move-page-left" type="submit" name="jsMovePageLeft" value="$messages.getString("portal.page.editing.movePageLeft")" />
++            <input id="move-page-right" type="submit" name="jsMovePageRight" value="$messages.getString("portal.page.editing.movePageRight")" />
++          </div>
++        </fieldset>
++#end
++<br/>
++#if($allowDeletePage)
++        <fieldset>
++          <legend>Delete Page</legend>
++          <div>
++            <label for="deletepage">$messages.getString("portal.page.editing.deleteThisPage")</label>
++            <input id="deletepage" type="submit" name="jsDeletePage" value="$messages.getString("portal.page.editing.deletePage")" onclick="if(window.confirm('$messages.getString("portal.page.editing.confirmDeleteThisPage")')){return true;}return false;"/>
++          </div>
++        </fieldset>
++#end
++      </div>
++#end
++
++#* Add Page *#
++#if($allowAddPage)
++      <div id="${namespace}AddPage" style="z-index:10020;width:450px;margin:5px;padding-left:5px;">
++        <fieldset>
++          <legend>$messages.getString("portal.page.editing.pageConfiguration")</legend>
++          <div class="page-content">
++            <div>
++              <label for="pagename">$messages.getString("portal.page.editing.page")</label>
++              <input id='pagename' name='jsNewPageName'/>
++            </div>
++            <div>
++              <label for="pagetitle">$messages.getString("portal.page.editing.page.title")</label>
++              <input id='pagetitle' name='jsNewPageTitle'/>
++            </div>
++            <div>
++              <label for="pageshorttitle">$messages.getString("portal.page.editing.page.shorttitle")</label>
++              <input id='pageshorttitle' name='jsNewPageShortTitle'/>
++            </div>
++            <div>
++              <input type="submit" name="jsSubmitPage" value="$messages.getString("portal.page.editing.addpage")"/>
++            </div>
++          </div>
++        </fieldset>
++      </div>
++#end
++
++#* Folder Properties *#
++#if($allowChangeFolderName||$allowNavigateFolder||$allowDeleteFolder)
++      <div id="${namespace}FolderProperties" style="z-index:10020;width:450px;margin:5px;padding-left:5px;">
++#if($allowChangeFolderName)
++        <fieldset>
++          <legend>$messages.getString("portal.folder.editing.folderConfiguration")</legend>
++          <div class="folder-content">
++            <div>
++              <label for="foldername">$messages.getString("portal.folder.editing.folder")</label>
++              <input id='foldername' name='jsFolderName'/>
++            </div>
++            <div>
++              <label for="foldertitle">$messages.getString("portal.folder.editing.folder.title")</label>
++              <input id='foldertitle' name='jsFolderTitle'/>
++            </div>
++            <div>
++              <label for="foldershorttitle">$messages.getString("portal.folder.editing.folder.shorttitle")</label>
++              <input id='foldershorttitle' name='jsFolderShortTitle'/>
++            </div>
++            <div>
++              <input type="submit" name="jsChangeFolderName" value="$messages.getString("portal.folder.editing.changefoldername")"/>
++            </div>
++          </div>
++        </fieldset>
++#end
++<br/>
++#if($allowNavigateFolder)
++        <fieldset>
++          <legend>Folder Navigation</legend>
++          <div>
++            <label>$messages.getString("portal.folder.editing.foldernavigation")</label>
++            <input id="move-folder-left" type="submit" name="jsMoveFolderLeft" value="$messages.getString("portal.folder.editing.moveFolderLeft")" />
++            <input id="move-folder-right" type="submit" name="jsMoveFolderRight" value="$messages.getString("portal.folder.editing.moveFolderRight")" />
++          </div>
++        </fieldset>
++#end
++<br/>
++#if($allowDeleteFolder)
++        <fieldset>
++          <legend>Delete Folder</legend>
++          <div>
++            <label for="deletefolder">$messages.getString("portal.folder.editing.deleteThisFolder")</label>
++            <input id="deletefolder" type="submit" name="jsDeleteFolder" value="$messages.getString("portal.folder.editing.deleteFolder")" onclick="if(window.confirm('$messages.getString("portal.folder.editing.confirmDeleteThisFolder")')){return true;}return false;"/>
++          </div>
++        </fieldset>
++#end
++      </div>
++#end
++
++#* Add Folder *#
++#if($allowAddFolder)
++      <div id="${namespace}AddFolder" style="z-index:10020;width:450px;margin:5px;padding-left:5px;">
++        <fieldset>
++          <legend>$messages.getString("portal.folder.editing.folderConfiguration")</legend>
++          <div class="folder-content">
++            <div>
++              <label for="foldername">$messages.getString("portal.folder.editing.folder")</label>
++              <input id='foldername' name='jsNewFolderName'/>
++            </div>
++            <div>
++              <label for="foldertitle">$messages.getString("portal.folder.editing.folder.title")</label>
++              <input id='foldertitle' name='jsNewFolderTitle'/>
++            </div>
++            <div>
++              <label for="foldershorttitle">$messages.getString("portal.folder.editing.folder.shorttitle")</label>
++              <input id='foldershorttitle' name='jsNewFolderShortTitle'/>
++            </div>
++            <div>
++              <input type="submit" name="jsSubmitFolder" value="$messages.getString("portal.folder.editing.addfolder")"/>
++            </div>
++          </div>
++        </fieldset>
++      </div>
++#end
++
++#* Change Layout *#
++#if($allowChangeLayout)
++      <div id="${namespace}ChangeLayout" style="z-index:10020;width:450px;margin:5px;padding-left:5px;">
++        <fieldset>
++          <legend>$messages.getString("portal.page.editing.layout")</legend>
++          <select id='layout' name='layout'>
++            #foreach($ld in $decorationFactory.getLayouts($rc))     
++            <option value='$ld.Name' #if($myFragment.Name == $ld.Name) SELECTED #end>$ld.DisplayName
              #end
-           </select>   
-+          <br/>   
-         #end
-         #if($allowAddLayout||$allowChangeLayout)
-           <label>$messages.getString("portal.page.editing.layout")</label>
-@@ -102,10 +102,12 @@
-         #if($allowAddLayout)
+-          </select>   
+-        </div>
+-        #end
+-        #if($allowAddLayout||$allowChangeLayout)
+-        <div>
+-          <label for="layout">$messages.getString("portal.page.editing.layout")</label>
++          </select>
++          <input type="submit" name="jsChangeLayout" value="$messages.getString("portal.page.editing.changelayout")" />
++        </fieldset>
++<br/>
++        <fieldset>
++          <legend>Portlet Layout</legend>
++          <input type="button" onclick="${namespace}HidePreferenceWindow();" value="Change Portlet Layout" />
++        </fieldset>
++      </div>
++#end    
++
++#* Add Layout *#
++#if($allowAddLayout)
++      <div id="${namespace}AddLayout" style="z-index:10020;width:450px;margin:5px;padding-left:5px;">
++        <fieldset>
++          <legend>$messages.getString("portal.page.editing.layout")</legend>
+           <select id='layout' name='layout'>
+             #foreach($ld in $decorationFactory.getLayouts($rc))     
+             <option value='$ld.Name' #if($myFragment.Name == $ld.Name) SELECTED #end>$ld.DisplayName
+             #end
+           </select>
+-        #end
+-        #if ($allowChangeLayout)
+-          <input type="submit" name="jsChangeLayout" value="$messages.getString("portal.page.editing.changelayout")" />
+-        #end        
+-        #if($allowAddLayout)
            <input type="submit" name="jsAddLayout" value="$messages.getString("portal.page.editing.addlayout")" />
-         #end    
-+          <br/>   
-         #if($allowAddPage)
-           <label>$messages.getString("portal.page.editing.page")</label>
-           <input id='newpage' name='jsPageName'/>
-           <input type="submit" name="jsSubmitPage" value="$messages.getString("portal.page.editing.addpage")"/>
-+          <br/>   
-         #end
-       </form>
-     </div>    
+-        #end    
+-        #if($allowAddLayout||$allowChangeLayout)
+-        </div>
+-        #end    
+-        #getBoolProperty($allowChangePortletDecorator $rootDecorator "allow.change.portlet.decorator" true)
+-         ####### Take all fragments and apply style	  
+-        #if($allowChangePortletDecorator)          
+-        <div>
++        </fieldset>
++      </div>
++#end    
++
++#* Change Theme *#
++#if ($allowChangePageTheme||$allowChangePortletDecorator)
++      <div id="${namespace}ChangeTheme" style="z-index:10020;width:450px;margin:5px;padding-left:5px;">
++#if ($allowChangePageTheme)
++        <fieldset>
++          <legend>$messages.getString("portal.page.editing.theme")</legend>
++          <select id='theme' name='theme' onChange="$form$submit">
++            #foreach($td in $decorationFactory.getPageDecorations($rc))
++            <option value='$td' #if($rootDecorator.Name == $td) SELECTED #end>$td
++            #end
++          </select>   
++        </fieldset>
++<br/>
++#end
++#getBoolProperty($allowChangePortletDecorator $rootDecorator "allow.change.portlet.decorator" true)
++####### Take all fragments and apply style	  
++#if($allowChangePortletDecorator)          
++        <fieldset>
++          <legend>$messages.getString("portal.page.editing.portlet.decorator")</legend>
+           <input type="hidden" name="fragment" value="$f.id">
+           <input type="hidden" name="move" value="">
+           <input type="hidden" name="remove" value="">
+-          <label for="decorators">$messages.getString("portal.page.editing.portlet.decorator")</label>
+           <select id="decorators" name="decorators">
+             <option value=''>
+         	    #foreach($pd in $decorationFactory.getPortletDecorations($rc))
+@@ -158,112 +412,40 @@
+         	    #end
+           </select>
+           <input type="submit" name="jsSubmitTheme" value="$messages.getString("portal.page.editing.changethemeall")"/>
+-        </div>
+-        #end	   
+-        #if($allowAddLayout||$allowChangeLayout)
++        </fieldset>
++#end	   
+       </div>
+-        #end
+-    </div> 
+-    </fieldset>   
+-    <fieldset style="float:left;width:49%;margin:0px;padding:0px;">
+-    <div class="layout-edit-bar-left">
+-        #if($allowAddPage||$allowChangePageName||$allowDeletePage)
+-      <div class="page-title"><b>$messages.getString("portal.page.editing.pageConfiguration")</b></div>
+-      <div class="page-content">
+-        #end
+-        #if($allowAddPage||$allowChangePageName)
+-        <div>
+-          <label for="pagename">$messages.getString("portal.page.editing.page")</label>
+-          <input id='pagename' name='jsPageName'/>
+-        </div>
+-        <div>
+-          <label for="pagetitle">$messages.getString("portal.page.editing.page.title")</label>
+-          <input id='pagetitle' name='jsPageTitle'/>
+-        </div>
+-        <div>
+-          <label for="pageshorttitle">$messages.getString("portal.page.editing.page.shorttitle")</label>
+-          <input id='pageshorttitle' name='jsPageShortTitle'/>
+-        </div>
+-        <div>
+-        #end
+-        #if($allowAddPage)
+-          <input type="submit" name="jsSubmitPage" value="$messages.getString("portal.page.editing.addpage")"/>
+-        #end
+-        #if($allowChangePageName)
+-          <input type="submit" name="jsChangePageName" value="$messages.getString("portal.page.editing.changepagename")"/>
+-        #end
+-        #if($allowAddPage||$allowChangePageName)
+-        </div>
+-        #end
+-        #if($allowNavigatePage)
+-        <div>
+-          <label>$messages.getString("portal.page.editing.pagenavigation")</label>
+-          <input id="move-page-left" type="submit" name="jsMovePageLeft" value="$messages.getString("portal.page.editing.movePageLeft")" />
+-          <input id="move-page-right" type="submit" name="jsMovePageRight" value="$messages.getString("portal.page.editing.movePageRight")" />
+-        </div>
+-        #end
+-        #if($allowDeletePage)
+-        <div>
+-          <label for="deletepage">$messages.getString("portal.page.editing.deleteThisPage")</label>
+-          <input id="deletepage" type="submit" name="jsDeletePage" value="$messages.getString("portal.page.editing.deletePage")" onclick="if(window.confirm('$messages.getString("portal.page.editing.confirmDeleteThisPage")')){return true;}return false;"/>
+-        </div>
+-        #end
+-        #if($allowAddPage||$allowChangePageName||$allowDeletePage)
+-      </div>
+-        #end
+-    </div> 
+-    </fieldset>
+-    <fieldset style="width:49%;margin:0px;padding:0px;">
+-    <div class="layout-edit-bar-left">
+-        #if($allowAddFolder||$allowChangeFolderName||$allowDeleteFolder)
+-      <div class="folder-title"><b>$messages.getString("portal.folder.editing.folderConfiguration")</b></div>
+-      <div class="folder-content">
+-        #end
+-        #if($allowAddFolder||$allowChangeFolderName)
+-        <div>
+-          <label for="foldername">$messages.getString("portal.folder.editing.folder")</label>
+-          <input id='foldername' name='jsFolderName'/>
+-        </div>
+-        <div>
+-          <label for="foldertitle">$messages.getString("portal.folder.editing.folder.title")</label>
+-          <input id='foldertitle' name='jsFolderTitle'/>
+-        </div>
+-        <div>
+-          <label for="foldershorttitle">$messages.getString("portal.folder.editing.folder.shorttitle")</label>
+-          <input id='foldershorttitle' name='jsFolderShortTitle'/>
+-        </div>
+-        <div>
+-        #end
+-        #if($allowAddFolder)
+-          <input type="submit" name="jsSubmitFolder" value="$messages.getString("portal.folder.editing.addfolder")"/>
+-        #end
+-        #if($allowChangeFolderName)
+-          <input type="submit" name="jsChangeFolderName" value="$messages.getString("portal.folder.editing.changefoldername")"/>
+-        #end
+-        #if($allowAddFolder||$allowChangeFolderName)
+-        </div>
+-        #end
+-        #if($allowNavigateFolder)
+-        <div>
+-          <label>$messages.getString("portal.folder.editing.foldernavigation")</label>
+-          <input id="move-folder-left" type="submit" name="jsMoveFolderLeft" value="$messages.getString("portal.folder.editing.moveFolderLeft")" />
+-          <input id="move-folder-right" type="submit" name="jsMoveFolderRight" value="$messages.getString("portal.folder.editing.moveFolderRight")" />
+-        </div>
+-        #end
+-        #if($allowDeleteFolder)
+-        <div>
+-          <label for="deletefolder">$messages.getString("portal.folder.editing.deleteThisFolder")</label>
+-          <input id="deletefolder" type="submit" name="jsDeleteFolder" value="$messages.getString("portal.folder.editing.deleteFolder")" onclick="if(window.confirm('$messages.getString("portal.folder.editing.confirmDeleteThisFolder")')){return true;}return false;"/>
+-        </div>
+-        #end
+-        #if($allowAddFolder||$allowChangeFolderName||$allowDeleteFolder)
+-      </div>
+-        #end
++#end
++
++<script language="JavaScript"><!--
++var prefName=document.getElementById("${namespace}PreferenceName").value;
++if(prefName==""){
++  prefName="${namespace}PageProperties";
++}
++${namespace}UpdatePreference(prefName);
++var prefState=document.getElementById("${namespace}PreferenceState").value;
++if(prefState=="show"){
++  ${namespace}ShowPreferenceWindow();
++}else{
++  ${namespace}HidePreferenceWindow();
++}
++// --></script>
++
++      </form>
++
+     </div>
+-    </fieldset>
+-    <br style="clear:both;">
+-    </form>
++    <div style="z-index:10010;position:absolute;top:415px;left:10px;width:630px;height:30px;text-align:right;">
++#set($_actions = $layoutDecoration.actions)
++    #if($_actions.size() >0)
++    #foreach ($_action in $_actions)
++      <input type="button" onClick="location.href='${_action.Action}'" name="close" value="${_action.Name}" style="font-family:sans-serif;font-size:11pt;height:25px;"/>
++    #end
++    #end
++ </div>
++
++    </div>
+   </div>
++
+ ## end edit mode
+ #end
+ 


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