I am using liferay 6.2 on my system and I created a site and some portlets. Now I want to use the same site in mobile application. I searched on internet about mobile application that uses liferay services.
If I create a mobile application using liferay SDK. Is it possible to communicate with portlets which I created in desktop site.
I think you already know that LR 6.2 theme system is powered by bootstrap, so if the portlet of your markup is well written you can have a great view of the website in a mobile environment.
Speaking about a native mobile application, I think you are referring not to Liferay SDK, but to Liferay Mobile SDK.
In this case you will be able to access to your data by using API it provide to you. In fact, it wraps Liferay JSON web services.
An other option for you is to use any other kind of way to write your mobile application and to write inside also a client for accessing to Liferay JSON web services.
These options start from a basic concept: your portlet make used Liferay Service Layer to provide data access. In this case you just need to be sure that you declared your services also as "remote". If not just modify your service.xml file and relaunch the build-service.
If you not used LR service layer (and don't want to use it), just create a service layer (without tables) with one method for any your external calls.
If you not used (and won't use) Liferay service layer, you just need to create a RESTfull resource listener, and manage your remote calls in this way.
Last, don't forget that Liferay core services are already exposed as JSON services (so you can call it by Mobile SDK or with any client of your app)... by the way, starting from LR 6.2, there are some differences in accessing to these methods for guest users.
Hope it helps.
It is possible using Custom Remote Web services, Via Http You can call that service and communicate with portel using Liferay-mobile-SDK.
Related
I am completely new to the concept of servers, web APIs and web applications. I have a project where I need to design a Web API that allows clients to modify a database (hidden from the clients through the API).
And there is also a web application which has some functionalities. The web application also has to interact with the database.
So my question is, should I develop the Web API (Server) and the web application in the same project or two different projects?
I chose to implement the system using Mean stack for learning purposes. Mean stands for MongoDB, ExpressJS, Angular and NodeJS. As the Mean stack contains technologies to develop both the API and the Web app, am I supposed to develop all the code within one project and deploy it in my server or separate the Web API and the web application into two projects?
If it depends on the scenario, then to which kind of scenarios should I choose each and what are their pros and cons?
If shortly, Web API, it's backend, it's service, which you use in web application, and, web application, it's frontend, it's web site, which you see in your browser.
You can create one repo at github but server-side and client-side projects are separated.
You can choose the structure of your server-side and client-side projects depending on the purpose of your project. If you are going to create web application and then to develop mobile application (with ionic, for example) you should create web API separately. If you are going to create only the web application and to deploy your web application and web API to the same service (like heroku) you can make the same structure as in the heroku example (https://devcenter.heroku.com/articles/mean-apps-restful-api , also check the repo of this example https://github.com/chrisckchang/mean-contactlist-angular2 ).
Am trying to develop a mobile application which will be consuming an existing non-REST WCF service. What will be the best way to consume this service if i choose to develop the mobile application? Am new to mobile development and will be open to any suggestions.
Few things about the application as such:
Its an existing web application which we will be migrating to mobile
app.
The mobile app will need to have android/iOS versions so we are
thinking to develop hybrid app in either XAMARIN or IONIC.
The data-source for the application will be an already existing WCF
service.
We cannot rewrite or change the WCF service as we do not
have the permission to do so.
Security is an important aspect in this application.
I have only the end points and not the entire project. [Cannot edit the web.config or alter the methods to return JSON]
Am not asking for complete solution here and just for the directions. Any thoughts/suggestions will be really helpful.
Try using one of these modules to consume the WCF https://npms.io/search?q=WCF or https://npms.io/search?q=SOAP, or create another service that wraps/proxies the WCF and converts it to a REST or maybe JSON RPC interface, maybe something like this: https://github.com/kmvi/JsonRpc.ServiceModel
Consume that service in VS via Service Reference which generates proxy for you
I am in the process of building a Web based client for a Server application which is running as a Windows Service. The server application currently has a Windows Form based Client Application written in C# and the idea is to obsolete it and provide a new Web based Client Application. The Server application will be exposing REST based APIs and the Client Application would be using the REST APIs to communicate with the Server Application. (Currently the Server App exposes SOAP based endpoints which are consumed by the Windows Form Based App)
The Browser based client application would be written using Angular JS. The Client Application would be used by at max 10 concurrent users. The App is targeted for system administrators and would be used inside the enterprise environment.
Another requirement is to integrate Active Directory Authentication for the Client Application. So given the performance requirement and authentication requirements, I am wondering whether I should use IIS for hosting the Web Application. Or should I just use the existing Server to self host the web pages.
If at all I go with Self Hosting option, would Katana Self host be a good option? Or should i use WCF Rest kit to serve the pages?
What are the performance implications of using a Self Hosted mechanism for hosing the Web Application compared to IIS?
Any suggestion would be greatly appreciated.
WCF REST Starter kit is still in second preview 2 version from 2009 so I'd be pushed to recommend using it.
The question of IIS or self host depends, do you need the features that IIS has out of the box like logging, restart after failure, etc?
My suggestion would be to use ASP.NET Web API (or Nancy, which is an excellent choice too) but keep your hosting layer separate from your application layer so you have the flexibility to decide how you host your service later on.
The second suggestion is performance test early on, pick a hosting mechanism and measure how the service copes under load - you may find out that you're worrying about something that you don't need to.
As a part of Service builder, I used Local services many time but I never used the Remote services. I Read about the Remote services from the following tutorial http://www.liferay.com/documentation/liferay-portal/6.1/development/-/ai/writing-the-remote-service-class-liferay-portal-6-1-dev-guide-en.
Still I didn't completely understood the purpose and where exactly we use these Remote services.
Can any one please explain where and why we use these remote services with simple real time example.
Local services can only be invoked by Liferay itself or by a Liferay application (e.g., by a Liferay portlet).
Remote services can be invoked by any application that can access your Liferay portal (e.g., over the internet).
So, for example, if you wanted to create a desktop or mobile application that can access Liferay's Bookmarks API, you'd need to invoke the Bookmarks remote services: http://localhost:8080/api/jsonws?contextName=bookmarks
Similarly, if you're creating a custom Liferay entity via Service Builder and you want to allow developers to create desktop or mobile clients that can interact with your entity (e.g., peform CRUD operations on your entity), then you need to create remote services.
Also it's a Liferay best practice and convention not to add permission checks to local services but only to remote services. Even if you don't anticipate that any non-Liferay applications will need to access your service, you should still consider creating remote services, if only to have a place to add permission checks. (Your remote service would include permission checking code and then would invoke local your local service. This is a common pattern in Liferay.)
For more information, see https://dev.liferay.com/develop/tutorials/-/knowledge_base/6-2/creating-remote-services.
I have two liferay portals. I have deployed few portlets on Portal A. I want to use them on Portal B.
What is the appropriate way to do this?
You cannot use them in each other.
REASON : You liferay portal is your web-application server, your portlets are the web apps of that server, you have deployed them on specific server.
So, you simply cannot use this like the way you are thinking (I think your wild guess would be sharing "webapps" across portal)
The following possible solutions you can use for that
Use WSRP (Web Services for Remote Portlets), in this one, your one portal will host portlets and it can be used at remote portlets for another one.
Use Liferay Services (service.xml and remote-service=true), in this one, one portal must host liferay services as remote service =true, another portal can consume this and done.
Use Liferay Instance and not portals, Use a single Liferay portal server with 2 Liferay instances for 2 different web applications. This is possible, in this one, you can share all the resources on both the instance, and you can host them differently also.
Hope this helps!