Posts Tagged ‘Fatwire’


We have seen the introduction of the CSDT Command Line Tools provided by Oracle WebCenter Sites / Fatwire in my last article here.

 EXPORT USING CSDT COMMAND LINE TOOLS:

Before seeing how to use the csdt command line tools, we should know what is meant by export first.

Export: As the name itself is suggesting, it is the process of getting the assets from the content server. Here, assets means any thing inside the Content Server, right from start menus to templates. Everything. So we can export everything using this process.

What is the use of this export?

As said above, what is your main motto? To Export and to import the assets from one server instance to another server instance. So, to move the assets from one instance to the other we need the exported data (assets). That is what we are going to do here.

Ok..How to use it?

Lets come to the point of how to use the export process using CSDT command line tools.

The syntax of csdt command line is as follows.

java com.fatwire.csdt.client.main.CSDT [ContentServer url]  username= username password= password cmd=export|import|listcs|listds [options]

This is generic, and the syntax is same for both export and import, except you need to change a few parameters.

So, what are the parameters?

1. SERVER_INFO=http://:ContentServer    –   This is the server from where the assets need to be exported.

2. USER_NAME=fwadmin (or any other user name)

3. PASSWORD=xceladmin (or any other user’s password)

4. CLASSPATH= Path to the  csdt-client-11.1.1.8.0.jar and lib folders present inside the csdt-client folder. For example:

If you have placed your csdt-client folder inside the Content server installation directory, then the class path should be:

/csdt-client/csdt-client-11.1.1.8.0.jar:/csdt-client/lib/*

5.  CSDT_EXPORT_FOLDER=CSDT_Backup_files

This backup folder will be created under /export/envision/

Finally to execute the export process , make sure that your content server is running, and run the below command.

java -classpath $CLASSPATH com.fatwire.csdt.client.main.CSDT $SERVER_INFO username=$USER_NAME password=$PASSWORD resources=CSElement:1326492057112 cmd=export datastore=$CSDT_EXPORT_FOLDER

The above command exports the CSElement  which has the id 1326492057112, to the directory said above called CSDT_Backup_files.

How do I export other resources?

Below are the different resources which can be specified in the export script.

– @SITE – Specify the desired sites
– @ROLE – Specify the desired roles
– @ASSET_TYPE – Specify the desired asset types
– @TREETAB – Specify the desired tree tabs
– @STARTMENU – Specify the desired start menu items
– @ELEMENTCATALOG – Specify the desired ElementCatalog entries
– @SITECATALOG – Specify the desired site catalog entries
– @ALL_NONASSETS – Use this short-hand notation to select all non-asset resources
– @ALL_ASSETS – Use this short-hand notation to select all available assets
– asset type – Specify assets of a certain type.

In the next post, we will see how to Import the assets using CSDT command line tools.

Advertisements

CSDT Introduction:

CSDT stands for Content Server Developer Tools. This is a great feature provided in Oracle WebCenter Sites that helps the developers to easily import and export assets from one environment to the other environment, such as from DEV to UAT, etc.

This CSDT can be used in two ways.

1. Eclipse – CSDT Plugin:  This is a  plugin which can be embedded and used within eclipse, so that the developers can synch the assets between his workspace and local JSK instance(or any other dev server instance for that matter), and vice-versa.   You can see how to integrate this plugin with eclipse in one of my previous post. Click Here to read the article.

2. Command Line Tool : This is where we use the command line options for exporting and importing the assets between environments. The Developer Tools command-line tool can be used for deployment and other resource movement activities (like assets as said above). Unlike the Eclipse integration, which enables you to work only with the eclipse workspace, the command-line tool enables you to work with any
workspace. The main feature of using the command-line tool is that it provides import and export features which are not available when working in the Eclipse IDE.

How to use the Command-Line Tool:

To use the command line tool, one should use the csdt.zip provided with the Oracle WebCenter Sites installation unit, or with the patches. Make sure that you use the same csdt.zip from the patch which you have applied on your environment (In case if you have applied any patch).

Unzip the csdt.zip file, and you should be able to see two folders inside it.

  • csdt-client
  • csdt-eclipse

The csdt-eclipse folder contains the plugin for integrating with Eclipse.

The csdt-client will have a jar file which is responsible for the command line tools activity, and a lib folder. Under the lib folder you will have some more jar files which are required by the csdt command line tools.  Say for example, if you are using 11.1.1.8 version of Oracle WebCenter Sites, then you should see the following inside the csdt-client folder.

  • csdt-client-11.1.1.8.0.jar
  • lib
    • cas-client-core-3.1.9.jar
    • commons-logging-1.1.1.jar
    • cs-core-11.1.1.8.0.jar
    • rest-api-11.1.1.8.0.jar
    • …. etc

In the upcoming posts, we will see how we can use the CSDT Command line option to export assets like CSElements, Templates, all other assets.

Click on the below links for Export and Import using CSDT Command Line Tools.

1. Import using CSDT Command Line Tool in Oracle WebCenter Sites / Fatwire

2. Export using CSDT Command Line Tool in Oracle WebCenter Sites / Fatwire


No doubt, WebCenter Sites has provided a great tool called CSExplorer in JSK for exploring the Database contents. But this tool has limitations. This works only on the Windows environments. But in reality, developers work on different environments aswell like MAC, Linux, etc.

I really felt bad when I couldn’t find someway to explore the database contents. while working on MAC. Fortunately, I have gone through some other website, and came to know how to explore the HSQLDB using eclipse.

I want to explain now how to explore the underlying tables of WCS using Eclipse, more elaborately.

Step  1 :

Open your server.xml file. It can be found under the below location:

[WCS installation Dir ]/apache-tomcat-7.0.42/Sites/conf/server.xml

Get the below values:

  • Username
  • Password
  • URL

See below screen shot.

server_xml

Step  2:    

Have your eclipse installed. You can get it from  https://www.eclipse.org/downloads/

Step  3:     

Download the Data tools platform from eclipse marketplace. To do this, go to the Eclipse market place window, and search for ECLIPSE DTP (DATA TOOLS PLATFORM) 1.11.1 KEPLER, and install the plugin.

DTP

 Step 4:     

Now open the Perspective ” Database Development“.

You can do this by going to the Eclipse -> Window -> Open Perspective -> Other – > Database Development

Step 5: 

In the left hand, you will see a new tree opened called DATA SOURCE EXPLORER.

Right click on DATA CONNECTIONS, and click on NEW.

DATASOURCE

 Step 6:    

You will now get the following CONNECTION PROFILE window. Select HSQLDB from the available list of options, and click on NEXT button:

conn-profile

 Step 7:    

Enter the DB connection details in the below window:

Enter the following values from the inputs taken in step 1.

  • Database Location  : [WCS Installation Dir ] /App_Server/apache-tomcat-7.0.42/Sites/default/data/hypersonic/csDB
  • UserName  :   sa
  • Password    : blank

Then click on the TEST CONNECTION button. It shows a PING SUCCESSFUL dialog box. Now click on FINISH button.

DB Info Screen

NOTE:  You need to add the hsqldb.jar in the above window, by clicking on the + button available against the DRIVER  drop down.

Step  8:  

That’s it. In the Data source explorer tree of left hand side, you can see a new DB connection created to your local JSK. You can explore the tables as shown in the below screenshot.

 

TABLES

 

That’s it for now.

 

 

 

 


Introduction:

Oracle has introduced a new feature called Vanity URL in Oracle WebCenter Sites 11.1.1.8.0, which provides us the ability to define and manage the VANITY URLs for any asset. In this post, we will discuss about how to enable the Vanity urls in the ContentServer, and its usage.

 1)Creation of Vanity URLs for Assets:

Vanity URLs for an asset  can be created in two way, Manually and Auto-Generated. WebCenter Sites supports two types of Vanity Urls ie Asset URLS and Blob(File) Urls. An Asset Url can be either auto-generated(pattern defined by the Administrator in Admin Interface) or created in the Contributor Interface). A Blob (File) Url is created only by the Administrator in Admin Interface using pattern, but Blob(File) url cannot be created from Contributor UI.

 i) Manually creation from the Contribute UI:

From the Contribute UI, vanity URL can be created by Content Contributors. Open the asset for which you wish to create a Vanity url. Access the asset’s edit view in the Form mode. In the form section selector, select URL. Fill the following fields.

URL :   Enter the vanity url.

Host :  Form the dropdrown, select the root url.

Template : Select the layout to render the asset on the website.

After enter click the “Add” button, then the vanity URL is displayed. The Vanity URL will not work, until the asset is “Saved”.

 ii) Auto-Generated Vanity URLs:

Vanity URLs can be generated automatically for individual assets based on the patterns configured. Once a pattern is registered, the vanity URL is generated when the asset is saved.

Login to the Admin UI and under Admin tab, expand the AssetTypes node, then expand the node for the specific asset type you are creating and auto-generated URL. Expan the URL Pattern and double click on “Add New”

Name :  Unique name for the pattern.

Site  : The pattern will be applied for the list of sites for which the asset type is enabled.

Host : The WebRoot which the vanity URL applied to.

Pattern : Enter the rule that define the vanity URL. The pattern define will be appended to the WebRoot which is mentioned in the HOST attribute, for this pattern to create Oracle provided pre-defined functions like

i)${subtype.toLowerCase()}/${f:spaceToUnderscore(name).toLowerCase()}.html

So, the vanity url will be something like http://localhost:8080/cs/avi/samplesubtype/sample_by_krishna.html

ii)${id}.html

So, the vanity url will be something like  http://localhost:8080/cs/avi/1330543070443.html

ii)${name}.html

So, the vanity url will be something like  http://localhost:8080/cs/avi/sample+by+krishna.html

(Spaces are converted into + symbols by default)

AutoGenerate for Asset:  URL pattern generation of Assets vanity url.

AutoGenerate  for Blob(File): URL pattern generation of Blob File vanity url.

The Below section “Evalutate URL Pattern” in the above images, is used to validate the auto generate url.

2) To Enable the Vanity URLs in the Content Server]

By default, these would be enabled for first site II and avi sports sites.

2.1) Configure SitePrefix : The WebCenter Sites know which URLs to treat as vanity URLs. In the Content Sever web app enter the following filter. Do the setting in the Web.xml.

If there are multiple site, need to specify comma separated SitePrefix in the param-value tag.

Location : <>/webapps/cs/WEB-INF

Add this  filter just below the   “… WEM SSO Filter … ” entry.
<filter>
<filter-name>URLRewriteFilter</filter-name>
<filter-class>COM.FutureTense.Servlet.URLRewriteFilter</filter-class>
<init-param>
<param-name>SitePrefix</param-name>
<param-value>avi</param-value>
</init-param>
</filter>
<filter>
Add filtermapping just below  the filter-mapping of  “..WEM SSO Filter …” entry.
<filter-mapping>
<filter-name>URLRewriteFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

2.2) Create WebRoots:  Login to the Admin UI and under Admin tab, expand the WebRoots node and Add New. The WebRoots can be of Absolute , Relative or Combination.

HostName          : Enter the HostName which is unique identified for the WebRoot instance.

Root URL           : This can be Absolute or relative.

Virtual Root URL : If need to used the Virtual Url,  In futuretense.ini file for the property sites.environment specify the environment value as management/delivery.

It has two parameter the Environment and Root URL. For each environment will have one url,  enter environment name Root url and click add for

each environment.

Example : For Management environment, specify Environment = management,  Root URL = management.example.com

Sites                  :  Enable WebRoot for specific sites.

3) System tool – URL Utility:   

Login to the Admin UI and under Admin tab,  can view all the vanity URLs defined in the system. This tool can be used to resolve the conflicts in the vanity urls.    Using this “URL Utility” admin can view  the conflicting urls, and can delete the vanity urls which are not required.

4) Tags to get Vanity URL: 

     The normal tags can be used to get the Vanity URL. If the vanity url is present for the given asset then below tags will return the vanity url.

i)  render:gettemplateurl

ii)  render:getpageurl

ii)  render:getbloburl

iv) satellite:link


What is Dynamic Publishing?

Dynamic publishing is the process of copying assets and their underlying schema from one WebCenter Sites system to another. This Dynamic Publishing is of two types.

1. Mirror to Server : Mirror to Server is the method used to copy database rows to remote dynamic server

2. Real time Publishing : Real time Publishing is the method used to copy assets to remote dynamic server.

What is RealTimePublishing?

RealTime publishing is a dynamic publishing process. In RealTime publishing, this process is broken up into five stages. The System performs all the five steps in an order, to perform the RealTime publishing.

RealTime publishing is the preferred method for publishing. Using the RealTime user interface, an administrator can monitor the progress of a publishing session, bulk publish selected assets using the on demand queue, bulk un-approve the assets that are approved for publishing, cancel publishing process, and redo publishing sessions, etc.

Complete Publishing Mode:

When the destination is configured for complete publishing mode, the process proceeds without interruption.

Delayed Publishing Mode:

When configured for delayed publishing mode, the process pauses before the fourth step. User interaction is needed for the session to complete. It continues to stage 4 only after the administrator selects the Resume button on the “Publish Console” or “Publishing Status” screen.

As the publishing session proceeds, you can monitor the progress of each stage on the ‘Publishing Status’ screen.

Five Stages of Publishing:
1. Gathering data to publish:

a. The WebCenter Sites source system locks the assets that are approved for this publishing session.  This ensures the assets that need to be published from being edited during publishing.

b. The list of assets to be published from source to destination systems are created in a file called MANIFEST. The manifest identifies the assets that must exist together on the destination to prevent broken links and incomplete pages.

2. Serializing data:

a. The WebCenter Sites source system mirrors the following items:

– Asset types
– Tables
– Approved assets

b. The data that needs to be published to the target will be serialized at the source system (i.e, translation into binary format).

3. Sending data to the target:

a. The destination WebCenter Sites database locks assets that are approved for this publishing session. When assets on the target are locked, they cannot be edited.

b. The WebCenter Sites source system sends the serialized data and the manifest file to the destination.

RealTime Publishing

4. Deserializing and saving data:

a. The WebCenter Sites destination system de-serializes (to WebCenterSites format) the mirrored asset types, tables, and approved assets.

b. The destination system’s database updates asset types and tables with the deserialized ones, or adds them as new data.

c. The destination system uses the manifest to determine when to commit assets to its database.

5. Updating page caches:

The destination system completes the publication process, and does the following tasks:

a. To remove the expired pages, the page cachce is flushed.

b. If any new pages are added, they are added to the cached.

In this way, the RealTime publishing works in Oracle WebCenter Sites.


All the Fatwire / Oracle WebCenter Sites developers are familiar with coding the templates through either Admin interface, or using a text editor such as notepad, etc.  But, Oracle WebCenter Sites provides us with a plugin called DEVELOPER TOOLS (In Fatwire, it was called as CONTENT SERVER DEVELOPER TOOLS plugin), which enables us to work with an Integrated Development Environment like Eclipse. What all we need to do is to use this plugin, and make our work easy by working with Eclipse IDE.

The Developer Tools kit enables developers to work in a distributed environment using tools such as the Eclipse IDE and version control system integration. The developer interacts with Developer Tools (and WebCenter Sites), primarily through Eclipse, which upon integration provides a  set of WebCenter Sites-specific tools for managing assets and other resources.

The Developer Tools kit enables synchronization of resource development in Eclipse with resource development in WebCenter Sites, and resources of WebCenter with resources of Eclipse.

Eclipse Plug-in

 

 

USES OF ECLIPSE IDE Integration

 

There are pretty good usages of integrating the plugin with Eclipse, and coding through Eclipse. Following are the uses through Eclipse integration:

  • Create, edit, and delete Templates, CSElements, and SiteEntries.
  • Develop JSPs with Eclipse features such as tag completion, syntax highlighting, debugging, etc.
  • Export and import assets, asset types, flex families, sites, roles, tree tabs, and start menu items
  • View the output, i.e, Previewing of WebCenter Sites pages within the Eclipse IDE using the preview browser
  • View the WebCenter Sites log file in the error console.

 


In the real world implementation, there may be more than one web-site that a company maintains.

For example, lets assume that we have client called “X”. This client has engaged with the Oracle WebCenter Sites developers team to get a Content Management Site created, say http://www.MySiteOne.com . The client has later come up with a requirement to create another site called http://www.MySiteTwo.com using Oracle WebCenter Sites / Fatwire.

To create a new site from scratch, we need to create all the stuff like attribute editors, asset types, templates, elements, etc.

Oracle WebCenter Sites / Fatwire comes with a utility that can be used in such a situation, which will replicate the structure of an existing site (please mind that the first site is also created using Fatwire), and creates a  new site automatically with all the above said stuff such as attribute editors, asset types, templates, elements, etc.

This utility tool provided by Oracle WebCenter Sites is called as SITE LAUNCHER UTILITY.

Site Launcher Overview

To minimize your effort in creating new sites, WebCenter Sites provides a site-replication utility called “Site Launcher.” This utility is designed not for backing up CM sites, but for spinning them off.

Some important points to be noted about the Site Launcher utility.

  1. Site Launcher replicates source sites directly on their native WebCenter Sites system, reusing the existing database schema. The sites are replicated quickly and easily, without the need for coding.
  2. Site replication can be carried out only by the general administrator.
  3. We can either copy or share the assets (templates, asset types, attributes, etc) between both the sites.
  4. While COPY of assets will create a new set of assets into the site, SHARING will share the same asset between both the sites
  5. In the new site, we can remove the existing assets, or add new assets according to the requirements
  6. New asset types, templates, elements etc can be created in the new site.
  7. New users can be created for the newly created site.
  8. Site Launcher can be used to replicate almost any CM site: small, large, functional,incomplete, independent of other sites, and overlapping other sites by the sharing of components.