You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

portal-eclipse.asciidoc 3.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. ---
  2. title: Creating a Generic Portlet in Eclipse
  3. order: 2
  4. layout: page
  5. ---
  6. [[portal.eclipse]]
  7. = Creating a Generic Portlet in Eclipse
  8. Here we describe the creation of a generic portlet project in Eclipse. You can
  9. use the Maven archetypes also in other IDEs or without an IDE.
  10. For Liferay portlet development, you may instead want to use the Maven archetype
  11. or Liferay IDE to create the project, as described in
  12. <<dummy/../../../framework/portal/portal-liferay#portal.liferay,"Developing
  13. Vaadin Portlets for Liferay">>.
  14. [[portal.eclipse.vaadin]]
  15. == Creating a Project with Vaadin Plugin
  16. The Vaadin Plugin for Eclipse has a wizard for easy creation of generic portlet
  17. projects. It creates a UI class and all the necessary descriptor files.
  18. Creating a portlet project is almost identical to the creation of a regular
  19. Vaadin servlet application project. For a full treatment of the New Project
  20. Wizard and the possible options, please see
  21. <<dummy/../../../framework/getting-started/getting-started-first-project#getting-started.first-project.creation,"Creating
  22. the Project">>.
  23. . Start creating a new project by selecting from the menu "File > New > Project..."+
  24. //TODO Use ellipsis
  25. //&lt;?dbfo-need height="8cm" ?&gt;
  26. . In the [guilabel]#New Project# window that opens, select "Web > Vaadin 7 Project" and click [guibutton]#Next#.
  27. //&lt;?dbfo-need height="10cm" ?&gt;
  28. . In the [guilabel]#Vaadin Project# step, you need to set the basic web project
  29. settings. You need to give at least the project name, the runtime, select
  30. [guilabel]#Generic Portlet# for the [guilabel]#Deployment configuration#; the
  31. default values should be good for the other settings.
  32. ifdef::web[]
  33. +
  34. image::img/project-new-portlet-1.png[]
  35. endif::web[]
  36. +
  37. You can click [guibutton]#Finish# here to use the defaults for the rest of the
  38. settings, or click [guibutton]#Next#.
  39. . The settings in the [guilabel]#Web Module# step define the basic servlet-related
  40. settings and the structure of the web application project. All the settings are
  41. pre-filled, and you should normally accept them as they are and click
  42. [guibutton]#Next#.
  43. . The [guilabel]#Vaadin project# step page has various Vaadin-specific application
  44. settings. These are largely the same as for regular applications. Setting them
  45. here is easiest - later some of the changes require changes in several different
  46. files. The [guilabel]#Create portlet template# option should be automatically
  47. selected. You can give another portlet title of you want. You can change most of
  48. the settings afterward.
  49. +
  50. image::img/project-new-portlet-3.png[]
  51. [guilabel]#Create project template#:: Creates a UI class and all the needed portlet deployment descriptors.
  52. [guilabel]#Application name#:: The application name is used in the title of the browser window, which is
  53. usually invisible in portlets, and as an identifier, either as is or with a
  54. suffix, in various deployment descriptors.
  55. [guilabel]#Base package name#:: Java package for the UI class.
  56. [guilabel]#Application class name#:: Name of the UI class. The default is derived from the project name.
  57. [guilabel]#Theme name#:: Name of the custom portlet theme to use.
  58. [guilabel]#Portlet version#:: Same as in the project settings.
  59. [guilabel]#Portlet title#:: The portlet title, defined in [filename]#portlet.xml#, can be used as the
  60. display name of the portlet (at least in Liferay). The default value is the
  61. project name. The title is also used as a short description in
  62. [filename]#liferay-plugin-package.properties#.
  63. [guilabel]#Vaadin version#:: Same as in the project settings.
  64. +
  65. Finally, click [guibutton]#Finish# to create the project.
  66. . Eclipse may ask you to switch to J2EE perspective. A Dynamic Web Project uses an
  67. external web server and the J2EE perspective provides tools to control the
  68. server and manage application deployment. Click [guibutton]#Yes#.