Bring in custom NSF as data service to Bluemix - xpages

I would like to bring a custom NSF for data service in Bluemix. I can create a copy of the NSF to the Bluemix server, but from there I can not bind the service to my XPages application since it does nowhere appear under available services.
The reason why I have created a copy of the NSF file to Bluemix is that I want to avoid the default todo_data.nsf file name. This filename gives the customer the indication the application is not ready/finished and it does not reply to my application which is not a todo application.
Are there other ways to provide a NSF data service with a custom filename?

In the bluemixContext there is a utility method to facilitate what you are describing. It was added in release 15 of the ExtLib. You can see the code here: https://github.com/OpenNTF/XPagesExtensionLibrary/blob/master/extlib/lwp/product/runtime/eclipse/plugins/com.ibm.xsp.bluemix.util/src/com/ibm/xsp/bluemix/util/context/DataService.java#L132
Once your custom data NSF is copied up to the XPages NoSQL Database service, you should be able to reference it inside your design NSF as follows:
bluemixContext.getDataService().findDatabaseByName("customDbPath")
Pass that value to the databaseName property of your XPages data sources, like how the boilerplate example app does it for tododata.nsf using findDatabaseName() instead.

Related

Does a version of a master template need to be on every server that a database resides on if only a design element is inheriting from it?

Scenario: We have four databases that are setup to inherit from a master template and they in turn have individual design elements that inherit from a different master template via template name added in the field shown in image.
It has always been my understanding that in order for the individual design elements in the database to inherit any changes a version of the master template must also be on all servers where the database resides so that the nightly server process will make updates to the design element(s).
Is this true? Does this change when creating a build using Teamstudio CIAO Builds/Promotions?
If you want changes to any design elements to be automatically picked up from templates overnight - regardless of whether they inherit individually as in your screenshot, or inherit from the template named in the database properties - then one of the following must be true:
If the database is replicated to multiple servers, then the templates must be on at least one of those servers; or
If the database is only on one server, then the templates must be on that server.
So, if you have a few databases that are on one server each and not replicated, and they inherit from the same templates, then you'd need those templates on every server to get automatic overnight inheritance in every database.
However, there's no need to rely on automatic inheritance, as users with Designer access to affected databases can manually refresh designs from templates using the Notes or Designer client. If you do this, you can keep the templates on just one server regardless of how many servers have databases using those templates.
Note regarding template designs in any case, whether databases are automatically or manually refreshed: Best practice (as I understand it) is to have production template designs signed by a single user id created for the express purpose of signing designs, with a Domino policy in place to ensure that all users Execution Control Lists (ECLs) trust that signer, to prevent users from getting ECL alerts when using production applications.
My experience with Teamstudio CIAO isn't extensive, but I don't think it changes any of the above.
CIAO! / Build Manager uses the IBM Domino API to perform a Design Refresh, therefore it does not need to wait for the nightly Design task to run.
CIAO! / Build Manager calls the Design Refresh API and passes the Target DB info and then name of the IBM Server where the template resides. Therefore for a full design refresh of a Target db the Template does not need to reside on the same server.
If you have indicated a Design Template for individual Design Elements within a Notes Application, then in this scenario the Master Template would need to reside on the IBM Domino server where the Notes Application also resides. The CIAO! / Build Manager application does not include the capability of updating these individual Design Elements.

Liferay create site / page programmatically

I have been using Liferay for work for 2 weeks. I noticed that it's a bit difficult to find good documentation and tutorials.
Until now I created pages from the web portal. After I create them, I drag and drop portlets. I don't really like this approach, I would prefer to use a coding approach. Is there a way to create a website or page programmatically by defining a project as I do to create portlets?
Moreover, I am using Liferay with WebLogic 10.3.6. I want to know where liferay puts pages I created via web-portal on the file system. I suppose that a file, or something similar, is created when I declare a new site on the Liferay web-portal.
Thank you all,
Marco
Yes Liferay has it's Database, all data of any Liferay object is stored in the database and / or on the file system depending on your configuration.
However, one of the functionality of Liferay is to let you create pages / sites through the UI. As documented in the Java Portal Specification and Liferay Server Documents your approach to create pages in an alternative way is possible but it is part of Liferay's Portal Services. You can use Liferay's Service (HTTP REST) API to call the related service. To access those APIs you need to configure your Liferay Server.
In case you want to do programmatically you still need to configure, enable and call those external HTTP services from your code. You should not create Liferay Objects from your own code hosted as an extension inside your Liferay Instance as that will result inconsistency in your Liferay Database / filesystem. (As in case of page creation Liferay creates a set of other related objects in it's database / filesystem.)
In your liferay bundle you will find two plugins of interest.
First is resources-importer-web for which description says
The Resources Importer app allows front-end developers to package web
content, portlet configurations, and layouts together in a theme
without saving it as a compiled .LAR file thereby allowing for greater
flexibility in its usage between Liferay Portal versions.This app will automatically create associated content when other
plugins are deployed that are configured to make use of the Resource
Importer app.This app installs as a Liferay service.
Second is welcome-theme which declares resources to be created by resources-importer-web. This on should be example how to create your own. Take a look at
welcome-theme\WEB-INF\src\resources-importer\*
welcome-theme\WEB-INF\liferay-plugin-package.properties
This feature is described at importing-resources-with-themes
As mentioned by gabor_the_kid, Liferay stores all objects in its tables. For example, User related objects would be in user table. Liferay exposed services or API's to change the default/to add new behaviors by program but not easier than achieving it through UI. Also maintenance should be considered for going program way of creating pages or layouts etc.
You can describe your changes using xml and use the Liferay Portal DB Setup core to create the changes in DB.
The library defines the list of available xml configurations.

How can I implement domino data services within an xpinc application to display a notes view in a restful state

I have an xPages application that I would like to get working in the Notes client via xpinc. I have a view that displays its information via domino data services as json. How can I make this available to my xpinc application?
Yes, Patrick. You answered your own question in the comments section.
The full Domino data service does not run locally on the Notes client. Therefore, your xpinc application can't use a local instance of the data service. On the other hand, the XPages REST service control should work locally. The REST service control uses some of the same underlying code as the data service, so you should be able to make it return essentially the same JSON representation of view entries. It may take a bit more work, but it's the best option for xpinc.
Good luck.

Where does Liferay save its data?

Let's say I'm adding data to different portlets inside of the Liferay Portal. Where is all these data saved to?
Most of the out of the box portlets that Liferay ships with like Blogs, Forums, Wiki, Web content gets stored in Liferay database. You can see the tables and the actual data properly if you have a production ready database configured with Liferay like MySQL or Oracle.
Liferay by default ships with Hypersonic database for quick demo purpose. It save all the information in a file. All the hypersonic related files are saved in "data\hsql" folder inside wherever you have extracted Liferay. You can view the tables using DbVisualizer if you want to see hypersonic db data.
You can also create your custom portlets. Where the data of these has to be stored is completely upto you. You can save the data in the Liferay's database if you want but that is not mandatory. It's upto you where you want to persist data for the custom portlets

Extracting Metadata of Lotus Notes Applications Using Notes Java API?

I am looking for extracting metadata about Notes Applications on a Domino server using Java Notes API. I tried reading the list of applications/databases from catalog.nsf file.
But catalog.nsf does not have new Applications that are created based on a existing template.
So From where can I get the list of applications that are existing on a Domino Server? Will the new Applications be added to catalog? If not how to make them to be added in the catalog?
Any help or Ideas will be much appreciated.
Thanks,
Srinivas
So if you want to do this in Java If the catalog.nsf is not upto date, then you can also try the dbdirectory class, look ==>here.
This should have an example to give you an idea how to read through all database on the server. If the Domino server is not registering new applications then catalog process is not running. You can load it by simply type "load catalog" at the console. More details ==>here.
There can still be other issues, but will wait for your response.
This is more of a "Server Fault" answer, but in the Domino Directory, you can turn on the Domain Catalog server task for a server in your domain, and that server will populate (and keep updated) the catalog.nsf file, which will then replicate across your domain.
So just enable that task within the server document, or go to the domino console and type load catalog

Resources