Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error working with GateIn/Juzu portal. #71

Open
brunosimioni opened this issue Aug 14, 2014 · 1 comment
Open

Error working with GateIn/Juzu portal. #71

brunosimioni opened this issue Aug 14, 2014 · 1 comment

Comments

@brunosimioni
Copy link

Hey all,

I'm facing with a strange problem under GateIn 3.8.1, when deploying my portlet there.

Env
JBoss Developer Studio 7.1.1.GA
Openjdk 1.7
GateIn 3.8.1-Final
I'm starting up the GateIn tomcat bundle inside Eclipse "servers" tab, where I can get my development updates hot-deployed.

Problem
The portlet displays correctly (VIEW mode). All javascripts/css works fine.
The portlet throws several error in EDIT mode, when, after Eclipse deploys my portlet war, I place it into a page (edit page, as root user in gatein portal) and click in "edit portlet" button.
I'm using the same index.gtmpl under VIEW and EDIT mode just for test purposes. index.gtmpl has no variables, just html code.

Code
My controller class basic has the following (so basic):

@Inject
@Path("index.gtmpl")
Template index;

@View
    public Response.Content index(RequestContext reqContext) 
    {
        PortletMode portletMode = reqContext.getProperty(JuzuPortlet.PORTLET_MODE);
        if (portletMode.equals(PortletMode.VIEW))
        {
        return index.with().ok();
        }
        else if (portletMode.equals(PortletMode.EDIT))
        {
            return index.with().ok();
        }
        return null;
    }

Eclipse deploys my portlet correctly under GateIn. I'm using the default configuration, and placing the category manually under GateIn administration section.

The problem occurs when I'm placing my portlet under a page, and click on "edit" button. The problem occurs under web navigator and Eclipse log.

Server Log

Aug 14, 2014 7:56:10 AM org.apache.catalina.core.StandardContext reload
INFO: Reloading Context with name [/br.com.ampliato.devel.exo.addon.geopins] has started
Aug 14, 2014 7:56:14 AM juzu.impl.common.JUL send
INFO: Using inject implementation guice
Aug 14, 2014 7:56:14 AM juzu.impl.common.JUL send
INFO: Initializing module in prod mode
Aug 14, 2014 7:56:14 AM org.apache.catalina.core.StandardContext reload
INFO: Reloading Context with name [/br.com.ampliato.devel.exo.addon.geopins] is completed
Aug 14, 2014 7:56:32 AM juzu.impl.common.JUL send
INFO: Starting Application
[http-bio-8080-exec-44] WARN portal:WebuiBindingContext - Can not find resource bundle for key : IconDropDown.item.IconSet16x16
[http-bio-8080-exec-44] WARN portal:WebuiBindingContext - Can not find resource bundle for key : IconDropDown.item.IconSet16x16
[http-bio-8080-exec-52] WARN portal:WebuiBindingContext - Can not find resource bundle for key : IconDropDown.item.IconSet16x16
[http-bio-8080-exec-52] WARN portal:WebuiBindingContext - Can not find resource bundle for key : IconDropDown.item.IconSet16x16
[http-bio-8080-exec-58] WARN portal:WebuiBindingContext - Can not find resource bundle for key : IconDropDown.item.IconSet16x16
[http-bio-8080-exec-58] WARN portal:WebuiBindingContext - Can not find resource bundle for key : IconDropDown.item.IconSet16x16
[http-bio-8080-exec-56] WARN portal:WebuiBindingContext - Can not find resource bundle for key : IconDropDown.item.IconSet16x16
[http-bio-8080-exec-56] WARN portal:WebuiBindingContext - Can not find resource bundle for key : IconDropDown.item.IconSet16x16
[http-bio-8080-exec-54] WARN portal:WebuiBindingContext - Can not find resource bundle for key : IconDropDown.item.IconSet16x16
[http-bio-8080-exec-54] WARN portal:WebuiBindingContext - Can not find resource bundle for key : IconDropDown.item.IconSet16x16
[http-bio-8080-exec-54] WARN portal:WebuiBindingContext - Can not find resource bundle for key : IconDropDown.item.IconSet16x16
[http-bio-8080-exec-54] WARN portal:WebuiBindingContext - Can not find resource bundle for key : IconDropDown.item.IconSet16x16

Browser alert errors

SyntaxError: missing } after function body : window.require(["SHARED/base","SHARED/uiMaskWorkspace","SHARED/portalControl","SHARED/webui-ext","SHARED/portal","SHARED/jquery","SHARED/uiPopupWindow","SHARED/skin"],function(base,maskWS,portalControl,webuiExt,portal,$,uiPopupWindow,skin) {
maskWS.show('UIMaskWorkspace', 800, -1)  -- 0


ReferenceError: webuiExt is not defined : webuiExt.UIPortletForm.init('tab-UIPortletForm', portalControl)  -- 1

ReferenceError: webuiExt is not defined : webuiExt.UIDropDownControl.init('IconDropDown')  -- 2

ReferenceError: portal is not defined : portal.UIFormInputThemeSelector.initForm()  -- 3

ReferenceError: portal is not defined : portal.UIFormInputThemeSelector.initSelector()  -- 4

ReferenceError: webuiExt is not defined : webuiExt.UIDropDownControl.init('ThemeDropDown')  -- 5

SyntaxError: unterminated string literal : $('#UIListPermissionSelector-94af9a64980b4746b7165a4e87fb09dd .UIAction &gt  -- 6

SyntaxError: missing ; before statement :  span').click(function() {uiPopupWindow.show('UIListPermissionSelectorPopup-94af9a64980b4746b7165a4e87fb09dd')})  -- 7

SyntaxError: syntax error : })  -- 9

portlet.xml

<?xml version="1.0" encoding="UTF-8"?>
<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
             version="2.0"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd
   http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd">

   <portlet>
     <portlet-name>br.com.ampliato.devel.exo.addon.geopins</portlet-name>
     <display-name xml:lang="EN">Ampliato GEOPins</display-name>

     <portlet-class>br.com.ampliato.devel.exo.addon.geopins.GeopinsPortlet</portlet-class>

     <init-param>
       <name>juzu.run_mode</name>
       <value>dev</value>
     </init-param>
     <init-param>
       <name>juzu.inject</name>
       <value>guice</value>
     </init-param>

     <supports>
       <mime-type>text/html</mime-type>
        <portlet-mode>view</portlet-mode>
        <portlet-mode>edit</portlet-mode>
     </supports>

     <supported-locale>en</supported-locale>
     <resource-bundle>locale.portlet.GeopinsPortlet.GeopinsPortlet</resource-bundle>

     <portlet-info>
       <title>Ampliato GeoPin</title>
       <keywords>juzu,ampliato</keywords>
     </portlet-info>

   </portlet>
</portlet-app>

package-info.java

@Application
@Portlet
@Servlet("/geopins/*")

@Scripts({
    @Script(id = "jquery", value = "jquery-1.11.1.min.js"),
    @Script(id = "bootstrap", value = "bootstrap.min.js"),
    @Script(id = "leaflet", value = "leaflet.js"),
    @Script(id = "leaflet-makimarkers", value = "Leaflet.MakiMarkers.js"),
    @Script(id = "xml2json", value = "xml2json.min.js"),
    @Script(id = "app", value = "app.js", depends = {"jquery", "bootstrap", "leaflet", "leaflet-makimarkers", "xml2json"})
})

@Stylesheets({
    @Stylesheet("bootstrap.min.css"),
    @Stylesheet("bootstrap-theme.min.css"),
    @Stylesheet("leaflet.css"),
    @Stylesheet("app.css")
})
@Assets("*")

package br.com.ampliato.devel.exo.addon.geopins;

import juzu.Application;
import juzu.plugin.asset.Assets;
import juzu.plugin.asset.Script;
import juzu.plugin.asset.Scripts;
import juzu.plugin.asset.Stylesheet;
import juzu.plugin.asset.Stylesheets;
import juzu.plugin.portlet.Portlet;
import juzu.plugin.servlet.Servlet;

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.juzu</groupId>
        <artifactId>juzu-doc-tutorial-parent</artifactId>
        <version>1.0.0-cr1</version>
    </parent>

    <groupId>br.com.ampliato.devel</groupId>
    <artifactId>exo.addon.geopins</artifactId>
    <version>1.0</version>
    <packaging>war</packaging>

    <name>br.com.ampliato.devel.exo.addon.geopins</name>
    <description>br.com.ampliato.devel.exo.addon.geopins</description>

    <dependencies>

        <dependency>
            <groupId>javax.inject</groupId>
            <artifactId>javax.inject</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.juzu</groupId>
            <artifactId>juzu-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.juzu</groupId>
            <artifactId>juzu-plugins-less4j</artifactId>
        </dependency>
        <dependency>
            <groupId>org.juzu</groupId>
            <artifactId>juzu-plugins-servlet</artifactId>
        </dependency>
        <dependency>
            <groupId>org.juzu</groupId>
            <artifactId>juzu-plugins-portlet</artifactId>
        </dependency>

    </dependencies>

    <build>
        <finalName>br.com.ampliato.devel.exo.addon.geopins</finalName>
        <pluginManagement>
            <plugins>
                <!--This plugin's configuration is used to store Eclipse m2e settings 
                    only. It has no influence on the Maven build itself. -->
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.codehaus.mojo</groupId>
                                        <artifactId>
                                            build-helper-maven-plugin
                                        </artifactId>
                                        <versionRange>[1.8,)</versionRange>
                                        <goals>
                                            <goal>
                                                reserve-network-port
                                            </goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

</project>

Any help would be appreciated.

@vstorm83
Copy link
Contributor

vstorm83 commented Sep 3, 2014

Look like there are Javascript errors in your portlet. When you change to "Edit Mode". It's an portal's ajax action. And during updating html phase, it executes javascript returned from server. But if there is errors in portlet's js, the update process is interupted

Can you investigate your portlet's js? or can you push your portlet some where in Github then we can try to reproduce the issue ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants