Showing posts with label spaces. Show all posts
Showing posts with label spaces. Show all posts

Tuesday, October 9, 2012

How to get the source codes of Build-In WebCenter Spaces Task Flows


The post is originally posted here.

Since WebCenter PS5, Oracle brings lots of standard task flows inside WebCenter Spaces. Some of them are already registered within the resource catalog and ready to use, most of them are also ready but you need to add them to the resource catalog first for business users to utilize. But from a developer standpoint, you may be interested in reviewing the source codes of the standard task flow shipped with Oracle WebCenter Spaces. Today I will show you how to locate the EAR or WAR file and take the advantages of build-in task flows.
After the Oracle WebCenter Spaces is installed, go to the following directory and you will find the relevant EAR and WAR files are already installed. In my case, it’s WebCenter PS5 but it’s applicable to other 11g releases.
$FMW_HOME/<WebCenter Instance Name>/webcenter/modules/oracle.webcenter.spaces_11.1.1











The one we are interested is the one at the bottom ‘oracle.webcenter.spaces.webapp.war’ file. You can ftp the file from the server to your local directory and extract it. You will find there are two subfolders in the file – “META-INF” and “WEB-INF”. If you are familiar with WebCenter/ADF development/deployment, those two folders should not be strange. The “META-INF” folder contains configuration files for applications, extensions, class loaders and services. The “WEB-INF” contains the static content that could be referenced and defined in some configuration files in META-INF folder for libraries pre-loading. So there is a folder ‘lib’ residing in WEB-INF and contains the JAR files that is pre-loaded when the server starts and they are the libraries that contains the build-in task flows. Here is the snapshot of the lib directory:











Again, it contains several JAR files that aggregate different set of resources in terms of their modules of functionalities and scope of use. We will look at the one at the bottom “spaces-web” JAR file. In this jar file, you will find all kinds of build-in task flows that are used internally in standard WebCenter Spaces resources. For example, in WebCenter Spaces, the default page template is a template called “Top Navigation”. In the template files, there are several regions being used are those task flows, which can be found here. Take the navigation region as an example, you could find the navigation task flow in this package ‘oracle.webcenter.webcenterapp.view.taskflows.navigation’. Here is the screenshot of the directory you can find about navigation task flows:
















In the same ‘spaces-web’ jar file, you could find:
  • All the templates jspx file and their page definition files
  • Standard task flows that you can access from resource catalog
  • Java Beans that manage/support the transactions for the task flows and page fragments

If you want to learn a certain functionality that how Oracle WebCenter build or just find out the source codes that behind the scene, you can find all the relevant info by this means.



Saturday, September 29, 2012

Skin Analysis on WebCenter Spaces Page Template

Oracle WebCenter Spaces provides framework and resources that ready for business users to use after installation and configurations. But we all know the default look and feel of the site is really not appealing. I’ve seen prospective customers direct eyes on the WebCenter great features but step back because of the look and feel. I will have to confirm them that the site can be skinned and customized to whatever you want the site to look like. And that’s true, there are indeed great looking sites out there using sophisticated CSS and JavaScript (e.g. JQuery). Those sites are mostly designed from a HTML markup perspective and mixed with ADF components, which could make the source codes of the pages hard to read and maintain. Hard to read? Who cares, as long as it works for what the customer wants. But one of the drawbacks I’ve seen and it’s worthy to mention is it breaks the partial page rendering because of the mix of html and ADF components. Most of the pretty WebCenter public sites so far don't have the PPR feature - every navigation is a full page refresh - which doesn't surprise me (If anyone knows any public sites with PPR enabled, please let me know). Therefore, I will do a few analyses on the standard WebCenter Space page template and make a few changes on the CSS file to improve the look and feel of the WebCenter Spaces site. It might not be good enough for your needs, but should be a good start to begin with.

The default page template widely used in WebCenter Spaces is the one called “Top Navigation”. Please note there is another version of top navigation but stretchable. I will take the non-stretchable one to present as it is the default one being used. Here is the screenshot of it using the default top navigation page template. 

Page Structure

I’ve marked four regions which will represent on the page definition later on. To grab the source codes for the page template, just go to the administration section -> resources, from the ‘page template’ group, make a copy of the top navigation template and rename it whatever you like, from the edit link, you will be able to see the ‘Edit Source’ link enabled and that’s how you can grab the source code easy and quick. You can paste the source codes into JDeveloper which will help us to understand the page template structure. Here is the screenshot of the page structure:

As you can see, the page template starts with a panelGroupLayout in a scroll layout, and this is how this template is a flow layout template (fixed width of the page). For a stretchable layout, you will see it starts with the ‘panel stretch layout’.

Next you will find two Spaces tags <wcdc> and we will skip that.

Next is a decorative box component and it’s the template header part and the A region in the first image. This region contains site logo, a search inputbox region and several command/go links. You are definitely free to customize those components if you like. One thing you may consider to do is to upload your site logo to content server and put the image url to an ADF image component for the site logo. Decorative box comes with two facets: center and top. By default, the top facet doesn’t have any background (white color), but the center has some light gray background on the top edge of it. See the following:


Besides, decorative box provides an additional property for styling call “theme”.

Tips: About Theme

The purpose of themes is to provide a consistent look and feel across multiple components for a portion of a page. A common usage for themes is in a page template where certain areas have a distinct look. For example, a page may have a branding area at the top with a dark background and light text, a navigation component with a lighter background, and a main content area with a light background.
A component that sets a theme exposes that theme to its child components and therefore the theme is inherited. Themes can be set (started or changed) by the following components:

·         af:document
·         af:decorativeBox
·         af:panelStretchLayout
·         af:panelGroupLayout

By definition, themes are cascaded down through all child components. All HTML elements that are rendered by a rich component within a themed component will have the theme added to its list of style classes. Themes are not compatible with tonal styles and therefore only one method can be used per page (themes or tonal styles). A blank theme will remove the current theme, and a value of "inherit", null or not setting a theme will use the current theme. Skins are the sources of the themes. Some skins may have no themed definitions. Suggested theme names include "dark", "medium", "light", and "default".

Besides decorative box, Spaces have additional theme styling, such as “webcenter” is applied to the decorative box by default. If you want to have your own background and styling, I suggest avoiding using the decorative box simply by dragging its direct child out of the decorative box. In this case it’s ‘panel border layout’. Just drag the panel border layout out of the decorative box and comment it. You can apply your styling directly on the panel border layout.

Next component is the navigation panel region which is marked as ‘B’. The region is referring a build-in navigation task flow. To examine the source codes of it, please refer to another blog I posted here.

Next part is the content which is just a facet in a page template. It’s marked as ‘C’.

The last part is the ‘panel border layout’ component again wrapping the footer of the page template. It’s marked as ‘D’.

Styling

Spaces template uses style class for styling purpose, which comes with “WC” as its prefix. Now I will list all the style class that are used in the top navigation template by what effect it could take for styling in the page.

Here I am going to change the background to white:
/*override the background*/
.WCSiteTemplateBackground{
    background: #FFFFFF !important;
}

Change the navigation background to dark gray color:
/*change the styling of the page template top navigation*/
.WCSiteTemplateTopNavPanel {
    background: #666666 !important;
}

To change the navigation links text color to white:
af|commandMenuItem.WCSiteTemplateTopNavPanel::bar-item-text {
    color: #FFFFFF !important;
}

You can add hover effect if you want by defining:
af|commandMenuItem.WCSiteTemplateTopNavPanel::bar-item-text:hover {}


Define the background of the navigation link when it’s selected:
/*the styling when tab is selected*/
.WCSiteTemplateTopNavPanelSelected {
    background: #FF8000 !important;
}

You can define the text color to change when it’s selected by:
af|commandMenuItem.WCSiteTemplateTopNavPanelSelected::bar-item-text {}

Define the navigation link to change color when hovering:
/*the styling when mouse hover*/
.WCSiteTemplateTopNavPanel:highlighted {
    background: #7A7A7A !important;
}

Change the footer background:
/*change the background of the page template footer*/
.WCSiteTemplateFooter {
    background: #666666 !important;
}

Change the header and footer font color:
/*change the font color on the template header*/
.x106, .x107 {
    color: #FFFFFF !important;
    font-weight: bold !important;
}

By the above few CSS changes and some minor change on the template, you will find your pages could look like this:



Is it nice and neat? Besides, you won’t have your ppr navigation broken. Enjoy!

Tuesday, January 4, 2011

WCI vs Webcenter Spaces

This post will describe some of the differences between Webcenter Interaction and Webcenter Spaces. It is meant to be used as an informal guide to the choices available within Webcenter Suite and future paths for those who may already be invested in the Webcenter Interaction product. Before we get too much further we should first define some of the products and terms used in connection with Webcenter Suite.

Webcenter Suite is an enterprise portal platform made up of many products including 3 portal products, Webcenter services and the Webcenter development framework. Also included is limited-use licensing for Universal Content Management, Secure Enterprise Search and Presence and Communications Services.

Webcenter Interaction refers to the cross-platform portal product and services previously known as Plumtree and BEA's Aqualogic Interaction. It has portal versions native to both .net and Java.

Webcenter Services is a set of Enterprise ready social services that can be integrated with existing portals as well as custom applications. It includes products for wikis, blogs, RSS, activity streams, discussions, tags and links.

Webcenter Spaces is the portal application that provides the UI and administration layer to the products that make up Webcenter Suite. It has out of the box features that closely match the features provided with Webcenter Interaction’s portal. It is the product with the highest level of integration to Webcenter Services, Fusion Middleware and other Oracle products.

So what are the differences?

To understand the differences it is good to know the history of the products. Webcenter Interaction grew up as a pure play portal product. This meant that the product was originally meant to be a top layer portal product that did not care too much about the backing technologies that needed to be surfaced. That being said, many of WCI’s components were built using Java and only the core portal product was 'jumped' to .net using a java to .net conversion technology. Also, most of WCI’s add-on products and services are black box java apps that run on packaged tomcat or JBoss app servers. Development against WCI can be done using your IDE of choice depending on the technology you are using (.net,java,php,rails or any html emitting technology) and the functionality or product you are surfacing. An SDK and API web services are used for writing portlets and composite applications that take advantage of portal services and intrinsic functionality. Exposing and consuming JSR 168 and WSRP 1.0 compliant portlets is also possible with WCI.

Webcenter Spaces, on the other hand is a pure java based application that is supported for deployment to Weblogic Application Server. It was built to be the presentation layer to the Fusion Middleware product line. Customizing and developing for Spaces involves the use of Oracle's Jdeveloper IDE. You can use another Java IDE but that would be painful. Jdeveloper has deep integration not only with the Webcenter stack but with ADF development and fusion middleware overall. The Webcenter framework used with Spaces allows for consumption of JSR 168 as well as WSRP 1 and 2 compliant portlets. Additionally, ADF taskflows can be exposed as JSR 168 portlets using the portlet bridge available as part of the framework.

Which do I go with?

If you are in the process of deciding on a portal suite and framework be assured that the Webcenter Suite provides everything you need to stand up an enterprise strength portal with many out of the box features. Enterprise 2.0 functions come out of the box for both Spaces and WCI. For WCI the integration levels range from simple installation/configuration to custom integration work or even the dreaded iframe. If you have not yet decided on the portal product to use also be assured that Webcenter Interaction and Webcenter Spaces both provide enterprise strength portal functionality and customization capabilities.

With the 11g release of Spaces there is no longer much that Spaces lacks in comparison with WCI. Both products are fully supported by Oracle. Both portal products have or will have 11g versions and future versions/enhancements. Going forward, though, pieces of WCI functionality will be replaced by Webcenter services and other Oracle solutions as consolidation and convergence happens with the Webcenter products and shared services. This may be the biggest reason to choose Spaces as the portal of choice if you are not invested in either portal yet and if you are not absolutely tied to the .net development environment. Even if your preference is to develop using .net you can wrap .net apps with WSRP 2.0 and maintain functionality within Spaces.

My experience has been that most companies have a blend of technologies in the enterprise and either have teams that know both technologies or have separate teams to handle .net or java development. In either of these two situations you might be better served to go with Webcenter Spaces as your choice of portal product since integration is tighter with the other Webcenter pieces and Spaces will only be enhanced while the WCI product may have some functionality replaced with newer Oracle products or services.

What if you are already invested in Webcenter Interaction?

If you are already on the Webcenter Interaction product stack you have your choice of paths. The decision on whether to move to Webcenter Spaces is dependent on a longer list of decision points than we can discuss here. So what kinds of paths might you take to transition to Spaces from Webcenter Interaction portal?

Stay with the product for the foreseeable future. If you are heavily invested in the WCI product set and are only interested in modest changes for the foreseeable future you can certainly stay with WCI. You can augment functionality with Webcenter Services and integration with UCM. These integrations are not yet mature but they will be soon.

Start a piecemeal migration. You can stay with the core portal product and start smaller migrations of functionality. For example, you can migrate from Publisher to UCM or start migrating portlets or apps to be exposed via JSR 168 or WSRP and surfaced through Spaces.

Yank the band-aid and start a full migration effort. Knowing that the Spaces product is fairly mature should help if you decide to make the full blown migration effort. Depending on the size of your user base, app/portlet inventory and points of integration a migration effort might take a few months to a year or more. Just remember that the effort will put you on the latest version of Spaces and in the middle of the best of breed products and services that make up the Webcenter Suite offering.

In future posts we will take a look at specific mappings of functionality between WCI and Webcenter Spaces.