portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shinsuke Sugaya <sug...@n2sm.net>
Subject Re: svn commit: r529102 - in /portals/jetspeed-2/trunk: layout-portlets/src/java/org/apache/jetspeed/portlets/layout/ layout-portlets/src/java/org/apache/jetspeed/portlets/layout/resources/ src/webapp/WEB-INF/templates/layout/html/columns/
Date Mon, 16 Apr 2007 01:11:46 GMT
Hi Ate,

Ate Douma wrote:
> Shinsuke,
> 
> I haven't actually looked at your enhancement yet but it seems quite 
> useful :)

I added a folder config form like page config one.

> It would be good though to "record" these kind of enhancements against a 
> JIRA issue, so we can properly track these for the next release.

Okay, I'll do that.

> Note: I'd like to roll out a 2.1.1 release soon, so even while the 
> current version in trunk is set to 2.2-dev, current trunk changes should 
> be best limited to minor enhancements and bugfixes.
> If you plan to commit bigger changes more qualified for a later 2.2 
> release, please let me know.

If I have, let you know.

Regards,
  shinsuke

> In that case I think we should create a 2.1.1-dev branch off the current 
> trunk first.
> 
> Regards,
> 
> Ate
> 
> shinsuke@apache.org wrote:
>> Author: shinsuke
>> Date: Sun Apr 15 17:29:08 2007
>> New Revision: 529102
>>
>> URL: http://svn.apache.org/viewvc?view=rev&rev=529102
>> Log:
>> added form for folder configuration.
>>
>> Modified:
>>     
>> portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/MultiColumnPortlet.java

>>
>>     
>> portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/resources/LayoutResource.properties

>>
>>     
>> portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/resources/LayoutResource_en.properties

>>
>>     
>> portals/jetspeed-2/trunk/src/webapp/WEB-INF/templates/layout/html/columns/layout.vm

>>
>>
>> Modified: 
>> portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/MultiColumnPortlet.java

>>
>> URL: 
>> http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/MultiColumnPortlet.java?view=diff&rev=529102&r1=529101&r2=529102

>>
>> ============================================================================== 
>>
>> --- 
>> portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/MultiColumnPortlet.java

>> (original)
>> +++ 
>> portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/MultiColumnPortlet.java

>> Sun Apr 15 17:29:08 2007
>> @@ -281,12 +281,12 @@
>>                              String path = parent.getPath();
>>                              if (path.endsWith(Folder.PATH_SEPARATOR))
>>                              {
>> -                                path = path + 
>> getEscapedPageName(jsPageName);
>> +                                path = path + 
>> getEscapedName(jsPageName);
>>                              }
>>                              else
>>                              {
>>                                  path = path + Folder.PATH_SEPARATOR
>> -                                        + 
>> getEscapedPageName(jsPageName);
>> +                                        + getEscapedName(jsPageName);
>>                              }
>>                              Page page = pageManager.newPage(path);
>>                              if ( layout == null || layout.length() == 
>> 0 )
>> @@ -458,7 +458,250 @@
>>                  }
>>                  return;
>>              }            -            +
>> +            if (request.getParameter("jsSubmitFolder") != null)
>> +            {
>> +                String jsFolderName = 
>> request.getParameter("jsFolderName");
>> +                if (jsFolderName != null && jsFolderName.length() > 0
>> +                        && 
>> jsFolderName.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(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(jsFolderName);
>> +                            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;
>> +            }
>> +
>> +            if (request.getParameter("jsDeleteFolder") != null)
>> +            {
>> +                try
>> +                {
>> +                    Folder targetFolder = (Folder) 
>> requestPage.getParent();
>> +                    Folder parent = (Folder) targetFolder.getParent();
>> +                    if (parent != null)
>> +                    {
>> +                        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);
>> +                    }
>> +                }
>> +                catch (Exception e)
>> +                {
>> +                    throw new PortletException(
>> +                            "Unable to access folder for removing: "
>> +                                    + e.getMessage(), e);
>> +                }
>> +                return;
>> +            }
>> +
>> +            if (request.getParameter("jsMoveFolderLeft") != null)
>> +            {
>> +                try
>> +                {
>> +                    Folder targetFolder = (Folder) 
>> requestPage.getParent();
>> +                    Folder parent = (Folder) targetFolder.getParent();
>> +                    if (parent != null)
>> +                    {
>> +                        List orderList = parent.getDocumentOrder();
>> +                        String name = targetFolder.getName();
>> +                        if (orderList != null)
>> +                        {
>> +                            int index = orderList.indexOf(name);
>> +                            if (index > -1)
>> +                            {
>> +                                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);
>> +                                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 folder for changing the 
>> document order: "
>> +                                    + e.getMessage(), e);
>> +                }
>> +                return;
>> +            }
>> +
>> +            if (request.getParameter("jsMoveFolderRight") != null)
>> +            {
>> +                try
>> +                {
>> +                    Folder targetFolder = (Folder) 
>> requestPage.getParent();
>> +                    Folder parent = (Folder) targetFolder.getParent();
>> +                    if (parent != null)
>> +                    {
>> +                        List orderList = parent.getDocumentOrder();
>> +                        String name = targetFolder.getName();
>> +                        if (orderList != null)
>> +                        {
>> +                            int index = orderList.indexOf(name);
>> +                            if (index > -1)
>> +                            {
>> +                                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);
>> +                                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 folder for changing the 
>> document order: "
>> +                                    + e.getMessage(), e);
>> +                }
>> +                return;
>> +            }
>> +
>>              String theme = request.getParameter("theme");
>>              if ( theme != null && theme.length() > 0 && 
>> !theme.equals(requestPage.getDefaultDecorator(Fragment.LAYOUT)) )
>>              {
>> @@ -693,7 +936,7 @@
>>          return -1;
>>      }
>>  
>> -    protected String getEscapedPageName(String pageName)
>> +    protected String getEscapedName(String pageName)
>>      {
>>          try
>>          {
>>
>> Modified: 
>> portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/resources/LayoutResource.properties

>>
>> URL: 
>> http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/resources/LayoutResource.properties?view=diff&rev=529102&r1=529101&r2=529102

>>
>> ============================================================================== 
>>
>> --- 
>> portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/resources/LayoutResource.properties

>> (original)
>> +++ 
>> portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/resources/LayoutResource.properties

>> Sun Apr 15 17:29:08 2007
>> @@ -86,4 +86,14 @@
>>  portal.page.actions.Help=Help
>>  portal.page.actions.View=View
>>  
>> +portal.folder.editing.folderConfiguration=Folder Configuration
>> +portal.folder.editing.folder=Folder
>> +portal.folder.editing.addfolder=Add Folder
>> +portal.folder.editing.foldernavigation=Navigation:
>> +portal.folder.editing.moveFolderLeft=Move Folder Left
>> +portal.folder.editing.moveFolderRight=Move Folder Right
>> +portal.folder.editing.deleteThisFolder=Delete this folder:
>> +portal.folder.editing.deleteFolder=Delete
>> +portal.folder.editing.confirmDeleteThisFolder=Do you want to delete 
>> this folder?
>> +
>>  
>>
>> Modified: 
>> portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/resources/LayoutResource_en.properties

>>
>> URL: 
>> http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/resources/LayoutResource_en.properties?view=diff&rev=529102&r1=529101&r2=529102

>>
>> ============================================================================== 
>>
>> --- 
>> portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/resources/LayoutResource_en.properties

>> (original)
>> +++ 
>> portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/resources/LayoutResource_en.properties

>> Sun Apr 15 17:29:08 2007
>> @@ -86,4 +86,13 @@
>>  portal.page.actions.Help=Help
>>  portal.page.actions.View=View
>>  
>> +portal.folder.editing.folderConfiguration=Folder Configuration
>> +portal.folder.editing.folder=Folder
>> +portal.folder.editing.addfolder=Add Folder
>> +portal.folder.editing.foldernavigation=Navigation:
>> +portal.folder.editing.moveFolderLeft=Move Folder Left
>> +portal.folder.editing.moveFolderRight=Move Folder Right
>> +portal.folder.editing.deleteThisFolder=Delete this folder:
>> +portal.folder.editing.deleteFolder=Delete
>> +portal.folder.editing.confirmDeleteThisFolder=Do you want to delete 
>> this folder?
>>  
>>
>> Modified: 
>> portals/jetspeed-2/trunk/src/webapp/WEB-INF/templates/layout/html/columns/layout.vm

>>
>> URL: 
>> http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/WEB-INF/templates/layout/html/columns/layout.vm?view=diff&rev=529102&r1=529101&r2=529102

>>
>> ============================================================================== 
>>
>> --- 
>> portals/jetspeed-2/trunk/src/webapp/WEB-INF/templates/layout/html/columns/layout.vm

>> (original)
>> +++ 
>> portals/jetspeed-2/trunk/src/webapp/WEB-INF/templates/layout/html/columns/layout.vm

>> Sun Apr 15 17:29:08 2007
>> @@ -62,11 +62,19 @@
>>        #getBoolProperty($allowAddPage $rootDecorator "allow.add.page" 
>> true)
>>        #getBoolProperty($allowNavigatePage $rootDecorator 
>> "allow.navigate.page" true)
>>        #getBoolProperty($allowDeletePage $rootDecorator 
>> "allow.delete.page" true)
>> +      #getBoolProperty($allowChangeFolderTheme $rootDecorator 
>> "allow.change.folder.theme" true)
>> +      #getBoolProperty($allowAddFolder $rootDecorator 
>> "allow.add.folder" true)
>> +      #getBoolProperty($allowNavigateFolder $rootDecorator 
>> "allow.navigate.folder" true)
>> +      #getBoolProperty($allowDeleteFolder $rootDecorator 
>> "allow.delete.folder" true)
>>      #else
>>        #set($allowChangePageTheme=false)
>>        #set($allowAddPage=false)
>>        #set($allowNavigatePage=false)
>>        #set($allowDeletePage=false)
>> +      #set($allowChangeFolderTheme=false)
>> +      #set($allowAddFolder=false)
>> +      #set($allowNavigateFolder=false)
>> +      #set($allowDeleteFolder=false)
>>      #end
>>  
>>      #getIntProperty($maxLayoutNesting $rootDecorator 
>> "max.layout.nesting" 2)
>> @@ -92,13 +100,13 @@
>>        #end
>>      </div>
>>      </fieldset>
>> -    <fieldset>
>> -    <div class="layout-edit-bar-left">
>>        #set($form="f${renderResponse.namespace}")
>>        #set($formAction = "$renderResponse.createActionURL()")
>>        #set($submit = ".submit()")
>>  
>> -      <form name="$form" action="$formAction" method='post'>
>> +    <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">
>> @@ -167,9 +175,34 @@
>>          #if($allowAddPage||$allowDeletePage)
>>            </div>
>>          #end
>> -      </form>
>>      </div> -  </fieldset>
>> +    </fieldset>
>> +    <fieldset>
>> +    <div class="layout-edit-bar-left">
>> +        #if($allowAddFolder||$allowDeleteFolder)
>> +          <div 
>> class="folder-title"><b>$messages.getString("portal.folder.editing.folderConfiguration")</b></div>

>>
>> +          <div class="folder-content">
>> +        #end
>> +        #if($allowAddFolder)
>> +          <label 
>> for="newfolder">$messages.getString("portal.folder.editing.folder")</label>

>>
>> +          <input id='newfolder' name='jsFolderName'/>
>> +          <input type="submit" name="jsSubmitFolder" 
>> value="$messages.getString("portal.folder.editing.addfolder")"/>
>> +        #end
>> +        #if($allowNavigateFolder)
>> +          
>> <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")" />
>> +        #end
>> +        #if($allowDeleteFolder)
>> +          <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;"/>
>> +        #end
>> +        #if($allowAddFolder||$allowDeleteFolder)
>> +          </div>
>> +        #end
>> +    </div>
>> +    </fieldset>
>> +    </form>
>>    </div>
>>  ## end edit mode
>>  #end
>> @@ -273,4 +306,4 @@
>>    </form>
>>    #parse($myFragment.decoration.footer)
>>  #end
>> -  \ No newline at end of file
>> + 
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
>> For additional commands, e-mail: jetspeed-dev-help@portals.apache.org
>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-dev-help@portals.apache.org
> 
> 


-- 
Shinsuke Sugaya
N2SM, Inc.
sugaya@n2sm.net
Tel: +81-3-5225-0905/Fax: +81-3-5225-0906
URL: http://www.n2sm.net/
Next Networking, Solution and Merchandising

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message