added ClientScopeHandler to help prevent the back button cache problem in Chrome and Firefox

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/top-topics@102007 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2014-12-12 10:30:13 +00:00
parent 84ff2a6bdf
commit 77df751492
9 changed files with 48 additions and 23 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/top-topics-1.0.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<classpathentry kind="src" output="target/top-topics-1.0.1-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
@ -30,5 +30,5 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/top-topics-1.0.0-SNAPSHOT/WEB-INF/classes"/>
<classpathentry kind="output" path="target/top-topics-1.0.1-SNAPSHOT/WEB-INF/classes"/>
</classpath>

View File

@ -1,5 +1,5 @@
eclipse.preferences.version=1
jarsExcludedFromWebInfLib=
lastWarOutDir=/Users/massi/Documents/workspace/top-topics/target/top-topics-1.0.0-SNAPSHOT
lastWarOutDir=/Users/massi/Documents/workspace/top-topics/target/top-topics-1.0.1-SNAPSHOT
warSrcDir=src/main/webapp
warSrcDirIsOutput=false

View File

@ -4,6 +4,9 @@
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<dependent-module archiveName="gcube-widgets-1.9.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/gcube-widgets/gcube-widgets">
<dependency-type>uses</dependency-type>
</dependent-module>
<property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/>
<property name="context-root" value="top-topics"/>
</wb-module>

View File

@ -13,7 +13,7 @@
<groupId>org.gcube.portlets.user</groupId>
<artifactId>top-topics</artifactId>
<packaging>war</packaging>
<version>1.0.0-SNAPSHOT</version>
<version>1.0.1-SNAPSHOT</version>
<name>Top Topics Portlet</name>
<description>
Top Topics Portle shows the top 10 topics in the scope where is deployed.
@ -59,7 +59,8 @@
</dependency>
<dependency>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>gcube-widgets</artifactId>
<artifactId>gcube-widgets</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.gcube.portal</groupId>

View File

@ -1,8 +1,11 @@
package org.gcube.portlets.user.topics.client;
import org.gcube.portlets.user.gcubewidgets.client.ClientScopeHelper;
import org.gcube.portlets.user.topics.client.panel.TopicsPanel;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.Window.Location;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.RootPanel;
/**
*
@ -12,6 +15,15 @@ import com.google.gwt.user.client.ui.RootPanel;
public class TopTopics implements EntryPoint {
public void onModuleLoad() {
RootPanel.get("Trending-Topics-Container").add(new TopicsPanel());
ClientScopeHelper.getService().setScope(Location.getHref(), new AsyncCallback<Boolean>() {
@Override
public void onSuccess(Boolean result) {
RootPanel.get("Trending-Topics-Container").add(new TopicsPanel());
}
@Override
public void onFailure(Throwable caught) {
}
});
}
}

View File

@ -25,7 +25,6 @@ import org.slf4j.LoggerFactory;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
import com.liferay.portal.model.Organization;
import com.liferay.portal.model.User;
import com.liferay.portal.service.UserLocalServiceUtil;
/**
* @author Massimiliano Assante, ISTI-CNR

View File

@ -2,8 +2,8 @@
<module rename-to='toptopics'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User' />
<!-- <set-property name="user.agent" value="safari" /> -->
<!-- To Comment out -->
<!-- <set-property name="user.agent" value="safari,gecko1_8" /> -->
<!-- Other module inherits -->
<inherits name='org.gcube.portlets.user.gcubewidgets.WidgetFactory' />

View File

@ -1,5 +1,5 @@
#Trending-Topics-Container {
margin-right: 20px;
margin-right: 10px;
}
.topic-title {

View File

@ -5,20 +5,30 @@
<web-app>
<!-- Servlets -->
<servlet>
<servlet-name>topicsServlet</servlet-name>
<servlet-class>org.gcube.portlets.user.topics.server.TopicServiceImpl</servlet-class>
</servlet>
<!-- Servlets -->
<servlet>
<servlet-name>topicsServlet</servlet-name>
<servlet-class>org.gcube.portlets.user.topics.server.TopicServiceImpl</servlet-class>
</servlet>
<servlet>
<servlet-name>scopeService</servlet-name>
<servlet-class>org.gcube.portlets.user.gcubewidgets.server.ScopeServiceImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>topicsServlet</servlet-name>
<url-pattern>/toptopics/topicservice</url-pattern>
</servlet-mapping>
<!-- Default page to serve -->
<welcome-file-list>
<welcome-file>TrendingTopics.html</welcome-file>
</welcome-file-list>
<servlet-mapping>
<servlet-name>topicsServlet</servlet-name>
<url-pattern>/toptopics/topicservice</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>scopeService</servlet-name>
<url-pattern>/toptopics/scopeService</url-pattern>
</servlet-mapping>
<!-- Default page to serve -->
<welcome-file-list>
<welcome-file>TrendingTopics.html</welcome-file>
</welcome-file-list>
</web-app>