how to add a virtual navigation tree ?

hi, i m trying to enable another navigation tree. for the moment, my contribution looks like this :

i declared a schema to hold my query
target=“org.nuxeo.ecm.core.schema.TypeService” point=“schema”

create a document LocationSearch
target=“org.nuxeo.ecm.core.schema.TypeService” point=“doctype” and the tree
target=“org.nuxeo.ecm.webapp.directory.DirectoryTreeService” point=“trees”

but i certainly miss something with the new content view byLocationsContentView:

i declared my view with this extension point
target=“org.nuxeo.ecm.platform.ui.web.ContentViewService” point=“contentViews”

adding locations_virtual_navigation.xhtml under nuxeo.war

<ui:decorate template="/incl/virtual_navigation_template.xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets">
    <ui:param name="contentViewName" value="byLocationsContentView" />
</ui:decorate>

and my deployment fragment

<?xml version="1.0"?>
<fragment>
  <extension target="application#MODULE">
    <module>
      <java>${bundle.fileName}</java>
    </module>
  </extension>

  <install>

    <!-- Unzip the contents of our nuxeo.war into the server -->
    <unzip from="${bundle.fileName}" to="/">
      <include>nuxeo.war/**</include>
    </unzip>

  </install>

    <extension target="faces-config#NAVIGATION">

        <navigation-case>
          <from-outcome>locations_virtual_navigation</from-outcome>
          <to-view-id>/locations_virtual_navigation.xhtml</to-view-id>
          <redirect />
        </navigation-case>

    </extension>

  <extension target="pages#PAGES">

    <page view-id="/locations_virtual_navigation.xhtml">
      breadcrumb=test
    </page>

  </extension>

</fragment>

@Anahide, everything else is working, and if i call the bySubjectContentView instead of my view in the DirectoryTreeService extension point, the result is another Subject tree.

for example, this is a try in the coverage view. DEBUG [org.nuxeo.ecm.platform.ui.web.binding.alias.AliasValueExpression] Resolved expression var='contentViewName' for mapper with id '1176491654_3d42a2f6_1': byCoverageContentView

and this is in my custom view. obviously, it did not call the good view, but i can't figure out why ?

*DEBUG [org.nuxeo.ecm.platform.ui.web.binding.alias.AliasValueExpression] Resolved expression var='contentViewName' for mapper with id '-574529264_4dcfd17_1': document_content*
0 votes

1 answers

2681 views

ANSWER

hi,

it seems you've done a lot of things that's needed so you should be on the right path!

can you please edit your post to give more info about what you're experiencing (is the rest of the application working ok, including other virtual navigations? is it just that your own navigation is not displayed? is the virtual navigation the only thing that does not work in your plugin? do you see any errors in logs?).

also please try to format the xml content you're pasting using the "preformatted text" button as it's quite hard reading it right now, and your configuration could be useful to other users.

thanks!

02/09/2012

sorry for the xml but the pre-formatted button doesn't look's to work on my computer…apparently, it's not possible to mix code and unordered list in the same post.
02/09/2012

Thanks for the update, i'm assuming you don't have any ERROR logs?

DEBUG logs are low level logs that can give hints, but it's not clear what's working or not: from your description i guess that the tab is shown, it's just not displaying the right navigation, is that it? Please give more info.

In any case, posting the contributions to org.nuxeo.ecm.webapp.directory.DirectoryTreeService and org.nuxeo.ecm.platform.ui.web.ContentViewService could give a hint.

02/10/2012

no, no errors are displayed on the logs.

i see the tab and the tree but when i clic on one item, i dont get any result and the right part of the page doesn't change. if i rename the view to an existing one, bySubjects for example, the tree is working so i guess it's something on my custom view registration.

i can't post the contributions for now, i will post them tonight

02/10/2012



ok, i finnaly find the problem…i was testing my contribution within the ide.

The view was not registred when i deploy my contribution directly in the eclispe nuxeo-ide, but everything is working when i export a jar file.

here is the contribution :

     <!-- le schema qui contient la navigation virtuelle -->  
<extension target="org.nuxeo.ecm.core.schema.TypeService" point="schema">
    <schema name="locationsearch" src="schemas/location_search.xsd" prefix="ls"/>
</extension>      

    <!-- le document qui contient le schema précedent -->
<extension target="org.nuxeo.ecm.core.schema.TypeService" point="doctype">   
    <doctype extends="Document" name="LocationSearch">
        <schema name="locationsearch"/>
    </doctype>
</extension>

    <!-- Crée la vue qui va permettre d'afficher les résultats -->

<extension target="org.nuxeo.ecm.platform.ui.web.ContentViewService"
point="contentViews">

<contentView name="byLocationsContentView">
  <title>location search</title>
  <translateTitle>false</translateTitle>
  <showTitle>true</showTitle>
  <emptySentence>label.content.empty.search</emptySentence>
  <translateEmptySentence>false</translateEmptySentence>

  <coreQueryPageProvider>
    <property name="coreSession">#{documentManager}</property>
    <whereClause docType="LocationSearch">
      <predicate operator="STARTSWITH" parameter="lc:locations">
        <field name="location_search_query" schema="locationsearch"/>
      </predicate>
      <fixedPart>
        ecm:mixinType != 'HiddenInNavigation' AND
        ecm:currentLifeCycleState
        !='deleted' AND ecm:isCheckedInVersion = 0
      </fixedPart>
    </whereClause>
    <sort column="dc:title" ascending="true" />
    <pageSize>10</pageSize>
  </coreQueryPageProvider>

  <showPageSizeSelector>true</showPageSizeSelector>
  <useGlobalPageSize>true</useGlobalPageSize>
  <refresh>
    <event>documentChildrenChanged</event>
  </refresh>
  <cacheKey>only_one_cache</cacheKey>
  <cacheSize>1</cacheSize>

  <resultLayouts>
    <layout name="document_virtual_navigation_listing_ajax" title="document_listing"
      translateTitle="true" iconPath="/icons/document_listing_icon.png"
      showCSVExport="true" showPDFExport="false" showSyndicationLinks="true" />
    <layout name="document_virtual_navigation_listing_ajax_compact_2_columns"
      title="document_listing_compact_2_columns" translateTitle="true"
      iconPath="/icons/document_listing_compact_2_columns_icon.png"
      showSyndicationLinks="true" />
    <layout name="document_virtual_navigation_listing_ajax_icon_2_columns"
      title="document_listing_icon_2_columns" translateTitle="true"
      iconPath="/icons/document_listing_icon_2_columns_icon.png"
      showSyndicationLinks="true" />
  </resultLayouts>

  <selectionList>CURRENT_SELECTION</selectionList>
  <actions category="CURRENT_SELECTION_LIST" />

</contentView>

</extension>


<!-- ajout de la navigation virtuelle  -->
<extension target="org.nuxeo.ecm.webapp.directory.DirectoryTreeService"
point="trees">

    <directoryTree name="byLocationsNavigation" label="My location Test"
    contentView="byLocationsContentView" field="location_search_query"
    schema="locationsearch" outcome="locations_virtual_navigation">
        <directory>departements</directory>
        <directory>villes</directory>
    </directoryTree>

</extension>
0 votes



You may create a JIRA ticket or use the Forum and explain exactly the procedure to reproduce the way to not have the bundle deployed with Nuxeo IDE. This feature works and we may miss something or you may miss something. If you want to benefit of the hot reload features, this could be better for you :).

To create an issue JIRA you can go here.

Thanks for your feedback.

02/13/2012

ok, i post my contribution in the french forum
02/13/2012