Costantino Perciante 8 years ago
parent de780d1fa4
commit 553ff50b7e

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/user-statistics-portlet-0.0.1-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/user-statistics-portlet-0.0.1-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
<classpathentry kind="output" path="target/user-statistics-portlet-0.0.1-SNAPSHOT/WEB-INF/classes"/>
</classpath>

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>user-statistics</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.google.gdt.eclipse.core.webAppProjectValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.google.gwt.eclipse.core.gwtProjectValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
<nature>com.google.gwt.eclipse.core.gwtNature</nature>
</natures>
</projectDescription>

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main/webapp"/>
<classpathentry kind="src" path="target/m2e-wtp/web-resources"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
<attributes>
<attribute name="hide" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
<classpathentry kind="output" path=""/>
</classpath>

@ -0,0 +1,2 @@
eclipse.preferences.version=1
filesCopiedToWebInfLib=

@ -0,0 +1,5 @@
eclipse.preferences.version=1
jarsExcludedFromWebInfLib=
lastWarOutDir=/home/costantino/workspace/user-statistics-portlet/target/user-statistics-portlet-0.0.1-SNAPSHOT
warSrcDir=src/main/webapp
warSrcDirIsOutput=false

@ -0,0 +1,4 @@
eclipse.preferences.version=1
entryPointModules=
filesCopiedToWebInfLib=
gwtCompileSettings=PGd3dC1jb21waWxlLXNldHRpbmdzPjxsb2ctbGV2ZWw+SU5GTzwvbG9nLWxldmVsPjxvdXRwdXQtc3R5bGU+T0JGVVNDQVRFRDwvb3V0cHV0LXN0eWxlPjxleHRyYS1hcmdzPjwhW0NEQVRBW11dPjwvZXh0cmEtYXJncz48dm0tYXJncz48IVtDREFUQVstWG14NTEybV1dPjwvdm0tYXJncz48ZW50cnktcG9pbnQtbW9kdWxlPm9yZy5nY3ViZS5wb3J0bGV0LnVzZXIudXNlcnN0YXRpc3RpY3Nwb3J0bGV0LlN0YXRpc3RpY3M8L2VudHJ5LXBvaW50LW1vZHVsZT48L2d3dC1jb21waWxlLXNldHRpbmdzPg\=\=

@ -0,0 +1,6 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding//src/test/java=UTF-8
encoding//src/test/resources=UTF-8
encoding/<project>=UTF-8

@ -0,0 +1,13 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.7

@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1

@ -0,0 +1,3 @@
eclipse.preferences.version=1
org.eclipse.m2e.wtp.enableM2eWtp=true
org.eclipse.m2e.wtp.enabledProjectSpecificPrefs=false

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="user-statistics">
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<property name="java-output-path" value="/user-statistics/target/user-statistics-portlet-0.0.1-SNAPSHOT/WEB-INF/classes"/>
<property name="context-root" value="user-statistics-portlet"/>
</wb-module>
</project-modules>

@ -0,0 +1,7 @@
<root>
<facet id="jst.jaxrs">
<node name="libprov">
<attribute name="provider-id" value="jaxrs-no-op-library-provider"/>
</node>
</facet>
</root>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<fixed facet="wst.jsdt.web"/>
<installed facet="java" version="1.7"/>
<installed facet="jst.web" version="2.3"/>
<installed facet="wst.jsdt.web" version="1.0"/>
<installed facet="jst.jaxrs" version="1.1"/>
</faceted-project>

@ -0,0 +1 @@
org.eclipse.wst.jsdt.launching.baseBrowserLibrary

@ -0,0 +1,2 @@
disabled=06target
eclipse.preferences.version=1

@ -0,0 +1,7 @@
gCube System - License
------------------------------------------------------------
The gCube/gCore software is licensed as Free Open Source software conveying to the EUPL (http://ec.europa.eu/idabc/eupl).
The software and documentation is provided by its authors/distributors "as is" and no expressed or
implied warranty is given for its use, quality or fitness for a particular case.

@ -0,0 +1,6 @@
Mantainers
-------
* Massimiliano Assante (massimiliano.assante@isti.cnr.it), CNR Pisa,
Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo".

@ -0,0 +1,3 @@
This work has been partially supported by the following European projects: DILIGENT (FP6-2003-IST-2),
D4Science (FP7-INFRA-2007-1.2.2), D4Science-II (FP7-INFRA-2008-1.2.2), iMarine (FP7-INFRASTRUCTURES-2011-2),
and EUBrazilOpenBio (FP7-ICT-2011-EU-Brazil), Parthenos (H2020-INFRADEV-1-2014-1), BlueBridge (H2020-EINFRA-2015-1).

@ -0,0 +1,3 @@
<ReleaseNotes>
<!-- TODO -->
</ReleaseNotes>

@ -0,0 +1,48 @@
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>servicearchive</id>
<formats>
<format>tar.gz</format>
</formats>
<baseDirectory>/</baseDirectory>
<fileSets>
<fileSet>
<directory>${distroDirectory}</directory>
<outputDirectory>/</outputDirectory>
<useDefaultExcludes>true</useDefaultExcludes>
<includes>
<include>README</include>
<include>LICENSE</include>
<include>INSTALL</include>
<include>MAINTAINERS</include>
<include>changelog.xml</include>
</includes>
<fileMode>755</fileMode>
<filtered>true</filtered>
</fileSet>
<fileSet>
<directory>target/apidocs</directory>
<outputDirectory>/${artifactId}/doc/api</outputDirectory>
<useDefaultExcludes>true</useDefaultExcludes>
<fileMode>755</fileMode>
</fileSet>
</fileSets>
<files>
<file>
<source>${distroDirectory}/profile.xml</source>
<outputDirectory>./</outputDirectory>
<filtered>true</filtered>
</file>
<file>
<source>target/${build.finalName}.war</source>
<outputDirectory>/${artifactId}</outputDirectory>
</file>
<file>
<source>${distroDirectory}/svnpath.txt</source>
<outputDirectory>/${artifactId}</outputDirectory>
<filtered>true</filtered>
</file>
</files>
</assembly>

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<Resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ID></ID>
<Type>Service</Type>
<Profile>
<Description>${description}</Description>
<Class>PortletUser</Class>
<Name>${artifactId}</Name>
<Version>${version}</Version>
<Packages>
<Software>
<Name>${artifactId}</Name>
<Version>${version}</Version>
<MavenCoordinates>
<groupId>${groupId}</groupId>
<artifactId>${artifactId}</artifactId>
<version>${version}</version>
</MavenCoordinates>
<Files>
<File>target/${build.finalName}.war</File>
</Files>
</Software>
</Packages>
</Profile>
</Resource>

@ -0,0 +1 @@
${scm.url}

@ -0,0 +1,199 @@
<?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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>maven-parent</artifactId>
<groupId>org.gcube.tools</groupId>
<version>1.0.0</version>
<relativePath />
</parent>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>user-statistics-portlet</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>User statistics portlet</name>
<description>
User statistics portlet shows main user's statistics.
</description>
<scm>
<connection>scm:svn:http://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/${project.artifactId}</connection>
<developerConnection>scm:https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/${project.artifactId}</developerConnection>
<url>http://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/${project.artifactId}</url>
</scm>
<properties>
<!-- Convenience property to set the GWT version -->
<gwtVersion>2.7.0</gwtVersion>
<!-- GWT needs at least java 1.6 -->
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt</artifactId>
<version>${gwtVersion}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.gcube.distribution</groupId>
<artifactId>maven-portal-bom</artifactId>
<version>LATEST</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<scope>provided</scope>
<version>2.7.0</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<scope>provided</scope>
<version>2.7.0</version>
</dependency>
<dependency>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>gcube-widgets</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>portal-service</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.portal</groupId>
<artifactId>custom-portal-handler</artifactId>
</dependency>
<dependency>
<groupId>org.gcube.applicationsupportlayer</groupId>
<artifactId>aslcore</artifactId>
</dependency>
<dependency>
<groupId>org.gcube.dvos</groupId>
<artifactId>usermanagement-core</artifactId>
</dependency>
<dependency>
<groupId>com.google</groupId>
<artifactId>gwt-jsonmaker</artifactId>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.gcube.core</groupId>
<artifactId>common-scope-maps</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>javax.portlet</groupId>
<artifactId>portlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.portal</groupId>
<artifactId>social-networking-library</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>home-library</artifactId>
<scope>provided</scope>
<exclusions>
<exclusion>
<artifactId>asm-all</artifactId>
<groupId>asm</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>home-library-jcr</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<!-- Output classes directly into the webapp, so that IDEs and "mvn process-classes"
update them in DevMode -->
<outputDirectory>${webappDirectory}/WEB-INF/classes</outputDirectory>
<plugins>
<!-- GWT Maven Plugin -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>${gwtVersion}</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<!-- <goal>test</goal> -->
<!-- <goal>generateAsync</goal> -->
</goals>
</execution>
</executions>
<!-- Plugin configuration. There are many available options, see gwt-maven-plugin
documentation at codehaus.org -->
<configuration>
<runTarget>Statistics.html</runTarget>
<hostedWebapp>${webappDirectory}</hostedWebapp>
</configuration>
</plugin>
<!-- Copy static web files before executing gwt:run -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>exploded</goal>
</goals>
</execution>
</executions>
<configuration>
<webappDirectory>${webappDirectory}</webappDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<!-- SA Plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
</plugin>
</plugins>
</build>
</project>

@ -0,0 +1,32 @@
package org.gcube.portlet.user.userstatisticsportlet.client;
import org.gcube.portlets.user.gcubewidgets.client.ClientScopeHelper;
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;
/**
* Entry point classes define <code>onModuleLoad()</code>.
*
* @author Costantino Perciante at ISTI-CNR
*/
public class Statistics implements EntryPoint {
/**
* This is the entry point method.
*/
public void onModuleLoad() {
ClientScopeHelper.getService().setScope(Location.getHref(), new AsyncCallback<Boolean>() {
@Override
public void onSuccess(Boolean result) {
// fill container with incoming statistics
RootPanel.get("statistics-container").add(new StatisticsPanel());
}
@Override
public void onFailure(Throwable caught) {
}
});
}
}

@ -0,0 +1,442 @@
package org.gcube.portlet.user.userstatisticsportlet.client;
import org.gcube.portlet.user.userstatisticsportlet.client.resources.Images;
import org.gcube.portlet.user.userstatisticsportlet.client.ui.CommentsAndLikesWidget;
import org.gcube.portlet.user.userstatisticsportlet.client.ui.StatisticWidget;
import org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean;
import org.gcube.portlet.user.userstatisticsportlet.shared.UserInformation;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.i18n.client.NumberFormat;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Label;
/**
* Panel to show received user's statistics
*
* @author Costantino Perciante at ISTI-CNR
*/
public class StatisticsPanel extends Composite {
/**
* Create a remote service proxy to talk to the server-side statistics service.
*/
private final UserStatisticsServiceAsync statisticsService = GWT.create(UserStatisticsService.class);
/**
* Path of the image to be shown during loading
*/
public static final String imagePath = GWT.getModuleBaseURL() + "../images/statistics-loader.gif";
/**
* alert icon to be show if some statistic is not available
*/
public static final String alertIconPath = GWT.getModuleBaseURL() + "../images/icon-alert.png";
/**
* tooltip for the above image
*/
private static final String ALERT_MESSAGE = "Information not available at the moment.";
/**
* Title of the page
*/
public static final String DISPLAY_NAME = "Your Stats ";
/**
* Labels
*/
private final static String POSTS_LABEL = "Posts";
private final static String STORAGE_LABEL = "Total Space Used";
private final static String LIKES_COMMENTS_LABEL = "You got";
private final static String PROFILE_STRENGTH_LABEL = "Profile Strength";
/**
* profile url
*/
private final static String profileAccount = "https://dev.d4science.org/group/data-e-infrastructure-gateway/profile";
/**
* profile button label
*/
private final static String IMPROVE_BUTTON_LABEL = "Improve";
/**
* threshold for improving profile button
*/
private final static int profileImproveThreshold = 50;
/**
* Information about the context of the running portlet
*/
private boolean isRoot;
/**
* Image to be shown during loading
*/
private Image loadingImage;
/**
* FlowPanel to contain the statistics
*/
private FlowPanel mainPanel = new FlowPanel();
public StatisticsPanel() {
//init this object
super();
initWidget(mainPanel);
// set style of the main panel
mainPanel.setStyleName("user-stats-frame");
//init image loader
loadingImage = new Image(imagePath);
loadingImage.setStyleName("loading-image-center");
//show loader, waiting for the answer coming by the server
showLoader();
// request user's information
statisticsService.getUserSettings(new AsyncCallback<UserInformation>() {
@Override
public void onFailure(Throwable arg0) {
showError();
}
@Override
public void onSuccess(UserInformation information) {
// remove loading image
mainPanel.remove(loadingImage);
// check which kind of information we have to show
isRoot = information.isRoot();
if(!isRoot){
// add the border to the panel and the VRE name
mainPanel.addStyleName("user-stats-frame-border");
final HTML name = new HTML(DISPLAY_NAME + " in " + information.getActualVre());
name.setStyleName("user-stats-title");
mainPanel.add(name);
}
// user image
Images image = GWT.create(Images.class);
Image userImage = new Image(image.avatarLoader());
// check if the user has an avatar
if(information.getUrlAvatar() == null)
userImage.setResource(image.avatarDefaultImage());
else
userImage.setUrl(information.getUrlAvatar());
// set the style for the user image
userImage.setStyleName("user-image");
// set url to change avatar
final String urlAccount = information.getAccountURL();
if(urlAccount != null){
userImage.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent ev) {
Window.Location.assign(urlAccount);
}
});
userImage.setTitle("Edit your avatar");
userImage.addStyleName("user-image-editable");
}
// add image to mainPanel
mainPanel.add(userImage);
// feeds
final StatisticWidget feeds = new StatisticWidget();
feeds.setHeader(POSTS_LABEL);
if(isRoot)
feeds.setToolTip("Your posts during the last year.");
else
feeds.setToolTip("Your posts during the last year in this VRE.");
// add loading image that will be replaced by the incoming values
Image postsLoader = new Image(imagePath);
postsLoader.setStyleName("loading-image-center-small");
feeds.appendToPanel(postsLoader);
// append widget
mainPanel.add(feeds);
// likes & comments
final StatisticWidget likesAndComments = new StatisticWidget();
likesAndComments.setHeader(LIKES_COMMENTS_LABEL);
if(isRoot)
likesAndComments.setToolTip("Likes and post replies you got during the last year.");
else
likesAndComments.setToolTip("Likes and post replies you got during the last year in this VRE.");
// add loading image that will be replaced by the incoming values
Image commentsLikesLoader = new Image(imagePath);
commentsLikesLoader.setStyleName("loading-image-center-small");
likesAndComments.appendToPanel(commentsLikesLoader);
// append widget
mainPanel.add(likesAndComments);
// the storage and the profile strength(only in root)
final StatisticWidget storage = new StatisticWidget();
final StatisticWidget profileStrength = new StatisticWidget();
if(isRoot){
storage.setHeader(STORAGE_LABEL);
storage.setToolTip("Total amount of space used in the infrastructure.");
// add loading image that will be replaced by the incoming values
Image totalSpaceLoader = new Image(imagePath);
totalSpaceLoader.setStyleName("loading-image-center-small");
storage.appendToPanel(totalSpaceLoader);
mainPanel.add(storage);
profileStrength.setHeader(PROFILE_STRENGTH_LABEL);
profileStrength.setToolTip("Your profile strength.");
// add loading image that will be replaced by the incoming values
Image profileStrengthLoader = new Image(imagePath);
profileStrengthLoader.setStyleName("loading-image-center-small");
profileStrength.appendToPanel(profileStrengthLoader);
// add to the panel
mainPanel.add(profileStrength);
// async requests that must be performed in root context
statisticsService.getTotalSpaceInUse(new AsyncCallback<String>() {
@Override
public void onFailure(Throwable arg0) {
appendAlertIcon(storage);
}
@Override
public void onSuccess(String spaceInUse) {
if(spaceInUse == null){
appendAlertIcon(storage);
return;
}
storage.clearPanelValues();
Label storageValue = new Label(spaceInUse);
storageValue.setStyleName("statistic-value");
storage.appendToPanel(storageValue);
}
});
statisticsService.getProfileStrength(new AsyncCallback<Integer>() {
@Override
public void onFailure(Throwable arg0) {
appendAlertIcon(profileStrength);
}
@Override
public void onSuccess(Integer profileStrengthInt) {
if(profileStrengthInt < 0){
appendAlertIcon(profileStrength);
return;
}
// clear panel
profileStrength.clearPanelValues();
final Label profileStrengthLabel = new Label(profileStrengthInt + "%");
profileStrengthLabel.setStyleName("statistic-value");
profileStrength.appendToPanel(profileStrengthLabel);
// in case too low information within the user profile
if(profileStrengthInt < profileImproveThreshold){
final Button improveProfileButton = new Button(IMPROVE_BUTTON_LABEL);
improveProfileButton.setTitle("Improve your profile.");
improveProfileButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent arg0) {
// redirect
Window.Location.assign(profileAccount);
}
});
profileStrengthLabel.setStyleName("statistic-value-inline");
improveProfileButton.setStyleName("button-improve-profile");
profileStrength.appendToPanel(improveProfileButton);
}
}
});
}
// retrieve othe information about number of feeds and post replies/likes
statisticsService.getPostsStats(new AsyncCallback<PostsStatsBean>(){
public void onFailure(Throwable arg0) {
appendAlertIcon(feeds);
appendAlertIcon(likesAndComments);
}
public void onSuccess(PostsStatsBean postsBean) {
// if there are no statistics
if(postsBean == null){
appendAlertIcon(feeds);
appendAlertIcon(likesAndComments);
return;
}
// update feeds number
feeds.clearPanelValues();
Label numberOfFeedsLabel = new Label(formattedNumbers(postsBean.getFeedsNumber()));
if(isRoot)
numberOfFeedsLabel.setTitle("Your posts during the last year (" + postsBean.getFeedsNumber() + ").");
else
numberOfFeedsLabel.setTitle("Your posts during the last year in this VRE (" + postsBean.getFeedsNumber() + ").");
numberOfFeedsLabel.setStyleName("statistic-value");
feeds.appendToPanel(numberOfFeedsLabel);
// updates comments and likes
likesAndComments.clearPanelValues();
CommentsAndLikesWidget content = new CommentsAndLikesWidget();
String urlLikesIcon = GWT.getModuleBaseURL() + "../images/star_blue.png";
if(isRoot)
content.setLikes(
urlLikesIcon,
formattedNumbers(postsBean.getLikesReceived()),
"Likes you got during the last year.",
"Likes you got during the last year (" + postsBean.getLikesReceived() + ").");
else
content.setLikes(
urlLikesIcon,
formattedNumbers(postsBean.getLikesReceived()),
"Likes you got during the last year in this VRE",
"Likes you got during the last year in this VRE (" + postsBean.getLikesReceived() + ").");
String urlCommentsIcon = GWT.getModuleBaseURL() + "../images/comment_edit.png";
if(isRoot)
content.setComments(
urlCommentsIcon,
formattedNumbers(postsBean.getCommentsReceived()),
"Post replies you got during the last year.",
"Post replies you got during the last year (" + postsBean.getCommentsReceived() + ").");
else
content.setComments(
urlCommentsIcon,
formattedNumbers(postsBean.getCommentsReceived()),
"Post replies you got during the last year in this VRE.",
"Post replies you got during the last year in this VRE (" + postsBean.getCommentsReceived() + ").");
likesAndComments.appendToPanel(content);
}
});
}
});
}
/**
* Show loading image
*/
private void showLoader() {
mainPanel.clear();
mainPanel.add(loadingImage);
}
/**
* Error when is not possible to receive data or the received data is null
*/
private void showError() {
mainPanel.clear();
HTML messageError = new HTML(
"Sorry but it is not possible to retrieve your statistics at the moment. Retry later."
);
messageError.setStyleName("error-msg");
mainPanel.add(messageError);
}
/**
* Add alert icon/message for this statistic
* @param w
*/
private void appendAlertIcon(StatisticWidget w) {
w.clearPanelValues();
Image alert = new Image(alertIconPath);
alert.setTitle(ALERT_MESSAGE);
alert.setStyleName("alert-icon-center");
w.appendToPanel(alert);
}
/**
* Format a given value and append k, M, G
* @param value
* @return
*/
private String formattedNumbers(long value){
String formattedString = null;
double v = value;
double k = (double)value/1000.0;
double m = (double)value/1_000_000.0;
double g = (double)value/1_000_000_000.0;
NumberFormat dec = NumberFormat.getFormat("###.###");
if ( g >= 1.0 ) {
formattedString = dec.format(g).concat("G");
} else if ( m >= 1.0 ) {
formattedString = dec.format(m).concat("M");
} else if ( k >= 1.0 ) {
formattedString = dec.format(k).concat("K");
} else {
formattedString = dec.format(v).concat("");
}
return formattedString;
}
}

@ -0,0 +1,37 @@
package org.gcube.portlet.user.userstatisticsportlet.client;
import org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean;
import org.gcube.portlet.user.userstatisticsportlet.shared.UserInformation;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
/**
* Interface for retrieving user's statistics
* @author Costantino Perciante at ISTI-CNR
*/
@RemoteServiceRelativePath("statisticservice")
public interface UserStatisticsService extends RemoteService {
/**
* get other user's information
* @return an object with user's information (actual vre, his name, url of his image)
*/
UserInformation getUserSettings();
/**
* get information relatives to feeds(posts), comment replies and likes received
* @return an object with user's statistics (number of feeds(posts), comment replies, likes received)
*/
PostsStatsBean getPostsStats();
/**
* get the total space in use on the workspace
*/
String getTotalSpaceInUse();
/**
* get profile strenght
*/
int getProfileStrength();
}

@ -0,0 +1,23 @@
package org.gcube.portlet.user.userstatisticsportlet.client;
import org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean;
import org.gcube.portlet.user.userstatisticsportlet.shared.UserInformation;
import com.google.gwt.user.client.rpc.AsyncCallback;
/**
* Async version of the UserStatisticsService interface
*
* @author Costantino Perciante at ISTI-CNR
*/
public interface UserStatisticsServiceAsync {
void getUserSettings(AsyncCallback<UserInformation> callback);
void getPostsStats(AsyncCallback<PostsStatsBean> callback);
void getTotalSpaceInUse(AsyncCallback<String> callback);
void getProfileStrength(AsyncCallback<Integer> callback);
}

@ -0,0 +1,12 @@
package org.gcube.portlet.user.userstatisticsportlet.client.resources;
import com.google.gwt.resources.client.ClientBundle;
import com.google.gwt.resources.client.ImageResource;
public interface Images extends ClientBundle {
@Source("avatarLoader.gif")
ImageResource avatarLoader();
@Source("Avatar_default.png")
ImageResource avatarDefaultImage();
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

@ -0,0 +1,51 @@
package org.gcube.portlet.user.userstatisticsportlet.client.ui;
import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;
public class CommentsAndLikesWidget extends Composite {
private static CommentsAndLikesWidgetUiBinder uiBinder = GWT
.create(CommentsAndLikesWidgetUiBinder.class);
interface CommentsAndLikesWidgetUiBinder extends
UiBinder<Widget, CommentsAndLikesWidget> {
}
@UiField
Image likesImage;
@UiField
Image commentsImage;
@UiField
Label likesValue;
@UiField
Label commentsValue;
public CommentsAndLikesWidget() {
initWidget(uiBinder.createAndBindUi(this));
}
public void setComments(String url, String value, String tipIcon, String tipValue){
this.commentsImage.setUrl(url);
this.commentsImage.setTitle(tipIcon);
this.commentsValue.setText(value);
this.commentsValue.setTitle(tipValue);
}
public void setLikes(String url, String value, String tipIcon, String tipValue){
this.likesImage.setUrl(url);
this.likesImage.setTitle(tipIcon);
this.likesValue.setText(value);
this.likesValue.setTitle(tipValue);
}
}

@ -0,0 +1,23 @@
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
xmlns:g="urn:import:com.google.gwt.user.client.ui">
<ui:style>
.statistic-icon {
display: inline-block;
vertical-align: bottom;
}
.statistic-value {
color: #0084B4 !important;
font-size: 13px;
display: inline-block;
vertical-align: bottom;
}
</ui:style>
<g:HTMLPanel>
<g:Image styleName="{style.statistic-icon}" ui:field="likesImage"></g:Image>
<g:Label styleName="{style.statistic-value}" ui:field="likesValue"></g:Label>
<g:Image styleName="{style.statistic-icon}" ui:field="commentsImage"></g:Image>
<g:Label styleName="{style.statistic-value}" ui:field="commentsValue"></g:Label>
</g:HTMLPanel>
</ui:UiBinder>

@ -0,0 +1,54 @@
package org.gcube.portlet.user.userstatisticsportlet.client.ui;
import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;
/**
* Container for couple Statistic Header/Value
* @author Costantino Perciante at ISTI-CNR
*
*/
public class StatisticWidget extends Composite{
private static StatisticWidgetUiBinder uiBinder = GWT
.create(StatisticWidgetUiBinder.class);
interface StatisticWidgetUiBinder extends UiBinder<Widget, StatisticWidget> {
}
@UiField
Label header; //i.e., FEEDS, LIKES ..
@UiField
FlowPanel containerValues;
public StatisticWidget() {
initWidget(uiBinder.createAndBindUi(this));
}
public void setHeader(String header) {
this.header.setText(header);
}
public void appendToPanel(Widget w) {
this.containerValues.add(w);
}
public void removeFromPanel(Widget w){
this.containerValues.remove(w);
}
public void clearPanelValues(){
this.containerValues.clear();
}
public void setToolTip(String tooltip){
this.setTitle(tooltip);
}
}

@ -0,0 +1,32 @@
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
xmlns:g="urn:import:com.google.gwt.user.client.ui">
<ui:style>
.statistic-container {
margin-right: 10px;
display: inline-block;
vertical-align: top;
}
.statistic-header {
font-family: 'Lucida Grande', Verdana, 'Bitstream Vera Sans', Arial,
sans-serif;
font-size: 12px;
color: #8899A6;
letter-spacing: 0.02em;
overflow: hidden;
text-transform: uppercase;
margin-top: 15px;
margin-bottom: 2px;
text-align: center;
vertical-align: text-top;
}
</ui:style>
<g:HTMLPanel styleName="{style.statistic-container}">
<g:Label styleName="{style.statistic-header}" ui:field="header" />
<g:FlowPanel ui:field="containerValues">
<!-- Content goes here -->
</g:FlowPanel>
</g:HTMLPanel>
</ui:UiBinder>

@ -0,0 +1,460 @@
package org.gcube.portlet.user.userstatisticsportlet.server;
import java.text.DecimalFormat;
import java.util.Date;
import java.util.List;
import org.gcube.application.framework.core.session.ASLSession;
import org.gcube.application.framework.core.session.SessionManager;
import org.gcube.common.homelibrary.home.HomeLibrary;
import org.gcube.common.homelibrary.home.workspace.Workspace;
import org.gcube.common.scope.impl.ScopeBean;
import org.gcube.common.scope.impl.ScopeBean.Type;
import org.gcube.portal.custom.communitymanager.OrganizationsUtil;
import org.gcube.portal.custom.scopemanager.scopehelper.ScopeHelper;
import org.gcube.portal.databook.server.DBCassandraAstyanaxImpl;
import org.gcube.portal.databook.server.DatabookStore;
import org.gcube.portal.databook.shared.Feed;
import org.gcube.portlet.user.userstatisticsportlet.client.UserStatisticsService;
import org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean;
import org.gcube.portlet.user.userstatisticsportlet.shared.UserInformation;
import org.slf4j.LoggerFactory;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
import com.liferay.portal.kernel.util.WebKeys;
import com.liferay.portal.model.Contact;
import com.liferay.portal.model.User;
import com.liferay.portal.model.Website;
import com.liferay.portal.service.UserLocalServiceUtil;
import com.liferay.portal.service.WebsiteLocalServiceUtil;
import com.liferay.portal.theme.ThemeDisplay;
/**
* The server side implementation of the RPC service.
*/
@SuppressWarnings("serial")
public class UserStatisticsServiceImpl extends RemoteServiceServlet implements UserStatisticsService {
// Logger
private static final org.slf4j.Logger _log = LoggerFactory.getLogger(UserStatisticsServiceImpl.class);
//dev user
public static final String userid = "test.user";
//dev vre
private static final String vreID = "/gcube/devsec/devVRE";
// Cassandra connection
private DatabookStore store;
@Override
public void init() {
// get connection to Cassandra
_log.info("Getting connection to Cassandra..");
store = new DBCassandraAstyanaxImpl();
}
@Override
public void destroy(){
// shutting down connection to Cassandra
_log.info("Closing connection to Cassandra");
store.closeConnection();
}
/**
* the current ASLSession
* @return the session
*/
private ASLSession getASLSession() {
String sessionID = this.getThreadLocalRequest().getSession().getId();
String user = (String) this.getThreadLocalRequest().getSession().getAttribute(ScopeHelper.USERNAME_ATTRIBUTE);
if (user == null) {
_log.warn("USER IS NULL setting " + userid + " and Running OUTSIDE PORTAL");
user = getDevelopmentUser();
SessionManager.getInstance().getASLSession(sessionID, user).setScope(vreID);
}
return SessionManager.getInstance().getASLSession(sessionID, user);
}
/**
* Indicates whether the scope is the whole infrastructure.
* @return <code>true</code> if it is, <code>false</code> otherwise.
*/
private boolean isInfrastructureScope() {
boolean toReturn = false;
try {
ScopeBean scope = new ScopeBean(getASLSession().getScope());
toReturn = scope.is(Type.INFRASTRUCTURE);
return toReturn;
}
catch (NullPointerException e) {
_log.error("NullPointerException in isInfrastructureScope returning false");
return false;
}
}
/**
* Online or in development mode?
* @return true if you're running into the portal, false if in development
*/
private boolean isWithinPortal() {
try {
UserLocalServiceUtil.getService();
return true;
}
catch (com.liferay.portal.kernel.bean.BeanLocatorException ex) {
_log.trace("Development Mode ON");
return false;
}
}
/**
* when packaging test will fail if the user is not set to test.user
* @return .
*/
public String getDevelopmentUser() {
String user = userid;
// user = "massimiliano.assante";
return user;
}
@Override
public String getTotalSpaceInUse() {
String storageInUse = null;
// get the session
ASLSession session = getASLSession();
//username
String userName = session.getUsername();
//in case the portal is restarted and you have the social home open it will get test.user (no callback to set session info)
//this check just return nothing if that happens
if (userName.compareTo(userid) == 0) {
_log.debug("Found " + userName + " returning nothing");
return null;
}else{
_log.info("Getting " + userName + " amount of workspace in use.");
try{
long init = System.currentTimeMillis();
Workspace workspace = HomeLibrary.getUserWorkspace(userName);
long storage = workspace.getDiskUsage();
storageInUse = formatFileSize(storage);
long end = System.currentTimeMillis();
_log.info("[USER-STATISTICS] time taken to retrieve user space is " + (end - init) + "ms");
}catch(Exception e){
_log.error("Unable to retrieve workspace information!");
}
}
return storageInUse;
}
@Override
public int getProfileStrength() {
int profileStrenght = -1;
// get the session
ASLSession session = getASLSession();
//username
String userName = session.getUsername();
//in case the portal is restarted and you have the social home open it will get test.user (no callback to set session info)
//this check just return nothing if that happens
if (userName.compareTo(userid) == 0) {
_log.debug("Found " + userName + " returning nothing");
return profileStrenght;
}else{
// valuate profile strength
if(isWithinPortal()){
try{
// check if the avatar is present
boolean avatarPresent = session.getUserAvatarId() != null;
long init = System.currentTimeMillis();
User user = OrganizationsUtil.validateUser(userName);
profileStrenght = evaluateProfileStrenght(user, avatarPresent);
long end = System.currentTimeMillis();
_log.info("[USER-STATISTICS] time taken to evaluate user profile strenght is " + (end - init) + "ms");
}catch(Exception e){
_log.error("Profile strenght evaluation failed!!");
}
}
}
return profileStrenght;
}
@Override
public UserInformation getUserSettings() {
// get the session
ASLSession session = getASLSession();
//username
String userName = session.getUsername();
//in case the portal is restarted and you have the social home open it will get test.user (no callback to set session info)
//this check just return nothing if that happens
if (userName.compareTo(userid) == 0) {
_log.debug("Found " + userName + " returning nothing");
return null;
}
if(isWithinPortal()){
// If the user is in the root panel, we have to send him the overall number of posts made, comments/likes(received) and the space in use.
// Otherwise we have to filter on the vre.
boolean isInfrastructure = isInfrastructureScope();
_log.info("User scope is " + (isInfrastructure ? " the whole infrastucture " : " a VRE"));
// get path of the avatar
String thumbnailURL = session.getUserAvatarId();
_log.info(userName + " avatar has url " + thumbnailURL);
// get the vre (if not in the infrastructure)
String actualVre = null;
if(!isInfrastructure){
String[] temp = session.getScope().split("/");
actualVre = temp[temp.length - 1];
}
// url account to change the avatar
String accountURL = null;
ThemeDisplay themeDisplay = (ThemeDisplay) this.getThreadLocalRequest().getSession().getAttribute(WebKeys.THEME_DISPLAY);
accountURL = themeDisplay.getURLMyAccount().toString();
_log.info("Account url for " + userName + " is " + accountURL);
return new UserInformation(isInfrastructure, thumbnailURL, userName, actualVre, accountURL);
}
else return new UserInformation(true, null, userName, null, null);
}
@SuppressWarnings("deprecation")
@Override
public PostsStatsBean getPostsStats(){
// get the session
ASLSession session = getASLSession();
//username
String userName = session.getUsername();
//in case the portal is restarted and you have the social home open it will get test.user (no callback to set session info)
//this check just return nothing if that happens
if (userName.compareTo(userid) == 0) {
_log.debug("Found " + userName + " returning nothing");
return null;
}
long totalFeeds = 0, totalLikes = 0, totalComments = 0;
// check if the user is or not in a VRE
boolean isInfrastructure = isInfrastructureScope();
// date corresponding to one year ago
Date oneYearAgo = new Date();
oneYearAgo.setYear(oneYearAgo.getYear() - 1);
_log.info("Reference time is " + oneYearAgo.toString());
try {
long init = System.currentTimeMillis();
_log.info("Getting " + userName + " feeds in the last year.");
List<Feed> userFeeds = store.getRecentFeedsByUserAndDate(userName, oneYearAgo.getTime());
_log.info("Evaluating number of comments and likes of " + userName + "'s feeds.");
for (Feed feed : userFeeds) {
try{
// check if the user is in the root, if not check if the VRE of the feed is the current one
if(!isInfrastructure && !feed.getVreid().equals(session.getScope()))
continue;
// increment feeds number
totalFeeds ++;
//increment number of post replies and likes
totalComments += Integer.parseInt(feed.getCommentsNo());
totalLikes += Integer.parseInt(feed.getLikesNo());
}catch(NumberFormatException e){
_log.error(e.toString());
}
}
long end = System.currentTimeMillis();
_log.info("[USER-STATISTICS] time taken to retrieve and filter user feeds, get likes and replies got is " + (end - init) + "ms");
_log.info("Total number of feeds (after time filtering) of " + userName + " is " + totalFeeds);
_log.info("Total number of likes (after time filtering) for " + userName + " is " + totalLikes);
_log.info("Total number of comments (after time filtering) for " + userName + " is " + totalComments);
}catch(Exception e){
_log.error(e.toString());
return null;
}
// return the object
return new PostsStatsBean(totalFeeds, totalLikes, totalComments);
}
/**
* returns dynamically the formated size.
*
* @param size the size
* @return the string
*/
private static String formatFileSize(long size) {
String formattedSize = null;
double b = size;
double k = size/1024.0;
double m = ((size/1024.0)/1024.0);
double g = (((size/1024.0)/1024.0)/1024.0);
double t = ((((size/1024.0)/1024.0)/1024.0)/1024.0);
DecimalFormat dec = new DecimalFormat("0.00");
if ( t >= 1.0 ) {
formattedSize = dec.format(t).concat(" TB");
} else if ( g >= 1.0 ) {
formattedSize = dec.format(g).concat(" GB");
} else if ( m >= 1.0 ) {
formattedSize = dec.format(m).concat(" MB");
} else if ( k >= 1.0 ) {
formattedSize = dec.format(k).concat(" KB");
} else {
formattedSize = dec.format(b).concat(" Bytes");
}
return formattedSize;
}
/**
* Evaluates the profile strenght of the user
* @param user
* @return a int in [0, 100]
*/
private static int evaluateProfileStrenght(User user, boolean imageIsPresent) {
int score = evaluateContactScore(user);
score += evaluateInformationScore(user, imageIsPresent);
return score;
}
/**
* Evaluates a score according to the information of the user such as job, organization, comments
* @param user
* @return a score in [0, 65]
*/
private static int evaluateInformationScore(User user, boolean imageIsPresent) {
int score = 0;
score += user.getJobTitle().compareTo("") != 0 ? 20 : 0;
score += user.getOpenId().compareTo("") != 0 ? 20 : 0;
String summary = getSummary(user);
int lenght = summary.replace(" ", "").length();
float partialScore = ((float)lenght / 10.0f);
score += partialScore > 20f ? 20 : (int)partialScore;
if(imageIsPresent)
score += 5;
return score;
}
/**
* get the user's comment
* @param user
* @return
*/
private static String getSummary(User user) {
String toReturn = escapeHtml(user.getComments());
// replace all the line breaks by <br/>
toReturn = toReturn.replaceAll("(\r\n|\n)"," <br/> ");
// then replace all the double spaces by the html version &nbsp;
toReturn = toReturn.replaceAll("\\s\\s","&nbsp;&nbsp;");
return toReturn;
}
/**
* Escape an html string. Escaping data received from the client helps to
* prevent cross-site script vulnerabilities.
*
* @param html the html string to escape
* @return the escaped string
*/
private static String escapeHtml(String html) {
if (html == null) {
return null;
}
return html.replaceAll("&", "&amp;").replaceAll("<", "&lt;")
.replaceAll(">", "&gt;");
}
/**
* Evaluates user's contact information
* @param user
* @return a value in [0, 35]
*/
private static int evaluateContactScore(User user){
int score = 0;
try{
Contact contact = user.getContact();
score += contact.getMySpaceSn().compareTo("") != 0 ? 5 : 0;
score += contact.getTwitterSn().compareTo("") != 0 ? 5 : 0;
score += contact.getFacebookSn().compareTo("") != 0 ? 5 : 0;
score += contact.getSkypeSn().compareTo("") != 0 ? 5 : 0;
score += contact.getJabberSn().compareTo("") != 0 ? 5 : 0;
score += contact.getAimSn().compareTo("") != 0 ? 5 : 0;
List<Website> websites = WebsiteLocalServiceUtil.getWebsites(user.getCompanyId(), "com.liferay.portal.model.Contact", contact.getContactId());
score += websites.size() > 0 ? 5 : 0;
}catch(Exception e ){
_log.error("Contact profile score evaluation failed!!");
score = 0;
}
return score;
}
}

@ -0,0 +1,26 @@
package org.gcube.portlet.user.userstatisticsportlet.server.portlet;
import java.io.IOException;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
import javax.portlet.GenericPortlet;
import javax.portlet.PortletException;
import javax.portlet.PortletRequestDispatcher;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import org.gcube.portal.custom.scopemanager.scopehelper.ScopeHelper;
public class UserStatisticsPortlet extends GenericPortlet {
public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException {
response.setContentType("text/html");
ScopeHelper.setContext(request);
PortletRequestDispatcher dispatcher = getPortletContext().getRequestDispatcher("/WEB-INF/jsp/Statistics_view.jsp");
dispatcher.include(request, response);
}
public void processAction(ActionRequest request, ActionResponse response)
throws PortletException, IOException {
}
}

@ -0,0 +1,62 @@
package org.gcube.portlet.user.userstatisticsportlet.shared;
import java.io.Serializable;
/**
* Contains the retrieved user's statistics relative to number of feeds written, replies and likes got.
*
* @author Costantino Perciante at ISTI-CNR
*/
public class PostsStatsBean implements Serializable{
/**
* Generated serial version id
*/
private static final long serialVersionUID = 2043823499293477290L;
private long feeds;
private long likesReceived;
private long commentsReceived;
public PostsStatsBean(){
super();
}
public PostsStatsBean(long feeds, long likesReceived, long commentsReceived) {
super();
this.feeds = feeds;
this.likesReceived = likesReceived;
this.commentsReceived = commentsReceived;
}
public long getFeedsNumber() {
return feeds;
}
public void setFeedsNumber(long feeds) {
this.feeds = feeds;
}
public long getLikesReceived() {
return likesReceived;
}
public void setLikesReceived(long likesReceived) {
this.likesReceived = likesReceived;
}
public long getCommentsReceived() {
return commentsReceived;
}
public void setCommentsReceived(long commentsReceived) {
this.commentsReceived = commentsReceived;
}
@Override
public String toString() {
return "FeedsInformation [feeds=" + feeds + ", likesReceived="
+ likesReceived + ", commentsReceived=" + commentsReceived
+ "]";
}
}

@ -0,0 +1,98 @@
package org.gcube.portlet.user.userstatisticsportlet.shared;
import java.io.Serializable;
/**
* Some information of the current user
*
* @author Costantino Perciante at ISTI-CNR
*/
public class UserInformation implements Serializable {
/**
*
*/
private static final long serialVersionUID = 6360825683813448487L;
private boolean isRoot;
private String urlAvatar;
private String displayName;
private String actualVre;
private String accountURL;
public UserInformation(){
super();
}
public UserInformation(boolean isRoot, String urlAvatar,
String displayName, String actualVre, String accountURL) {
super();
this.isRoot = isRoot;
this.urlAvatar = urlAvatar;
this.displayName = displayName;
this.actualVre = actualVre;
this.accountURL = accountURL;
}
public boolean isRoot() {
return isRoot;
}
public void setRoot(boolean isRoot) {
this.isRoot = isRoot;
}
public String getUrlAvatar() {
return urlAvatar;
}
public void setUrlAvatar(String urlAvatar) {
this.urlAvatar = urlAvatar;
}
public String getDisplayName() {
return displayName;
}
public void setDisplayName(String displayName) {
this.displayName = displayName;
}
public String getActualVre() {
return actualVre;
}
public void setActualVre(String actualVre) {
this.actualVre = actualVre;
}
public String getAccountURL() {
return accountURL;
}
public void setAccountURL(String accountURL) {
this.accountURL = accountURL;
}
@Override
public String toString() {
return "UserInformation [isRoot=" + isRoot + ", urlAvatar=" + urlAvatar
+ ", displayName=" + displayName + ", actualVre=" + actualVre
+ ", accountURL=" + accountURL + "]";
}
}

@ -0,0 +1,12 @@
log4j.rootLogger=DEBUG, A1
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
# Print the date in ISO 8601 format
log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
# Print only messages of level TRACE or above in the package org.gcube
log4j.logger.org.gcube=TRACE
log4j.logger.org.gcube.application.framework.core.session=INFO
log4j.logger.org.gcube.common.scope.impl.DefaultScopeProvider=ERROR
log4j.logger.com.netflix.astyanax.connectionpool.impl.CountingConnectionPoolMonitor=ERROR

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='statistics'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User' />
<!-- Other module inherits -->
<inherits name='org.gcube.portlets.user.gcubewidgets.WidgetFactory' />
<inherits name='org.gcube.portal.databook.GCubeSocialNetworking' />
<!-- Specify the app entry point class. -->
<entry-point
class='org.gcube.portlet.user.userstatisticsportlet.client.Statistics' />
<!-- Specify the paths for translatable code -->
<source path='client' />
<source path='shared' />
</module>

@ -0,0 +1,5 @@
Manifest-Version: 1.0
Built-By: costantino
Build-Jdk: 1.7.0_80
Created-By: Maven Integration for Eclipse

@ -0,0 +1,7 @@
#Generated by Maven Integration for Eclipse
#Fri Nov 13 16:46:36 CET 2015
version=0.0.1-SNAPSHOT
groupId=org.gcube.portlets.user
m2e.projectName=user-statistics-portlet
m2e.projectLocation=/home/costantino/workspace/user-statistics-portlet
artifactId=user-statistics-portlet

@ -0,0 +1,182 @@
<?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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>maven-parent</artifactId>
<groupId>org.gcube.tools</groupId>
<version>1.0.0</version>
<relativePath />
</parent>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>user-statistics-portlet</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>User statistics portlet</name>
<description>
User statistics portlet shows manin user's statistics.
</description>
<scm>
<connection>scm:svn:http://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/${project.artifactId}</connection>
<developerConnection>scm:https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/${project.artifactId}</developerConnection>
<url>http://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/${project.artifactId}</url>
</scm>
<properties>
<!-- Convenience property to set the GWT version -->
<gwtVersion>2.7.0</gwtVersion>
<!-- GWT needs at least java 1.6 -->
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt</artifactId>
<version>${gwtVersion}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.gcube.distribution</groupId>
<artifactId>maven-portal-bom</artifactId>
<version>LATEST</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>gcube-widgets</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.gcube.portal</groupId>
<artifactId>custom-portal-handler</artifactId>
</dependency>
<dependency>
<groupId>org.gcube.applicationsupportlayer</groupId>
<artifactId>aslcore</artifactId>
</dependency>
<dependency>
<groupId>org.gcube.dvos</groupId>
<artifactId>usermanagement-core</artifactId>
</dependency>
<dependency>
<groupId>com.google</groupId>
<artifactId>gwt-jsonmaker</artifactId>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.gcube.core</groupId>
<artifactId>common-scope-maps</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>javax.portlet</groupId>
<artifactId>portlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.portal</groupId>
<artifactId>social-networking-library</artifactId>
</dependency>
<dependency>
<groupId>com.netflix.astyanax</groupId>
<artifactId>astyanax</artifactId>
</dependency>
</dependencies>
<build>
<!-- Output classes directly into the webapp, so that IDEs and "mvn process-classes"
update them in DevMode -->
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>
<plugins>
<!-- GWT Maven Plugin -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>${gwtVersion}</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<!-- <goal>test</goal> -->
<!-- <goal>generateAsync</goal> -->
</goals>
</execution>
</executions>
<!-- Plugin configuration. There are many available options, see gwt-maven-plugin
documentation at codehaus.org -->
<configuration>
<runTarget>Statistics.html</runTarget>
<hostedWebapp>${webappDirectory}</hostedWebapp>
<modules>
<module>org.gcube.portlet.user.userstatisticsportlet.Statistics</module>
</modules>
</configuration>
</plugin>
<!-- Copy static web files before executing gwt:run -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>exploded</goal>
</goals>
</execution>
</executions>
<configuration>
<webappDirectory>${webappDirectory}</webappDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<!-- SA Plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
</plugin>
</plugins>
</build>
</project>

@ -0,0 +1,80 @@
.user-stats-frame {
padding: 10px;
background-color: #FFF;
}
.user-stats-frame-border {
border-radius: 6px !important;
-moz-border-radius: 6px !important;
-webkit-border-radius: 6px !important;
border: 1px solid #DBDBDB;
}
.user-image {
align: left;
height: 73px;
width: auto;
border: 1px solid #e6e6e6;
padding: 2px;
color: #FFF;
margin-right: 12px;
display: inline-block;
vertical-align: top;
}
.user-image-editable:hover {
cursor: pointer;
}
.error-msg {
font-family: "Architects Daughter", arial, sans-serif;
}
.user-stats-title {
display: block;
font-size: 16px;
color: #555;
margin-bottom: 10px;
}
.statistic-value {
color: #0084B4 !important;
font-size: 15px;
text-align: center;
vertical-align: bottom;
}
.statistic-value-inline {
color: #0084B4 !important;
font-size: 15px;
text-align: center;
vertical-align: bottom;
display: inline-block;
}
.loading-image-center {
display: block;
margin: auto auto;
}
.loading-image-center-small {
width: 20px;
height: auto;
display: block;
margin: auto auto;
}
.alert-icon-center{
display: block;
margin: auto auto;
}
.button-improve-profile {
margin: 0 0 0 25px;
font-family: Tahoma, Helvetica, Arial, sans-serif;
line-height: 12px;
font-size: 12px;
color: #fff;
padding: 5px 15px;
font-weight: normal;
}

@ -0,0 +1,53 @@
<!doctype html>
<!-- The DOCTYPE declaration above will set the -->
<!-- browser's rendering engine into -->
<!-- "Standards Mode". Replacing this declaration -->
<!-- with a "Quirks Mode" doctype may lead to some -->
<!-- differences in layout. -->
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<!-- -->
<!-- Consider inlining CSS to reduce the number of requested files -->
<!-- -->
<link type="text/css" rel="stylesheet" href="Statistics.css">
<link href='https://fonts.googleapis.com/css?family=Architects+Daughter' rel='stylesheet' type='text/css'>
<!-- -->
<!-- Any title is fine -->
<!-- -->
<title>User statistics</title>
<!-- -->
<!-- This script loads your compiled module. -->
<!-- If you add any GWT meta tags, they must -->
<!-- be added before this line. -->
<!-- -->
<script type="text/javascript" language="javascript"
src="statistics/statistics.nocache.js"></script>
</head>
<!-- -->
<!-- The body can have arbitrary html, or -->
<!-- you can leave the body empty if you want -->
<!-- to create a completely dynamic UI. -->
<!-- -->
<body>
<!-- OPTIONAL: include this if you want history support -->
<iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1'
style="position: absolute; width: 0; height: 0; border: 0"></iframe>
<!-- RECOMMENDED if your web app will not function without JavaScript enabled -->
<noscript>
<div
style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif">
Your web browser must have JavaScript enabled in order for this
application to display correctly.</div>
</noscript>
<div id="statistics-container"></div>
</body>
</html>

@ -0,0 +1,6 @@
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<link href='https://fonts.googleapis.com/css?family=Architects+Daughter' rel='stylesheet' type='text/css'>
<script type="text/javascript" language="javascript" src="<%=request.getContextPath()%>/statistics/statistics.nocache.js"></script>
<div id="statistics-container"></div>

@ -0,0 +1,8 @@
<?xml version="1.0"?>
<!DOCTYPE display PUBLIC "-//Liferay//DTD Display 6.0.0//EN" "http://www.liferay.com/dtd/liferay-display_6_0_0.dtd">
<display>
<category name="gCube Social Apps">
<portlet id="Statistics" />
</category>
</display>

@ -0,0 +1,9 @@
name=Statistics
module-group-id=liferay
module-incremental-version=1
tags=
short-description=
change-log=
page-url=http://www.d4science.org
author=D4Science.org
licenses=EUPL

@ -0,0 +1,28 @@
<?xml version="1.0"?>
<!DOCTYPE liferay-portlet-app PUBLIC "-//Liferay//DTD Portlet Application 5.2.0//EN" "http://www.liferay.com/dtd/liferay-portlet-app_6_0_0.dtd">
<liferay-portlet-app>
<portlet>
<portlet-name>Statistics</portlet-name>
<layout-cacheable>false</layout-cacheable>
<instanceable>false</instanceable>
<ajaxable>false</ajaxable>
<header-portlet-css>/Statistics.css</header-portlet-css>
</portlet>
<role-mapper>
<role-name>administrator</role-name>
<role-link>Administrator</role-link>
</role-mapper>
<role-mapper>
<role-name>guest</role-name>
<role-link>Guest</role-link>
</role-mapper>
<role-mapper>
<role-name>power-user</role-name>
<role-link>Power User</role-link>
</role-mapper>
<role-mapper>
<role-name>user</role-name>
<role-link>User</role-link>
</role-mapper>
</liferay-portlet-app>

@ -0,0 +1,30 @@
<?xml version="1.0"?>
<portlet-app
version="2.0"
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
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>Statistics</portlet-name>
<display-name>User statistics</display-name>
<portlet-class>org.gcube.portlet.user.userstatisticsportlet.server.portlet.UserStatisticsPortlet</portlet-class>
<init-param>
<name>view-jsp</name>
<value>/view.jsp</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
</supports>
<portlet-info>
<title>Statistics</title>
<short-title>User statistics</short-title>
<keywords>User statistics</keywords>
</portlet-info>
<security-role-ref>
<role-name>administrator</role-name>
</security-role-ref>
</portlet>
</portlet-app>

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<!-- Servlets -->
<servlet>
<servlet-name>userStatisticsServlet</servlet-name>
<servlet-class>org.gcube.portlet.user.userstatisticsportlet.server.UserStatisticsServiceImpl</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>userStatisticsServlet</servlet-name>
<url-pattern>/statistics/statisticservice</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>scopeService</servlet-name>
<url-pattern>/statistics/scopeService</url-pattern>
</servlet-mapping>
<!-- Default page to serve -->
<welcome-file-list>
<welcome-file>Statistics.html</welcome-file>
</welcome-file-list>
</web-app>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 469 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

@ -0,0 +1,19 @@
package org.gcube.portlet.user.userstatisticsportlet.client;
import static org.junit.Assert.*;
import org.gcube.portlet.user.userstatisticsportlet.server.UserStatisticsServiceImpl;
import org.junit.Test;
public class TestForDeploy {
@Test
public void testUserIsTestUser() {
UserStatisticsServiceImpl serviceImpl = new UserStatisticsServiceImpl();
String username = serviceImpl.getDevelopmentUser();
System.out.println("username for deploy is: " + username);
assertTrue(username.compareTo(UserStatisticsServiceImpl.userid) == 0);
System.out.println("Test OK!");
}
}

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module rename-to="Statistics">
<!-- Inherit our applications main module. -->
<inherits name='org.gcube.portlet.user.userstatisticsportlet.Statistics' />
<!-- Specify the path to any remote services. -->
<servlet path="/Statistics/greet" class="org.gcube.portlet.user.userstatisticsportlet.server.GreetingServiceImpl" />
</module>

@ -0,0 +1,80 @@
package com.google.gwt.i18n.client.constants;
public class NumberConstantsImpl_ implements com.google.gwt.i18n.client.constants.NumberConstantsImpl {
public java.lang.String notANumber() {
return "NaN";
}
public java.lang.String currencyPattern() {
return "¤#,##0.00";
}
public java.lang.String decimalPattern() {
return "#,##0.###";
}
public java.lang.String decimalSeparator() {
return ".";
}
public java.lang.String defCurrencyCode() {
return "USD";
}
public java.lang.String exponentialSymbol() {
return "E";
}
public java.lang.String globalCurrencyPattern() {
return "¤¤¤¤#,##0.00 ¤¤";
}
public java.lang.String groupingSeparator() {
return ",";
}
public java.lang.String infinity() {
return "∞";
}
public java.lang.String minusSign() {
return "-";
}
public java.lang.String monetaryGroupingSeparator() {
return ",";
}
public java.lang.String monetarySeparator() {
return ".";
}
public java.lang.String percent() {
return "%";
}
public java.lang.String percentPattern() {
return "#,##0%";
}
public java.lang.String perMill() {
return "‰";
}
public java.lang.String plusSign() {
return "+";
}
public java.lang.String scientificPattern() {
return "#E0";
}
public java.lang.String simpleCurrencyPattern() {
return "¤¤¤¤#,##0.00";
}
public java.lang.String zeroDigit() {
return "0";
}
}

@ -0,0 +1,30 @@
package com.google.gwt.i18n.client.impl;
import com.google.gwt.core.client.GWT;
import com.google.gwt.i18n.client.LocaleInfo;
import com.google.gwt.i18n.client.constants.NumberConstants;
import com.google.gwt.i18n.client.constants.NumberConstantsImpl;
import com.google.gwt.i18n.client.DateTimeFormatInfo;
import com.google.gwt.i18n.client.impl.cldr.DateTimeFormatInfoImpl;
public class LocaleInfoImpl_ extends LocaleInfoImpl_shared {
@Override
public String getLocaleName() {
return "default";
}
@Override
public String getLocaleQueryParam() {
return "locale";
}
@Override
public DateTimeFormatInfo getDateTimeFormatInfo() {
return GWT.create(com.google.gwt.i18n.client.impl.cldr.DateTimeFormatInfoImpl.class);
}
@Override
public NumberConstants getNumberConstants() {
return GWT.create(com.google.gwt.i18n.client.constants.NumberConstantsImpl.class);
}
}

@ -0,0 +1,47 @@
package com.google.gwt.i18n.client.impl;
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.JavaScriptObject;
import java.util.HashMap;
public class LocaleInfoImpl_shared extends com.google.gwt.i18n.client.impl.LocaleInfoImpl {
private static native String getLocaleNativeDisplayName(
JavaScriptObject nativeDisplayNamesNative,String localeName) /*-{
return nativeDisplayNamesNative[localeName];
}-*/;
HashMap<String,String> nativeDisplayNamesJava;
private JavaScriptObject nativeDisplayNamesNative;
@Override
public String[] getAvailableLocaleNames() {
return new String[] {
"default",
};
}
@Override
public String getLocaleNativeDisplayName(String localeName) {
if (GWT.isScript()) {
if (nativeDisplayNamesNative == null) {
nativeDisplayNamesNative = loadNativeDisplayNamesNative();
}
return getLocaleNativeDisplayName(nativeDisplayNamesNative, localeName);
} else {
if (nativeDisplayNamesJava == null) {
nativeDisplayNamesJava = new HashMap<String, String>();
}
return nativeDisplayNamesJava.get(localeName);
}
}
@Override
public boolean hasAnyRTL() {
return false;
}
private native JavaScriptObject loadNativeDisplayNamesNative() /*-{
return {
};
}-*/;
}

@ -0,0 +1,6 @@
package com.google.gwt.lang;
public class org_00046gcube_00046portlet_00046user_00046userstatisticsportlet_00046Statistics__EntryMethodHolder {
public static final void init() {
// to be synthesized later
}
}

@ -0,0 +1,17 @@
package com.google.gwt.user.client;
import com.google.gwt.user.client.DocumentModeAsserter.Severity;
public class DocumentModeAsserter_DocumentModeProperty implements com.google.gwt.user.client.DocumentModeAsserter.DocumentModeProperty {
public String[] getAllowedDocumentModes() {
return new String[] {
"CSS1Compat",
};
}
public Severity getDocumentModeSeverity() {
return Severity.WARN;
}
}

@ -0,0 +1,110 @@
package com.google.gwt.user.client.impl;
import com.google.gwt.core.client.GWT;
import com.google.gwt.resources.client.ResourcePrototype;
public class WindowImplIE_Resources_default_InlineClientBundleGenerator implements com.google.gwt.user.client.impl.WindowImplIE.Resources {
private static WindowImplIE_Resources_default_InlineClientBundleGenerator _instance0 = new WindowImplIE_Resources_default_InlineClientBundleGenerator();
private void initWindowCloseHandlerInitializer() {
initWindowCloseHandler = new com.google.gwt.resources.client.TextResource() {
// jar:file:/home/costantino/.m2/repository/com/google/gwt/gwt-user/2.7.0/gwt-user-2.7.0.jar!/com/google/gwt/user/client/impl/initWindowCloseHandler.js
public String getText() {
return "function __gwt_initWindowCloseHandler(beforeunload, unload) {\n var wnd = window\n , oldOnBeforeUnload = wnd.onbeforeunload\n , oldOnUnload = wnd.onunload;\n \n wnd.onbeforeunload = function(evt) {\n var ret, oldRet;\n try {\n ret = beforeunload();\n } finally {\n oldRet = oldOnBeforeUnload && oldOnBeforeUnload(evt);\n }\n // Avoid returning null as IE6 will coerce it into a string.\n // Ensure that \"\" gets returned properly.\n if (ret != null) {\n return ret;\n }\n if (oldRet != null) {\n return oldRet;\n }\n // returns undefined.\n };\n \n wnd.onunload = function(evt) {\n try {\n unload();\n } finally {\n oldOnUnload && oldOnUnload(evt);\n wnd.onresize = null;\n wnd.onscroll = null;\n wnd.onbeforeunload = null;\n wnd.onunload = null;\n }\n };\n \n // Remove the reference once we've initialize the handler\n wnd.__gwt_initWindowCloseHandler = undefined;\n}\n";
}
public String getName() {
return "initWindowCloseHandler";
}
}
;
}
private static class initWindowCloseHandlerInitializer {
static {
_instance0.initWindowCloseHandlerInitializer();
}
static com.google.gwt.resources.client.TextResource get() {
return initWindowCloseHandler;
}
}
public com.google.gwt.resources.client.TextResource initWindowCloseHandler() {
return initWindowCloseHandlerInitializer.get();
}
private void initWindowResizeHandlerInitializer() {
initWindowResizeHandler = new com.google.gwt.resources.client.TextResource() {
// jar:file:/home/costantino/.m2/repository/com/google/gwt/gwt-user/2.7.0/gwt-user-2.7.0.jar!/com/google/gwt/user/client/impl/initWindowResizeHandler.js
public String getText() {
return "function __gwt_initWindowResizeHandler(resize) {\n var wnd = window, oldOnResize = wnd.onresize;\n \n wnd.onresize = function(evt) {\n try {\n resize();\n } finally {\n oldOnResize && oldOnResize(evt);\n }\n };\n \n // Remove the reference once we've initialize the handler\n wnd.__gwt_initWindowResizeHandler = undefined;\n}\n";
}
public String getName() {
return "initWindowResizeHandler";
}
}
;
}
private static class initWindowResizeHandlerInitializer {
static {
_instance0.initWindowResizeHandlerInitializer();
}
static com.google.gwt.resources.client.TextResource get() {
return initWindowResizeHandler;
}
}
public com.google.gwt.resources.client.TextResource initWindowResizeHandler() {
return initWindowResizeHandlerInitializer.get();
}
private void initWindowScrollHandlerInitializer() {
initWindowScrollHandler = new com.google.gwt.resources.client.TextResource() {
// jar:file:/home/costantino/.m2/repository/com/google/gwt/gwt-user/2.7.0/gwt-user-2.7.0.jar!/com/google/gwt/user/client/impl/initWindowScrollHandler.js
public String getText() {
return "function __gwt_initWindowScrollHandler(scroll) {\n var wnd = window, oldOnScroll = wnd.onscroll;\n \n wnd.onscroll = function(evt) {\n try {\n scroll();\n } finally {\n oldOnScroll && oldOnScroll(evt);\n }\n };\n \n // Remove the reference once we've initialize the handler\n wnd.__gwt_initWindowScrollHandler = undefined;\n}\n";
}
public String getName() {
return "initWindowScrollHandler";
}
}
;
}
private static class initWindowScrollHandlerInitializer {
static {
_instance0.initWindowScrollHandlerInitializer();
}
static com.google.gwt.resources.client.TextResource get() {
return initWindowScrollHandler;
}
}
public com.google.gwt.resources.client.TextResource initWindowScrollHandler() {
return initWindowScrollHandlerInitializer.get();
}
private static java.util.HashMap<java.lang.String, com.google.gwt.resources.client.ResourcePrototype> resourceMap;
private static com.google.gwt.resources.client.TextResource initWindowCloseHandler;
private static com.google.gwt.resources.client.TextResource initWindowResizeHandler;
private static com.google.gwt.resources.client.TextResource initWindowScrollHandler;
public ResourcePrototype[] getResources() {
return new ResourcePrototype[] {
initWindowCloseHandler(),
initWindowResizeHandler(),
initWindowScrollHandler(),
};
}
public ResourcePrototype getResource(String name) {
if (GWT.isScript()) {
return getResourceNative(name);
} else {
if (resourceMap == null) {
resourceMap = new java.util.HashMap<java.lang.String, com.google.gwt.resources.client.ResourcePrototype>();
resourceMap.put("initWindowCloseHandler", initWindowCloseHandler());
resourceMap.put("initWindowResizeHandler", initWindowResizeHandler());
resourceMap.put("initWindowScrollHandler", initWindowScrollHandler());
}
return resourceMap.get(name);
}
}
private native ResourcePrototype getResourceNative(String name) /*-{
switch (name) {
case 'initWindowCloseHandler': return this.@com.google.gwt.user.client.impl.WindowImplIE.Resources::initWindowCloseHandler()();
case 'initWindowResizeHandler': return this.@com.google.gwt.user.client.impl.WindowImplIE.Resources::initWindowResizeHandler()();
case 'initWindowScrollHandler': return this.@com.google.gwt.user.client.impl.WindowImplIE.Resources::initWindowScrollHandler()();
}
return null;
}-*/;
}

@ -0,0 +1,36 @@
package com.google.gwt.user.client.rpc;
import com.google.gwt.user.client.rpc.SerializationException;
import com.google.gwt.user.client.rpc.SerializationStreamReader;
import com.google.gwt.user.client.rpc.SerializationStreamWriter;
import com.google.gwt.user.client.rpc.impl.ReflectionHelper;
@SuppressWarnings("deprecation")
public class IncompatibleRemoteServiceException_FieldSerializer implements com.google.gwt.user.client.rpc.impl.TypeHandler {
public static void deserialize(SerializationStreamReader streamReader, com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException instance) throws SerializationException {
com.google.gwt.user.client.rpc.core.java.lang.RuntimeException_FieldSerializer.deserialize(streamReader, instance);
}
public static com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException instantiate(SerializationStreamReader streamReader) throws SerializationException {
return new com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException();
}
public static void serialize(SerializationStreamWriter streamWriter, com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException instance) throws SerializationException {
com.google.gwt.user.client.rpc.core.java.lang.RuntimeException_FieldSerializer.serialize(streamWriter, instance);
}
public Object create(SerializationStreamReader reader) throws SerializationException {
return com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException_FieldSerializer.instantiate(reader);
}
public void deserial(SerializationStreamReader reader, Object object) throws SerializationException {
com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException_FieldSerializer.deserialize(reader, (com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException)object);
}
public void serial(SerializationStreamWriter writer, Object object) throws SerializationException {
com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException_FieldSerializer.serialize(writer, (com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException)object);
}
}

@ -0,0 +1,36 @@
package com.google.gwt.user.client.rpc;
import com.google.gwt.user.client.rpc.SerializationException;
import com.google.gwt.user.client.rpc.SerializationStreamReader;
import com.google.gwt.user.client.rpc.SerializationStreamWriter;
import com.google.gwt.user.client.rpc.impl.ReflectionHelper;
@SuppressWarnings("deprecation")
public class RpcTokenException_FieldSerializer implements com.google.gwt.user.client.rpc.impl.TypeHandler {
public static void deserialize(SerializationStreamReader streamReader, com.google.gwt.user.client.rpc.RpcTokenException instance) throws SerializationException {
com.google.gwt.user.client.rpc.core.java.lang.RuntimeException_FieldSerializer.deserialize(streamReader, instance);
}
public static com.google.gwt.user.client.rpc.RpcTokenException instantiate(SerializationStreamReader streamReader) throws SerializationException {
return new com.google.gwt.user.client.rpc.RpcTokenException();
}
public static void serialize(SerializationStreamWriter streamWriter, com.google.gwt.user.client.rpc.RpcTokenException instance) throws SerializationException {
com.google.gwt.user.client.rpc.core.java.lang.RuntimeException_FieldSerializer.serialize(streamWriter, instance);
}
public Object create(SerializationStreamReader reader) throws SerializationException {
return com.google.gwt.user.client.rpc.RpcTokenException_FieldSerializer.instantiate(reader);
}
public void deserial(SerializationStreamReader reader, Object object) throws SerializationException {
com.google.gwt.user.client.rpc.RpcTokenException_FieldSerializer.deserialize(reader, (com.google.gwt.user.client.rpc.RpcTokenException)object);
}
public void serial(SerializationStreamWriter writer, Object object) throws SerializationException {
com.google.gwt.user.client.rpc.RpcTokenException_FieldSerializer.serialize(writer, (com.google.gwt.user.client.rpc.RpcTokenException)object);
}
}

@ -0,0 +1,45 @@
package com.google.gwt.user.client.rpc;
import com.google.gwt.user.client.rpc.SerializationException;
import com.google.gwt.user.client.rpc.SerializationStreamReader;
import com.google.gwt.user.client.rpc.SerializationStreamWriter;
import com.google.gwt.user.client.rpc.impl.ReflectionHelper;
@SuppressWarnings("deprecation")
public class XsrfToken_FieldSerializer implements com.google.gwt.user.client.rpc.impl.TypeHandler {
private static native java.lang.String getToken(com.google.gwt.user.client.rpc.XsrfToken instance) /*-{
return instance.@com.google.gwt.user.client.rpc.XsrfToken::token;
}-*/;
private static native void setToken(com.google.gwt.user.client.rpc.XsrfToken instance, java.lang.String value)
/*-{
instance.@com.google.gwt.user.client.rpc.XsrfToken::token = value;
}-*/;
public static void deserialize(SerializationStreamReader streamReader, com.google.gwt.user.client.rpc.XsrfToken instance) throws SerializationException {
setToken(instance, streamReader.readString());
}
public static com.google.gwt.user.client.rpc.XsrfToken instantiate(SerializationStreamReader streamReader) throws SerializationException {
return new com.google.gwt.user.client.rpc.XsrfToken();
}
public static void serialize(SerializationStreamWriter streamWriter, com.google.gwt.user.client.rpc.XsrfToken instance) throws SerializationException {
streamWriter.writeString(getToken(instance));
}
public Object create(SerializationStreamReader reader) throws SerializationException {
return com.google.gwt.user.client.rpc.XsrfToken_FieldSerializer.instantiate(reader);
}
public void deserial(SerializationStreamReader reader, Object object) throws SerializationException {
com.google.gwt.user.client.rpc.XsrfToken_FieldSerializer.deserialize(reader, (com.google.gwt.user.client.rpc.XsrfToken)object);
}
public void serial(SerializationStreamWriter writer, Object object) throws SerializationException {
com.google.gwt.user.client.rpc.XsrfToken_FieldSerializer.serialize(writer, (com.google.gwt.user.client.rpc.XsrfToken)object);
}
}

@ -0,0 +1,36 @@
package com.google.gwt.user.client.rpc.core.java.lang;
import com.google.gwt.user.client.rpc.SerializationException;
import com.google.gwt.user.client.rpc.SerializationStreamReader;
import com.google.gwt.user.client.rpc.SerializationStreamWriter;
import com.google.gwt.user.client.rpc.impl.ReflectionHelper;
@SuppressWarnings("deprecation")
public class Exception_FieldSerializer implements com.google.gwt.user.client.rpc.impl.TypeHandler {
public static void deserialize(SerializationStreamReader streamReader, java.lang.Exception instance) throws SerializationException {
com.google.gwt.user.client.rpc.core.java.lang.Throwable_FieldSerializer.deserialize(streamReader, instance);
}
public static java.lang.Exception instantiate(SerializationStreamReader streamReader) throws SerializationException {
return new java.lang.Exception();
}
public static void serialize(SerializationStreamWriter streamWriter, java.lang.Exception instance) throws SerializationException {
com.google.gwt.user.client.rpc.core.java.lang.Throwable_FieldSerializer.serialize(streamWriter, instance);
}
public Object create(SerializationStreamReader reader) throws SerializationException {
return com.google.gwt.user.client.rpc.core.java.lang.Exception_FieldSerializer.instantiate(reader);
}
public void deserial(SerializationStreamReader reader, Object object) throws SerializationException {
com.google.gwt.user.client.rpc.core.java.lang.Exception_FieldSerializer.deserialize(reader, (java.lang.Exception)object);
}
public void serial(SerializationStreamWriter writer, Object object) throws SerializationException {
com.google.gwt.user.client.rpc.core.java.lang.Exception_FieldSerializer.serialize(writer, (java.lang.Exception)object);
}
}

@ -0,0 +1,36 @@
package com.google.gwt.user.client.rpc.core.java.lang;
import com.google.gwt.user.client.rpc.SerializationException;
import com.google.gwt.user.client.rpc.SerializationStreamReader;
import com.google.gwt.user.client.rpc.SerializationStreamWriter;
import com.google.gwt.user.client.rpc.impl.ReflectionHelper;
@SuppressWarnings("deprecation")
public class RuntimeException_FieldSerializer implements com.google.gwt.user.client.rpc.impl.TypeHandler {
public static void deserialize(SerializationStreamReader streamReader, java.lang.RuntimeException instance) throws SerializationException {
com.google.gwt.user.client.rpc.core.java.lang.Exception_FieldSerializer.deserialize(streamReader, instance);
}
public static java.lang.RuntimeException instantiate(SerializationStreamReader streamReader) throws SerializationException {
return new java.lang.RuntimeException();
}
public static void serialize(SerializationStreamWriter streamWriter, java.lang.RuntimeException instance) throws SerializationException {
com.google.gwt.user.client.rpc.core.java.lang.Exception_FieldSerializer.serialize(streamWriter, instance);
}
public Object create(SerializationStreamReader reader) throws SerializationException {
return com.google.gwt.user.client.rpc.core.java.lang.RuntimeException_FieldSerializer.instantiate(reader);
}
public void deserial(SerializationStreamReader reader, Object object) throws SerializationException {
com.google.gwt.user.client.rpc.core.java.lang.RuntimeException_FieldSerializer.deserialize(reader, (java.lang.RuntimeException)object);
}
public void serial(SerializationStreamWriter writer, Object object) throws SerializationException {
com.google.gwt.user.client.rpc.core.java.lang.RuntimeException_FieldSerializer.serialize(writer, (java.lang.RuntimeException)object);
}
}

@ -0,0 +1,22 @@
package com.google.gwt.user.client.rpc.core.java.lang;
import com.google.gwt.user.client.rpc.SerializationException;
import com.google.gwt.user.client.rpc.SerializationStreamReader;
import com.google.gwt.user.client.rpc.SerializationStreamWriter;
import com.google.gwt.user.client.rpc.impl.ReflectionHelper;
@SuppressWarnings("deprecation")
public class String_FieldSerializer implements com.google.gwt.user.client.rpc.impl.TypeHandler {
public Object create(SerializationStreamReader reader) throws SerializationException {
return com.google.gwt.user.client.rpc.core.java.lang.String_CustomFieldSerializer.instantiate(reader);
}
public void deserial(SerializationStreamReader reader, Object object) throws SerializationException {
com.google.gwt.user.client.rpc.core.java.lang.String_CustomFieldSerializer.deserialize(reader, (java.lang.String)object);
}
public void serial(SerializationStreamWriter writer, Object object) throws SerializationException {
com.google.gwt.user.client.rpc.core.java.lang.String_CustomFieldSerializer.serialize(writer, (java.lang.String)object);
}
}

@ -0,0 +1,45 @@
package com.google.gwt.user.client.rpc.core.java.lang;
import com.google.gwt.user.client.rpc.SerializationException;
import com.google.gwt.user.client.rpc.SerializationStreamReader;
import com.google.gwt.user.client.rpc.SerializationStreamWriter;
import com.google.gwt.user.client.rpc.impl.ReflectionHelper;
@SuppressWarnings("deprecation")
public class Throwable_FieldSerializer implements com.google.gwt.user.client.rpc.impl.TypeHandler {
private static native java.lang.String getDetailMessage(java.lang.Throwable instance) /*-{
return instance.@java.lang.Throwable::detailMessage;
}-*/;
private static native void setDetailMessage(java.lang.Throwable instance, java.lang.String value)
/*-{
instance.@java.lang.Throwable::detailMessage = value;
}-*/;
public static void deserialize(SerializationStreamReader streamReader, java.lang.Throwable instance) throws SerializationException {
setDetailMessage(instance, streamReader.readString());
}
public static java.lang.Throwable instantiate(SerializationStreamReader streamReader) throws SerializationException {
return new java.lang.Throwable();
}
public static void serialize(SerializationStreamWriter streamWriter, java.lang.Throwable instance) throws SerializationException {
streamWriter.writeString(getDetailMessage(instance));
}
public Object create(SerializationStreamReader reader) throws SerializationException {
return com.google.gwt.user.client.rpc.core.java.lang.Throwable_FieldSerializer.instantiate(reader);
}
public void deserial(SerializationStreamReader reader, Object object) throws SerializationException {
com.google.gwt.user.client.rpc.core.java.lang.Throwable_FieldSerializer.deserialize(reader, (java.lang.Throwable)object);
}
public void serial(SerializationStreamWriter writer, Object object) throws SerializationException {
com.google.gwt.user.client.rpc.core.java.lang.Throwable_FieldSerializer.serialize(writer, (java.lang.Throwable)object);
}
}

@ -0,0 +1,14 @@
package com.google.gwt.user.client.ui.impl;
public class ClippedImageImpl_DraggableTemplateImpl implements com.google.gwt.user.client.ui.impl.ClippedImageImpl.DraggableTemplate {
public com.google.gwt.safehtml.shared.SafeHtml image(com.google.gwt.safehtml.shared.SafeUri arg0,com.google.gwt.safecss.shared.SafeStyles arg1) {
StringBuilder sb = new java.lang.StringBuilder();
sb.append("<img onload='this.__gwtLastUnhandledEvent=\"load\";' src='");
sb.append(com.google.gwt.safehtml.shared.SafeHtmlUtils.htmlEscape(arg0.asString()));
sb.append("' style='");
sb.append(com.google.gwt.safehtml.shared.SafeHtmlUtils.htmlEscape(arg1.asString()));
sb.append("' border='0' draggable='true'>");
return new com.google.gwt.safehtml.shared.OnlyToBeUsedInGeneratedCodeStringBlessedAsSafeHtml(sb.toString());
}
}

@ -0,0 +1,14 @@
package com.google.gwt.user.client.ui.impl;
public class ClippedImageImpl_TemplateImpl implements com.google.gwt.user.client.ui.impl.ClippedImageImpl.Template {
public com.google.gwt.safehtml.shared.SafeHtml image(com.google.gwt.safehtml.shared.SafeUri arg0,com.google.gwt.safecss.shared.SafeStyles arg1) {
StringBuilder sb = new java.lang.StringBuilder();
sb.append("<img onload='this.__gwtLastUnhandledEvent=\"load\";' src='");
sb.append(com.google.gwt.safehtml.shared.SafeHtmlUtils.htmlEscape(arg0.asString()));
sb.append("' style='");
sb.append(com.google.gwt.safehtml.shared.SafeHtmlUtils.htmlEscape(arg1.asString()));
sb.append("' border='0'>");
return new com.google.gwt.safehtml.shared.OnlyToBeUsedInGeneratedCodeStringBlessedAsSafeHtml(sb.toString());
}
}

@ -0,0 +1,30 @@
package com.google.gwt.useragent.client;
public class UserAgentImplGecko1_8 implements com.google.gwt.useragent.client.UserAgent {
public native String getRuntimeValue() /*-{
var ua = navigator.userAgent.toLowerCase();
var docMode = $doc.documentMode;
if ((function() {
return (ua.indexOf('webkit') != -1);
})()) return 'safari';
if ((function() {
return (ua.indexOf('msie') != -1 && (docMode >= 10 && docMode < 11));
})()) return 'ie10';
if ((function() {
return (ua.indexOf('msie') != -1 && (docMode >= 9 && docMode < 11));
})()) return 'ie9';
if ((function() {
return (ua.indexOf('msie') != -1 && (docMode >= 8 && docMode < 11));
})()) return 'ie8';
if ((function() {
return (ua.indexOf('gecko') != -1 || docMode >= 11);
})()) return 'gecko1_8';
return 'unknown';
}-*/;
public String getCompileTimeValue() {
return "gecko1_8";
}
}

@ -0,0 +1,30 @@
package com.google.gwt.useragent.client;
public class UserAgentImplIe10 implements com.google.gwt.useragent.client.UserAgent {
public native String getRuntimeValue() /*-{
var ua = navigator.userAgent.toLowerCase();
var docMode = $doc.documentMode;
if ((function() {
return (ua.indexOf('webkit') != -1);
})()) return 'safari';
if ((function() {
return (ua.indexOf('msie') != -1 && (docMode >= 10 && docMode < 11));
})()) return 'ie10';
if ((function() {
return (ua.indexOf('msie') != -1 && (docMode >= 9 && docMode < 11));
})()) return 'ie9';
if ((function() {
return (ua.indexOf('msie') != -1 && (docMode >= 8 && docMode < 11));
})()) return 'ie8';
if ((function() {
return (ua.indexOf('gecko') != -1 || docMode >= 11);
})()) return 'gecko1_8';
return 'unknown';
}-*/;
public String getCompileTimeValue() {
return "ie10";
}
}

@ -0,0 +1,30 @@
package com.google.gwt.useragent.client;
public class UserAgentImplIe8 implements com.google.gwt.useragent.client.UserAgent {
public native String getRuntimeValue() /*-{
var ua = navigator.userAgent.toLowerCase();
var docMode = $doc.documentMode;
if ((function() {
return (ua.indexOf('webkit') != -1);
})()) return 'safari';
if ((function() {
return (ua.indexOf('msie') != -1 && (docMode >= 10 && docMode < 11));
})()) return 'ie10';
if ((function() {
return (ua.indexOf('msie') != -1 && (docMode >= 9 && docMode < 11));
})()) return 'ie9';
if ((function() {
return (ua.indexOf('msie') != -1 && (docMode >= 8 && docMode < 11));
})()) return 'ie8';
if ((function() {
return (ua.indexOf('gecko') != -1 || docMode >= 11);
})()) return 'gecko1_8';
return 'unknown';
}-*/;
public String getCompileTimeValue() {
return "ie8";
}
}

@ -0,0 +1,30 @@
package com.google.gwt.useragent.client;
public class UserAgentImplIe9 implements com.google.gwt.useragent.client.UserAgent {
public native String getRuntimeValue() /*-{
var ua = navigator.userAgent.toLowerCase();
var docMode = $doc.documentMode;
if ((function() {
return (ua.indexOf('webkit') != -1);
})()) return 'safari';
if ((function() {
return (ua.indexOf('msie') != -1 && (docMode >= 10 && docMode < 11));
})()) return 'ie10';
if ((function() {
return (ua.indexOf('msie') != -1 && (docMode >= 9 && docMode < 11));
})()) return 'ie9';
if ((function() {
return (ua.indexOf('msie') != -1 && (docMode >= 8 && docMode < 11));
})()) return 'ie8';
if ((function() {
return (ua.indexOf('gecko') != -1 || docMode >= 11);
})()) return 'gecko1_8';
return 'unknown';
}-*/;
public String getCompileTimeValue() {
return "ie9";
}
}

@ -0,0 +1,30 @@
package com.google.gwt.useragent.client;
public class UserAgentImplSafari implements com.google.gwt.useragent.client.UserAgent {
public native String getRuntimeValue() /*-{
var ua = navigator.userAgent.toLowerCase();
var docMode = $doc.documentMode;
if ((function() {
return (ua.indexOf('webkit') != -1);
})()) return 'safari';
if ((function() {
return (ua.indexOf('msie') != -1 && (docMode >= 10 && docMode < 11));
})()) return 'ie10';
if ((function() {
return (ua.indexOf('msie') != -1 && (docMode >= 9 && docMode < 11));
})()) return 'ie9';
if ((function() {
return (ua.indexOf('msie') != -1 && (docMode >= 8 && docMode < 11));
})()) return 'ie8';
if ((function() {
return (ua.indexOf('gecko') != -1 || docMode >= 11);
})()) return 'gecko1_8';
return 'unknown';
}-*/;
public String getCompileTimeValue() {
return "safari";
}
}

@ -0,0 +1,80 @@
package org.gcube.portlet.user.userstatisticsportlet.client;
import com.google.gwt.user.client.rpc.impl.RemoteServiceProxy;
import com.google.gwt.user.client.rpc.impl.ClientSerializationStreamWriter;
import com.google.gwt.user.client.rpc.SerializationStreamWriter;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.ResponseReader;
import com.google.gwt.user.client.rpc.SerializationException;
import com.google.gwt.user.client.rpc.RpcToken;
import com.google.gwt.user.client.rpc.RpcTokenException;
import com.google.gwt.core.client.impl.Impl;
import com.google.gwt.user.client.rpc.impl.RpcStatsContext;
public class UserStatisticsService_Proxy extends RemoteServiceProxy implements org.gcube.portlet.user.userstatisticsportlet.client.UserStatisticsServiceAsync {
private static final String REMOTE_SERVICE_INTERFACE_NAME = "org.gcube.portlet.user.userstatisticsportlet.client.UserStatisticsService";
private static final String SERIALIZATION_POLICY ="D1F27E2D652AE1A94EC26DA253E5F4EF";
private static final org.gcube.portlet.user.userstatisticsportlet.client.UserStatisticsService_TypeSerializer SERIALIZER = new org.gcube.portlet.user.userstatisticsportlet.client.UserStatisticsService_TypeSerializer();
public UserStatisticsService_Proxy() {
super(GWT.getModuleBaseURL(),
"statisticservice",
SERIALIZATION_POLICY,
SERIALIZER);
}
public void getPostsStats(com.google.gwt.user.client.rpc.AsyncCallback callback) {
com.google.gwt.user.client.rpc.impl.RemoteServiceProxy.ServiceHelper helper = new com.google.gwt.user.client.rpc.impl.RemoteServiceProxy.ServiceHelper("UserStatisticsService_Proxy", "getPostsStats");
try {
SerializationStreamWriter streamWriter = helper.start(REMOTE_SERVICE_INTERFACE_NAME, 0);
helper.finish(callback, ResponseReader.OBJECT);
} catch (SerializationException ex) {
callback.onFailure(ex);
}
}
public void getProfileStrength(com.google.gwt.user.client.rpc.AsyncCallback callback) {
com.google.gwt.user.client.rpc.impl.RemoteServiceProxy.ServiceHelper helper = new com.google.gwt.user.client.rpc.impl.RemoteServiceProxy.ServiceHelper("UserStatisticsService_Proxy", "getProfileStrength");
try {
SerializationStreamWriter streamWriter = helper.start(REMOTE_SERVICE_INTERFACE_NAME, 0);
helper.finish(callback, ResponseReader.INT);
} catch (SerializationException ex) {
callback.onFailure(ex);
}
}
public void getTotalSpaceInUse(com.google.gwt.user.client.rpc.AsyncCallback callback) {
com.google.gwt.user.client.rpc.impl.RemoteServiceProxy.ServiceHelper helper = new com.google.gwt.user.client.rpc.impl.RemoteServiceProxy.ServiceHelper("UserStatisticsService_Proxy", "getTotalSpaceInUse");
try {
SerializationStreamWriter streamWriter = helper.start(REMOTE_SERVICE_INTERFACE_NAME, 0);
helper.finish(callback, ResponseReader.STRING);
} catch (SerializationException ex) {
callback.onFailure(ex);
}
}
public void getUserSettings(com.google.gwt.user.client.rpc.AsyncCallback callback) {
com.google.gwt.user.client.rpc.impl.RemoteServiceProxy.ServiceHelper helper = new com.google.gwt.user.client.rpc.impl.RemoteServiceProxy.ServiceHelper("UserStatisticsService_Proxy", "getUserSettings");
try {
SerializationStreamWriter streamWriter = helper.start(REMOTE_SERVICE_INTERFACE_NAME, 0);
helper.finish(callback, ResponseReader.OBJECT);
} catch (SerializationException ex) {
callback.onFailure(ex);
}
}
@Override
public SerializationStreamWriter createStreamWriter() {
ClientSerializationStreamWriter toReturn =
(ClientSerializationStreamWriter) super.createStreamWriter();
if (getRpcToken() != null) {
toReturn.addFlags(ClientSerializationStreamWriter.FLAG_RPC_TOKEN_INCLUDED);
}
return toReturn;
}
@Override
protected void checkRpcTokenType(RpcToken token) {
if (!(token instanceof com.google.gwt.user.client.rpc.XsrfToken)) {
throw new RpcTokenException("Invalid RpcToken type: expected 'com.google.gwt.user.client.rpc.XsrfToken' but got '" + token.getClass() + "'");
}
}
}

@ -0,0 +1,76 @@
package org.gcube.portlet.user.userstatisticsportlet.client;
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.JsArrayString;
import com.google.gwt.user.client.rpc.impl.TypeHandler;
import java.util.HashMap;
import java.util.Map;
import com.google.gwt.core.client.GwtScriptOnly;
public class UserStatisticsService_TypeSerializer extends com.google.gwt.user.client.rpc.impl.SerializerBase {
private static final MethodMap methodMapNative;
private static final JsArrayString signatureMapNative;
static {
methodMapNative = loadMethodsNative();
signatureMapNative = loadSignaturesNative();
}
@SuppressWarnings("deprecation")
@GwtScriptOnly
private static native MethodMap loadMethodsNative() /*-{
var result = {};
result["com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException/3936916533"] = [
@com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException_FieldSerializer::instantiate(Lcom/google/gwt/user/client/rpc/SerializationStreamReader;),
@com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException_FieldSerializer::deserialize(Lcom/google/gwt/user/client/rpc/SerializationStreamReader;Lcom/google/gwt/user/client/rpc/IncompatibleRemoteServiceException;),
@com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException_FieldSerializer::serialize(Lcom/google/gwt/user/client/rpc/SerializationStreamWriter;Lcom/google/gwt/user/client/rpc/IncompatibleRemoteServiceException;)
];
result["com.google.gwt.user.client.rpc.RpcTokenException/2345075298"] = [
@com.google.gwt.user.client.rpc.RpcTokenException_FieldSerializer::instantiate(Lcom/google/gwt/user/client/rpc/SerializationStreamReader;),
@com.google.gwt.user.client.rpc.RpcTokenException_FieldSerializer::deserialize(Lcom/google/gwt/user/client/rpc/SerializationStreamReader;Lcom/google/gwt/user/client/rpc/RpcTokenException;),
];
result["com.google.gwt.user.client.rpc.XsrfToken/4254043109"] = [
,
,
@com.google.gwt.user.client.rpc.XsrfToken_FieldSerializer::serialize(Lcom/google/gwt/user/client/rpc/SerializationStreamWriter;Lcom/google/gwt/user/client/rpc/XsrfToken;)
];
result["java.lang.String/2004016611"] = [
@com.google.gwt.user.client.rpc.core.java.lang.String_CustomFieldSerializer::instantiate(Lcom/google/gwt/user/client/rpc/SerializationStreamReader;),
@com.google.gwt.user.client.rpc.core.java.lang.String_CustomFieldSerializer::deserialize(Lcom/google/gwt/user/client/rpc/SerializationStreamReader;Ljava/lang/String;),
@com.google.gwt.user.client.rpc.core.java.lang.String_CustomFieldSerializer::serialize(Lcom/google/gwt/user/client/rpc/SerializationStreamWriter;Ljava/lang/String;)
];
result["org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean/454022566"] = [
@org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean_FieldSerializer::instantiate(Lcom/google/gwt/user/client/rpc/SerializationStreamReader;),
@org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean_FieldSerializer::deserialize(Lcom/google/gwt/user/client/rpc/SerializationStreamReader;Lorg/gcube/portlet/user/userstatisticsportlet/shared/PostsStatsBean;),
];
result["org.gcube.portlet.user.userstatisticsportlet.shared.UserInformation/736341965"] = [
@org.gcube.portlet.user.userstatisticsportlet.shared.UserInformation_FieldSerializer::instantiate(Lcom/google/gwt/user/client/rpc/SerializationStreamReader;),
@org.gcube.portlet.user.userstatisticsportlet.shared.UserInformation_FieldSerializer::deserialize(Lcom/google/gwt/user/client/rpc/SerializationStreamReader;Lorg/gcube/portlet/user/userstatisticsportlet/shared/UserInformation;),
];
return result;
}-*/;
@SuppressWarnings("deprecation")
@GwtScriptOnly
private static native JsArrayString loadSignaturesNative() /*-{
var result = [];
result[@com.google.gwt.core.client.impl.Impl::getHashCode(Ljava/lang/Object;)(@com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException::class)] = "com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException/3936916533";
result[@com.google.gwt.core.client.impl.Impl::getHashCode(Ljava/lang/Object;)(@com.google.gwt.user.client.rpc.RpcTokenException::class)] = "com.google.gwt.user.client.rpc.RpcTokenException/2345075298";
result[@com.google.gwt.core.client.impl.Impl::getHashCode(Ljava/lang/Object;)(@com.google.gwt.user.client.rpc.XsrfToken::class)] = "com.google.gwt.user.client.rpc.XsrfToken/4254043109";
result[@com.google.gwt.core.client.impl.Impl::getHashCode(Ljava/lang/Object;)(@java.lang.String::class)] = "java.lang.String/2004016611";
result[@com.google.gwt.core.client.impl.Impl::getHashCode(Ljava/lang/Object;)(@org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean::class)] = "org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean/454022566";
result[@com.google.gwt.core.client.impl.Impl::getHashCode(Ljava/lang/Object;)(@org.gcube.portlet.user.userstatisticsportlet.shared.UserInformation::class)] = "org.gcube.portlet.user.userstatisticsportlet.shared.UserInformation/736341965";
return result;
}-*/;
public UserStatisticsService_TypeSerializer() {
super(null, methodMapNative, null, signatureMapNative);
}
}

@ -0,0 +1,307 @@
// .ui.xml template last modified: 1448472359000
package org.gcube.portlet.user.userstatisticsportlet.client.ui;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Element;
import com.google.gwt.safehtml.client.SafeHtmlTemplates;
import com.google.gwt.safehtml.shared.SafeHtml;
import com.google.gwt.safehtml.shared.SafeHtmlUtils;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
import com.google.gwt.safehtml.shared.SafeUri;
import com.google.gwt.safehtml.shared.UriUtils;
import com.google.gwt.uibinder.client.UiBinderUtil;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiBinderUtil;
import com.google.gwt.user.client.ui.Widget;
public class CommentsAndLikesWidget_CommentsAndLikesWidgetUiBinderImpl implements UiBinder<com.google.gwt.user.client.ui.Widget, org.gcube.portlet.user.userstatisticsportlet.client.ui.CommentsAndLikesWidget>, org.gcube.portlet.user.userstatisticsportlet.client.ui.CommentsAndLikesWidget.CommentsAndLikesWidgetUiBinder {
interface Template extends SafeHtmlTemplates {
@Template("<span id='{0}'></span> <span id='{1}'></span> <span id='{2}'></span> <span id='{3}'></span>")
SafeHtml html1(String arg0, String arg1, String arg2, String arg3);
}
Template template = GWT.create(Template.class);
public com.google.gwt.user.client.ui.Widget createAndBindUi(final org.gcube.portlet.user.userstatisticsportlet.client.ui.CommentsAndLikesWidget owner) {
return new Widgets(owner).get_f_HTMLPanel1();
}
/**
* Encapsulates the access to all inner widgets
*/
class Widgets {
private final org.gcube.portlet.user.userstatisticsportlet.client.ui.CommentsAndLikesWidget owner;
public Widgets(final org.gcube.portlet.user.userstatisticsportlet.client.ui.CommentsAndLikesWidget owner) {
this.owner = owner;
build_style(); // generated css resource must be always created. Type: GENERATED_CSS. Precedence: 1
build_domId0(); // more than one getter call detected. Type: DOM_ID_HOLDER, precedence: 2
build_domId1(); // more than one getter call detected. Type: DOM_ID_HOLDER, precedence: 2
build_domId2(); // more than one getter call detected. Type: DOM_ID_HOLDER, precedence: 2
build_domId3(); // more than one getter call detected. Type: DOM_ID_HOLDER, precedence: 2
build_domId0Element(); // more than one getter call detected. Type: DEFAULT, precedence: 2
build_domId1Element(); // more than one getter call detected. Type: DEFAULT, precedence: 2
build_domId2Element(); // more than one getter call detected. Type: DEFAULT, precedence: 2
build_domId3Element(); // more than one getter call detected. Type: DEFAULT, precedence: 2
}
SafeHtml template_html1() {
return template.html1(get_domId0(), get_domId1(), get_domId2(), get_domId3());
}
/**
* Getter for clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay called 1 times. Type: GENERATED_BUNDLE. Build precedence: 1.
*/
private org.gcube.portlet.user.userstatisticsportlet.client.ui.CommentsAndLikesWidget_CommentsAndLikesWidgetUiBinderImpl_GenBundle get_clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay() {
return build_clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay();
}
private org.gcube.portlet.user.userstatisticsportlet.client.ui.CommentsAndLikesWidget_CommentsAndLikesWidgetUiBinderImpl_GenBundle build_clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay() {
// Creation section.
final org.gcube.portlet.user.userstatisticsportlet.client.ui.CommentsAndLikesWidget_CommentsAndLikesWidgetUiBinderImpl_GenBundle clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay = (org.gcube.portlet.user.userstatisticsportlet.client.ui.CommentsAndLikesWidget_CommentsAndLikesWidgetUiBinderImpl_GenBundle) GWT.create(org.gcube.portlet.user.userstatisticsportlet.client.ui.CommentsAndLikesWidget_CommentsAndLikesWidgetUiBinderImpl_GenBundle.class);
// Setup section.
return clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay;
}
/**
* Getter for style called 4 times. Type: GENERATED_CSS. Build precedence: 1.
*/
private org.gcube.portlet.user.userstatisticsportlet.client.ui.CommentsAndLikesWidget_CommentsAndLikesWidgetUiBinderImpl_GenCss_style style;
private org.gcube.portlet.user.userstatisticsportlet.client.ui.CommentsAndLikesWidget_CommentsAndLikesWidgetUiBinderImpl_GenCss_style get_style() {
return style;
}
private org.gcube.portlet.user.userstatisticsportlet.client.ui.CommentsAndLikesWidget_CommentsAndLikesWidgetUiBinderImpl_GenCss_style build_style() {
// Creation section.
style = get_clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay().style();
// Setup section.
style.ensureInjected();
return style;
}
/**
* Getter for f_HTMLPanel1 called 1 times. Type: DEFAULT. Build precedence: 1.
*/
private com.google.gwt.user.client.ui.HTMLPanel get_f_HTMLPanel1() {
return build_f_HTMLPanel1();
}
private com.google.gwt.user.client.ui.HTMLPanel build_f_HTMLPanel1() {
// Creation section.
final com.google.gwt.user.client.ui.HTMLPanel f_HTMLPanel1 = new com.google.gwt.user.client.ui.HTMLPanel(template_html1().asString());
// Setup section.
{
// Attach section.
UiBinderUtil.TempAttachment __attachRecord__ = UiBinderUtil.attachToDom(f_HTMLPanel1.getElement());
get_domId0Element().get();
get_domId1Element().get();
get_domId2Element().get();
get_domId3Element().get();
// Detach section.
__attachRecord__.detach();
}
f_HTMLPanel1.addAndReplaceElement(get_likesImage(), get_domId0Element().get());
f_HTMLPanel1.addAndReplaceElement(get_likesValue(), get_domId1Element().get());
f_HTMLPanel1.addAndReplaceElement(get_commentsImage(), get_domId2Element().get());
f_HTMLPanel1.addAndReplaceElement(get_commentsValue(), get_domId3Element().get());
return f_HTMLPanel1;
}
/**
* Getter for domId0 called 2 times. Type: DOM_ID_HOLDER. Build precedence: 2.
*/
private java.lang.String domId0;
private java.lang.String get_domId0() {
return domId0;
}
private java.lang.String build_domId0() {
// Creation section.
domId0 = com.google.gwt.dom.client.Document.get().createUniqueId();
// Setup section.
return domId0;
}
/**
* Getter for likesImage called 1 times. Type: DEFAULT. Build precedence: 2.
*/
private com.google.gwt.user.client.ui.Image get_likesImage() {
return build_likesImage();
}
private com.google.gwt.user.client.ui.Image build_likesImage() {
// Creation section.
final com.google.gwt.user.client.ui.Image likesImage = (com.google.gwt.user.client.ui.Image) GWT.create(com.google.gwt.user.client.ui.Image.class);
// Setup section.
likesImage.setStyleName("" + get_style().statisticIcon() + "");
this.owner.likesImage = likesImage;
return likesImage;
}
/**
* Getter for domId0Element called 2 times. Type: DEFAULT. Build precedence: 2.
*/
private com.google.gwt.uibinder.client.LazyDomElement domId0Element;
private com.google.gwt.uibinder.client.LazyDomElement get_domId0Element() {
return domId0Element;
}
private com.google.gwt.uibinder.client.LazyDomElement build_domId0Element() {
// Creation section.
domId0Element = new com.google.gwt.uibinder.client.LazyDomElement<Element>(get_domId0());
// Setup section.
return domId0Element;
}
/**
* Getter for domId1 called 2 times. Type: DOM_ID_HOLDER. Build precedence: 2.
*/
private java.lang.String domId1;
private java.lang.String get_domId1() {
return domId1;
}
private java.lang.String build_domId1() {
// Creation section.
domId1 = com.google.gwt.dom.client.Document.get().createUniqueId();
// Setup section.
return domId1;
}
/**
* Getter for likesValue called 1 times. Type: DEFAULT. Build precedence: 2.
*/
private com.google.gwt.user.client.ui.Label get_likesValue() {
return build_likesValue();
}
private com.google.gwt.user.client.ui.Label build_likesValue() {
// Creation section.
final com.google.gwt.user.client.ui.Label likesValue = (com.google.gwt.user.client.ui.Label) GWT.create(com.google.gwt.user.client.ui.Label.class);
// Setup section.
likesValue.setStyleName("" + get_style().statisticValue() + "");
this.owner.likesValue = likesValue;
return likesValue;
}
/**
* Getter for domId1Element called 2 times. Type: DEFAULT. Build precedence: 2.
*/
private com.google.gwt.uibinder.client.LazyDomElement domId1Element;
private com.google.gwt.uibinder.client.LazyDomElement get_domId1Element() {
return domId1Element;
}
private com.google.gwt.uibinder.client.LazyDomElement build_domId1Element() {
// Creation section.
domId1Element = new com.google.gwt.uibinder.client.LazyDomElement<Element>(get_domId1());
// Setup section.
return domId1Element;
}
/**
* Getter for domId2 called 2 times. Type: DOM_ID_HOLDER. Build precedence: 2.
*/
private java.lang.String domId2;
private java.lang.String get_domId2() {
return domId2;
}
private java.lang.String build_domId2() {
// Creation section.
domId2 = com.google.gwt.dom.client.Document.get().createUniqueId();
// Setup section.
return domId2;
}
/**
* Getter for commentsImage called 1 times. Type: DEFAULT. Build precedence: 2.
*/
private com.google.gwt.user.client.ui.Image get_commentsImage() {
return build_commentsImage();
}
private com.google.gwt.user.client.ui.Image build_commentsImage() {
// Creation section.
final com.google.gwt.user.client.ui.Image commentsImage = (com.google.gwt.user.client.ui.Image) GWT.create(com.google.gwt.user.client.ui.Image.class);
// Setup section.
commentsImage.setStyleName("" + get_style().statisticIcon() + "");
this.owner.commentsImage = commentsImage;
return commentsImage;
}
/**
* Getter for domId2Element called 2 times. Type: DEFAULT. Build precedence: 2.
*/
private com.google.gwt.uibinder.client.LazyDomElement domId2Element;
private com.google.gwt.uibinder.client.LazyDomElement get_domId2Element() {
return domId2Element;
}
private com.google.gwt.uibinder.client.LazyDomElement build_domId2Element() {
// Creation section.
domId2Element = new com.google.gwt.uibinder.client.LazyDomElement<Element>(get_domId2());
// Setup section.
return domId2Element;
}
/**
* Getter for domId3 called 2 times. Type: DOM_ID_HOLDER. Build precedence: 2.
*/
private java.lang.String domId3;
private java.lang.String get_domId3() {
return domId3;
}
private java.lang.String build_domId3() {
// Creation section.
domId3 = com.google.gwt.dom.client.Document.get().createUniqueId();
// Setup section.
return domId3;
}
/**
* Getter for commentsValue called 1 times. Type: DEFAULT. Build precedence: 2.
*/
private com.google.gwt.user.client.ui.Label get_commentsValue() {
return build_commentsValue();
}
private com.google.gwt.user.client.ui.Label build_commentsValue() {
// Creation section.
final com.google.gwt.user.client.ui.Label commentsValue = (com.google.gwt.user.client.ui.Label) GWT.create(com.google.gwt.user.client.ui.Label.class);
// Setup section.
commentsValue.setStyleName("" + get_style().statisticValue() + "");
this.owner.commentsValue = commentsValue;
return commentsValue;
}
/**
* Getter for domId3Element called 2 times. Type: DEFAULT. Build precedence: 2.
*/
private com.google.gwt.uibinder.client.LazyDomElement domId3Element;
private com.google.gwt.uibinder.client.LazyDomElement get_domId3Element() {
return domId3Element;
}
private com.google.gwt.uibinder.client.LazyDomElement build_domId3Element() {
// Creation section.
domId3Element = new com.google.gwt.uibinder.client.LazyDomElement<Element>(get_domId3());
// Setup section.
return domId3Element;
}
}
}

@ -0,0 +1,15 @@
package org.gcube.portlet.user.userstatisticsportlet.client.ui;
import com.google.gwt.resources.client.ClientBundle;
import com.google.gwt.resources.client.DataResource;
import com.google.gwt.resources.client.DataResource.DoNotEmbed;
import com.google.gwt.resources.client.DataResource.MimeType;
import com.google.gwt.resources.client.ImageResource;
import com.google.gwt.resources.client.ImageResource.ImageOptions;
import com.google.gwt.resources.client.CssResource.Import;
public interface CommentsAndLikesWidget_CommentsAndLikesWidgetUiBinderImpl_GenBundle extends ClientBundle {
@Source("uibinder.org.gcube.portlet.user.userstatisticsportlet.client.ui.CommentsAndLikesWidget_CommentsAndLikesWidgetUiBinderImpl_GenCss_style.css")
CommentsAndLikesWidget_CommentsAndLikesWidgetUiBinderImpl_GenCss_style style();
}

@ -0,0 +1,70 @@
package org.gcube.portlet.user.userstatisticsportlet.client.ui;
import com.google.gwt.core.client.GWT;
import com.google.gwt.resources.client.ResourcePrototype;
public class CommentsAndLikesWidget_CommentsAndLikesWidgetUiBinderImpl_GenBundle_default_InlineClientBundleGenerator implements org.gcube.portlet.user.userstatisticsportlet.client.ui.CommentsAndLikesWidget_CommentsAndLikesWidgetUiBinderImpl_GenBundle {
private static CommentsAndLikesWidget_CommentsAndLikesWidgetUiBinderImpl_GenBundle_default_InlineClientBundleGenerator _instance0 = new CommentsAndLikesWidget_CommentsAndLikesWidgetUiBinderImpl_GenBundle_default_InlineClientBundleGenerator();
private void styleInitializer() {
style = new org.gcube.portlet.user.userstatisticsportlet.client.ui.CommentsAndLikesWidget_CommentsAndLikesWidgetUiBinderImpl_GenCss_style() {
private boolean injected;
public boolean ensureInjected() {
if (!injected) {
injected = true;
com.google.gwt.dom.client.StyleInjector.inject(getText());
return true;
}
return false;
}
public String getName() {
return "style";
}
public String getText() {
return (".GBE-UDYCEI{display:" + ("inline-block") + ";vertical-align:" + ("bottom") + ";}.GBE-UDYCFI{color:" + ("#0084b4") + " !important;font-size:" + ("13px") + ";display:" + ("inline-block") + ";vertical-align:" + ("bottom") + ";}");
}
public java.lang.String statisticIcon() {
return "GBE-UDYCEI";
}
public java.lang.String statisticValue() {
return "GBE-UDYCFI";
}
}
;
}
private static class styleInitializer {
static {
_instance0.styleInitializer();
}
static org.gcube.portlet.user.userstatisticsportlet.client.ui.CommentsAndLikesWidget_CommentsAndLikesWidgetUiBinderImpl_GenCss_style get() {
return style;
}
}
public org.gcube.portlet.user.userstatisticsportlet.client.ui.CommentsAndLikesWidget_CommentsAndLikesWidgetUiBinderImpl_GenCss_style style() {
return styleInitializer.get();
}
private static java.util.HashMap<java.lang.String, com.google.gwt.resources.client.ResourcePrototype> resourceMap;
private static org.gcube.portlet.user.userstatisticsportlet.client.ui.CommentsAndLikesWidget_CommentsAndLikesWidgetUiBinderImpl_GenCss_style style;
public ResourcePrototype[] getResources() {
return new ResourcePrototype[] {
style(),
};
}
public ResourcePrototype getResource(String name) {
if (GWT.isScript()) {
return getResourceNative(name);
} else {
if (resourceMap == null) {
resourceMap = new java.util.HashMap<java.lang.String, com.google.gwt.resources.client.ResourcePrototype>();
resourceMap.put("style", style());
}
return resourceMap.get(name);
}
}
private native ResourcePrototype getResourceNative(String name) /*-{
switch (name) {
case 'style': return this.@org.gcube.portlet.user.userstatisticsportlet.client.ui.CommentsAndLikesWidget_CommentsAndLikesWidgetUiBinderImpl_GenBundle::style()();
}
return null;
}-*/;
}

@ -0,0 +1,10 @@
package org.gcube.portlet.user.userstatisticsportlet.client.ui;
import com.google.gwt.resources.client.CssResource;
public interface CommentsAndLikesWidget_CommentsAndLikesWidgetUiBinderImpl_GenCss_style extends CssResource {
@ClassName("statistic-value")
String statisticValue();
@ClassName("statistic-icon")
String statisticIcon();
}

@ -0,0 +1,18 @@
package org.gcube.portlet.user.userstatisticsportlet.client.ui;
public class CommentsAndLikesWidget_CommentsAndLikesWidgetUiBinderImpl_TemplateImpl implements org.gcube.portlet.user.userstatisticsportlet.client.ui.CommentsAndLikesWidget_CommentsAndLikesWidgetUiBinderImpl.Template {
public com.google.gwt.safehtml.shared.SafeHtml html1(java.lang.String arg0,java.lang.String arg1,java.lang.String arg2,java.lang.String arg3) {
StringBuilder sb = new java.lang.StringBuilder();
sb.append("<span id='");
sb.append(com.google.gwt.safehtml.shared.SafeHtmlUtils.htmlEscape(arg0));
sb.append("'></span> <span id='");
sb.append(com.google.gwt.safehtml.shared.SafeHtmlUtils.htmlEscape(arg1));
sb.append("'></span> <span id='");
sb.append(com.google.gwt.safehtml.shared.SafeHtmlUtils.htmlEscape(arg2));
sb.append("'></span> <span id='");
sb.append(com.google.gwt.safehtml.shared.SafeHtmlUtils.htmlEscape(arg3));
sb.append("'></span>");
return new com.google.gwt.safehtml.shared.OnlyToBeUsedInGeneratedCodeStringBlessedAsSafeHtml(sb.toString());
}
}

@ -0,0 +1,205 @@
// .ui.xml template last modified: 1449140426000
package org.gcube.portlet.user.userstatisticsportlet.client.ui;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Element;
import com.google.gwt.safehtml.client.SafeHtmlTemplates;
import com.google.gwt.safehtml.shared.SafeHtml;
import com.google.gwt.safehtml.shared.SafeHtmlUtils;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
import com.google.gwt.safehtml.shared.SafeUri;
import com.google.gwt.safehtml.shared.UriUtils;
import com.google.gwt.uibinder.client.UiBinderUtil;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiBinderUtil;
import com.google.gwt.user.client.ui.Widget;
public class StatisticWidget_StatisticWidgetUiBinderImpl implements UiBinder<com.google.gwt.user.client.ui.Widget, org.gcube.portlet.user.userstatisticsportlet.client.ui.StatisticWidget>, org.gcube.portlet.user.userstatisticsportlet.client.ui.StatisticWidget.StatisticWidgetUiBinder {
interface Template extends SafeHtmlTemplates {
@Template("<span id='{0}'></span> <span id='{1}'></span>")
SafeHtml html1(String arg0, String arg1);
}
Template template = GWT.create(Template.class);
public com.google.gwt.user.client.ui.Widget createAndBindUi(final org.gcube.portlet.user.userstatisticsportlet.client.ui.StatisticWidget owner) {
return new Widgets(owner).get_f_HTMLPanel1();
}
/**
* Encapsulates the access to all inner widgets
*/
class Widgets {
private final org.gcube.portlet.user.userstatisticsportlet.client.ui.StatisticWidget owner;
public Widgets(final org.gcube.portlet.user.userstatisticsportlet.client.ui.StatisticWidget owner) {
this.owner = owner;
build_style(); // generated css resource must be always created. Type: GENERATED_CSS. Precedence: 1
build_domId0(); // more than one getter call detected. Type: DOM_ID_HOLDER, precedence: 2
build_domId1(); // more than one getter call detected. Type: DOM_ID_HOLDER, precedence: 2
build_domId0Element(); // more than one getter call detected. Type: DEFAULT, precedence: 2
build_domId1Element(); // more than one getter call detected. Type: DEFAULT, precedence: 2
}
SafeHtml template_html1() {
return template.html1(get_domId0(), get_domId1());
}
/**
* Getter for clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay called 1 times. Type: GENERATED_BUNDLE. Build precedence: 1.
*/
private org.gcube.portlet.user.userstatisticsportlet.client.ui.StatisticWidget_StatisticWidgetUiBinderImpl_GenBundle get_clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay() {
return build_clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay();
}
private org.gcube.portlet.user.userstatisticsportlet.client.ui.StatisticWidget_StatisticWidgetUiBinderImpl_GenBundle build_clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay() {
// Creation section.
final org.gcube.portlet.user.userstatisticsportlet.client.ui.StatisticWidget_StatisticWidgetUiBinderImpl_GenBundle clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay = (org.gcube.portlet.user.userstatisticsportlet.client.ui.StatisticWidget_StatisticWidgetUiBinderImpl_GenBundle) GWT.create(org.gcube.portlet.user.userstatisticsportlet.client.ui.StatisticWidget_StatisticWidgetUiBinderImpl_GenBundle.class);
// Setup section.
return clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay;
}
/**
* Getter for style called 2 times. Type: GENERATED_CSS. Build precedence: 1.
*/
private org.gcube.portlet.user.userstatisticsportlet.client.ui.StatisticWidget_StatisticWidgetUiBinderImpl_GenCss_style style;
private org.gcube.portlet.user.userstatisticsportlet.client.ui.StatisticWidget_StatisticWidgetUiBinderImpl_GenCss_style get_style() {
return style;
}
private org.gcube.portlet.user.userstatisticsportlet.client.ui.StatisticWidget_StatisticWidgetUiBinderImpl_GenCss_style build_style() {
// Creation section.
style = get_clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay().style();
// Setup section.
style.ensureInjected();
return style;
}
/**
* Getter for f_HTMLPanel1 called 1 times. Type: DEFAULT. Build precedence: 1.
*/
private com.google.gwt.user.client.ui.HTMLPanel get_f_HTMLPanel1() {
return build_f_HTMLPanel1();
}
private com.google.gwt.user.client.ui.HTMLPanel build_f_HTMLPanel1() {
// Creation section.
final com.google.gwt.user.client.ui.HTMLPanel f_HTMLPanel1 = new com.google.gwt.user.client.ui.HTMLPanel(template_html1().asString());
// Setup section.
f_HTMLPanel1.setStyleName("" + get_style().statisticContainer() + "");
{
// Attach section.
UiBinderUtil.TempAttachment __attachRecord__ = UiBinderUtil.attachToDom(f_HTMLPanel1.getElement());
get_domId0Element().get();
get_domId1Element().get();
// Detach section.
__attachRecord__.detach();
}
f_HTMLPanel1.addAndReplaceElement(get_header(), get_domId0Element().get());
f_HTMLPanel1.addAndReplaceElement(get_containerValues(), get_domId1Element().get());
return f_HTMLPanel1;
}
/**
* Getter for domId0 called 2 times. Type: DOM_ID_HOLDER. Build precedence: 2.
*/
private java.lang.String domId0;
private java.lang.String get_domId0() {
return domId0;
}
private java.lang.String build_domId0() {
// Creation section.
domId0 = com.google.gwt.dom.client.Document.get().createUniqueId();
// Setup section.
return domId0;
}
/**
* Getter for header called 1 times. Type: DEFAULT. Build precedence: 2.
*/
private com.google.gwt.user.client.ui.Label get_header() {
return build_header();
}
private com.google.gwt.user.client.ui.Label build_header() {
// Creation section.
final com.google.gwt.user.client.ui.Label header = (com.google.gwt.user.client.ui.Label) GWT.create(com.google.gwt.user.client.ui.Label.class);
// Setup section.
header.setStyleName("" + get_style().statisticHeader() + "");
this.owner.header = header;
return header;
}
/**
* Getter for domId0Element called 2 times. Type: DEFAULT. Build precedence: 2.
*/
private com.google.gwt.uibinder.client.LazyDomElement domId0Element;
private com.google.gwt.uibinder.client.LazyDomElement get_domId0Element() {
return domId0Element;
}
private com.google.gwt.uibinder.client.LazyDomElement build_domId0Element() {
// Creation section.
domId0Element = new com.google.gwt.uibinder.client.LazyDomElement<Element>(get_domId0());
// Setup section.
return domId0Element;
}
/**
* Getter for domId1 called 2 times. Type: DOM_ID_HOLDER. Build precedence: 2.
*/
private java.lang.String domId1;
private java.lang.String get_domId1() {
return domId1;
}
private java.lang.String build_domId1() {
// Creation section.
domId1 = com.google.gwt.dom.client.Document.get().createUniqueId();
// Setup section.
return domId1;
}
/**
* Getter for containerValues called 1 times. Type: DEFAULT. Build precedence: 2.
*/
private com.google.gwt.user.client.ui.FlowPanel get_containerValues() {
return build_containerValues();
}
private com.google.gwt.user.client.ui.FlowPanel build_containerValues() {
// Creation section.
final com.google.gwt.user.client.ui.FlowPanel containerValues = (com.google.gwt.user.client.ui.FlowPanel) GWT.create(com.google.gwt.user.client.ui.FlowPanel.class);
// Setup section.
this.owner.containerValues = containerValues;
return containerValues;
}
/**
* Getter for domId1Element called 2 times. Type: DEFAULT. Build precedence: 2.
*/
private com.google.gwt.uibinder.client.LazyDomElement domId1Element;
private com.google.gwt.uibinder.client.LazyDomElement get_domId1Element() {
return domId1Element;
}
private com.google.gwt.uibinder.client.LazyDomElement build_domId1Element() {
// Creation section.
domId1Element = new com.google.gwt.uibinder.client.LazyDomElement<Element>(get_domId1());
// Setup section.
return domId1Element;
}
}
}

@ -0,0 +1,15 @@
package org.gcube.portlet.user.userstatisticsportlet.client.ui;
import com.google.gwt.resources.client.ClientBundle;
import com.google.gwt.resources.client.DataResource;
import com.google.gwt.resources.client.DataResource.DoNotEmbed;
import com.google.gwt.resources.client.DataResource.MimeType;
import com.google.gwt.resources.client.ImageResource;
import com.google.gwt.resources.client.ImageResource.ImageOptions;
import com.google.gwt.resources.client.CssResource.Import;
public interface StatisticWidget_StatisticWidgetUiBinderImpl_GenBundle extends ClientBundle {
@Source("uibinder.org.gcube.portlet.user.userstatisticsportlet.client.ui.StatisticWidget_StatisticWidgetUiBinderImpl_GenCss_style.css")
StatisticWidget_StatisticWidgetUiBinderImpl_GenCss_style style();
}

@ -0,0 +1,70 @@
package org.gcube.portlet.user.userstatisticsportlet.client.ui;
import com.google.gwt.core.client.GWT;
import com.google.gwt.resources.client.ResourcePrototype;
public class StatisticWidget_StatisticWidgetUiBinderImpl_GenBundle_default_InlineClientBundleGenerator implements org.gcube.portlet.user.userstatisticsportlet.client.ui.StatisticWidget_StatisticWidgetUiBinderImpl_GenBundle {
private static StatisticWidget_StatisticWidgetUiBinderImpl_GenBundle_default_InlineClientBundleGenerator _instance0 = new StatisticWidget_StatisticWidgetUiBinderImpl_GenBundle_default_InlineClientBundleGenerator();
private void styleInitializer() {
style = new org.gcube.portlet.user.userstatisticsportlet.client.ui.StatisticWidget_StatisticWidgetUiBinderImpl_GenCss_style() {
private boolean injected;
public boolean ensureInjected() {
if (!injected) {
injected = true;
com.google.gwt.dom.client.StyleInjector.inject(getText());
return true;
}
return false;
}
public String getName() {
return "style";
}
public String getText() {
return com.google.gwt.i18n.client.LocaleInfo.getCurrentLocale().isRTL() ? ((".GBE-UDYCGI{margin-left:" + ("10px") + ";display:" + ("inline-block") + ";vertical-align:" + ("top") + ";}.GBE-UDYCHI{font-family:" + ("\"Lucida Grande\""+ ","+ " " +"Verdana"+ ","+ " " +"\"Bitstream Vera Sans\""+ ","+ " " +"Arial"+ ","+ " " +"sans-serif") + ";font-size:" + ("12px") + ";color:" + ("#8899a6") + ";letter-spacing:" + ("0.02em") + ";overflow:" + ("hidden") + ";text-transform:" + ("uppercase") + ";margin-top:" + ("15px") + ";margin-bottom:") + (("2px") + ";text-align:" + ("center") + ";vertical-align:" + ("text-top") + ";}")) : ((".GBE-UDYCGI{margin-right:" + ("10px") + ";display:" + ("inline-block") + ";vertical-align:" + ("top") + ";}.GBE-UDYCHI{font-family:" + ("\"Lucida Grande\""+ ","+ " " +"Verdana"+ ","+ " " +"\"Bitstream Vera Sans\""+ ","+ " " +"Arial"+ ","+ " " +"sans-serif") + ";font-size:" + ("12px") + ";color:" + ("#8899a6") + ";letter-spacing:" + ("0.02em") + ";overflow:" + ("hidden") + ";text-transform:" + ("uppercase") + ";margin-top:" + ("15px") + ";margin-bottom:") + (("2px") + ";text-align:" + ("center") + ";vertical-align:" + ("text-top") + ";}"));
}
public java.lang.String statisticContainer() {
return "GBE-UDYCGI";
}
public java.lang.String statisticHeader() {
return "GBE-UDYCHI";
}
}
;
}
private static class styleInitializer {
static {
_instance0.styleInitializer();
}
static org.gcube.portlet.user.userstatisticsportlet.client.ui.StatisticWidget_StatisticWidgetUiBinderImpl_GenCss_style get() {
return style;
}
}
public org.gcube.portlet.user.userstatisticsportlet.client.ui.StatisticWidget_StatisticWidgetUiBinderImpl_GenCss_style style() {
return styleInitializer.get();
}
private static java.util.HashMap<java.lang.String, com.google.gwt.resources.client.ResourcePrototype> resourceMap;
private static org.gcube.portlet.user.userstatisticsportlet.client.ui.StatisticWidget_StatisticWidgetUiBinderImpl_GenCss_style style;
public ResourcePrototype[] getResources() {
return new ResourcePrototype[] {
style(),
};
}
public ResourcePrototype getResource(String name) {
if (GWT.isScript()) {
return getResourceNative(name);
} else {
if (resourceMap == null) {
resourceMap = new java.util.HashMap<java.lang.String, com.google.gwt.resources.client.ResourcePrototype>();
resourceMap.put("style", style());
}
return resourceMap.get(name);
}
}
private native ResourcePrototype getResourceNative(String name) /*-{
switch (name) {
case 'style': return this.@org.gcube.portlet.user.userstatisticsportlet.client.ui.StatisticWidget_StatisticWidgetUiBinderImpl_GenBundle::style()();
}
return null;
}-*/;
}

@ -0,0 +1,10 @@
package org.gcube.portlet.user.userstatisticsportlet.client.ui;
import com.google.gwt.resources.client.CssResource;
public interface StatisticWidget_StatisticWidgetUiBinderImpl_GenCss_style extends CssResource {
@ClassName("statistic-header")
String statisticHeader();
@ClassName("statistic-container")
String statisticContainer();
}

@ -0,0 +1,14 @@
package org.gcube.portlet.user.userstatisticsportlet.client.ui;
public class StatisticWidget_StatisticWidgetUiBinderImpl_TemplateImpl implements org.gcube.portlet.user.userstatisticsportlet.client.ui.StatisticWidget_StatisticWidgetUiBinderImpl.Template {
public com.google.gwt.safehtml.shared.SafeHtml html1(java.lang.String arg0,java.lang.String arg1) {
StringBuilder sb = new java.lang.StringBuilder();
sb.append("<span id='");
sb.append(com.google.gwt.safehtml.shared.SafeHtmlUtils.htmlEscape(arg0));
sb.append("'></span> <span id='");
sb.append(com.google.gwt.safehtml.shared.SafeHtmlUtils.htmlEscape(arg1));
sb.append("'></span>");
return new com.google.gwt.safehtml.shared.OnlyToBeUsedInGeneratedCodeStringBlessedAsSafeHtml(sb.toString());
}
}

@ -0,0 +1,73 @@
package org.gcube.portlet.user.userstatisticsportlet.shared;
import com.google.gwt.user.client.rpc.SerializationException;
import com.google.gwt.user.client.rpc.SerializationStreamReader;
import com.google.gwt.user.client.rpc.SerializationStreamWriter;
import com.google.gwt.user.client.rpc.impl.ReflectionHelper;
@SuppressWarnings("deprecation")
public class PostsStatsBean_FieldSerializer implements com.google.gwt.user.client.rpc.impl.TypeHandler {
@com.google.gwt.core.client.UnsafeNativeLong
private static native long getCommentsReceived(org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean instance) /*-{
return instance.@org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean::commentsReceived;
}-*/;
@com.google.gwt.core.client.UnsafeNativeLong
private static native void setCommentsReceived(org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean instance, long value)
/*-{
instance.@org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean::commentsReceived = value;
}-*/;
@com.google.gwt.core.client.UnsafeNativeLong
private static native long getFeeds(org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean instance) /*-{
return instance.@org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean::feeds;
}-*/;
@com.google.gwt.core.client.UnsafeNativeLong
private static native void setFeeds(org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean instance, long value)
/*-{
instance.@org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean::feeds = value;
}-*/;
@com.google.gwt.core.client.UnsafeNativeLong
private static native long getLikesReceived(org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean instance) /*-{
return instance.@org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean::likesReceived;
}-*/;
@com.google.gwt.core.client.UnsafeNativeLong
private static native void setLikesReceived(org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean instance, long value)
/*-{
instance.@org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean::likesReceived = value;
}-*/;
public static void deserialize(SerializationStreamReader streamReader, org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean instance) throws SerializationException {
setCommentsReceived(instance, streamReader.readLong());
setFeeds(instance, streamReader.readLong());
setLikesReceived(instance, streamReader.readLong());
}
public static org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean instantiate(SerializationStreamReader streamReader) throws SerializationException {
return new org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean();
}
public static void serialize(SerializationStreamWriter streamWriter, org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean instance) throws SerializationException {
streamWriter.writeLong(getCommentsReceived(instance));
streamWriter.writeLong(getFeeds(instance));
streamWriter.writeLong(getLikesReceived(instance));
}
public Object create(SerializationStreamReader reader) throws SerializationException {
return org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean_FieldSerializer.instantiate(reader);
}
public void deserial(SerializationStreamReader reader, Object object) throws SerializationException {
org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean_FieldSerializer.deserialize(reader, (org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean)object);
}
public void serial(SerializationStreamWriter writer, Object object) throws SerializationException {
org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean_FieldSerializer.serialize(writer, (org.gcube.portlet.user.userstatisticsportlet.shared.PostsStatsBean)object);
}
}

@ -0,0 +1,89 @@
package org.gcube.portlet.user.userstatisticsportlet.shared;
import com.google.gwt.user.client.rpc.SerializationException;
import com.google.gwt.user.client.rpc.SerializationStreamReader;
import com.google.gwt.user.client.rpc.SerializationStreamWriter;
import com.google.gwt.user.client.rpc.impl.ReflectionHelper;
@SuppressWarnings("deprecation")
public class UserInformation_FieldSerializer implements com.google.gwt.user.client.rpc.impl.TypeHandler {
private static native java.lang.String getAccountURL(org.gcube.portlet.user.userstatisticsportlet.shared.UserInformation instance) /*-{
return instance.@org.gcube.portlet.user.userstatisticsportlet.shared.UserInformation::accountURL;
}-*/;
private static native void setAccountURL(org.gcube.portlet.user.userstatisticsportlet.shared.UserInformation instance, java.lang.String value)
/*-{
instance.@org.gcube.portlet.user.userstatisticsportlet.shared.UserInformation::accountURL = value;
}-*/;
private static native java.lang.String getActualVre(org.gcube.portlet.user.userstatisticsportlet.shared.UserInformation instance) /*-{
return instance.@org.gcube.portlet.user.userstatisticsportlet.shared.UserInformation::actualVre;
}-*/;
private static native void setActualVre(org.gcube.portlet.user.userstatisticsportlet.shared.UserInformation instance, java.lang.String value)
/*-{
instance.@org.gcube.portlet.user.userstatisticsportlet.shared.UserInformation::actualVre = value;
}-*/;
private static native java.lang.String getDisplayName(org.gcube.portlet.user.userstatisticsportlet.shared.UserInformation instance) /*-{
return instance.@org.gcube.portlet.user.userstatisticsportlet.shared.UserInformation::displayName;
}-*/;
private static native void setDisplayName(org.gcube.portlet.user.userstatisticsportlet.shared.UserInformation instance, java.lang.String value)
/*-{
instance.@org.gcube.portlet.user.userstatisticsportlet.shared.UserInformation::displayName = value;
}-*/;
private static native boolean getIsRoot(org.gcube.portlet.user.userstatisticsportlet.shared.UserInformation instance) /*-{
return instance.@org.gcube.portlet.user.userstatisticsportlet.shared.UserInformation::isRoot;
}-*/;
private static native void setIsRoot(org.gcube.portlet.user.userstatisticsportlet.shared.UserInformation instance, boolean value)
/*-{
instance.@org.gcube.portlet.user.userstatisticsportlet.shared.UserInformation::isRoot = value;
}-*/;
private static native java.lang.String getUrlAvatar(org.gcube.portlet.user.userstatisticsportlet.shared.UserInformation instance) /*-{
return instance.@org.gcube.portlet.user.userstatisticsportlet.shared.UserInformation::urlAvatar;
}-*/;
private static native void setUrlAvatar(org.gcube.portlet.user.userstatisticsportlet.shared.UserInformation instance, java.lang.String value)
/*-{
instance.@org.gcube.portlet.user.userstatisticsportlet.shared.UserInformation::urlAvatar = value;
}-*/;
public static void deserialize(SerializationStreamReader streamReader, org.gcube.portlet.user.userstatisticsportlet.shared.UserInformation instance) throws SerializationException {
setAccountURL(instance, streamReader.readString());
setActualVre(instance, streamReader.readString());
setDisplayName(instance, streamReader.readString());
setIsRoot(instance, streamReader.readBoolean());
setUrlAvatar(instance, streamReader.readString());
}
public static org.gcube.portlet.user.userstatisticsportlet.shared.UserInformation instantiate(SerializationStreamReader streamReader) throws SerializationException {
return new org.gcube.portlet.user.userstatisticsportlet.shared.UserInformation();
}
public static void serialize(SerializationStreamWriter streamWriter, org.gcube.portlet.user.userstatisticsportlet.shared.UserInformation instance) throws SerializationException {
streamWriter.writeString(getAccountURL(instance));
streamWriter.writeString(getActualVre(instance));
streamWriter.writeString(getDisplayName(instance));
streamWriter.writeBoolean(getIsRoot(instance));
streamWriter.writeString(getUrlAvatar(instance));
}
public Object create(SerializationStreamReader reader) throws SerializationException {
return org.gcube.portlet.user.userstatisticsportlet.shared.UserInformation_FieldSerializer.instantiate(reader);
}
public void deserial(SerializationStreamReader reader, Object object) throws SerializationException {
org.gcube.portlet.user.userstatisticsportlet.shared.UserInformation_FieldSerializer.deserialize(reader, (org.gcube.portlet.user.userstatisticsportlet.shared.UserInformation)object);
}
public void serial(SerializationStreamWriter writer, Object object) throws SerializationException {
org.gcube.portlet.user.userstatisticsportlet.shared.UserInformation_FieldSerializer.serialize(writer, (org.gcube.portlet.user.userstatisticsportlet.shared.UserInformation)object);
}
}

@ -0,0 +1,52 @@
package org.gcube.portlets.user.gcubewidgets.client.rpc;
import com.google.gwt.user.client.rpc.impl.RemoteServiceProxy;
import com.google.gwt.user.client.rpc.impl.ClientSerializationStreamWriter;
import com.google.gwt.user.client.rpc.SerializationStreamWriter;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.ResponseReader;
import com.google.gwt.user.client.rpc.SerializationException;
import com.google.gwt.user.client.rpc.RpcToken;
import com.google.gwt.user.client.rpc.RpcTokenException;
import com.google.gwt.core.client.impl.Impl;
import com.google.gwt.user.client.rpc.impl.RpcStatsContext;
public class ScopeService_Proxy extends RemoteServiceProxy implements org.gcube.portlets.user.gcubewidgets.client.rpc.ScopeServiceAsync {
private static final String REMOTE_SERVICE_INTERFACE_NAME = "org.gcube.portlets.user.gcubewidgets.client.rpc.ScopeService";
private static final String SERIALIZATION_POLICY ="61CF2EB1942C991A9518A75D35EC17FD";
private static final org.gcube.portlets.user.gcubewidgets.client.rpc.ScopeService_TypeSerializer SERIALIZER = new org.gcube.portlets.user.gcubewidgets.client.rpc.ScopeService_TypeSerializer();
public ScopeService_Proxy() {
super(GWT.getModuleBaseURL(),
"scopeService",
SERIALIZATION_POLICY,
SERIALIZER);
}
public void setScope(java.lang.String portalURL, com.google.gwt.user.client.rpc.AsyncCallback callback) {
com.google.gwt.user.client.rpc.impl.RemoteServiceProxy.ServiceHelper helper = new com.google.gwt.user.client.rpc.impl.RemoteServiceProxy.ServiceHelper("ScopeService_Proxy", "setScope");
try {
SerializationStreamWriter streamWriter = helper.start(REMOTE_SERVICE_INTERFACE_NAME, 1);
streamWriter.writeString("java.lang.String/2004016611");
streamWriter.writeString(portalURL);
helper.finish(callback, ResponseReader.BOOLEAN);
} catch (SerializationException ex) {
callback.onFailure(ex);
}
}
@Override
public SerializationStreamWriter createStreamWriter() {
ClientSerializationStreamWriter toReturn =
(ClientSerializationStreamWriter) super.createStreamWriter();
if (getRpcToken() != null) {
toReturn.addFlags(ClientSerializationStreamWriter.FLAG_RPC_TOKEN_INCLUDED);
}
return toReturn;
}
@Override
protected void checkRpcTokenType(RpcToken token) {
if (!(token instanceof com.google.gwt.user.client.rpc.XsrfToken)) {
throw new RpcTokenException("Invalid RpcToken type: expected 'com.google.gwt.user.client.rpc.XsrfToken' but got '" + token.getClass() + "'");
}
}
}

@ -0,0 +1,64 @@
package org.gcube.portlets.user.gcubewidgets.client.rpc;
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.JsArrayString;
import com.google.gwt.user.client.rpc.impl.TypeHandler;
import java.util.HashMap;
import java.util.Map;
import com.google.gwt.core.client.GwtScriptOnly;
public class ScopeService_TypeSerializer extends com.google.gwt.user.client.rpc.impl.SerializerBase {
private static final MethodMap methodMapNative;
private static final JsArrayString signatureMapNative;
static {
methodMapNative = loadMethodsNative();
signatureMapNative = loadSignaturesNative();
}
@SuppressWarnings("deprecation")
@GwtScriptOnly
private static native MethodMap loadMethodsNative() /*-{
var result = {};
result["com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException/3936916533"] = [
@com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException_FieldSerializer::instantiate(Lcom/google/gwt/user/client/rpc/SerializationStreamReader;),
@com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException_FieldSerializer::deserialize(Lcom/google/gwt/user/client/rpc/SerializationStreamReader;Lcom/google/gwt/user/client/rpc/IncompatibleRemoteServiceException;),
@com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException_FieldSerializer::serialize(Lcom/google/gwt/user/client/rpc/SerializationStreamWriter;Lcom/google/gwt/user/client/rpc/IncompatibleRemoteServiceException;)
];
result["com.google.gwt.user.client.rpc.RpcTokenException/2345075298"] = [
@com.google.gwt.user.client.rpc.RpcTokenException_FieldSerializer::instantiate(Lcom/google/gwt/user/client/rpc/SerializationStreamReader;),
@com.google.gwt.user.client.rpc.RpcTokenException_FieldSerializer::deserialize(Lcom/google/gwt/user/client/rpc/SerializationStreamReader;Lcom/google/gwt/user/client/rpc/RpcTokenException;),
];
result["com.google.gwt.user.client.rpc.XsrfToken/4254043109"] = [
,
,
@com.google.gwt.user.client.rpc.XsrfToken_FieldSerializer::serialize(Lcom/google/gwt/user/client/rpc/SerializationStreamWriter;Lcom/google/gwt/user/client/rpc/XsrfToken;)
];
result["java.lang.String/2004016611"] = [
@com.google.gwt.user.client.rpc.core.java.lang.String_CustomFieldSerializer::instantiate(Lcom/google/gwt/user/client/rpc/SerializationStreamReader;),
@com.google.gwt.user.client.rpc.core.java.lang.String_CustomFieldSerializer::deserialize(Lcom/google/gwt/user/client/rpc/SerializationStreamReader;Ljava/lang/String;),
@com.google.gwt.user.client.rpc.core.java.lang.String_CustomFieldSerializer::serialize(Lcom/google/gwt/user/client/rpc/SerializationStreamWriter;Ljava/lang/String;)
];
return result;
}-*/;
@SuppressWarnings("deprecation")
@GwtScriptOnly
private static native JsArrayString loadSignaturesNative() /*-{
var result = [];
result[@com.google.gwt.core.client.impl.Impl::getHashCode(Ljava/lang/Object;)(@com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException::class)] = "com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException/3936916533";
result[@com.google.gwt.core.client.impl.Impl::getHashCode(Ljava/lang/Object;)(@com.google.gwt.user.client.rpc.RpcTokenException::class)] = "com.google.gwt.user.client.rpc.RpcTokenException/2345075298";
result[@com.google.gwt.core.client.impl.Impl::getHashCode(Ljava/lang/Object;)(@com.google.gwt.user.client.rpc.XsrfToken::class)] = "com.google.gwt.user.client.rpc.XsrfToken/4254043109";
result[@com.google.gwt.core.client.impl.Impl::getHashCode(Ljava/lang/Object;)(@java.lang.String::class)] = "java.lang.String/2004016611";
return result;
}-*/;
public ScopeService_TypeSerializer() {
super(null, methodMapNative, null, signatureMapNative);
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save