methods visibility changed to public
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/social-networking/social-util-library@128807 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
7790f80905
commit
59d03674ff
|
@ -15,6 +15,7 @@
|
||||||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
|
||||||
|
|
13
.project
13
.project
|
@ -5,6 +5,11 @@
|
||||||
<projects>
|
<projects>
|
||||||
</projects>
|
</projects>
|
||||||
<buildSpec>
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.wst.common.project.facet.core.builder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
<buildCommand>
|
<buildCommand>
|
||||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||||
<arguments>
|
<arguments>
|
||||||
|
@ -15,9 +20,17 @@
|
||||||
<arguments>
|
<arguments>
|
||||||
</arguments>
|
</arguments>
|
||||||
</buildCommand>
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.wst.validation.validationbuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
</buildSpec>
|
</buildSpec>
|
||||||
<natures>
|
<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.jdt.core.javanature</nature>
|
||||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||||
|
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
|
||||||
</natures>
|
</natures>
|
||||||
</projectDescription>
|
</projectDescription>
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
|
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
||||||
org.eclipse.jdt.core.compiler.compliance=1.7
|
org.eclipse.jdt.core.compiler.compliance=1.7
|
||||||
|
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.problem.forbiddenReference=warning
|
||||||
org.eclipse.jdt.core.compiler.source=1.7
|
org.eclipse.jdt.core.compiler.source=1.7
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
|
||||||
|
<wb-module deploy-name="social-util-library">
|
||||||
|
<wb-resource deploy-path="/" source-path="/src/main/java"/>
|
||||||
|
</wb-module>
|
||||||
|
</project-modules>
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<faceted-project>
|
||||||
|
<installed facet="java" version="1.7"/>
|
||||||
|
<installed facet="jst.utility" version="1.0"/>
|
||||||
|
</faceted-project>
|
|
@ -37,7 +37,7 @@ public class Utils {
|
||||||
* @param preview
|
* @param preview
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
protected static String convertFileNameAnchorHTML(String url) {
|
public static String convertFileNameAnchorHTML(String url) {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("<span style=\"color:gray; font-size:12px;\">shared </span><a class=\"link\" href=\"").append(url).append("\" target=\"_blank\">").append("a file.").append("</a> ").toString();
|
sb.append("<span style=\"color:gray; font-size:12px;\">shared </span><a class=\"link\" href=\"").append(url).append("\" target=\"_blank\">").append("a file.").append("</a> ").toString();
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
|
@ -99,7 +99,7 @@ public class Utils {
|
||||||
* @param postText
|
* @param postText
|
||||||
* @return the list of hashtags present in the text
|
* @return the list of hashtags present in the text
|
||||||
*/
|
*/
|
||||||
protected static List<String> getHashTags(String postText) {
|
public static List<String> getHashTags(String postText) {
|
||||||
List<String> hashtags = new ArrayList<>();
|
List<String> hashtags = new ArrayList<>();
|
||||||
Pattern MY_PATTERN = Pattern.compile("^#\\w+|\\s#\\w+");
|
Pattern MY_PATTERN = Pattern.compile("^#\\w+|\\s#\\w+");
|
||||||
Matcher matcher = MY_PATTERN.matcher(postText);
|
Matcher matcher = MY_PATTERN.matcher(postText);
|
||||||
|
@ -114,7 +114,7 @@ public class Utils {
|
||||||
* @param feedText
|
* @param feedText
|
||||||
* @return the text with the clickable url in it
|
* @return the text with the clickable url in it
|
||||||
*/
|
*/
|
||||||
protected static String extractURL(String feedText) {
|
public static String extractURL(String feedText) {
|
||||||
// separate input by spaces ( URLs have no spaces )
|
// separate input by spaces ( URLs have no spaces )
|
||||||
feedText = feedText.replaceAll("(\r\n|\n)"," <br/> ");
|
feedText = feedText.replaceAll("(\r\n|\n)"," <br/> ");
|
||||||
String [] parts = feedText.split("\\s");
|
String [] parts = feedText.split("\\s");
|
||||||
|
@ -142,7 +142,7 @@ public class Utils {
|
||||||
* @param html the html string to escape
|
* @param html the html string to escape
|
||||||
* @return the escaped string
|
* @return the escaped string
|
||||||
*/
|
*/
|
||||||
protected static String escapeHtmlAndTransformUrl(String html) {
|
public static String escapeHtmlAndTransformUrl(String html) {
|
||||||
if (html == null) {
|
if (html == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -164,7 +164,7 @@ public class Utils {
|
||||||
* @param html the html string to escape
|
* @param html the html string to escape
|
||||||
* @return the escaped string
|
* @return the escaped string
|
||||||
*/
|
*/
|
||||||
protected static String escapeHtml(String html) {
|
public static String escapeHtml(String html) {
|
||||||
return html.replaceAll("&", "&").replaceAll("<", "<")
|
return html.replaceAll("&", "&").replaceAll("<", "<")
|
||||||
.replaceAll(">", ">");
|
.replaceAll(">", ">");
|
||||||
}
|
}
|
||||||
|
@ -175,7 +175,7 @@ public class Utils {
|
||||||
* @param feedText
|
* @param feedText
|
||||||
* @return the text with the clickable url in it
|
* @return the text with the clickable url in it
|
||||||
*/
|
*/
|
||||||
protected static String transformUrls(String feedText) {
|
public static String transformUrls(String feedText) {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
// separate input by spaces ( URLs have no spaces )
|
// separate input by spaces ( URLs have no spaces )
|
||||||
String [] parts = feedText.split("\\s");
|
String [] parts = feedText.split("\\s");
|
||||||
|
@ -206,7 +206,7 @@ public class Utils {
|
||||||
* @param item a text token
|
* @param item a text token
|
||||||
* @return the actual http link
|
* @return the actual http link
|
||||||
*/
|
*/
|
||||||
private static String getHttpToken(String item) {
|
public static String getHttpToken(String item) {
|
||||||
if (item.startsWith("http") || item.startsWith("www") || item.startsWith("(www") || item.startsWith("(http")) {
|
if (item.startsWith("http") || item.startsWith("www") || item.startsWith("(www") || item.startsWith("(http")) {
|
||||||
if (item.startsWith("("))
|
if (item.startsWith("("))
|
||||||
item = item.substring(1, item.length());
|
item = item.substring(1, item.length());
|
||||||
|
@ -225,7 +225,7 @@ public class Utils {
|
||||||
* @param taggedPeople
|
* @param taggedPeople
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
protected static String convertMentionPeopleAnchorHTML(String escapedFeedText, ArrayList<ItemBean> taggedPeople, HttpServletRequest request) {
|
public static String convertMentionPeopleAnchorHTML(String escapedFeedText, ArrayList<ItemBean> taggedPeople, HttpServletRequest request) {
|
||||||
String userProfilePageURL = "";
|
String userProfilePageURL = "";
|
||||||
userProfilePageURL = PortalContext.getConfiguration().getSiteLandingPagePath(request)+GCubePortalConstants.USER_PROFILE_FRIENDLY_URL;
|
userProfilePageURL = PortalContext.getConfiguration().getSiteLandingPagePath(request)+GCubePortalConstants.USER_PROFILE_FRIENDLY_URL;
|
||||||
for (ItemBean tagged : taggedPeople) {
|
for (ItemBean tagged : taggedPeople) {
|
||||||
|
@ -244,7 +244,7 @@ public class Utils {
|
||||||
* @param hashtags
|
* @param hashtags
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
protected static String convertHashtagsAnchorHTML(String escapedFeedText, List<String> hashtags) {
|
public static String convertHashtagsAnchorHTML(String escapedFeedText, List<String> hashtags) {
|
||||||
for (String hashtag : hashtags) {
|
for (String hashtag : hashtags) {
|
||||||
String taggedHTML = "<a class=\"link\" style=\"font-size:14px;\" href=\"?"+
|
String taggedHTML = "<a class=\"link\" style=\"font-size:14px;\" href=\"?"+
|
||||||
new String(Base64.encodeBase64(GCubeSocialNetworking.HASHTAG_OID.getBytes()))+"="+
|
new String(Base64.encodeBase64(GCubeSocialNetworking.HASHTAG_OID.getBytes()))+"="+
|
||||||
|
@ -265,7 +265,7 @@ public class Utils {
|
||||||
* @param link the link to check
|
* @param link the link to check
|
||||||
* @return the description guessed
|
* @return the description guessed
|
||||||
*/
|
*/
|
||||||
private static String createDescriptionFromContent(String link) {
|
public static String createDescriptionFromContent(String link) {
|
||||||
StringBean sb = new StringBean();
|
StringBean sb = new StringBean();
|
||||||
sb.setURL(link);
|
sb.setURL(link);
|
||||||
sb.setLinks(false);
|
sb.setLinks(false);
|
||||||
|
|
Loading…
Reference in New Issue