fixed job title longer than 75 chars problem

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/social-profile@102184 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2015-01-07 11:17:57 +00:00
parent 417fe2d580
commit b047613b45
2 changed files with 8 additions and 6 deletions

View File

@ -4,10 +4,10 @@
<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="wsmail-widget-1.7.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/wsmail-widget/wsmail-widget"> <dependent-module archiveName="wsmail-widget-1.7.2-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/wsmail-widget/wsmail-widget">
<dependency-type>uses</dependency-type> <dependency-type>uses</dependency-type>
</dependent-module> </dependent-module>
<dependent-module archiveName="session-checker-0.2.5-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/session-checker/session-checker"> <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> <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"/>

View File

@ -48,12 +48,10 @@ import org.slf4j.LoggerFactory;
import org.w3c.dom.Document; import org.w3c.dom.Document;
import com.google.gwt.user.server.rpc.RemoteServiceServlet; import com.google.gwt.user.server.rpc.RemoteServiceServlet;
import com.liferay.portal.kernel.cache.CacheRegistryUtil;
import com.liferay.portal.kernel.util.WebKeys; import com.liferay.portal.kernel.util.WebKeys;
import com.liferay.portal.model.Contact; import com.liferay.portal.model.Contact;
import com.liferay.portal.model.User; import com.liferay.portal.model.User;
import com.liferay.portal.service.ContactLocalServiceUtil; import com.liferay.portal.service.ContactLocalServiceUtil;
import com.liferay.portal.service.ContactServiceUtil;
import com.liferay.portal.service.UserLocalServiceUtil; import com.liferay.portal.service.UserLocalServiceUtil;
import com.liferay.portal.theme.ThemeDisplay; import com.liferay.portal.theme.ThemeDisplay;
@ -421,8 +419,12 @@ public class SocialServiceImpl extends RemoteServiceServlet implements SocialSer
com.liferay.portal.model.User user; com.liferay.portal.model.User user;
user = UserLocalServiceUtil.getUserByScreenName(OrganizationsUtil.getCompany().getCompanyId(), getASLSession().getUsername()); user = UserLocalServiceUtil.getUserByScreenName(OrganizationsUtil.getCompany().getCompanyId(), getASLSession().getUsername());
//headline //headline
if (headline.compareTo("") != 0) if (headline.compareTo("") != 0) {
user.setJobTitle(escapeHtml(headline)); String checkedHeadline = headline;
if (headline.length() >= 75)
checkedHeadline = headline.substring(0, 70) + " ...";
user.setJobTitle(escapeHtml(checkedHeadline));
}
//location and industry //location and industry
if (location.compareTo("") != 0 && industry.compareTo("") != 0) if (location.compareTo("") != 0 && industry.compareTo("") != 0)
user.setOpenId(escapeHtml(location + " | " + industry)); user.setOpenId(escapeHtml(location + " | " + industry));