AnsweredAssumed Answered

Problem with the presets.xml

Question asked by rodrigoa on Apr 30, 2012
Hi all,

I am with a very strange problem. I made a functionality (resetDashboard) to allow the admin change the dashboard automatically from the other users, passing as a parameter the user and the configuration he wants. I created in the presets.xml to different configurations to the users dashboards, one configuration is with 1 column and 4 dashlets, and the second one is with 2 columns and 2 dashlets.

Here is my presets.xml:

   <preset id="user-dashboard">
      <components>
         <!– title –>
         <component>
            <scope>page</scope>
            <region-id>title</region-id>
            <source-id>user/${userid}/dashboard</source-id>
            <url>/components/title/user-dashboard-title</url>
         </component>
         <!– dashboard components –>
         <component>
            <scope>page</scope>
            <region-id>component-1-1</region-id>
            <source-id>user/${userid}/dashboard</source-id>
            <url>/components/dashlets/my-documents</url>
         </component>
         <component>
            <scope>page</scope>
            <region-id>component-2-1</region-id>
            <source-id>user/${userid}/dashboard</source-id>
            <url>/com/lacapitale/dashlets/docprocsummary</url>
         </component>
      </components>
      <pages>
         <page id="user/${userid}/dashboard">
            <title>User Dashboard</title>
            <title-id>page.userDashboard.title</title-id>
            <description>Users dashboard page</description>
            <description-id>page.userDashboard.description</description-id>
            <template-instance>dashboard-2-columns-wide-right</template-instance>
            <authentication>user</authentication>
         </page>
      </pages>
   </preset>  
  
   <preset id="user-dashboard-approbation">
      <components>
         <!– title –>
         <component>
            <scope>page</scope>
            <region-id>title</region-id>
            <source-id>user/${userid}/dashboard</source-id>
            <url>/components/title/user-dashboard-title</url>
         </component>
         <!– dashboard components –>
         <component>
            <scope>page</scope>
            <region-id>component-1-1</region-id>
            <source-id>user/${userid}/dashboard</source-id>
            <url>/components/dashlets/my-documents</url>
         </component>
         <component>
            <scope>page</scope>
            <region-id>component-1-2</region-id>
            <source-id>user/${userid}/dashboard</source-id>
            <url>/com/lacapitale/dashlets/docprocsummary</url>
         </component>
         <component>
            <scope>page</scope>
            <region-id>component-1-3</region-id>
            <source-id>user/${userid}/dashboard</source-id>
            <url>/components/dashlets/my-sites</url>
         </component>
         <component>
            <scope>page</scope>
            <region-id>component-1-4</region-id>
            <source-id>user/${userid}/dashboard</source-id>
            <url>/components/dashlets/my-tasks</url>
         </component>
      </components>
      <pages>
         <page id="user/${userid}/dashboard">
            <title>User Dashboard</title>
            <title-id>page.userDashboard.title</title-id>
            <description>Users dashboard page</description>
            <description-id>page.userDashboard.description</description-id>
            <!–<template-instance>dashboard-1-column</template-instance>–>
            <template-instance>dashboard-1-column</template-instance>
            <authentication>user</authentication>
         </page>
      </pages>
   </preset>

   <preset id="user-dashboard-consultation">
      <components>
         <!– title –>
         <component>
            <scope>page</scope>
            <region-id>title</region-id>
            <source-id>user/${userid}/dashboard</source-id>
            <url>/components/title/user-dashboard-title</url>
         </component>
         <!– dashboard components –>
         <component>
            <scope>page</scope>
            <region-id>component-1-1</region-id>
            <source-id>user/${userid}/dashboard</source-id>
            <url>/components/dashlets/my-documents</url>
         </component>
         <component>
            <scope>page</scope>
            <region-id>component-2-1</region-id>
            <source-id>user/${userid}/dashboard</source-id>
            <url>/com/lacapitale/dashlets/docprocsummary</url>
         </component>
      </components>
      <pages>
         <page id="user/${userid}/dashboard">
            <title>User Dashboard</title>
            <title-id>page.userDashboard.title</title-id>
            <description>Users dashboard page</description>
            <description-id>page.userDashboard.description</description-id>
            <template-instance>dashboard-2-columns-wide-right</template-instance>
            <authentication>user</authentication>
         </page>
      </pages>
   </preset>


Let me try to clarify to the problem:

1 - The admin create a new user.
2 - Change to the  id="user-dashboard-consultation" dashboard.
3 - The admin change to id="user-dashboard-approbation", the dashboard show the 4 dashlets in the left, as if the dashlet has 2 columns.

I appreciate any kind of help,

Rodrigo Araujo.

Outcomes