Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Skin name in External
shameem
I have multiple skins associated to a component. I need the skin names to be processed based on which I need to execute some presentation logic in my external.
Is there any command to get the skin selected for the component in my external.
Find more posts tagged with
Comments
Rick Poulin
I provide this with no guarantees (read: not supported, not tested by me, not even 100% sure it works).
String skinToUse = (String) context.getPageScopeData().get("component_custom_skin");
shameem
Thank you quick response... unfortunate, line of code didn't work.
HeMan10
Loop through the page scope data and print out key, value pairs. That might give you the exact key you should be using.
shameem
Tried all the following but no luck.
LOGGER.debug("context.getPageScopeData() ::" + context.getPageScopeData());
LOGGER.debug("Page SKIN:" + context.getPageScopeData().get(RuntimePage.PAGESCOPE_CUSTOM_SKIN));
LOGGER.debug("Page SKIN:" +
context.getPageScopeData().get("skinCreateNewName"));
Rick Poulin
What HeMan was getting at is this:
Map scopeData = context.getPageScopeData();
for (Object key : scopeData) {
LOGGER.debug(String.valueOf(key) + "=" + String.valueOf(scopeData.get(key)));
}
shameem
Tried the code and it seems to be there is no skin name. Infact I am getting null.
However its a mere common sense I am missing that the page scope is always to look at the page level not at component level. The skin name I am looking at is at the component level. Hoping that the right scrutiny.
So I am wondering we dont have a predefined function or variable which gives the SKIN name in the external java program on a component.
rohit34582
Something like this perhaps:
context.getThisComponentModel().selectSingleNode("
");
shameem
Not sure if any parameters are expeceted to this function. Tried with blank as given, didn't work.
Is there any API docs avaialble which I can go through.
rohit34582
The param in the method will be the x-path to the skin..
shameem
I am trying to get the skin name. If I know the XPath for the skin I would be able to process it based on the Xpath. Could you please give an example if possible.
Rick Poulin
This is a guess, based on the input provided so far in this thread, but given that the page file structure looks like this:
[PHP]
Default
Mr Awesome
Mr Awesome
[/PHP]
Then perhaps rohit's suggestion equates to this:
String skin = context.getThisComponentModel().selectSingleNode("./SelectedSkin").getStringValue();