Xpages - Compute Xsp.properties to set theme - xpages

Hi I saw from another question that it's possible to set theme via (on beforePageLoad event)
if ( ! theme.equals(context.getSessionProperty("xsp.theme"))) {
context.setSessionProperty("xsp.theme", theme);
context.redirectToPage(context.getUrl().toSiteRelativeString(context));
}
But was wondering whether it's possible to set values in xsp.properties via SSJS or Java ?
Would I need to build the DB after it's been set ?

As Tim pointed out: EL is valid inside a theme, so you might create one theme and have your variations inside that theme using EL.

Related

hide pages in websphere portal without using set parameters

I am using WebSphere Portal 8.5 Enable. I have created a custom theme. But this theme requires to hide pages on navigation which has unique name with ".omit." value in it, so that I don't have to manually set each page's parameter.
I created the flyout or menu dropdown using this:
Flyout or Menu Dropdown in Portal 8 themes
Any suggestions and pointers are welcome. Thanks in advance.
Maybe you have already thought about this.
The solution you mentioned (Flyout or Menu Dropdown in Portal 8 themes) hides nodes based on the hidden flag. This method is used to calculate it. Now you could query the uniquename of the Node witin this method and check for your naming pattern and use this to determine if it is hidden. It would allow you to combine the two as well.
the method I think you need to modify.
public boolean isHiddenPage(NavigationNode node){
if (node instanceof com.ibm.portal.MetaDataProvider) {
com.ibm.portal.MetaData iMetaData=((com.ibm.portal.MetaDataProvider) node).getMetaData();
Object url=iMetaData.getValue("hide.from.menu");
return (url != null && url.toString().equals("true"));
}
return false;
}
You can hide any page using the role settings just create a user group which is never used and make that the only thing that can access the page. You should be able to do this is your PAA's PageAssignAccessControl.xml (could be slightly wrong about the name of this file) as well as in the portal Admin console, so you can do it automatically in your deployment code.

Liferay - Translate

I am using Liferay 6.1.0 GA1.
I added Documents and Media portlet. When I change language in Add menu, it is still named Documents and Media display.
Where I can change that?
Edit: I have hook for translations I just don't know what to write to make it work.
As excepcted for rookie, problem was trivial.
In portlet.xml name wasn't documents-and-media. It was some number.
So then just javax.portlet.title.1= fixed it.
If You don't have a hook, look there -
https://www.liferay.com/community/wiki/-/wiki/Main/Portal+Hook+Plugins
https://www.liferay.com/community/forums/-/message_boards/message/5368654

Adding User Defined Runtime Attributes?

Is there a way to add user defined runtime attributes to a button in Xamarin's storyboard designer?
I'm trying to get Pixate Freestyle to work and need to define the attributes. I can only find the place to define them within xcode.
I was working on a Xamarin Forms project and I figured out that on each platform, there is a method to update the style for a Control. The way I used to do this is something like this:
PixateFreestyle.SetStyleId(view, styleId);
or
PixateFreestyle.SetClassId(view, classId);
Where view is any UIView you want to style ann styleId/classId is a string with the style name in your default.css
Hope this works for you
This is where I based my project
XamarinForms-PixateFreestyle

Is it possible to use a common resource in an non-themed view?

I am using orchard cms v 1.4 and developing some site content that is stand alone and does not use the standard theme. I would like to use some of the resources already declared in manifest files on the non-themed views. However they only render when I apply a theme to the controller or the specific view.
In my view I am including the following:
#{
Script.Require("jQuery").AtHead();
}
This only functions as expected when I include: [Themed]
as an attribute on my controller.
Any idea's on how to get this to work without creating a full theme for my stand alone pages?
Yes, see http://weblogs.asp.net/bleroy/archive/2012/10/20/writing-an-unthemed-view-while-still-using-orchard-shapes-and-helpers.aspx
What's important is that you use a shape as the model. Themed or not doesn't matter then.

How to access custom fields of a page in the theme template

I'd like to use custom fields to display some page specific strings in the theme.
I have created a custom field "intro" of type Textbox.
How do I access the data in the theme template (velocity)?
As there is no "introspection" which variables are declared, I find it very difficult to figure out how to access them. The documentation is far from usable on the topic of custom fields :-/
If you definde custom attribute in a page than you can use
$layout.getExpandoBridge().getAttribute("intro")
Also see javadoc or source for com.liferay.portlet.expando.model.ExpandoBridge
if you need use in template FTL, in my case for menu navigation template
<#assign prop = navItem.getLayout().getExpandoBridge().getAttribute("prop_name") >
Work for me in Liferay 7+:
Create a custom field type "site", fill data into site settings, and use into theme template for call this data into liferay theme:
If a VM file:
#set ($site_custom_field = $layout.getGroup().getExpandoBridge().getAttribute("site_custom_field_key"))
<h1>$site_custom_field</h1>
If a FTL file:
<#assign site_custom_field = layout.getGroup().getExpandoBridge().getAttribute("site_custom_field_key")>
<h1>${site_custom_field}</h1>
Have a nice day!

Resources