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="/WEB-INF/classes" source-path="/src/main/java"/>
<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>
</dependent-module>
<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>
<Changeset component="org.gcube.portlets.user.shareupdates.1-6-1" 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 component="org.gcube.portlets.user.shareupdates.1-7-0"
date="2015-05-27">
<Change>Integrated gwt-bootstrap and revised css</Change>
<Change>ported to GWT 2.7.0</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>
<Changeset component="org.gcube.portlets.user.shareupdates.1-6-1"
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>
</Changeset>
<Changeset component="org.gcube.portlets.user.shareupdates.1-5-1"

View File

@ -60,6 +60,11 @@
<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.common.portal</groupId>
<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.UiField;
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.HTML;
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">
<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>
.important {
font-weight: bold;
}
.important {
font-weight: bold;
}
</ui:style>
<g:HTMLPanel>
<table class="link-previewer">
@ -22,8 +23,8 @@
<div class="link-desc">
<g:HTML styleName="" ui:field="descText" />
<div class="hide-description">
<g:CheckBox ui:field="hideImageCheckBox">Hide Image</g:CheckBox>
<g:CheckBox ui:field="hideCheckBox">Hide Description</g:CheckBox>
<b:CheckBox ui:field="hideImageCheckBox">Hide Image</b:CheckBox>
<b:CheckBox ui:field="hideCheckBox">Hide Description</b:CheckBox>
</div>
</div>
</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.uibinder.client.UiBinder;
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.Widget;

View File

@ -1,9 +1,9 @@
<!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">
xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:b="urn:import:com.github.gwtbootstrap.client.ui">
<g:HTMLPanel styleName="link-previewer">
<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>
</g:HTMLPanel>
</ui:UiBinder>

View File

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

View File

@ -5,7 +5,7 @@
<inherits name="net.eliasbalasis.tibcopagebus4gwt.tibcopagebus4gwt" />
<inherits name="org.jsonmaker.gwt.Gwt_jsonmaker" />
<inherits name="com.github.gwtbootstrap.Bootstrap" />
<!-- inherits GCUBE Widgets -->
<inherits name='org.gcube.portlets.user.gcubewidgets.WidgetFactory' />
@ -13,7 +13,7 @@
name="net.eliasbalasis.tibcopagebus4gwt.testsubscriber.TestSubscriber" />
<!-- 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 -->

View File

@ -264,13 +264,6 @@ a.link:hover {
-webkit-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 */
#mycontentEditableElement input[type="text"] {

View File

@ -13,7 +13,9 @@
<!-- Consider inlining CSS to reduce the number of requested files -->
<!-- -->
<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"
src="shareupdates/shareupdates.nocache.js"></script>
@ -23,7 +25,7 @@
$(document).ready(function(){
setTimeout(function(){
$('.postTextArea').autosize();
}, 3000);
}, 5000);
});
</script>

View File

@ -13,7 +13,8 @@
window.PageBus = window.parent.PageBus;
}
</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"
src='<%=request.getContextPath()%>/shareupdates/shareupdates.nocache.js'></script>