XPages - how to assign OneUI3 theme? - xpages

I have a new XPages app with Domino 9 but I don't see an option to have OneUI3 there. I got also the XPages Demo App 2.0 from OpenNTF where this option exists, however I could not find where does it come from. If I just copy the demo app xsp.properties source code to my application, it does not work. Do I have to do something special with my application to get this theme?

There is no predefined choice or option for that.
Just edit the source of your XSP properties file OR create and use a theme. Extend the theme from the "oneuiv3.0.2" theme to get this working. Details here: http://mardou.dyndns.org/Privat/osnippets.nsf/snippet.xsp?documentId=96AB51B29A4F4369C1257B1D0064D05F

Related

Access a property defined in portal-ext.properties from a theme that uses Freemarker - Liferay 7

I need to obtain a property that is set in portal-ext.properties from my theme's portal_normal.ftl file. Using Liferay 7.
All my searches have come up short, but I can't believe I'm the first one to have this need.
For background, I need to display a web content that is stored in the global site. This needs to be displayed on every site, which is why it's going into the theme. It also needs to be updated by the content editors, so the content can't be included in the theme.
I can display the web content easily, using the journalArticleLocalService like this
journalArticleLocalService.fetchArticle(10197,"1260480")
but I obviously don't want to hard code the group ID and article ID like this; and they are already stored in portal-ext.properties for another reason.
Also, I know about theme configuration values, I use them for a lot of other configuration needs, but those require the values to be entered for each site and there are hundreds of sites in our implementation so this is not an option.
Thanks in advance for any solutions or advice you can provide.
Properties are (as far as I know) not available in Liferay's Freemarker Templates - and as everything in Liferay tries to phase them out in favor of OSGi based configuration) I'd not recommend keeping up the configuration there. Any change requires a restart of the portal - proper configuration would make them hot-changeable.
However, as you now have this situation and probably look for a quick solution: You can create a TemplateContextContributor and make the required values available for your template.

Openntf Domino API Plugins missing from one Notes Template

I have one Notes Template ntf in which the Openntf Domino API plugins do not appear in 'Plug-in Dependencies' library, eg. org.openntf.domino.xsp etc. They are installed on both the server and the local machine, as we use XPiNC. They appear in any a new application created from the template and they appear in other templates and other nsfs. The plugin xml references them but they are still not in there.
<import optional="true" plugin="org.openntf.domino.xsp"/>
The Notes template is on a server. How do I get them in there or solve the problem, I have tried various import methods to no avail, this area is not a strong point for me.
Thanks for any help.
You cannot use an NTF with XPinc. The status bar will show a message about it not running. You can have an NSF with a TEMPLATE NAME that will refresh other database that inherit from that template. If you need the NTF for database creation purposes, develop in an NSF that has a TEMPLATE NAME from which the NTF inherits. (EG: MyAppDev). THe NTF then has a TEMPLATE NAME from whihc other databases inherit (EG: MyApp)
If you're getting an error that you cannot import a class in Domino Designer, there are two places to look.
The library needs "ticking" on the Xsp Properties. This tells the application that it needs that particular plugin at runtime. If it's missing on the server, you'll get an error.
The library needs installing for every Domino Designer that's going to be used to work on the application. Upgrading Notes to a new version will invariably disable previously installed plugins, so you need to go to File > Application > Application Management.... Custom plugins are in the second category, and if they have a red circle crossed through, it's disabled and needs re-enabling.

Liferay Portal customization

I'm new to the Liferay Portal and I have been assigned to develop a Liferay application with the following structure:
logo
search bar
result list
We plan is to sell the application to different customers so the resources like images (logo and so on) and css need to be customizable. According to this tutorial resources like images and style sheets are part of the portal apps which are deployed to Liferay. So in my case for 2 different customers I would need 2 different app versions. Instead I'd like to have one version of the portlet which would load all the resources from a database (maybe via a rest call to an appropriate configuration service). That would give us an opportunity of a better provisioning.
Furthermore I'd like to be able to share css resources between different portlets.
Any ideas how I can achieve this 2 goals?
You seem to be talking about themes. You need to create a Liferay Theme. You can Extend an existing Liferay theme or create a brand new. Themes are like portlets meaning you deploy them the same way only they are specific for what you seem to be descibing. Take a look at https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-0/theme-builder.
Here you have lots of examples https://github.com/liferay/liferay-plugins/tree/master/themes and scripts for generating new themes.
Hope it helps
As Sudakatux said, you're talking about themes. I'd just like to add a couple of things:
If you're talking about styling portlet content (i.e. what should it look like when you display content in a portlet), you want to search for Application Display Templates (see links below).
If you're talking about styling portlet itself, i.e. what it looks like when you place portlets on your LR, you can do that within a theme.
Themes in Liferay 6.2 and 7.x are incompatible. You tagged the question LR-6 and LR7; I'd recommend choosing one (LR7 is vastly easier and faster to develop themes for, in my experience)
If you are creating your own portlet, and you want to style the content of your own portlet, you'll have to do that within JSPs. Edit: You can also use Freemarker with your portlets; however, I personally still prefer JSPs due to the sheer power of what you can do within it.
Useful links:
Liferay 6.2 Lunar Theme tutorial - shows how to create and deploy LR 6.2 theme
Liferay 7 Theme sample - LR7 has a Blade project that shows a lot by example. You can change Maven to Gradle and vice versa. Very useful.
Application Display Template LR7
Application Display Template LR6
This is how your theme directory structure should be laid out in Liferay 7 DXP. Make sure though you create a Liferay Workspace and create a Liferay module ( theme ) in that workspace. If you do not, you will have lots of errors and cause yourself much confusion.
You can put all your css changes in the _custom.scss file and they will overwrite the default css styles.
Blade CLI will generate the core freemarker templates. I recommend a header/footer template as well.
Lastly, this is how you reference the logo in your freemarker template
<a class="${logo_css_class}" href="${site_default_url}" title="<#liferay.language_format arguments="${site_name}" key="go-to-x" />">
<img alt="${logo_description}" class="logo1" src="${site_logo}" />
</a>

Looking for a sample db using select2

I have been trying to get select2 to work on an existing xPages application with no luck. I keep getting errors saying select2() is not a function. I must have something messed up with my files/folders for the required code.
I am not sure what files I need to incorporate into the Web-Inf folder. I am using Domino 9.0.1 FP3
Does anyone have a sample db I could get to pick apart and see what I am missing?
I've updated the Select2 demo on Bootstrap4XPages.com. That site is powered using the Bootstrap version in the ExtLib and no longer relies on the Bootstrap4XPages plugin. Select2 was added to the demo database in the WebContent folder and is loaded through a theme.
I've created the following examples:
Enabling Select2 on a ComboBox control, including a handler for the 'onchange' event that refreshes another section of the page.
Enabling Select2 on a ListBox control with multi-select.
A Select2 field that is attached to a (hidden) input and uses Ajax to get JSON search results from a second XPage.
Good luck picking it apart :-) The source is on GitHub

Setting up a new website with Liferay Portal - basic steps?

I know this is not specifically a programming question, but programmers will often have to do this work.
How do I create a website with Liferay portal - the docs are pretty light on this fundamental issue and are all for version 4.4. I am using version 5.2 and the docs don't seem to be relevant.
Do you know what the basic steps are. So far I have logged in as the bruno user and can see the 7cogs website and edit it. But I now need to create my own website (for my company) and be able to develop portlets to add to the parts of the page.
Further I notice that the docs talk about doing work in Eclipse. If our website is all static HTML, (the reason we want liferay is mainly so that we can edit content items using its content management tools), then will there be any need for Java dev, or will it all be drag n drop and clicking to get setup. Any guidance will be much appreciated.
Liferay can be used as a simple CMS, without much Java knowledge : creating, editing and positioning of web content fragments are drag'n'drop and use of the included rich text editor.
But to start using Liferay for your company, there are two main steps : a technical configuration (database, etc.), and a look'n'feel customization.
The technical part
First of all, you should get rid of the 7cogs website : this is called a hook in the Liferay wording. To do that, if you are using Tomcat for the application server, just delete the 7cogs directory as stated here.
You can now create the configuration file for your installation : it's a simple text properties file, named portal-ext.properties and placed in the webapps/ROOT/WEB-INF/classes folder of your tomcat installation.
This file handles most of the configuration of the Liferay portal, for example :
the name of your company
if you want to display a terms of use page on first login
if you want anybody to be able to create an account on your portal
the database where the data will be stored
To do this, the properties in the portal-ext.properties override default properties found in a embedded portal.properties file located in the jar file portal-impl.jar, in the webapps/ROOT/WEB-INF/lib directory. Just unzip the jar file in a temporary folder to access the portal.properties file.
A sample portal-ext.properties file :
company.default.web.id=yourcompany.com
terms.of.use.required=false
company.security.strangers=false
jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=root
jdbc.default.password=root
Once done, you can startup your application server. As the default admin (named test, something you can change in the portal-ext.properties file), you can access to the centralized web "control center", located in the "dock" (the strange menu labelled "welcome Test" in the upper right part of any page once logged in).
I would advise you to read the administration guide, useful for most administrative tasks.
The "branding" part
Liferay uses "Themes" to automatically decorate the portal pages (logo, navigation, portlet borders...) using images, CSS, Javascript (JQuery) and the templating language Velocity. The themes are bundled in a .war file, like a standard web application, and deployed on the fly either via the control center or by dropping the file in the deploy directory of the server.
Liferay can use several themes at the same time, one for each community (a group of pages, users and content) for example.
Creating your own theme can be done afterwards, using the "Plugins SDK".
The Wiki, forums and blogs can be very useful.

Resources