Web Center Sites – Use proxy asset
Web Center Sites – Use proxy asset
After the introduction of Proxy Assets in Oracle WebCenter Sites 11.1.1.8.0, it has become easy to fetch data from external repository. As content is not stored in Sites (rather its present in the service provider database) there is no longer need for storing data or importing bulk content in Sites and later bothering with content storing, publishing and handling tell-tale errors (given that there is API for fetching data from third party repository which generates data on the fly).
Proxy Asset follows the architecture:
Requirements for using Proxy Assets:
- You need to have service URL (API provided by third-party service) whose output on querying results in either JSON or XML(mainly these 2 because already there are jar present in webapps/cs/WEB-INF/lib folder to process them). Other outputs can also be handled, but will require deploying jar for them.
- You may or may not need a key to access these API (API can be public or from some organization; again depends on service provider).
Creating Proxy Assets for:
- Get a key (available free but with some limitations or the paid one). Details present here.
- Just get any icon for GoogleMap (16x16 png file) and place it under <App_Server>/webapps/cs/Xcelerate/OMTree/TreeImages/AssetTypes/GoogleMap.png.
- Create proxy asset.
- Create one Proxy Asset Type from Admin Tab. In the Admin tab, expand Proxy Asset Manager and Double-click Add New.
- Open Sites Explorer and create folder structure under CustomElements (same as it was done for Youtube proxy asset but name would be assettype i.e. GoogleMap) which should end up like this:
3. Create "SearchAction.jsp", "SearchJson.jsp" and "ProxyHtml.jsp" file under respective folder from SitesExplorer and save.
Navigate,to <Sites_Installation>/Shared/elements/CustomElements/ to see if there is a "GoogleMap" named folder created and the structure will be as shown above.
4. Copy the element code from SearchAction.jsp, SearchJson.jsp and ProxyHtml.jsp and paste it in respective elements.
5. Open ProxyHtml.jsp in some file editor and paste your Google Map key on line number 23. Just replace <USE YOUR OWN KEY> with GoogleMap ke.
6. Create new "search" start menu for GoogleMap proxy asset (Google Map location) and enable GoogleMap proxy asset for your site. I enabled it for AviSports.
Select "Google Map Location" and search against any location. You may get one or more results. Click on any one of the result to view it, which should look this:
Note: I am storing latitude, longitude and address in externalid so that when map loads up, I can use latitude and longitude for finding location on map (reverse geocoding) and address for dropping marker on the map.
Furthermore, you can change search views, add custom tree tabs, add the proxy asset via insite editing to your assets, etc. All details are present in developer's guide and the templates for Youtube proxy asset.
Category: Technology & Innovation
0 Comments