Integrated gwt-bootstrap and revised css, ported to GWT 2.7.0

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/news-feed@114433 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2015-04-27 14:39:29 +00:00
parent f3d1129b40
commit 4a5940089e
17 changed files with 70 additions and 63 deletions

View File

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

View File

@ -0,0 +1,3 @@
eclipse.preferences.version=1
validateFragments=false
validation.use-project-settings=true

View File

@ -1,13 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="${module}">
<wb-module deploy-name="news-feed-portlet">
<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/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-sources/gwt"/>
<dependent-module archiveName="session-checker-0.3.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/session-checker/session-checker">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="workspace-light-tree-2.13.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/workspace-light-tree/workspace-light-tree">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="gcube-widgets-1.9.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/gcube-widgets/gcube-widgets">
<dependent-module archiveName="wsmail-widget-1.7.3-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/wsmail-widget/wsmail-widget">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="gcube-widgets-1.9.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/gcube-widgets/gcube-widgets">
<dependency-type>uses</dependency-type>
</dependent-module>
<property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/>

View File

@ -4,4 +4,5 @@
<installed facet="wst.jsdt.web" version="1.0"/>
<installed facet="jst.web" version="2.5"/>
<installed facet="java" version="1.7"/>
<installed facet="liferay.portlet" version="6.0"/>
</faceted-project>

1
.tern-project Normal file
View File

@ -0,0 +1 @@
{"ide":{"scriptPaths":[]},"plugins":{"aui":{},"liferay":{},"yui":{}},"libs":["ecma5","browser"]}

View File

@ -1,4 +1,8 @@
<ReleaseNotes>
<Changeset component="org.gcube.portlets.user.NewsFeed.1-9-0" date="2015-04-27">
<Change>Integrated gwt-bootstrap and revised css</Change>
<Change>Ported to GWT 2.7.0</Change>
</Changeset>
<Changeset component="org.gcube.portlets.user.NewsFeed.1-8-2" date="2014-12-13">
<Change>added ClientScopeHandler to help prevent the back button cache problem in Chrome and Firefox</Change>
</Changeset>

13
pom.xml
View File

@ -13,7 +13,7 @@
<groupId>org.gcube.portlets.user</groupId>
<artifactId>news-feed</artifactId>
<packaging>war</packaging>
<version>1.8.2-SNAPSHOT</version>
<version>1.9.0-SNAPSHOT</version>
<name>gCube News Feed Portlet</name>
<description>
@ -26,7 +26,7 @@
</scm>
<properties>
<!-- Convenience property to set the GWT version -->
<gwtVersion>2.5.1</gwtVersion>
<gwtVersion>2.7.0</gwtVersion>
<distroDirectory>distro</distroDirectory>
<!-- GWT needs at least java 1.6 -->
<maven.compiler.source>1.7</maven.compiler.source>
@ -51,13 +51,20 @@
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>${gwtVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<version>${gwtVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.gwtbootstrap</groupId>
<artifactId>gwt-bootstrap</artifactId>
<version>2.3.2.0</version>
</dependency>
<dependency>
<groupId>org.gcube.applicationsupportlayer</groupId>
<artifactId>aslcore</artifactId>
@ -191,7 +198,7 @@
<!-- Plugin configuration. There are many available options, see gwt-maven-plugin
documentation at codehaus.org -->
<configuration>
<runTarget>Messages.html</runTarget>
<runTarget>NewsFeed.html</runTarget>
<hostedWebapp>${webappDirectory}</hostedWebapp>
</configuration>
</plugin>

View File

@ -13,9 +13,6 @@ import org.jsonmaker.gwt.client.Jsonizer;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.logical.shared.ResizeEvent;
import com.google.gwt.event.logical.shared.ResizeHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.Window.Location;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.RootPanel;
@ -45,24 +42,18 @@ public class NewsFeed implements EntryPoint {
public void init() {
mainPanel = new NewsFeedPanel();
resize();
mainPanel.setWidth("620px");
RootPanel.get(UNIQUE_DIV).add(mainPanel);
Window.addResizeHandler(new ResizeHandler() {
public void onResize(ResizeEvent event) {
int width = RootPanel.get(UNIQUE_DIV).getOffsetWidth();
mainPanel.setWidth(""+width);
}
});
ClientFeed notification = new ClientFeed();
//Subscribe to message and associate subsequent receptions with custom subscriber data
try
{
try {
pageBusAdapter.PageBusSubscribe("org.gcube.portal.databook.shared", null, null, notification, (Jsonizer)GWT.create(ClientFeedJsonizer.class));
}
catch (PageBusAdapterException e1)
{
catch (PageBusAdapterException e1) {
e1.printStackTrace();
}
@ -81,13 +72,6 @@ public class NewsFeed implements EntryPoint {
return null;
}
});
}
private void resize() {
int width = RootPanel.get(UNIQUE_DIV).getOffsetWidth();
mainPanel.setWidth(""+width);
}
}

View File

@ -118,7 +118,7 @@ public class AddCommentTemplate extends Composite {
return;
}
if (userComment.equals(COMMENT_TEXT) || userComment.equals(ERROR_UPDATE_TEXT) || userComment.equals("")) {
commentTextArea.addStyleName("error");
commentTextArea.addStyleName("nwfeed-error");
commentTextArea.setText(ERROR_UPDATE_TEXT);
return;
}
@ -168,7 +168,7 @@ public class AddCommentTemplate extends Composite {
if (commentTextArea.getText().equals(COMMENT_TEXT) || commentTextArea.getText().equals(ERROR_UPDATE_TEXT) ) {
commentTextArea.setText("");
commentTextArea.addStyleName("comment-dark-color");
commentTextArea.removeStyleName("error");
commentTextArea.removeStyleName("nwfeed-error");
}
submitButton.setVisible(true);
}
@ -178,7 +178,7 @@ public class AddCommentTemplate extends Composite {
if (commentTextArea.getText().equals(COMMENT_TEXT) || commentTextArea.getText().equals(ERROR_UPDATE_TEXT) ) {
commentTextArea.setText("");
commentTextArea.addStyleName("comment-dark-color");
commentTextArea.removeStyleName("error");
commentTextArea.removeStyleName("nwfeed-error");
}
}
/**

View File

@ -11,17 +11,15 @@
<g:HTMLPanel styleName="comment-hidden" ui:field="mainPanel">
<table class="">
<tr>
<td width="30px;" align="middle">
<td width="30px" align="middle">
<g:Image styleName="member-photo" url="" ui:field="avatarImage"
width="30" height="30" />
width="30px" height="30px" />
</td>
<td>
<div id="comment-supercontainer">
<div id="comment-highlighterContainer">
<!-- <div id="comment-highlighter"> -->
<!-- </div> -->
<w:Div styleName="comment-highlighter" ui:field="highlighterDIV"></w:Div>
</div>
<div id="comment-inputContainer">

View File

@ -9,13 +9,13 @@
<g:HTMLPanel ui:field="mainPanel">
<table class="single-comment">
<tr>
<td width="30px;" align="middle">
<td width="30px" align="middle">
<g:Image styleName="member-photo" url="" ui:field="avatarImage"
width="30" height="30" />
width="30px" height="30px" />
<m:AvatarReplacement4Comments visible="false"
ui:field="avatarReplacement"></m:AvatarReplacement4Comments>
</td>
<td width="100%" valign="TOP">
<td>
<div class="commentsPanel">
<g:HTML styleName="user-comment" ui:field="commentText" />
<g:HTML styleName="" ui:field="seeMore" />

View File

@ -104,7 +104,7 @@ public class SuperPosedTextArea extends TextArea {
if (getText().equals(AddCommentTemplate.COMMENT_TEXT) || getText().equals(AddCommentTemplate.ERROR_UPDATE_TEXT) ) {
setText("");
addStyleName("dark-color");
removeStyleName("error");
removeStyleName("nwfeed-error");
}
break;
}
@ -134,7 +134,7 @@ public class SuperPosedTextArea extends TextArea {
if (getText().equals(AddCommentTemplate.COMMENT_TEXT) || getText().equals(AddCommentTemplate.ERROR_UPDATE_TEXT) ) {
setText("");
addStyleName("darker-color");
removeStyleName("error");
removeStyleName("nwfeed-error");
}
}
protected void cleanHighlighterDiv() {

View File

@ -53,7 +53,7 @@
</div>
<g:VerticalPanel ui:field="commentsPanel"></g:VerticalPanel>
</div>
<div class="div-table-col close">
<div class="div-table-col nf-post-remove">
<g:HTML height="15px" ui:field="closeImage"></g:HTML>
<g:HTML height="15px" ui:field="openImage"></g:HTML>
</div>

View File

@ -76,6 +76,8 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
private static final String SESSION_ADMIN_ATTR = "SESSION_ADMIN_ATTR";
private static final String USER_SETTINGS_ATTR = "USER_SETTINGS_ATTR";
private static final String TEST_USER = "test.user";
private static final String TEST_SCOPE = "/gcube/devsec/devVRE";
/**
*
@ -102,7 +104,7 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
if (user == null) {
_log.warn("USER IS NULL setting testing user and Running OUTSIDE PORTAL");
user = getDevelopmentUser();
SessionManager.getInstance().getASLSession(sessionID, user).setScope("/gcube/devsec/USTORE_VRE");
SessionManager.getInstance().getASLSession(sessionID, user).setScope(TEST_SCOPE);
}
return SessionManager.getInstance().getASLSession(sessionID, user);
}
@ -112,7 +114,7 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
*/
public String getDevelopmentUser() {
String user = TEST_USER;
//user = "massimiliano.assante";
// user = "massimiliano.assante";
return user;
}
/**
@ -479,7 +481,7 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
ArrayList<Feed> toMerge = new ArrayList<Feed>();
HashMap<String, Feed> feedsMap = new HashMap<String, Feed>();
ArrayList<Feed> OrganizationFeeds = (ArrayList<Feed>) store.getRecentFeedsByVRE(getASLSession().getScope(), feedsNoPerCategory*3);
ArrayList<Feed> OrganizationFeeds = (ArrayList<Feed>) store.getRecentFeedsByVRE(TEST_SCOPE, feedsNoPerCategory*3);
for (Feed feed : OrganizationFeeds) {
feedsMap.put(feed.getKey(), feed);
_log.trace("Reading desc: " + feed.getDescription());

View File

@ -11,6 +11,7 @@
<inherits name="org.jsonmaker.gwt.Gwt_jsonmaker" />
<inherits
name="net.eliasbalasis.tibcopagebus4gwt.testsubscriber.TestSubscriber" />
<inherits name="com.github.gwtbootstrap.Bootstrap" />
<!-- inherits gCube Widgets Library -->
<inherits name='org.gcube.portlets.user.gcubewidgets.WidgetFactory' />
<inherits name='org.gcube.portlets.widgets.wsmail.WsMail_Widget' />

View File

@ -12,7 +12,7 @@ table {
/* Superpose TextArea and Highlight DIV trick starts here */
#comment-supercontainer {
position: relative;
background-color: #FFFFFF;
background-color: #EFF3F5;
}
#comment-highlighterContainer {
@ -40,8 +40,8 @@ table {
line-height: normal;
border: 1px solid transparent;
width: 460px;
margin-left: 5px;
width: 430px;
min-height: 30px;
word-wrap: break-word; /* this is very important when usere paste long links*/
@ -60,8 +60,8 @@ table {
line-height: normal;
border: 1px solid #C3CDE7;
width: 460px;
margin-left: 5px;
width: 430px;
min-height: 30px;
}
@ -74,8 +74,8 @@ table {
.framed {
margin: 0 0 10px;
padding: 10px;
margin: 0px 5px;
background: #FFF url(images/vre_bg_gray.png) repeat-x left bottom;
margin: 0 5px;
background: #FFF;
border-radius: 6px !important;
-moz-border-radius: 6px !important;
-webkit-border-radius: 6px !important;
@ -196,6 +196,7 @@ table {
/* Other */
.linkpreview-image {
margin: 3px;
width: 80px;
}
.link-preview {
@ -206,7 +207,7 @@ table {
background-image: none;
border: 1px solid #DDD;
border-radius: 4px;
width: 500px;
width: 485px;
margin-top: 5px;
margin-left: 5px;
}
@ -232,6 +233,7 @@ table {
padding-top: 5px;
color: #333;
font-size: 10px;
line-height: 14px;
}
.member-photo {
@ -241,10 +243,11 @@ table {
}
.commentsPanel {
width: 430px !important;
width: 410px !important;
padding-left: 5px;
}
.comment-hidden {
opacity: 0;
}
@ -256,6 +259,7 @@ table {
-moz-transition: opacity .45s ease-in-out;
-webkit-transition: opacity .45s ease-in-out;
-ms-transition: opacity .45s ease-in-out;
width:494px;
}
.commentsPanel {
@ -280,6 +284,7 @@ table {
border-bottom-width: 1px;
border-left: 2px solid #DDD;
padding-left: 3px;
width: 494px;
}
.comment-bgcolor {
@ -540,7 +545,7 @@ a.link:hover {
width: 15px;
}
.div-table-col.close {
.div-table-col.nf-post-remove {
padding-left: 5px;
vertical-align: top;
width: 30px;
@ -569,7 +574,7 @@ a.link:hover {
background-color: #fdffcc;
}
.error {
.nwfeed-error {
color: #FFF;
background-color: pink;
transition: background .45s ease-in-out;

View File

@ -30,11 +30,7 @@
window.PageBus = window.parent.PageBus;
}
</script>
<!-- -->
<!-- This script loads your compiled module. -->
<!-- If you add any GWT meta tags, they must -->
<!-- be added before this line. -->
<!-- -->
<script type="text/javascript" src="newsfeed/newsfeed.nocache.js"></script>
</head>
@ -44,7 +40,6 @@
<!-- to create a completely dynamic UI. -->
<!-- -->
<body>
<div id="testButton"></div>
<div id="newsfeedDIV"></div>
</body>
</html>