I’ve been working with Oracle WebCenter Sites (FatWire) for over a year now. Here’s my guide to the 5 most important tags to learn with examples of their use.
First of all the most basic and important tag is ftcs. The ftcs tag sets the Content Server Context which tells Content Server that all the code within the opening and closing ftcs tags should be considered by Content Server.
All Content objects in FatWire are called Assets. So while working with the content management system you will frequently need to work with assets (content).
Before you can start working with any asset you have to load it. You might be familiar with the fact that in FatWire/WCS there are two types of assets, basic asset and flex asset. To load a basic asset you will use the asset:load tag.
Asset Load tag loads (retrieves and stores as an object in the memory) the asset according to the parameters. You can then use the asset and get its attribute and other asset related data by referring to the name given in the name parameter.
Other asset related tags use the name parameter to refer to the name of the asset loaded. The objectid parameter is the asset id.
The field and value parameters are optional. Field is for the attribute name and value represents its value. So, you might want to load an asset on the basis of one of its attribute values.
Loading an article asset that has the title “Green Gardens”.
Once the asset is loaded its attribute’s values can be retrieved. For retrieving the value of an attribute the asset:get tag is simplest to use.
Asset:get retrieves the value of the attribute/field specified in the field parameter for the asset referred in the name parameter and saves it in a variable given in output parameter (optional).
If the variable given in output parameter does not exist then it creates a new variable with the same name given in output.
Getting the attribute named summary from article asset we loaded in the previous example and storing it in articleSummary variable.
If the output variable is not provided the value of the attribute is stored in a variable with the same name as the attribute.
For example if in the above the output variable articleSummary is not provided then the articleAsset field value will be stored in a variable named articleAsset.
To load and get the attributes from a flex asset it is recommended to use the assetset:setasset tag.
The assetset:setasset is similar to asset:load in a sense that it returns the reference to the flexasset as name and the type parameter is for the type of the flex asset as it is in asset:load.
The id is the asset id of the flex asset. There is no parameter for field and value because it is a flex asset which can have attributes as asset type.
Loading a flex asset of type Article_C representing an article.
* If cid is the article asset id.
Assetset is the basic tag to load a flex asset and the first step to get/manipulate the attribute(s) of a flex asset. Once the asset is loaded tags like assetset:getattributevalues and assetset:getmultiplevalues can be used to retrieve attribute value(s).
Retrieving value(s) from an attribute of a flex asset can be achieved by using assetset:getattributevalues tag.
The name parameter represents the name of the asset that is loaded, for example the articleAsset flex asset we loaded above. In attribute parameter give the name of the flex attribute.
listvarname gets the name of the list which stores the value(s) of the attribute. It can be an already existing list or a new list.
After we have loaded flex asset article we want to get its attribute named Body which represents the main body of article.
The typename is for the attribute type. So, in our example the attribute type is articleAsset_A.
And that’s it. Please do ask any questions you have below the line and I’ll do my best to answer them as soon as I can.
Hi Mrudul, thank you for reading my blog. Creating page templates is a very good idea for my next blog. I will forward it to my team and we will come up with something related to page templates very soon!
Do you have any tutorial to learn fatwire CS coding from the scratch..?
Can you explain the backend working of assetset tag ?
Like how backend queries work?
essentially tries to build/load the FlexAsset indicated by ‘type’ and ‘id’ attributes (of the tag) as com.openmarket.gator.assetset.AssetSet object (onto memory) so that or tags could be used on top of it to retrieve the corresponding FlexAsset attribute values.
– Oracle documentation https://docs.oracle.com/cd/E29542_01/apirefs.1111/e39371/JSP/assetset-setasset.html for tag.
– The class ‘com.openmarket.gator.jsp.assetset.Setasset’ (available in ‘gator.jar’) used by tag.
– The class ‘com.openmarket.gator.seed.AssetSet’ served by tags.
Navigating through the above classes would lead you closer to finding the actual SQL statements used by each of tags.