how could i put the tree in a widget on the dashboard??

i need to see the tree in the dashboard. i have the idea to create my own widget type using the template /incl/directory_tree_explorer.xhtml (i think thats the tree´s template if i am wrong, please tell me)

here is the code how i am doing it

all is in the layouts-dashboard-contrib.xml on nuxeo-user-dashboard-jsf.jar

<extension target="org.nuxeo.ecm.platform.forms.layout.WebLayoutManager"

<layout name="grid_dashboard_layout">
    <template mode="any">
      <properties mode="any">
        <property name="nxl_gridStyleClass_0">gridStyle6</property>
        <property name="nxl_gridStyleClass_1">gridStyle6</property>

and then i create the widget

<extension target="org.nuxeo.ecm.platform.forms.layout.WebLayoutManager"

<widgetType name="arbol_widget_type">
  <property name="template">

<widget name="arbol_widget" type="arbol_widget_type">
    <label mode="any"></label>
  <properties widgetMode="any">
    <property name="category">DASHBOARD_RIGHT</property>
  <properties widgetMode="any">
    <property name="template">/incl/directory_tree_explorer.xhtml</property>

i´ll appreciate if someone help me

thanks ;)

0 votes

1 answers




I think you may be confusing widgets displaying content (like your tree) and widgets displaying other widgets via actions configuration.

The widgets named “dashboard_left” and “dashboard_right” are widgets stacking other widgets. The global grid layout configuration (with associated styles in the row property, names nxl_gridStyleClass_0, nxl_gridStyleClass_1) does not need to be altered for you to add your own widget to the dashboard. You only need to redefine this layout configuration if you'd like to change the “2 columns” appearance. Documentation about this configuration is here:

Now if you want to add your widget to the right column, for instance, you need to add an action in this category, with type “widget”, and reference the widget name in its property “widgetName”. Your widget can be declared independently (as you did) but it's not the one holding the action category “DASHBOARD_RIGHT”, it's the action. This configuration is visible at the end of the file you're referring to: (and you should not duplicate the tag properties widgetMode=“any” in a given widget configuration)

The widget type configuration looks ok, but the directory_tree_explorer.xhtml template is not a widget template: it should display its usual content in the dashboard, that is virtual navigations (btw are you sure that you're using the jsf dashboard, and not the opensocial one with gadgets?). But the field configuration “arbol_widget:directoryTreeNav” will be ignored, and i'm not sure what it refers to for your use case.

Hope this helps

1 votes