You are here

WebCenter 11g PS3 introduces the Navigation Model

Yesterday I told about the page hierarchy which contains the pages you include in your portal. Today I will talk about the navigation model. A navigation model is a collection of resources that the users can use to navigate in the portal. We call items in a navigation model resources because that's just what they are. They are more than links. You can for example add portlets, taskflows or content from a content server to your navigation model.

You can also have different navigation models which allows you to use a different model on different pages. If you are creating a large corporate portal and each division has their own sub section of the portal, than you also want the ability for each section to have their own navigation. This all becomes possible in from this release!

As most of the resources in WebCenter, you can manage a navigation model both in runtime as in JDeveloper. I will first explain the navigation model in JDeveloper.

Manage the navigation model in JDeveloper

In a WebCenter portal application, the navigation models are stored in the oracle/webcenter/portalapp/navigations folder. By default you will find 2 files:

  • default-navigation-model.xml this is the default navigation model used by the portal
  • navigation-registry.xml this file is used to limit the resource during runtime editing of a navigation model

When you open the default model you will notice that there is only a single element in it being the page hierarchy:

A navigation model has following properties:

  • ID: this is the id of your navigation model which must be unique in the portal
  • Navigation Filter: a navigation filter can be used to apply business logic to include or exclude specific resources from the model.
  • Visible: specifies whether or not to display the navigation model.

When pressing on the Plus sign to add nodes, you will get a list of types of resources that you can add to your navigation model. I will give a brief overview of all these items with the properties.

Content Item
By adding content item, you can add items from a content server. You first need to create a connection to a content server before you can select the content item. You can select the item by clicking on the browse button in the URL or you can also drag & drop the specific content from the connection to the navigation model.

You can specify the template of the page were the content item will be displayed or to redirect to an URL.

Content Query
You can also add the complete contents of a folder to a navigation model. This can be used if you have a folder with manuals and you want to show the list of manuals in the navigation. For this you need to add the Content Query. Each file will be listed as a child to the navigation model.

A Content query requires a repository (which is the connection to the content server) and of course the query.

By selecting the Insert folder contents, if your query returns folders than the content of those folders will also be added.

Link
A link is in fact the name for all sorts of resources. When you add a link you need to specify the type of link you want to add:

  • External link: this is a link to an external page. You can choose to display this in the template or redirect to the external link. When you choose Render URL in page template, then the actual page will be rendered as an iframe in the content facet of the template so it appears as if the page is actual content of the portal.
  • External application: this will open a configured external application.
  • Page: this will add a link to an existing page from within the portal project
  • Taskflow: this will add a link to the taskflow. When you select a template, the taskflow will be rendered in the content facet of the template. This way the taskflow will use all the possible space to display.
  • Portlet: the same as with the taskflow but it allows you to create a link to a portlet
  • Content: this is the exact same as adding a Content Item.

Instead of manually adding the parameters for the link resources, you can also use the drag & drop technique. You can for example drag a taskflow from the resource palette to the navigation model. This will automatically create a link with the correct properties.

Page Query
By adding a page query, you add a page hierarchy. You need to specify the path to the xml file containing the page hierarchy. Remember that each level of pages will have its own xml file so you don't need to select the root page hierarchy of the application.

You can also specify the page template and style that need to be used for those pages. By setting to default, it will use the application template.

In a page hierarchy you have the possibility to hide pages. When adding a page query you are allowed to choose whether or not to show the hidden pages in the navigation. You can also only show the hidden pages for example.

Navigation Reference
By adding a reference to another navigation, you include the content of another navigation model. You have to know that this will only create a reference so the content of the navigation model will be added during runtime.

You can use this to split large navigation models. If you have multiple navigation models and each model uses some same resources, than you can group these together and reference that model from all the others.

Folder
By adding a folder you can organize resource in the navigation model.

As an example I will add some content from a content server and a taskflow and show you how it looks in the default template. I will also add a link to Google and embed it into the portal.

This is how the navigation looks when everything has been added:

And this is how it looks in runtime:

This is what you get when clicking on the Folder View link:

As you can see, the taskflow is using the complete space. This is a very nice feature it often happens that you have only a single taskflow or portlet on a page. By adding a link to the portlet or taskflow, you no longer need to create a page and add the taskflow/portlet to it. This can save a lot of time!

This can also be used when you have a page with a small instance of a portlet or taskflow. When you provide a link to such a page, you provide a "Full screen" view of that taskflow/portlet.

The Google page will look like this in our portal:

My browser is set for Dutch so sorry for the language :)

As you see, Google integrates quiet well with our template.

When we click the WebCenterIntro.ptt (this is the content I added from the content server) you will see the properties of the file:

Manage Navigation model in runtime

You can of course also manage the navigation models in runtime.

When you create a navigation model in runtime, it is stored in the MDS.
You need to provide a unique name, a description and you can select an existing navigation model to base your model on.

When you edit the navigation model you also have the add button so you can easily add resources to the navigation model.

The elements you see in that menu are defined in the navigation-registry.xml
As you can see, these items are listed in the add menu:

And this is the new folder from the navigation-resources:

See the similarities? This way you can alter the add menu for the runtime managing of navigation models.

In the links folder, you define the items that the users can select when they press the browse button when adding a link.
This is the popup you see during runtime:

And this is the links folder:

This way you can fully customize the way people can manage navigation models in runtime.

Hope you enjoyed this post. If someone has a question, you can leave a comment below.

Category: 

Comments

Hi Yannick,

First of all thanks for this great explanation! I've a question concerning the fact of using a resource bundle in order to "localized" the navigation menu "item" page link title? Have you ever managed to do it? I've tried to do it by editing the URL Attribute "Title" but it doesn't work...

Thanks in advance and Kind regards,

I believe it is possible. I didn't try but i will soon try it.
I believe you could either use ${bunlde['key']} or #{bundle['key']}

Hi Yannick,

Thanks for your quick response! It helps me try other things and gave me another view on this issue.
I finally found how to do it but strangely...

Apparently (from the source view of the navigation model) :

is OK provided you already create and setup the correct bundle (in faces-config.xml).

But the following do not work correctly (or I missed something...) :

Don't work as is or neither with expression (#{res.key} for example)... The weird things is that it "translate" directly the key (viewable in the design view of the navigation model), making it in fact static and not more localizable.

Anyway thanks for your help! And see you soon on WC EMG,

Kind regards,

Stephane.

Hey Yannick,
Thanks for bunch of information and congrats for your new cook book.
We have some unique requirement with webcenter that we need to control
visibile property to hide the menu item in navigation model based on
some condition.

but when i set visible property to true or false , menu item donot refresh to
take latest value for visible property and hide and show it.
we have button in task flow and if we click one button some menu item need
to be hided and if we click some other button other menu item will get hided.

canyou please shed some lights on it. why navigation model is not refreshing.

I should do sme testing with this... I haven't tried setting the visible attribute in a way you describe.
I expect that it should work. Maybe it has to do with the way navigation models are cached in the JOC.
Or maybe it can be something with the scope of your managed bean.
How did you define the managed bean? Can you provide the EL you use in the navigation model + were and how you defined that managed bean.

I have managed bean in pageflowscope and Visible property is binded to managed bean like pageflowscope.beanname.property and I am setting the property during button click to make it as false or true.it is not hiding the menu after my button click , is there something like partialtrigger or Adffacescontext.getcurretninstance.addpartialtarget for navigation model ,so i can fire this refresh which will take latest property value to hide/show it.

Hi, I'm also having this problem. I have to display a link to a portal page, and the page is protected by ADF security. When a user click on the link, he/she should be required to login, when the user is logged in, the navigation bar is not refreshed. How do I force the navigation bar to refresh?

Hi, I'm facing a stupid problem... I would like to display an external page (like google in your example) but in another window (like an "a href" with target="_blank") when I click on a menu item.

I see the Target url attribute, but the "_blank" value doesn't work. How could I present the google page in a new window when I click on the "Google" menu item ?

Sorry to bother you with a so simple problem, but I'm stuck with this...

Thanks by advance.

I tried it and using the target _blank does work.
Did you add the URL as a link to the navigation model?

I think everything's correct.
Here's what I have defined :

  1.     <url id="googleUrl"
  2.         factoryClass="oracle.webcenter.portalframework.sitestructure.rc.UrlResourceFactory"
  3.         visible="#{true}" url="www.google.be">
  4.       <attributes>
  5.         <attribute attributeId="Title" value="Google" isKey="false"/>
  6.         <attribute attributeId="Redirect" value="true" isKey="false"/>
  7.         <attribute attributeId="Target" value="_blank" isKey="false"/>
  8.       </attributes>
  9.     </url>

Am I missing something ?

I copied/paste your code in my navigation model and it opens in a new window...
Can you try creating a new webcenter portal application and test it. It might be something in your application.
Are you using jquery that might rewrite some of the targets dynamically?

Indeed, it works in another project... I'm not using JQuery, and I will need to find out what's going on now ... :/

Anyway, thanks for the support and this great blog !

HI Yannick,

I am trying to open a new window from the navigation menu.
I am trying to replicate the same issue that was mentioned in the above post.
I am getting this below error message when I copied the above code and pasted into my navigation.
can you please point me in the correct direction.
Thank you very much in advacne!

Error:
'<' cannot appear in attribute value.

BAsed upon that, I think you have a syntax error in your navigation model. Can you check the source of your navigation model to see if its valid.

Hi,

Below is the source code that I am using,
Can you please let me know what are the changes tha tI need to make inorder to open new window.
I tried to replace on of the child nodes with the code you had above and it is throwing me the syntax error.
Your help is greatly appreciated!

*************************

<?xml version='1.0' encoding='UTF-8'?>

/oracle/webcenter/siteresources/scopedMD/s98b94daa_b4c9_4d33_8a50_0bc430ce3c59/siteTemplate/gsr9385d280_bb56_4ae3_88fb_f58803b6b255/Template.jspx

/oracle/webcenter/siteresources/scopedMD/s98b94daa_b4c9_4d33_8a50_0bc430ce3c59/siteTemplate/gsr9385d280_bb56_4ae3_88fb_f58803b6b255/Template.jspx

*********************************

I notice that you are using oracle.webcenter.portalframework.sitestructure.rc.LinkResourceFactory as the factory class instead of
oracle.webcenter.portalframework.sitestructure.rc.UrlResourceFactory

When you add a link to the navigation model you should select External Link from the type and not other. This way when you select redirect and put the _blank in the target, it will open in a new window.

Hi yannick,

Thank you very much!
We found the solution for this issue.
we changed the Page template and it is working now!

Hi,

How can i accomplish a partial page refresh i select a menu option? I don't want to refresh de whole page, just the template's content area.

Regards.

Don't think that will be possible to be honnest.

Not even using the target frame property and framesets?

Not even then. Maybe...
In order to make this work you have to create a parent template and child template. The parent template is the template used for the surrounding page (with the navigation) and the child template is the template you should use for the pages inside the frame. The child template will not show any navigation becuase it will be shown by the parent.

I have to say that this is a very bad practice and not recommended. In the past (Web 1.0) Iframes were used for easy navigation but today Iframes are really something to avoid or only used to embed things like youtube.

Hi Marco,

In your page template, instead of tag try to use and add the action="pprnav".
That should work!

Hi,

Can you please supply a more detailed suggestion?

Thank you very much for your reply.
I find it very strange that this trivial behavior in most of the modern sites is not possible with webcenter.

Regards.

Hi Yannick,

You say in the post in the part related to page query that "You can also specify the page template and style that need to be used for those pages".

It seems to me the page template and page style parameters are used to filter the queried pages, not to apply it on the pages when are rendered as a result of navigation from the links generated by the page query model.

Best regards,

Adrian

Hi Yannick,

I have a requirement to implement the localization using database table. All the information should be populated from tables. No resource bundle has to be used. Can you please can how to implement using oracle webcenter navigation model. Can you please one small example.

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer