Skip to main content link. Accesskey S
  • Log In
  • Help
  • IBM Logo
  • IBM Digital Experience wiki
  • All Wikis
  • All Forums
  • ANNOUNCEMENT: WIKI CHANGE TO READ-ONLY. LEARN MORE...
  • Home
  • Product Documentation
  • Community Articles
  • Learning Center
  • IBM Redbooks
  • API Documentation
Search
Community Articles > IBM Accelerators for WebSphere Portal > IBM Mobile Portal Accelerator > Referencing asset polices using Alternate approach instead if “mobilePortletContent” Tag
  • New Article
  • Share Show Menu▼
  • Subscribe Show Menu▼

About the Original Author

Click to view profileIBM contributorSathish Maiya
Contribution Summary:
  • Articles authored: 3
  • Articles edited: 0
  • Comments Posted: 0

Recent articles by this author

Referencing asset polices using an alternate approach instead if “mobilePortletContent” Tag

Instead of using mobilePortletContent you can reference imagesscripts(asset policies) using alternate approaches.

Migrating Mobile Portal Accelerator 6.x/7.x to 8.0 Using an alternative approach

Introduction: This article proposes an alternative way of migrating from lower versions of MPA to MPA8.0. The normal process is outlined in the article 1 mentioned under reference section. The process outlined in the article 1 requires a portal migration. If you have the portal installation ...

Migration From MPA 7.0.x to MPA 8.0

This article provides steps for migrating MPA from 7.0.x to 8.0 . And also mentions portal migration with a typical scenario.
Community articleReferencing asset polices using Alternate approach instead if “mobilePortletContent” Tag
Added by IBM contributorSathish Maiya | Edited by IBM contributorSathish Maiya on January 8, 2014 | Version 7
expanded Abstract
collapsed Abstract
Instead of using mobilePortletContent you can reference images/scripts(asset policies) using alternate approaches.
Tags: mobilePortletContent assets policy dynamic static
In MPA 8.0 use of tag to reference the images outside the portlet is deprecated. Instead of using this tag follow the following steps to reference image/assets. There are two approaches to reference the assets.

A) Reference image through a static project .
Step 1:


Create a new definition of the project in mcs-config.xml file. The file is present at two locations \installedApps\hostname\mcs.ear\mcs.war\WEB-INF\mcs-config.xml and \PortalServer\wp.mobile\wp.mobile.mcs\mcs-config.xml . You should add the details like below in both copies of mcs-config.xml file .
Please note the attributes identity (project), directory (xml-policies), base-url(assets) and prefix-url(In child element of assets) in the above example.

Step 2:

Put all the policy files like .mimg, scripts etc in directory "xml-policies" used in project definition .In the following example all polices are placed in below directory.
\installedApps\hostname\mcs.ear\mcs.war\projects\examples\policies
Place different policy files in different sub folders. See the snap below.


Step 3:
Put all the assets in the directory which is accessible via base-url provided in tag. Eg: image "magnifying-glass.png” should become available if you hit this url http://host:port/mcs/projects/examples/assets/images/magnifying-glass.png.
For this purpose you can create a directory inside mcs.ear/mcs.war/projects folder and put assets under that directory.
See in this example the assets are placed in below directory.


Step 4:
Similarly you can create script policy. While creating image/script policy just use simple file name in place of url (if you have followed the exact url pattern described above)

Step 5:
Restart the server.

Step 6:

Follow the following syntax to add image/script policy in custom jsp's.


B) Referencing the assets through dynamic projects
Step 1:
Create a String Buffer having details of project. (or portelt ) from where customer can access policies.
In the following example you can create

Step 2:
Details of variable used In xml-configuration file are given below
a) name = Name of Web Module(portlet) installed . (In my case inside InstalledApps)


b) Policy directory = Absolute directory path to policies
c) assets-base-url = context root of the portlet (Can be found from /wps/PA_offlineSample variable in "application.xml" file inside META-INF )

Step 3: By using below method all policy file of the PA_offllineSample can be used in any portlet eg.

Here testImage and helperFunction policy can be used in any portlet .
expanded Attachments (0)
collapsed Attachments (0)
expanded Versions (9)
collapsed Versions (9)
Version Comparison     
VersionDateChanged by              Summary of changes
9Jan 8, 2014, 4:34:17 AMSathish Maiya  IBM contributor
This version (7)Jan 8, 2014, 1:04:21 AMSathish Maiya  IBM contributor
6Jan 7, 2014, 5:13:48 AMSathish Maiya  IBM contributor
5Jan 7, 2014, 5:02:34 AMSathish Maiya  IBM contributor
4Jan 7, 2014, 3:06:50 AMSathish Maiya  IBM contributor
3Jan 6, 2014, 4:14:13 AMSathish Maiya  IBM contributor
3Jan 7, 2014, 1:45:27 AMSathish Maiya  IBM contributor
2Jan 6, 2014, 2:26:42 AMSathish Maiya  IBM contributor
1Jan 5, 2014, 11:03:05 PMSathish Maiya  IBM contributor
Copy and paste this wiki markup to link to this article from another article in this wiki.
Go ElsewhereStay ConnectedHelpAbout
  • IBM Collaboration Solutions wikis
  • IBM developerWorks
  • IBM Software support
  • Twitter LinkIBMSocialBizUX on Twitter
  • FacebookIBMSocialBizUX on Facebook
  • ForumsLotus product forums
  • BlogsIBM Social Business UX blog
  • Community LinkThe Social Lounge
  • Wiki Help
  • Forgot user name/password
  • About the wiki
  • About IBM
  • Privacy
  • Accessibility
  • IBM Terms of use
  • Wiki terms of use