You are here

WebCenter Portal Tutorial Part 7: Integrating Discussions and Link service

By now you should be familiar with creating pages, managing the navigation, integrating content and so on.

When we talk about an Enterprise 2.0 portal, it's not just about content and having the ability to create pages at runtime. One of the important aspects of an Enterprise 2.0 portal is allowing users to collaborate with each other. This can be done by writing a wiki, connecting to each other and having discussion forums available.

In the next few sections we will be adding discussion services to our portal. I will show you how you can use the Jive software to create categories so you can manage the forums and how we manage them in the portal.

We will also use the link service from WebCenter which will allow us to link documents to existing discussions. By doing so, we can create a direct link from the details page of a training to the discussion about that training. This gives a better user experience for the user and provides a much more intuitive interface.

In order for you to complete this tutorial you will have to have the discussion server running which is part of the WC_Collaboration managed server. Just start that managed server and the discussion software will be up and running.

You can download the ViePortal as it should be by the beginning of this tutorial from here.

Managing forum categories

Within the Jive forum software you can manage different forums in categories. By default a Root category has been created where WebCenter will put its new forums in.

However if you want to put more structure in your forums, you can do so by adding additional categories. The downside to this is that WebCenter Portal will not display the categories. You also cannot manage these categories inside the Portal. Therefore I recommend using categories as separations for different applications. If you have multiple applications or sections on your portal that have different forums, just put them in different categories.

In order to manage these categories you have to login to the Jive admin console which can be found on the following URL: http://localhost:8890/owc_discussions/admin
That's the case if you have a default WebCenter installation.

The login and password is the same as the login and password of your WebLogic console. In my case that's weblogic/weblogic1

Once you are logged in you see the Jive console where you can configure everything you want. Notice that most of the things here do not apply to WebCenter so it's not that important to focus on the Jive admin console. The important part of this console is the Content section

When you haven't been using WebCenter Spaces or discussion before the content should be empty as shown in this screenshot:

When we add forums in WebCenter by using the default taskflow, we have to provide a category ID. If we don't provide that ID it will use the Root category.

In our case we want to have things a little more organized so we are creating a new Sub Category so we can put all our VIE related forums there.

So let's click on the Create New Sub-Category button and name it VIE Portal as shown in the screenshot:

Click on the Create Category button.

In the Categories list you should see VIE Portal as the sub-category of the Root category. By selecting it you will go the manage page of the VIE Portal category.

If you notice in your browser, you will see a URL similar to this:

The URL has the cat parameter. In my case the VIE Portal category is category 9. If you have never used the discussions, the chance is that you will see 2. That's the ID we need in WebCenter Portal to identify our category so make a note of it.

We won't be managing the forums in the Jive console because that's something we can do from within WebCenter.

Creating a connection to the Discussion server

Now that we have created a category to organize our forums in, we need to create a connection to the discussion server from within our application.

If JDeveloper isn't open yet, open it and open the VIE Portal application. If you haven't done the previous chapters, you can download the starting point from here.

In the Application Resources right click on the Connections folder and select Discussion Forum as the connection type.

Specify a name and make sure the Set As Default Connection checkbox is selected.

Press Next

In this screen we have to provide the settings for the discussion connection. The URL is the URL to the discussion software. In a default installation this is http://localhost:8890/owc_discussions

Also provide the name of the admin user which is weblogic.

That's it. Now we can press the Finish button.

Creating the Discussion page

We haven't created a page suitable for discussions yet so we are going to do this now.

Create a new JSF page that uses the viePortal template:

Also don't forget to add it to the page hierarchy and navigation model:

Open up the page in JDeveloper.

Drag and drop the Discussion Forums taskflow on top of the content facet:

This will bring up the Discussion Forum input parameter popup with following parameters:

  • categoryId: Specify the ID of the category that we have created in the beginning. In my case this is 9. This means that the taskflow will only display forums created in that category.
  • forumId: if this parameter is provided, the taskflow will only display threads available in the forum. In our case we want to have a full listing of available forums so we leave this empty
  • showRecursiveForums: Suppose that Vie Portal has sub-categories in the Jive software and we want to display all of the forums for all of the its sub-categories than we have to set this to true. Notice that when you set it to true, you will not see a distinction between forums from a sub-category. There will be no tree like component. It will just display a listing of the forums!

That's about it. Let's run the portal to see the result

Managing forums

When we go to the forums page you will get a message saying that there were no forums found. That's normal because we haven't created any.

Although we could create them in Jive itself, we are going to manage them in WebCenter so let's login as the administrator and go the forum page again.

Now you get the same message but we also have a button to create a forum because we have sufficient rights to do so:

Let's create forum where people can ask questions so let's call it the Support forum:

Replicate following structure for forums:

That's basically it. Now people can start creating topics inside these forums.

Creating a connection to the Link Service

In this part of the tutorial we will be using the link service to link from a specific training to a discussion so people can easily navigate from the training to that discussion.

The link service doesn't use any specific server. Its data is stored in the WebCenter database so before we can use the link service we have to create a connection to the WebCenter database. This should have been created when you ran the RCU during the installation of WebCenter.

In the Application resources create a Database connection in the connections folder and specify the username and password for your WebCenter database. If you have installed it locally, the parameters should be similar to mine:

When you create the connection, JDeveloper will ask you if you want to associate this connection to the WebCenter schema, activity schema or neither. In our case we have to select WebCenterDS:

Preparing the Discussions connection for the Link service

This additional step is required because we have organized our discussions in a not so out-of-the-box way. By default WebCenter expects all of its forums to be in the same root category and no sub-category. Because we haven't any forum directly under the Root category this could lead to problems with the link service because when we want to link to a discussion, it will look for forums under the root.

Because of this, we have to tell our discussion connection what the default categoryId is. This way the link service will notice it and use that category as the default one instead of the root.

This configuration can be done by editing the already created discussion connection in the application resources.

Right click on the vieDiscussion connection and select Properties. This opens the property window for the discussion connection.

In the Additional Properties section we have to specify the categoryId. The parameter we have to add is
application.root.category.id

Now we are ready to put the link service on our page.

Adding the Link taskflow to a page

Because we are going to add the links to the details of a training we have to edit the trainingDetail.jspx page. Currently that page only has the content presenter that takes an ID from URL to display a specific item from UCM.

We will be using the same parameter to bind the link taskflow to the training.

From the Resource Palette drop the Links taskflow above the region for the Content Presenter. The links taskflows has following parameters:

  • serviceId: this is a unique identifier that should identifies your application. You are free to choose the value but it groups together links. In our case it makes sense to name it viePortal
  • resourceId: this is the ID for the resource. This is a free field and has no direct link to the resource you link to. It is just used in conjunction with the serviceId to generate a unique identifier to bind links. In our case we want to bind this to the URL parameter so we are going to use #{param.training_id}
  • resourceName is the name of the resource. We specify the same value as the resourceId

Other parameters can be left blank:

That should be it. Let's run the portal and take a look at the result.

When you go to the course page and click on the Read More link you will see the details page of a course. You will also see the Links section on top:

When you click on Link to New and select Discussion you are able to create a new discussion by selecting the forum in the dropdown list:

Notice that the Forum dropdown list gets populated by the forums from the sub-category we created in the beginning. This is all because of the additional property we added in the discussion connection.

Once the discussion has been created, you will be able to see it in the links:

If we open a different training we would see no linked items because we use the ID of the document for the resourceId of the links so each training has their own set of links.

This concludes part 7 of the tutorial.

Hope you liked it so far. If you have any questions, please let me know in the comments.

You can download the finished ViePortal from this section here. Notice that if you want to use it, you might need to change the categoryId on the taskflows and connection properties!

Comments

"The link service doesn't use any specific server. Its data is stored in the WebCenter database so before we can use the link service we have to create a connection to the WebCenter database. " What is it doing here exactly. How things are working behind scenes. Please explain.

It's not really difficult. For the discussion server you need to have the WC_Collaboration server started because it is using the jive software.
The link service however is just using the database. It does not use any application deployed on a server.
Creating links from a document to a discussion is just a record in a table so before you can use it, you need to create the tell the application which database connection connects to the WebCenter schema because that contains the tables for storing the links.

I tried to create the connection database as you described, but when I perform the test connection I receive following error

Test failed: IO Error: The Network Adapter could not establish the connection

Any suggestion?

Is your collaboration server up and running?

hi
i have created a sample link service taskflow and used the database connection.
the problem is that it is only showing the link to new option but not the link to existing. i have used the link details button and link dialog on the page.
looking for ur reply

Hi Yannick,

Great Post.

My setup consists of the Discussion Server running on a VM and JDeveloper running on my local desktop. When creating the connection I used the VM's IP address. The connection test failed with the message 'Failed to verify connection'. I am still able to carry on, run the application and create a forum.

Any ideas why JDeveloper is not able to verify the connection?

Thanks

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer