Archive for the ‘Fatwire’ Category


We have seen in the previous post about how to Export using CSDT Command Line Tool in Oracle WebCenter Sites / Fatwire.

Today we will see how we can Import using CSDT Command Line Tool in Oracle WebCenter Sites / Fatwire utilizing the exported data which is created earlier.

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

Import:

As the name itself is suggesting, it is the process of creating / importing the assets in(to) the content server. Here, assets means any thing inside the Content Server, right from start menus to templates. Everything. So we can import everything using this process.

Ok..How to use it?

Lets come to the point of how to do the import process using CSDT command line tools.

The syntax of csdt command line is as follows, which is common for both export and import.

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

What are the parameters?

1. SERVER_INFO=http://:ContentServer         —- This is the server into which the assets need to be imported.

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. IMPORT_FOLDER_LOCATION=<Content server installation directory>/export/envision/cs_workspace/

This is the location where CSDT files needs to be moved before importing
6. DATA_STORE=/src

Say for example if your folder is CSDT_Backup_Files, then the path should be    /CSDT_Backup_Files/src.

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

In the export process earlier, we have given the 13 digit content server id of the CSElement. But now to import, we need to give the UID created by the content server.

java -classpath $CLASSPATH com.fatwire.csdt.client.main.CSDT $SERVER_INFO username=$USER_NAME password=$PASSWORD resources=CSElement:ca572d73-ade3-4535-bc32-e2311b43fbb8 cmd=import

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

How do I import other resources?

Below are the different resources which can be specified in the import 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.

That’s it.. your content is imported to the target machine.

Advertisements

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.


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


Log Viewer Tool

This is one of the SYSTEM TOOLS. This tool enables you to view, tail, download, and search the contents of the WebCenter Sites logs directly from the WebCenter Sites administrator’s interface.

The options available in this tool are pretty simple, and can be understood upon viewing it. Hence, I’m not going to explain much about it. Below is the screenshot of the tool from Admin UI.

log

By default, it displays upto 100 lines of the log file. We can change it as per our wish upto 100o lines.

Alternatively, instead of going to this utility, we can directly use the following url to view the log file. The maximum number of lines to be displayed can be entered at the end of the url.

http://localhost:8080/cs/ContentServer?pagename=fatwire/systemtools/logs/logTailViewer&pageSize=100

Replace the localhost with your server name, and 8080 with your port number.

Bookmark this url, and this becomes handy when you need to see the WCS logs.


System Information Tool

The System Information tool provides access to various information like WCS information, database information, and thread information for troubleshooting and checking the health of your application.

We can either view information directly in the admin interface or download information to a file.

This tool consists of the following options:

  1. Sites Info
  2. DB Info
  3. Thread Info
Sites Info Node:

This node provides us the following facilities:

  1. Memory Information: This has the info about Total memory, free memory, etc.
  2. Option to download the WCS Property files like the .ini files
  3. Option to download the Webapp property files like the .properties, .xml files
  4. Info about Jar files available in Web-Inf/Lib folder
  5. Info about Session variables
  6. Info about System variables

sites information

DB Info Node:

This node provides us with the following information.

  1. Database Server Information
  2. JDBC Driver Info
  3. JDBC Driver Url
  4. JDBC Version
  5. JNDI Data Source
  6. Information about System Tables
  7. Information about Tree Tables
  8. Information about Object Tables
  9. Information about Other Tables
database info
Thread Info Node:

You can download or view thread dumps to analyze the runtime state of the application server. This can be especially useful when trying to detect problems that might result in resource starvation or thread hangs.

thread info

We will see about other tools in coming posts.