Creating and Using Dependent Choice Lists

March 18, 2015

By: Dwayne Parkinson – Solution Architect

Creating and Using Dependent Choice Lists

In WebCenter Content there is a nifty little feature that gives you the ability to build something called a Dependent Choice List. A Dependent Choice List (or DCL if you like three letter acronyms) is a special metadata configuration where the values in one metadata field depend on the selected value in some other field. An easy example a region and country; where the list of available countries is limited based on which global region you select. Let’s dive right in and create our own Region and Country DCL so you can see how they work.

Step 1: Create Two Metadata Fields

All of the work to create a DCL will be done in the Configuration Manager. Select the Administration menu, then start the Admin Applets. Finally, invoke the Configuration Manager tool and select the Information Fields tab.

Create a field for Region and a field for Country by clicking on the Add button.

1

Fill in the name of the new field and then click on OK.

2

On the detail screen for your new Region field just accept the defaults for now by clicking OK. Do the same for Country. You will notice that once the new fields are added the Update Database Design button is enabled.

3

Click that button to add your new fields to the database.

Step 2: Create a Region Table

Now that we’ve got a field for Region let’s create a table to hold our regions. Still from within the Configuration Manager, select the Tables tab and click add. Create a region table with an ID and a Region Name as shown below.

4

Step 3: Create a Country Table

While still in the Tables tab, click Add again and create a table to hold our Countries as shown below.

5

There’s one very important trick to this table. You must have a column which will store the region ID that is associated with each country. In the table above, ID is the Country ID and RegionID is the ID of the region that is associated to the country.

Step 4: Add a Region View

In order to add data to our tables we will need to create a view over them. Select the Views tab from within the Configuration Manager and then choose the Add button to add a view for our Regions table. Select the Regions table from the list and click on Next as shown below.

6

Add both the ID and RegionName columns from our table to the view and click on Finish as shown below.

7

Finally, give our view a name of vRegion and be sure to set the Visible Column to RegionName as shown below.

8

Step 5: Add a Country View

Everyone loves a country view right? Let’s add one following the same procedure we did with Regions. Click the Add button from the Views tab and select the Country table as shown below.   Then click Next.

9

Now we’ll add all three columns of the Country table to our view as shown below.

10

We’ll name this view vCountry and then be sure to set the Visible Column to CountryName as shown below.

11

Step 6: Create a Relationship

In order for the two tables to know about each other, we must create a relationship. Still within the Configuration Manager, select the Relationships tab and click Add. Then create the relationship as shown below.

12

 

To make our lives easier we’ll name the relationship exactly what it is; RegionToCountry. The Parent Info contains the table that holds our Parent table. In this case Region, since countries are contained within regions (i.e. United States is in the North America and Caribbean region). The second drop down in the Parent Info is used to designate the column in that table that will be used to tie the Child table.

For the Child Info we select the Country table as our Child table. Now we’re going to select the RegionID from the Country table as the column which should match the ID field in the Parent Info section. That effectively links the two tables together and establishes a relationship.

Step 6: Update the Region Metadata Field

With our tables, views and relationships in place, we can now go back and finish configuring the Region metadata field. Still from within the Configuration Manager, select the Information Fields tab and then highlight the Region field and click Edit. On the Edit screen, check the box to Enable Option List and then click the Configure button.

13

As shown below, check the box next to Use view and select the vRegion view.

14

Click OK to complete the configuration. The Region metadata field will now get values directly from our region view.

Step 7: Update the Country Metadata Field

Just as we did with Region, highlight the Country field, click edit, check the box to Enable Option List and click the Configure button. Check the Use View checkbox and select vCountry as the view as shown below.

15

We have one very important last step to complete this configuration. We have to tell the Country field that it is dependent on the Region field. To do that, enable the Dependent Field checkbox and select the Region metadata field.

The last step is to tell the Country field how it depends on the Region field. This is done by setting the relationship. Select our RegionToCountry relationship and click OK.

Step 8: Add Some Data

To make everything work, we have to add data to our tables. From within Configuration Manager, click on the Views tab, highlight the vRegion view and then click the Edit Values button (not the Edit button).

16

On the next screen click the Add button to add ID’s and values to the Regions as shown below.

17

Once the Regions have been entered, go ahead and enter some countries. Select the vCountry view and click Edit Values just as you did with Regions. Then enter some countries as shown below.

18

It’s very important that the RegionID is entered correctly in your vCountry view or your dependent choice list won’t work correctly.

Step 9: Test Your DCL

Now it’s time to test. Close the Configuration Manager and then press CTRL + F5 so your browser will refresh the page and clear out the cache. This is important because drop down menu values are often cached. If you don’t clear the cache you will make changes in the Configuration Manager and wonder why you’re not seeing them on the web page.

If you select New Check-In you should see a Region metadata field with data that is contained in the vRegions view.

19

When you select one of the options, you should see that the options for the Countries drop down changes to match only those countries that are within the Region you selected.

20

DCL Chaining

You can set up many levels of DCL’s in WebCenter Content so field 1 depends on field 2 which depends on field 3 which depends on field 4. As you add levels you add complexity, but the system is capable of handling it if those pesky humans can just manage to keep the data correct.

Multi Select Limitations

As nifty as WebCenter Content DCL’s are they have a couple of important limitations. The first limitation is that DCL’s don’t work as expected if the Parent field is a “multi-select” list. In other words, if I wanted to choose Africa and Asia as my regions and then expect my dependent drop down of Countries to include all countries from both Africa and Asia… that’s not going to work. The dependent list will show only countries for the region that is currently in the drop down selector tool. It will not show any countries for the previously selected regions in the multi-select list to the right of Regions field.

Interestingly, you can have the Child field be a multi-select list. Using our example, perhaps the business wants to be able to select multiple countries from anywhere in the world, but they don’t want a drop down with 300 countries. Using the DCL we created above, the user could select the region, select a country, change the region, select another country and change the region again to select a third country. Now they’ve selected three countries from three different regions without having to scroll through hundreds of countries.

Complex Relationship Limitations

The other significant limitation to WebCenter Content DCL’s is that they’re not meant for complex relationships. While you can “fake” a couple of things, they simply aren’t meant for complex logic. For example, if we had two independent fields of Color and Texture and we wanted a third field to show different values for Blue Smooth things, Blue Rough things, Red Smooth things and Red Rough things.   That sort of logic quickly goes beyond the intended use of a DCL.

Summary

The WebCenter Content Dependent Choice List (DCL) is a fantastic tool for representing simple relationships between metadata fields. It makes the user experience easier and helps to maintain data integrity. Hopefully the example above will give you everything you need to deliver some very nice features to your business. If you find that the limitations of DCL’s are cropping up in your business, please contact TEAM Informatics. We’ve got some custom solutions that we can use to deliver the functionality you need to overcome DCL limitations and add tremendous value to the business.

Want to meet us at Collaborate 15 in Vegas to talk about your WebCenter needs? Fill out the contact form and we will work with you to arrange a meeting!


Friendly URLs in WebCenter Sites

March 4, 2015

By: Darek Blankenbuhler – Application Consultant

Having friendlier, cleaner looking URLs has always been a challenge in WCS. In the past it would require a developer to write a Java class. Once the class had been written it would need to be configured and deployed on every instance of WebCenter Sites in your setup. If you wanted a second assembler for another asset type or blobs that would require even more configuration and coding to work properly. Suffice it to say that in the past making a friendlier URL was a difficult task especially if friendly URLs were not set up during the initial build. This has all changed with the advent of WebCenter Sites 11.1.1.8. Friendly URLs have been built right into the Advanced Interface and no longer require as much specialized knowledge. An administrator can find this new feature in the Admin tab under Asset Types inside the Asset that is being configured.

Fr1

Today I want to set up a new pattern for the Page Asset type. As you can see there are no URL patterns set for pages yet. So, I will go ahead and click Add New, and I will be brought to the following page:

Fr2

Now I am ready to start creating my first URL pattern. As you can see I can be as generic or as specific as I want to be. No longer do I have to worry about writing my templates and URL assembler to work together to render the final product. The system will go ahead and take care of that for me. The URL is comprised of the different attribute values available to the asset. In the case that the Subtype is set to “Any” I will only have access to the default basic attributes that come along with every asset type that is created. By selecting a subtype I can now use attributes that are a part of that asset type in the URL.

Fr3

The primary downside to this is the fact that now the “Standard” subtype will have its own pattern. If I only set up the “Standard Page” URL only page assets with the subtype “Standard” will have a friendly URL. It is a good idea to set up a pattern for “Any” type as before going live. Last we will put it all together with the pattern itself. The pattern uses the Java Expression Language to build the URL. As you can see I can put as much or as little information in the URL as I want too. When I have finished configuring the URL, at the bottom of the page I can get a preview URL for existing pages.

fr4

This way I can test to make sure my URLs are going to come out clean looking before I implement the new URLs. Then I can save and I have completed building the URLs. URL Patterns are stored as a part of the asset type. Which means that all I have to do is publish the asset type to get the URL pattern to be pushed between systems – this tool is kept as simple as possible.

All in all, the new URL pattern tool is a powerful and easy to use tool and a welcome addition to WebCenter Sites. Whether it is the ability to generate URLs using any information in the asset or the ability to make the URL assembler as specific as we want. URL assemblers are now much easier to make and implement.

Want to meet us at Collaborate 15 in Vegas to talk about your WebCenter needs? Fill out the contact form and we will work with you to arrange a meeting!


Easy Mass Metadata Updates In WebCenter Content

October 2, 2014

By: Dwayne Parkinson – Solution Architect

*This blog is informational in nature on an approach to mass updating WebCenter Content. Because each WebCenter implementation is unique in nature, it is not intended as a “how to” guide and any use of this information is at your own discretion.

If I had $100,000 for every time someone wanted to perform a mass update in WebCenter Content, I’d be a very wealthy man. The request doesn’t happen enough for me to lower the price, but it’s still a fairly regular request so I think it’s worth knowing how to answer the question: “How can I update all of these content items with a new metadata value?” Fortunately WebCenter Content offers a number of ways to do this.

Before we dive into the details I’ll just state the obvious disclaimer. Performing mass updates to large groups of content can have some unintended consequences so be careful!

Records Management Global Update

Surprise!!! There’s an incredibly easy to use feature called “Global Update” and as the name suggests, it allows you to perform global updates to metadata. The only caveat is that you must have WebCenter Content: Records Management enabled to use this feature. From the Records menu select Global Updates. From there you will see three options that you can update globally: Retention Categories, Records Folders and <insert heavenly choir of angels singing here> Content!

Untitled

When you select the Content option you will see the Global Updates: Content screen.

Untitled2

As shown above, you can define a query to select the content you want using standard metadata fields or free text searching and then define the metadata field to update. Notice the Preview option allows you to see the results of your query to insure you are updating only the content you want to update.

For reasons unknown to me, this incredibly useful option is hidden by default from the RM admin user. You will need to enable this feature by doing the following:

1) Login in as weblogic or Admin user.

2) Navigate to Administration > Admin Applets

3) Select the User Admin Applet

4) In the User Admin Applet > select the top menu “Security” option and then select the “Permission by Role” option.

5) In The “Permisions by Role” section, Highlight  the RMadmin Role and then select “Edit RMA Rights” option.

6) Select the “Admin” Tab from the “Edit RMA rights” section, then check the “No Security” option and select OK to save.

7) Exit out of the applet, and navigate to “Records “ and choose “Global Updates” to confirm this feature has been enabled.

 

Folder Metadata Propagation

For content that is stored in folders there is an exceptionally easy way to perform a mass update of metadata values. However, it’s important to know that there are two versions of folders implemented in WebCenter Content and as a best practice you have either one or the other, not both.

Let’s start with the “old” version of folders which is called Folders_g. If you click on the Browse Content menu and you see an option for Contribution Folders, then you have Folders_g.

Untitled3

To perform a mass metadata update for all content items in a Folders_g folder you browse to the folder containing the content you want to update. At that point you click on the Information icon.

Untitled4

On the next screen you select the Actions menu and choose Update to update the metadata for the folder.

Untitled5

Once you’ve updated the metadata from the folder, you still have one more step. Select the Actions menu again and choose Propagate. This will propagate the metadata change to all content items in that folder.

If you have the new version of folders, called Framework Folders, when you click on the Browse Content menu you will see an option that says Folders.

Untitled6

As with Folders_G you navigate to the folder which contains the items you want to update. Once you’ve selected your folder choose the Edit menu and update the metadata values for the folder.

Untitled7

After the metadata for the folder has been updated, select the Edit menu again and choose Propagate. This will update all of the content items in the folder with the new metadata value.

Yes, I know what you’re thinking. Folder propagation is great but it leads to an obvious question: What if not everything in the folder needs to be updated or your content is spread across hundreds of folders?

Query Folder Propagation

With the advent of Framework Folders, Oracle invented a new gizmo called a Query Folder. A Query Folder is a folder which contains the results of a query. To add a Query Folder you simply browse to any folder in your system that you want to contain the Query Folder, click the Add button and choose New Query Folder.

Untitled8 copy

The Query Folder creation screen allows you to use Full-Text Search or Query Builder options to determine which content items should be included in the Query Folder.

Untitled8

Once created, you will see a new Query Folder on your system and it will have a different icon that is a folder with a magnifying glass rather than just a folder.

Untitled10

This new Query Folder contains call content items that match the query defined when the folder was created. With the new folder in place you can use the Folder Propagation techniques above to update all of the content items in your Query Folder. This two step process of creating a Query Folder containing just the content items you want plus folder propagation, gives you the ability to have fine grained control over your mass update.

Conclusion

As you might expect, there are a number of hard and complex ways to perform mass metadata updates as well, but with the tools above, making mass metadata updates can be quick and easy.

If you have questions about WebCenter and want to talk to someone at TEAM, contact us today!