cancel
Showing results for 
Search instead for 
Did you mean: 

dashlet using template doesn't show in dashlet list

kay_be_
Champ in-the-making
Champ in-the-making
I was creating a dashlet that doesn't show up in the dashlet list. I then tried a simple basic dashlet using http://livinginjava.blogspot.com/2008/11/how-to-create-custom-dashlet-in.html .
I created a template hello.html.ftl in tomcat\webapps\alfresco\WEB-INF\classes\alfresco\templates\
<#assign name = person.properties.userName>
Hello ${name}

I created a hello.jsp in tomcat\webapps\alfresco\jsp\dashboards\dashlets\
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>

<%– Note that this template is loaded from the classpath –%>
<r:template template="/alfresco/templates/hello.html.ftl">
</r:template>

in web-client-config I added the dashlet
      
<dashlet id="hello" label="Hello Dashlet"  description="My Hello Dashlet"
     jsp="/jsp/dashboards/dashlets/hello.jsp">
</dashlet>
resulting in :

   <config evaluator="string-compare" condition="Dashboards">
      <!– Dashboard layouts and available dashlets for the My Alfresco pages –>
      <!– see http://wiki.alfresco.com/wiki/User_Configurable_Dashboards –>
      <dashboards>
         <layouts>
            <!– the mandatory "default" layout - will be used for all users initially –>
            <layout id="default" columns="1" column-length="5" image="/images/icons/layout_single_column.gif"
                  label-id="layout_single_label" description-id="layout_single_desc"
                  jsp="/jsp/dashboards/layouts/single-column.jsp" />
            <layout id="narrow-right-2column" columns="2" column-length="4" image="/images/icons/layout_narrow_right_2column.gif"
                  label-id="layout_narrow_right_label" description-id="layout_narrow_right_desc"
                  jsp="/jsp/dashboards/layouts/narrow-right-2column.jsp" />
            <layout id="narrow-left-2column" columns="2" column-length="4" image="/images/icons/layout_narrow_left_2column.gif"
                  label-id="layout_narrow_left_label" description-id="layout_narrow_left_desc"
                  jsp="/jsp/dashboards/layouts/narrow-left-2column.jsp" />
            <layout id="three-column" columns="3" column-length="4" image="/images/icons/layout_three_column.gif"
                  label-id="layout_three_column_label" description-id="layout_three_column_desc"
                  jsp="/jsp/dashboards/layouts/three-column.jsp" />
         </layouts>
        
         <dashlets>
            <!– this is the default dashlet shown in the default layout initially –>
            <!– the default dashlet must have the id of 'getting-started' –>
            <dashlet id="getting-started" label-id="dashlet_gettingstarted_label"
                  description-id="dashlet_gettingstarted_desc"
                  jsp="/jsp/dashboards/dashlets/getting-started.jsp" allow-narrow="false" />
            <!– this dashlet 'tasks-todo' is also shown by default for all users –>
            <dashlet id="tasks-todo" label-id="my_tasks_todo_title" description-id="my_tasks_todo_desc"
                  jsp="/jsp/workflow/tasks-todo-dashlet.jsp" allow-narrow="false" />
            <!– Not enabled by default
            <dashlet id="tasks-active" label-id="tasks_active_title" description-id="tasks_active_desc"
                     jsp="/jsp/workflow/tasks-active-dashlet.jsp" allow-narrow="false" />
            –>
            <dashlet id="pooled-tasks" label-id="pooled_tasks_title" description-id="pooled_tasks_desc"
                  jsp="/jsp/workflow/pooled-tasks-todo-dashlet.jsp" allow-narrow="false" />
            <dashlet id="tasks-completed" label-id="my_tasks_completed_title" description-id="my_tasks_completed_desc"
                  jsp="/jsp/workflow/tasks-completed-dashlet.jsp" allow-narrow="false" />
            <dashlet id="opensearch" label-id="opensearch" description-id="opensearch_desc"
                  jsp="/jsp/dashboards/dashlets/opensearch.jsp" />
            <dashlet id="doclist-webscript" label-id="doclist-webscript_title" description-id="doclist-webscript_desc"
                  jsp="/jsp/dashboards/dashlets/doclist-webscript.jsp" />
            <dashlet id="myspaces-webscript" label-id="myspaces-webscript_title" description-id="myspaces-webscript_desc"
                  jsp="/jsp/dashboards/dashlets/myspaces-webscript.jsp" />
            <dashlet id="mytasks-webscript" label-id="mytasks-webscript_title" description-id="mytasks-webscript_desc"
                  jsp="/jsp/dashboards/dashlets/mytasks-webscript.jsp" />
            <dashlet id="mywebforms-webscript" label-id="mywebforms-webscript_title" description-id="mywebforms-webscript_desc"
                  jsp="/jsp/dashboards/dashlets/mywebforms-webscript.jsp" />
            <dashlet id="mywebfiles-webscript" label-id="mywebfiles-webscript_title" description-id="mywebfiles-webscript_desc"
                  jsp="/jsp/dashboards/dashlets/mywebfiles-webscript.jsp" />
         <dashlet id="press-releases" label="Press Releases" description="Lists Press Releases with URL"
              jsp="/jsp/dashboards/dashlets/press_release.jsp"
            allow-narrow="true" />
         <dashlet id="hello" label="Hello Dashlet"
     description="My Hello Dashlet"
     jsp="/jsp/dashboards/dashlets/hello.jsp">
</dashlet>
         </dashlets>
        
         <!– configuration of the default dashlets to display when users login for the first time –>
         <!– if this config is removed, then no dashlets will be shown by default –>
         <!– overides of this config should redefine the entire list, not assume additions to it –>
         <default-dashlets>
            <dashlet id="getting-started" />
            <dashlet id="tasks-todo" />
         </default-dashlets>
        
         <!– set true allow the Guest user to configure the dashboard view - false by default –>
         <allow-guest-config>false</allow-guest-config>
      </dashboards>
   </config>

After restarting alfresco the new dashlet doesn't show…
What went wrong?

I'm using Alfresco 4.0.c.

Any help is appreciated.

Regards
Kris
2 REPLIES 2

mitpatoliya
Star Collaborator
Star Collaborator
This will be visible in alfresco explorer dashlets list.
Are you expecting this to be visible in the Alfresco share?
If you want to create dashlet in share then there are different steps you need to follow.

kay_be_
Champ in-the-making
Champ in-the-making
Now, that explains a lot 😉 I hoped this would be the config for share dashboards. Can share dashboards be developped the same way (just a template and jsp) or do I have to use webscripts?
I now realize that this config is in webapps\alfresco and not in webapps\share.  Smiley Surprised

Thanks for your help,
Kris