I am new in Liferay platform. I am trying to implement CRUD in Liferay using portlet. I am using liferay 6.2 and IDE as a developer studio.
I am creating project with below values (In Image) in developer studio.
When I am creating project in Developer studio I am getting 3 project in my Liferay project explorer which are shown in below image.
So my question is that why its three project are created when I only want to create one service builder portlet. What are the use of that?
Anyone can help?
So this is what Liferay with Maven does:
It creates a Parent Project (BookServicePortlet). Liferay assumes, if you want to build a service layer, you also will implement a portlet where you access the Services generated. So that's why Liferay-Maven is creating 2 SubProjects in your parent project. One for the service, and one for Web-Tier. This is done, so that you can distribute your service layer to other portlets without distributing all your front-end code. If you don't have a front-end (and I doubt that ;) ) you could just leave all blank in BookServicePortlet-portlet.
Related
I have created a Java webservice in Eclipse which provides a REST API and an Android project (in Android Studio) which consumes said API. The problem I am facing right now is that I want to use the same model/domain classes in both the Java webservice and the Android application (the webservice uses Maven whereas the Android application uses Gradle).
At the moment I am manually mirroring any changes I make to the model classes in both the Java webservice and the Android project. This is however very tedious and obviously not a good solution.
My questions is how I can solve this issue. I thought about creating a Maven module containing the model classes and importing them in the Java webservice and the Android project. However I am uncertain if this a solution which will work.
Are there any better (and maybe obvious) solutions I am not seeing? Thanks in advance for any help!
Edit: Is it actually smart to share the whole model classes? I clearly don't want to use all the attributes from the webservice in the Android project (e.g. passwords will never be stored in the Android project but have to be stored in the webservice).
You could create a library for your model, and share it between the provider (REST API) and the consumer (your Android app). That could be done with a multi-module maven project, where you can have a module for your model layer and another module for your REST API layer that uses the previous model artifact.
Doing so, you could install the model library in your local repository (or deploy it in whatever centralized repository you may need) and use it from your Android application.
But I would advice you against sharing the model that way, because you would be tight-coupling your consumer and provider at the model level. That would make it harder to evolve them independently.
I'm using Eclipse and have the Liferay plugin installed and trying to create a new portlet. I want the Liferay IDE to pre-generate as much code as possible
Does anyone know what the main differences are between creating a new Liferay Portlet and a Liferay Plugin Project?
Liferay Plugin Project allows you to create a project (of type portlet, theme, hook etc..), with all dependencies and settings that you need to start coding (or almost).
Liferay portlet adds to one of your plugin projects of type portlet a class (the portlet class) and optionally a JSP. But you have to tell the portlet how use this class and jsp, and probably many other missing settings.
I suggest you always use the Liferay Plugin Project, its simpler and fast.
I'd rather use a different explanation than Marco:
A plugin project is what you add to the IDE - This is where your actual plugins live. Eclipse organizes around projects, and the projects are what makes up a plugin for Liferay. As the IDE interprets different kinds of projects in a different way (e.g. standalone Java Applications vs. "Dynamic Web projects" etc), a "Portlet Project" or "Theme Project" just adds to this list.
Once you have a plugin project (of type "Portlet") you can add as many portlets to it as you like. Thus, if you're developing portlets, you'll always have a minimum of one portlet plugin. This portlet plugin can hold any number of portlets.
You'll always deploy the whole plugin to Liferay - this fact might influence which portlets you want to group into a single plugin.
I am working on an App-Engine-connected-Android project created through Google Plugin for Eclipse. After I updated some fields and methods for one of the entity classes in the App Engine backend, I regenerated the Cloud Endpoints client library, but it still shows old methods and new ones are not being generated.
I even tried the already existing endpoint libraries in the Android project and then regenerating the client libraries through GPE - it did not work.How can we fix this?
Did you save the project after the changes? Some IDEs automatically save changes as you make them but you have to explicitly click on save in Eclipse.
Everytime when I create a new java web project, I have to configure and add many folders and property files for primefaces, hibernate, jsf, ldap, tomcat etc.
It wastes all my time. I find a solution for this, but it is not a generic solution.
My solution is that, I created a web project and configure all props and folders but not develop any code. It was an configured empty project. I mean it was my custom template project.
When I want to create a new web project, I always have to import this configured project and rename it. It's not a good way I think.
So, In the project creation tab, how can I add my custom project to creation wizard or how can I create my custom project in the beginning.
Is there any plugin or tool to create pre-configured template web project ?
Is there any tutorial to develop an eclipse plugin to do this ?
Thanks for your interest.
You probably need e.g. maven archetype that would generate such a project.
Alternatively you can use Spring Tool Suite, it has some predefined templates.
If you want to create plugin by yourself you can read more about Creating Eclipse Wizards (by Lars Vogel). But this is not so trivial (may need some work to make it work perfectly). Generally whole Lars Vogel's site is about creating Eclipse plugins.
I want to create a new Netbeans 7.3 project that will be based on the 'HTML web-application' project type, but it will also need to communicate to a server, so I want to add 'Java Web support', but they are listed as two separate project types.
How can I create a Java web app and add the HTML 5 support into it? What are the steps required to create the 'merged' project types?
Apparently it's not tightly integrated in Netbeans yet, but I was able to do it by creating the two separate projects and then going in to the Web Application Project-Properties and adding an entry in the 'packaging' tab (see screenshot).