- Enable the asset type at target website.
- Pass c, cid and run=true from site entry (if run=false, or missing from site entry, assets won't be shared).
- Fetch the list of asset_id to be shared for the given asset_type
- From that list remove all the asset_id's that have been alredy shared (we don't want our element to load assets that are alredy been shared)
- Invoke asset:share tag fo all the asset_id's
- Prints the output in asset_id : asset_name format, also displays error's occured, if any and total number of successfully shared assets.
- Load the asset (using
asset:load
tag) - Get the association (using
asset:children
tag) - Fetch attributes (by looping through list using
ics:listloop
tag)
<asset:load name="HomePage" type="Page" objectid='<%=ics.GetVar("cid")%>' site='<%=ics.GetVar("site")%>'/>
To loop a list we make use of listloop
tag
IList list = ics.GetList("list_name");
int rows = list.numRows();
int cols = list.numColumns();
String columnName = "", columnValue = "";
out.println("Rows : " + rows + ", " + "Columns : " + cols + " for list " + list.getName() + " : " + list.hasData() + "<br/>");
- Fetch all the details of asset using Asset API's
read()
method. - Create JSON tree using JSON simple library and populate it with asset details from #1
- Print an JSON tree having all the asset details
<%@ taglib prefix="cs" uri="futuretense_cs/ftcs1_0.tld"
%><%@ taglib prefix="asset" uri="futuretense_cs/asset.tld"
%><%@ taglib prefix="ics" uri="futuretense_cs/ics.tld"
Recommendation is the part of Engage Framework of OWCS. To work with recommendation we need to use commercecontext
and vdm
tags.
- Create Visitor Attributes and group them into segments
- Create a
satellite:form
to collect these visitor attributes - Write an element to fetch visitor attributes from form and use them to load recommendations
fetch form values:
If you are using Engage, then is one caveat which needs to be taken care of:
"Data in visitor's tables can increase exponentially (obviously depends on how many times your site is visited) which can affect performance"
OWCS has no way to know which data is to be deleted and on what basis so basically you have to flush data from tables either manually or by programming.
Following sample code snippet can help to flush data after every 30 days:
<%@page import="java.util.Calendar"%>
Purpose of this topic is to send email notfications to the users tat have created the assets but haven't modified them since last 30 days.
We can use javax mail
service or send:mail
tag to achieve this purpose.
Before we begin we need to make following changes to futuretense.ini
file
futuretense.ini:cs.emailauthenticator=com.openmarket.framework.mail.ICSAuthenticator
futuretense.ini:cs.emailcontenttype=
futuretense.ini:cs.emailhost=smtp.gmail.com\:587
futuretense.ini:cs.emailaccount=
In Oracle Webcenter Sites you get a situation where you need to write code to search for a specific assets based on their attribute’s values. There are two major ways to look for assets in oracle webcenter sites. One is to get list of assets based on the asset type and may be also based on some field values. If you want to look for some assets which has searched keyword in their attribute values. This topic is to demonstrate working of asset search using searchstate
tag in case of flex assets and asset:search
in case of basic assets.
-
Get the searched keyword from parameter key has been passed in request. Sometimes the parameter name could be very short which is not easily understandable for developer in the code level. So if this is the case you can go for a new variable to store searched keyword. Otherwise you can skip this step
-
Create an empty search state with a constraint and it is taken by the
assetset:setsearchedassets
tag which does the search operation.
- Get handle for
AssetDataManager
which will act as a gateway to interact with Assets. - Create unique AssetIdInstance using
AssetIdImpl
andAssetId
fromc
andcid
parameters, basis on which read operation would be performed. - Call
delete()
method ofAssetDataManager
which actually performs delete operation.
<%@page import="com.openmarket.xcelerate.asset.AssetIdImpl"%>
<%@page import="java.util.Arrays"%>
<%@page import="com.fatwire.system.SessionFactory"%>