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

git-svn-id: https://svn.research-infrastructures.eu/d4science/gcube/trunk/portlets/user/share-updates@114440 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2015-04-27 14:52:29 +00:00
parent 18c29a2ad3
commit ca6cd65f98
13 changed files with 78 additions and 58 deletions

View File

@ -4,7 +4,7 @@
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/> <wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-sources/gwt"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-sources/gwt"/>
<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="gcube-widgets-1.9.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/gcube-widgets/gcube-widgets">
<dependency-type>uses</dependency-type> <dependency-type>uses</dependency-type>
</dependent-module> </dependent-module>
<property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/> <property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/>

1
.tern-project Normal file
View File

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

View File

@ -1,9 +1,18 @@
<ReleaseNotes> <ReleaseNotes>
<Changeset component="org.gcube.portlets.user.shareupdates.1-6-1" date="2014-12-13"> <Changeset component="org.gcube.portlets.user.shareupdates.1-7-0"
<Change>Added Client scope handler, to set the scope from the client and help preventing the browser back button cache problem</Change> date="2015-05-27">
<Change>Integrated gwt-bootstrap and revised css</Change>
<Change>ported to GWT 2.7.0</Change>
</Changeset> </Changeset>
<Changeset component="org.gcube.portlets.user.shareupdates.1-6-0" date="2014-11-03"> <Changeset component="org.gcube.portlets.user.shareupdates.1-6-1"
<Change>Added possibility to define topics in a post using hashtags</Change> date="2014-12-13">
<Change>Added Client scope handler, to set the scope from the client
and help preventing the browser back button cache problem</Change>
</Changeset>
<Changeset component="org.gcube.portlets.user.shareupdates.1-6-0"
date="2014-11-03">
<Change>Added possibility to define topics in a post using hashtags
</Change>
<Change>Added save attachments in VRE Group folder</Change> <Change>Added save attachments in VRE Group folder</Change>
</Changeset> </Changeset>
<Changeset component="org.gcube.portlets.user.shareupdates.1-5-1" <Changeset component="org.gcube.portlets.user.shareupdates.1-5-1"

View File

@ -60,6 +60,11 @@
<version>${gwtVersion}</version> <version>${gwtVersion}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency>
<groupId>com.github.gwtbootstrap</groupId>
<artifactId>gwt-bootstrap</artifactId>
<version>2.3.2.0</version>
</dependency>
<dependency> <dependency>
<groupId>org.gcube.common.portal</groupId> <groupId>org.gcube.common.portal</groupId>
<artifactId>portal-manager</artifactId> <artifactId>portal-manager</artifactId>

View File

@ -7,7 +7,7 @@ import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField; import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler; import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.ui.CheckBox; import com.github.gwtbootstrap.client.ui.CheckBox;
import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Widget; import com.google.gwt.user.client.ui.Widget;

View File

@ -1,10 +1,11 @@
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent"> <!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" <ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:m="urn:import:org.gcube.portlets.user.shareupdates.client.view"> xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:b="urn:import:com.github.gwtbootstrap.client.ui"
xmlns:m="urn:import:org.gcube.portlets.user.shareupdates.client.view">
<ui:style> <ui:style>
.important { .important {
font-weight: bold; font-weight: bold;
} }
</ui:style> </ui:style>
<g:HTMLPanel> <g:HTMLPanel>
<table class="link-previewer"> <table class="link-previewer">
@ -22,8 +23,8 @@
<div class="link-desc"> <div class="link-desc">
<g:HTML styleName="" ui:field="descText" /> <g:HTML styleName="" ui:field="descText" />
<div class="hide-description"> <div class="hide-description">
<g:CheckBox ui:field="hideImageCheckBox">Hide Image</g:CheckBox> <b:CheckBox ui:field="hideImageCheckBox">Hide Image</b:CheckBox>
<g:CheckBox ui:field="hideCheckBox">Hide Description</g:CheckBox> <b:CheckBox ui:field="hideCheckBox">Hide Description</b:CheckBox>
</div> </div>
</div> </div>
</td> </td>

View File

@ -3,7 +3,7 @@ package org.gcube.portlets.user.shareupdates.client.view;
import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField; import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.CheckBox; import com.github.gwtbootstrap.client.ui.CheckBox;
import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget; import com.google.gwt.user.client.ui.Widget;

View File

@ -1,9 +1,9 @@
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent"> <!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" <ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
xmlns:g="urn:import:com.google.gwt.user.client.ui"> xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:b="urn:import:com.github.gwtbootstrap.client.ui">
<g:HTMLPanel styleName="link-previewer"> <g:HTMLPanel styleName="link-previewer">
<div style="padding-left: 10px;"> <div style="padding-left: 10px;">
<g:CheckBox ui:field="saveCheckBox">Also save a copy in the Workspace (group folder)</g:CheckBox> <b:CheckBox ui:field="saveCheckBox">Also save a copy in the Workspace (group folder)</b:CheckBox>
</div> </div>
</g:HTMLPanel> </g:HTMLPanel>
</ui:UiBinder> </ui:UiBinder>

View File

@ -110,13 +110,13 @@ public class ShareUpdateServiceImpl extends RemoteServiceServlet implements Shar
if (user == null) { if (user == null) {
_log.warn("USER IS NULL setting test.user and Running OUTSIDE PORTAL"); _log.warn("USER IS NULL setting test.user and Running OUTSIDE PORTAL");
user = getDevelopmentUser(); user = getDevelopmentUser();
SessionManager.getInstance().getASLSession(sessionID, user).setScope("/gcube/devsec/USTORE_VRE"); SessionManager.getInstance().getASLSession(sessionID, user).setScope("/gcube/devsec/devVRE");
} }
return SessionManager.getInstance().getASLSession(sessionID, user); return SessionManager.getInstance().getASLSession(sessionID, user);
} }
public String getDevelopmentUser() { public String getDevelopmentUser() {
String user = TEST_USER; String user = TEST_USER;
//user = "massimiliano.assante"; // user = "massimiliano.assante";
return user; return user;
} }
/** /**
@ -133,7 +133,7 @@ public class ShareUpdateServiceImpl extends RemoteServiceServlet implements Shar
return false; return false;
} }
} }
/** /**
* *
*/ */
@ -141,11 +141,11 @@ public class ShareUpdateServiceImpl extends RemoteServiceServlet implements Shar
String vreId, LinkPreview preview, String urlThumbnail, ArrayList<String> mentionedUserFullNames,String fileName, String filePathOnServer, boolean notifyGroup) { String vreId, LinkPreview preview, String urlThumbnail, ArrayList<String> mentionedUserFullNames,String fileName, String filePathOnServer, boolean notifyGroup) {
String escapedFeedText = TextTransfromUtils.escapeHtmlAndTransformUrl(postText); String escapedFeedText = TextTransfromUtils.escapeHtmlAndTransformUrl(postText);
List<String> hashtags = TextTransfromUtils.getHashTags(postText); List<String> hashtags = TextTransfromUtils.getHashTags(postText);
if (hashtags != null && !hashtags.isEmpty()) if (hashtags != null && !hashtags.isEmpty())
escapedFeedText = TextTransfromUtils.convertHashtagsAnchorHTML(escapedFeedText, hashtags); escapedFeedText = TextTransfromUtils.convertHashtagsAnchorHTML(escapedFeedText, hashtags);
ArrayList<ItemBean> mentionedUsers = null; ArrayList<ItemBean> mentionedUsers = null;
if (mentionedUserFullNames != null && ! mentionedUserFullNames.isEmpty()) { if (mentionedUserFullNames != null && ! mentionedUserFullNames.isEmpty()) {
mentionedUsers = getSelectedUserIds(mentionedUserFullNames); mentionedUsers = getSelectedUserIds(mentionedUserFullNames);
@ -158,9 +158,9 @@ public class ShareUpdateServiceImpl extends RemoteServiceServlet implements Shar
String email = username+"@isti.cnr.it"; String email = username+"@isti.cnr.it";
String fullName = username+" FULL"; String fullName = username+" FULL";
String thumbnailURL = "images/Avatar_default.png"; String thumbnailURL = "images/Avatar_default.png";
boolean withinPortal = isWithinPortal(); boolean withinPortal = isWithinPortal();
if (withinPortal && username.compareTo(TEST_USER) != 0) { if (withinPortal && username.compareTo(TEST_USER) != 0) {
try { try {
UserInfo user = getUserSettings().getUserInfo(); UserInfo user = getUserSettings().getUserInfo();
@ -178,7 +178,7 @@ public class ShareUpdateServiceImpl extends RemoteServiceServlet implements Shar
String url = preview.getUrl(); String url = preview.getUrl();
if (urlThumbnail == null) if (urlThumbnail == null)
urlThumbnail = "null"; urlThumbnail = "null";
Date feedDate = new Date(); Date feedDate = new Date();
//this means the user has shared a file without text in it. //this means the user has shared a file without text in it.
String textToPost = ""; String textToPost = "";
@ -188,7 +188,7 @@ public class ShareUpdateServiceImpl extends RemoteServiceServlet implements Shar
textToPost = escapedFeedText; textToPost = escapedFeedText;
//System.out.println("textToPost=" + textToPost); //System.out.println("textToPost=" + textToPost);
} }
//get the VRE scope if single channel post //get the VRE scope if single channel post
String vreScope2Set = ""; String vreScope2Set = "";
if (pLevel == PrivacyLevel.SINGLE_VRE && vreId != null && vreId.compareTo("") != 0) { if (pLevel == PrivacyLevel.SINGLE_VRE && vreId != null && vreId.compareTo("") != 0) {
@ -201,7 +201,7 @@ public class ShareUpdateServiceImpl extends RemoteServiceServlet implements Shar
_log.info("Attempting to save Feed with text: " + textToPost + " Level: " + pLevel + " Timeline="+vreScope2Set); _log.info("Attempting to save Feed with text: " + textToPost + " Level: " + pLevel + " Timeline="+vreScope2Set);
boolean result = store.saveUserFeed(toShare); boolean result = store.saveUserFeed(toShare);
//need to put the feed into VRES Timeline too //need to put the feed into VRES Timeline too
if (pLevel == PrivacyLevel.VRES) { if (pLevel == PrivacyLevel.VRES) {
_log.trace("PrivacyLevel was set to VRES attempting to write onto User's VRES Timelines"); _log.trace("PrivacyLevel was set to VRES attempting to write onto User's VRES Timelines");
@ -270,7 +270,7 @@ public class ShareUpdateServiceImpl extends RemoteServiceServlet implements Shar
String email = username+"@isti.cnr.it"; String email = username+"@isti.cnr.it";
String fullName = username+" FULL"; String fullName = username+" FULL";
String thumbnailURL = "images/Avatar_default.png"; String thumbnailURL = "images/Avatar_default.png";
if (isWithinPortal() && username.compareTo(TEST_USER) != 0) { if (isWithinPortal() && username.compareTo(TEST_USER) != 0) {
com.liferay.portal.model.UserModel user = UserLocalServiceUtil.getUserByScreenName(OrganizationsUtil.getCompany().getCompanyId(), username); com.liferay.portal.model.UserModel user = UserLocalServiceUtil.getUserByScreenName(OrganizationsUtil.getCompany().getCompanyId(), username);
thumbnailURL = "/image/user_male_portrait?img_id="+user.getPortraitId(); thumbnailURL = "/image/user_male_portrait?img_id="+user.getPortraitId();
@ -315,13 +315,15 @@ public class ShareUpdateServiceImpl extends RemoteServiceServlet implements Shar
ScopeProvider.instance.set(currScope); ScopeProvider.instance.set(currScope);
String httpURL = ""; String httpURL = "";
//get the url to show, before actually uploading it String smpURI = "";
String smpURI = storageClient.getUrl().RFile(remoteFilePath); if (isWithinPortal()) {
//get the url to show, before actually uploading it
//The storage uploader Thread starts here asyncronously smpURI = storageClient.getUrl().RFile(remoteFilePath);
Thread thread = new Thread(new UploadToStorageThread(storageClient, fileName, fileabsolutePathOnServer, remoteFilePath));
thread.start();
//The storage uploader Thread starts here asyncronously
Thread thread = new Thread(new UploadToStorageThread(storageClient, fileName, fileabsolutePathOnServer, remoteFilePath));
thread.start();
}
try { try {
String mimeType = FilePreviewer.getMimeType(new File(fileabsolutePathOnServer), fileName); String mimeType = FilePreviewer.getMimeType(new File(fileabsolutePathOnServer), fileName);
@ -358,6 +360,12 @@ public class ShareUpdateServiceImpl extends RemoteServiceServlet implements Shar
} catch (Exception e) { } catch (Exception e) {
_log.error("Error while resolving or previewing file"); _log.error("Error while resolving or previewing file");
e.printStackTrace(); e.printStackTrace();
try {
return FilePreviewer.getUnhandledTypePreview(fileName, fileabsolutePathOnServer, httpURL, "Error During upload on Server!");
} catch (Exception e1) {
e1.printStackTrace();
}
} }
_log.debug("smpURI=" + smpURI); _log.debug("smpURI=" + smpURI);
@ -453,7 +461,7 @@ public class ShareUpdateServiceImpl extends RemoteServiceServlet implements Shar
} }
return toReturn; return toReturn;
} }
/** /**
* return the id as key and the names as value of the vre a user is subscribed to * return the id as key and the names as value of the vre a user is subscribed to
* @param username * @param username
@ -461,11 +469,11 @@ public class ShareUpdateServiceImpl extends RemoteServiceServlet implements Shar
*/ */
private HashMap<String, String> getUserVreNames(String username) { private HashMap<String, String> getUserVreNames(String username) {
HashMap<String, String> toReturn = new HashMap<String, String>(); HashMap<String, String> toReturn = new HashMap<String, String>();
for (GroupModel vre : getUserVREs(username)) { for (GroupModel vre : getUserVREs(username)) {
if (vre.getGroupName().compareTo(getASLSession().getGroupName())==0) if (vre.getGroupName().compareTo(getASLSession().getGroupName())==0)
toReturn.put(vre.getGroupId(), vre.getGroupName()); toReturn.put(vre.getGroupId(), vre.getGroupName());
} }
// } // }
return toReturn; return toReturn;
} }
@ -543,10 +551,10 @@ public class ShareUpdateServiceImpl extends RemoteServiceServlet implements Shar
return null; return null;
} }
} }
/** /**
* Indicates whether the scope is the whole infrastructure. * Indicates whether the scope is the whole infrastructure.
@ -587,7 +595,7 @@ public class ShareUpdateServiceImpl extends RemoteServiceServlet implements Shar
} }
return getOrganizationUsers(session.getScope(), session.getUsername(), withinPortal); return getOrganizationUsers(session.getScope(), session.getUsername(), withinPortal);
} }
@Override @Override
public ArrayList<ItemBean> getHashtags() { public ArrayList<ItemBean> getHashtags() {
ASLSession session = getASLSession(); ASLSession session = getASLSession();
@ -607,7 +615,7 @@ public class ShareUpdateServiceImpl extends RemoteServiceServlet implements Shar
} }
return toReturn; return toReturn;
} }
/** /**
* *
* @param session the Asl Session * @param session the Asl Session
@ -622,7 +630,7 @@ public class ShareUpdateServiceImpl extends RemoteServiceServlet implements Shar
GroupManager gm = new LiferayGroupManager(); GroupManager gm = new LiferayGroupManager();
ScopeBean sb = new ScopeBean(scope); ScopeBean sb = new ScopeBean(scope);
List<UserModel> users = null; List<UserModel> users = null;
if (sb.is(Type.INFRASTRUCTURE)) if (sb.is(Type.INFRASTRUCTURE))
users = um.listUsersByGroup(gm.getRootVO().getGroupId()); users = um.listUsersByGroup(gm.getRootVO().getGroupId());
else if (sb.is(Type.VRE)) { //must be in VRE else if (sb.is(Type.VRE)) { //must be in VRE
@ -662,7 +670,7 @@ public class ShareUpdateServiceImpl extends RemoteServiceServlet implements Shar
return portalUsers; return portalUsers;
} }
} }

View File

@ -5,7 +5,7 @@
<inherits name="net.eliasbalasis.tibcopagebus4gwt.tibcopagebus4gwt" /> <inherits name="net.eliasbalasis.tibcopagebus4gwt.tibcopagebus4gwt" />
<inherits name="org.jsonmaker.gwt.Gwt_jsonmaker" /> <inherits name="org.jsonmaker.gwt.Gwt_jsonmaker" />
<inherits name="com.github.gwtbootstrap.Bootstrap" />
<!-- inherits GCUBE Widgets --> <!-- inherits GCUBE Widgets -->
<inherits name='org.gcube.portlets.user.gcubewidgets.WidgetFactory' /> <inherits name='org.gcube.portlets.user.gcubewidgets.WidgetFactory' />
@ -13,7 +13,7 @@
name="net.eliasbalasis.tibcopagebus4gwt.testsubscriber.TestSubscriber" /> name="net.eliasbalasis.tibcopagebus4gwt.testsubscriber.TestSubscriber" />
<!-- To Comment out --> <!-- To Comment out -->
<!-- <set-property name="user.agent" value="safari,gecko1_8,ie9" /> --> <!-- <set-property name="user.agent" value="safari,gecko1_8" /> -->
<!-- Other module inherits --> <!-- Other module inherits -->

View File

@ -264,13 +264,6 @@ a.link:hover {
-webkit-border-radius: 4px; -webkit-border-radius: 4px;
border-radius: 4px; border-radius: 4px;
} }
.error {
color: #FFF;
background-color: pink;
transition: background .45s ease-in-out;
-moz-transition: background .45s ease-in-out;
-webkit-transition: background .45s ease-in-out;
}
/* smart textarea */ /* smart textarea */
#mycontentEditableElement input[type="text"] { #mycontentEditableElement input[type="text"] {

View File

@ -13,7 +13,9 @@
<!-- Consider inlining CSS to reduce the number of requested files --> <!-- Consider inlining CSS to reduce the number of requested files -->
<!-- --> <!-- -->
<link type="text/css" rel="stylesheet" href="ShareUpdates.css"> <link type="text/css" rel="stylesheet" href="ShareUpdates.css">
<script type="text/javascript"
src="shareupdates/js/jquery-1.10.1.min.js"></script>
<script type="text/javascript" src="shareupdates/js/bootstrap.min.js"></script>
<script type="text/javascript" <script type="text/javascript"
src="shareupdates/shareupdates.nocache.js"></script> src="shareupdates/shareupdates.nocache.js"></script>
@ -23,7 +25,7 @@
$(document).ready(function(){ $(document).ready(function(){
setTimeout(function(){ setTimeout(function(){
$('.postTextArea').autosize(); $('.postTextArea').autosize();
}, 3000); }, 5000);
}); });
</script> </script>

View File

@ -13,7 +13,8 @@
window.PageBus = window.parent.PageBus; window.PageBus = window.parent.PageBus;
} }
</script> </script>
<script type="text/javascript" src="<%=request.getContextPath()%>/shareupdates/js/jquery-1.10.1.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/shareupdates/js/bootstrap.min.js"></script>
<script type="text/javascript" <script type="text/javascript"
src='<%=request.getContextPath()%>/shareupdates/shareupdates.nocache.js'></script> src='<%=request.getContextPath()%>/shareupdates/shareupdates.nocache.js'></script>