PUBLIC - Liferay IDE
  1. PUBLIC - Liferay IDE
  2. IDE-463

As a portlet plugin developer, I want to be able to create portlet UI framework with springmvc

    Details

    • Type: Story Story
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0 M1
    • Component/s: Wizards, Wizards > Project
    • Labels:
      None
    • Similar Issues:
      Show 5 results 

      Description

      Need to add support for SpringMVC as a view technology for Liferay portlet projects. Also need a create a new Spring MVC Portlet wizard to go along with default portlet wizard, and JSF/Vaadin portlet wizard.

        Activity

        Hide
        Nagnedra Kumar Busam added a comment -

        This will be a great feature addition to Liferay IDE

        Show
        Nagnedra Kumar Busam added a comment - This will be a great feature addition to Liferay IDE
        Hide
        Nicholas Collins added a comment -

        Also as a part of this, it should include the option of using Spring Web Flow.

        Show
        Nicholas Collins added a comment - Also as a part of this, it should include the option of using Spring Web Flow.
        Hide
        Gregory Amerson added a comment -

        Please help me, my spring knowledge is lacking, what is the relationship/difference between SpringMVC and SpringWebFlow? Is it a alternative or superset, etc?

        Show
        Gregory Amerson added a comment - Please help me, my spring knowledge is lacking, what is the relationship/difference between SpringMVC and SpringWebFlow? Is it a alternative or superset, etc?
        Hide
        Nicholas Collins added a comment -

        Spring Web Flow layers on top of Spring MVC, and adds flow capabilities similar to what JSF offers, but is more sophisticated and IMHO easier to follow.

        Show
        Nicholas Collins added a comment - Spring Web Flow layers on top of Spring MVC, and adds flow capabilities similar to what JSF offers, but is more sophisticated and IMHO easier to follow.
        Hide
        Nicholas Collins added a comment -

        I have gotten Spring MVC and Spring Web Flow working with Liferay 6.1 with the changes you guys made to the parent context.

        The steps as outlined are as follows:

        1) Add the following to the web.xml

        <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
        </listener>

        <servlet>
        <servlet-name>ViewRendererServlet</servlet-name>
        <servlet-class>org.springframework.web.servlet.ViewRendererServlet</servlet-class>
        </servlet>
        <servlet-mapping>
        <servlet-name>ViewRendererServlet</servlet-name>
        <url-pattern>/WEB-INF/servlet/view</url-pattern>
        </servlet-mapping>

        2) add the file applicationContext.xml to your WEB-INF directory, including imports to your Spring MVC context XML files.

        3) add your Spring MVC context configuration XML files anywhere you want, provided the path matches what you have in the applicationContext.xml. I personally prefer WEB-INF/contexts/.

        4) modify your portlet descriptor in your portlet.xml file so the <portlet-class> references either org.springframework.web.portlet.DispatcherPortlet or your own class that extends DispatcherPortlet. Also include the init-param "contextConfigLocation" with the value as the path to the spring configuration for that portlet.

        5) configure your portlets context configuration XML with the portlet specific settings, such as registering controller beans, view resolvers, flow registries, flow handlers, and portlet mode handlers, etc.

        As part of this, the Service Builder script will need to be modified such that the *LocalServiceUtil classes implement java.io.Serializable. Otherwise they cannot be injected into the flows or controllers.

        If you want to see some of how this could look, I would check out the Spring MVC and Spring Web Flow scaffolding in MyEclipse for Spring. They use their Spring DSL (which would be an analog to our Service Builder entities) and allow you to scaffold out your app with a variety of view technologies, such as Spring MVC, Spring Web Flow, GWT, Flex, etc.

        Show
        Nicholas Collins added a comment - I have gotten Spring MVC and Spring Web Flow working with Liferay 6.1 with the changes you guys made to the parent context. The steps as outlined are as follows: 1) Add the following to the web.xml <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <servlet> <servlet-name>ViewRendererServlet</servlet-name> <servlet-class>org.springframework.web.servlet.ViewRendererServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>ViewRendererServlet</servlet-name> <url-pattern>/WEB-INF/servlet/view</url-pattern> </servlet-mapping> 2) add the file applicationContext.xml to your WEB-INF directory, including imports to your Spring MVC context XML files. 3) add your Spring MVC context configuration XML files anywhere you want, provided the path matches what you have in the applicationContext.xml. I personally prefer WEB-INF/contexts/. 4) modify your portlet descriptor in your portlet.xml file so the <portlet-class> references either org.springframework.web.portlet.DispatcherPortlet or your own class that extends DispatcherPortlet. Also include the init-param "contextConfigLocation" with the value as the path to the spring configuration for that portlet. 5) configure your portlets context configuration XML with the portlet specific settings, such as registering controller beans, view resolvers, flow registries, flow handlers, and portlet mode handlers, etc. As part of this, the Service Builder script will need to be modified such that the *LocalServiceUtil classes implement java.io.Serializable. Otherwise they cannot be injected into the flows or controllers. If you want to see some of how this could look, I would check out the Spring MVC and Spring Web Flow scaffolding in MyEclipse for Spring. They use their Spring DSL (which would be an analog to our Service Builder entities) and allow you to scaffold out your app with a variety of view technologies, such as Spring MVC, Spring Web Flow, GWT, Flex, etc.
        Hide
        Gregory Amerson added a comment -

        Fixed in 3.0M1, new Spring MVC Portlet is available when creating new projects (must have Spring Portlet Archetype installed or using 7.0 SDK)

        Show
        Gregory Amerson added a comment - Fixed in 3.0M1, new Spring MVC Portlet is available when creating new projects (must have Spring Portlet Archetype installed or using 7.0 SDK)
        Hide
        Yanan Yuan added a comment - - edited

        Hi Greg,

        Do we have new Spring mvc Portlet wizard on IDE 3.0-M1 now ? (I mean on liferay ide 3.0 master branch)
        When verify this ticket, I can create SpringMvc project on 7.0-m6 successfully, but I didn't find the SpringMvc portlet wizard yet, is this a new wizard like "new liferay portlet" and "new jsf portlet" wizards?

        Show
        Yanan Yuan added a comment - - edited Hi Greg, Do we have new Spring mvc Portlet wizard on IDE 3.0-M1 now ? (I mean on liferay ide 3.0 master branch) When verify this ticket, I can create SpringMvc project on 7.0-m6 successfully, but I didn't find the SpringMvc portlet wizard yet, is this a new wizard like "new liferay portlet" and "new jsf portlet" wizards?

          People

          • Votes:
            9 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Days since last comment:
              4 days ago

              Development

                Structure Helper Panel