refs:4381: org.gcube.portlets.user.tabular-data-toolbox-widget.1-11-0

https://support.d4science.org/issues/4381

Updated to Liferay 6.2

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@129374 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2016-06-23 14:57:54 +00:00
parent fbd394f4e2
commit caad9e3c97
6 changed files with 500 additions and 203 deletions

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" output="target/tabular-data-gwt-service-2.10.0-SNAPSHOT/WEB-INF/classes" path="src/main/java"> <classpathentry kind="src" path="src/main/java">
<attributes> <attributes>
<attribute name="optional" value="true"/> <attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry excluding="**" kind="src" output="target/tabular-data-gwt-service-2.10.0-SNAPSHOT/WEB-INF/classes" path="src/main/resources"> <classpathentry excluding="**" kind="src" path="src/main/resources">
<attributes> <attributes>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
@ -33,5 +33,5 @@
<attribute name="org.eclipse.jst.component.nondependency" value=""/> <attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="output" path="target/tabular-data-gwt-service-2.10.0-SNAPSHOT/WEB-INF/classes"/> <classpathentry kind="output" path="target/tabular-data-gwt-service-2.12.0-SNAPSHOT/WEB-INF/classes"/>
</classpath> </classpath>

View File

@ -1,4 +1,7 @@
<ReleaseNotes> <ReleaseNotes>
<Changeset component="org.gcube.portlets-user.tabular-data-gwt-service.2-12-0" date="2016-07-15">
<Change>Updated to Liferay 6.2</Change>
</Changeset>
<Changeset component="org.gcube.portlets-user.tabular-data-gwt-service.2-11-0" date="2016-05-01"> <Changeset component="org.gcube.portlets-user.tabular-data-gwt-service.2-11-0" date="2016-05-01">
<Change>Fixed ASLSession</Change> <Change>Fixed ASLSession</Change>
</Changeset> </Changeset>

154
pom.xml
View File

@ -14,7 +14,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.gcube.portlets.user</groupId> <groupId>org.gcube.portlets.user</groupId>
<artifactId>tabular-data-gwt-service</artifactId> <artifactId>tabular-data-gwt-service</artifactId>
<version>2.11.0-SNAPSHOT</version> <version>2.12.0-SNAPSHOT</version>
<name>tabular-data-gwt-service</name> <name>tabular-data-gwt-service</name>
<description>tabular-data-gwt-service allows communication between the GUI and services</description> <description>tabular-data-gwt-service allows communication between the GUI and services</description>
@ -95,12 +95,54 @@
<artifactId>gwt-user</artifactId> <artifactId>gwt-user</artifactId>
<version>${gwtVersion}</version> <version>${gwtVersion}</version>
</dependency> </dependency>
<!-- PORTAL -->
<dependency>
<groupId>org.gcube.core</groupId>
<artifactId>common-scope-maps</artifactId>
<scope>compile</scope>
</dependency>
<!-- <dependency> <groupId>javax.validation</groupId> <artifactId>validation-api</artifactId> <dependency>
<version>1.0.0.GA</version> <scope>test</scope> </dependency> <dependency> <groupId>org.gcube.portal</groupId>
<groupId>javax.validation</groupId> <artifactId>validation-api</artifactId> <artifactId>custom-portal-handler</artifactId>
<version>1.0.0.GA</version> <classifier>sources</classifier> <scope>test</scope> </dependency>
</dependency> -->
<dependency>
<groupId>org.gcube.applicationsupportlayer</groupId>
<artifactId>aslcore</artifactId>
</dependency>
<dependency>
<groupId>org.gcube.dvos</groupId>
<artifactId>usermanagement-core</artifactId>
<scope>provided</scope>
</dependency>
<!-- Authorization -->
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>common-authorization</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>authorization-client</artifactId>
<scope>provided</scope>
</dependency>
<!-- GCube Widgets -->
<dependency>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>gcube-widgets</artifactId>
<scope>compile</scope>
</dependency>
<dependency> <dependency>
<groupId>org.json</groupId> <groupId>org.json</groupId>
@ -112,33 +154,10 @@
<groupId>org.gcube.data.publishing</groupId> <groupId>org.gcube.data.publishing</groupId>
<artifactId>sdmx-registry-client-gcube</artifactId> <artifactId>sdmx-registry-client-gcube</artifactId>
<version>[3.0.0-SNAPSHOT,4.0.0-SNAPSHOT)</version> <version>[3.0.0-SNAPSHOT,4.0.0-SNAPSHOT)</version>
</dependency> </dependency>
<dependency>
<groupId>org.gcube.applicationsupportlayer</groupId>
<artifactId>aslcore</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.portal</groupId>
<artifactId>custom-portal-handler</artifactId>
<scope>provided</scope>
</dependency>
<!-- Authorization
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>common-authorization</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>authorization-client</artifactId>
<scope>provided</scope>
</dependency> -->
<!-- Social --> <!-- Social -->
<dependency> <dependency>
@ -154,12 +173,6 @@
</dependency> </dependency>
<!-- Home Library -->
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>home-library</artifactId>
<scope>provided</scope>
</dependency>
<!-- Apache Common Library --> <!-- Apache Common Library -->
<dependency> <dependency>
@ -184,6 +197,53 @@
<version>[1.2.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version> <version>[1.2.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
</dependency> </dependency>
<!-- Social -->
<dependency>
<groupId>org.gcube.portal</groupId>
<artifactId>social-networking-library</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.applicationsupportlayer</groupId>
<artifactId>aslsocial</artifactId>
<scope>provided</scope>
</dependency>
<!-- Storage -->
<dependency>
<groupId>org.gcube.contentmanagement</groupId>
<artifactId>storage-manager-core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.contentmanagement</groupId>
<artifactId>storage-manager-wrapper</artifactId>
<scope>provided</scope>
</dependency>
<!-- Home Library -->
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>home-library</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>home-library-jcr</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>home-library-model</artifactId>
<scope>provided</scope>
</dependency>
<!-- Service Client --> <!-- Service Client -->
<dependency> <dependency>
<groupId>org.gcube.data.analysis.tabulardata</groupId> <groupId>org.gcube.data.analysis.tabulardata</groupId>
@ -191,17 +251,7 @@
<version>[2.0.0-SNAPSHOT,3.0.0-SNAPSHOT)</version> <version>[2.0.0-SNAPSHOT,3.0.0-SNAPSHOT)</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<!-- Storage for CSV temp -->
<dependency>
<groupId>org.gcube.contentmanagement</groupId>
<artifactId>storage-manager-core</artifactId>
</dependency>
<dependency>
<groupId>org.gcube.contentmanagement</groupId>
<artifactId>storage-manager-wrapper</artifactId>
</dependency>
<!-- Uri Resolver Manager --> <!-- Uri Resolver Manager -->
<dependency> <dependency>
@ -224,10 +274,7 @@
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version> <version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<!-- Tika <dependency> <groupId>org.apache.tika</groupId> <artifactId>tika-core</artifactId>
<version>1.7</version> </dependency> -->
<!-- LOGGING --> <!-- LOGGING -->
<dependency> <dependency>
@ -300,7 +347,6 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId> <artifactId>maven-assembly-plugin</artifactId>
<version>2.2</version>
<configuration> <configuration>
<descriptors> <descriptors>
<descriptor>${distroDirectory}/descriptor.xml</descriptor> <descriptor>${distroDirectory}/descriptor.xml</descriptor>

View File

@ -2,9 +2,13 @@ package org.gcube.portlets.user.td.gwtservice.server.social;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.gcube.application.framework.core.session.ASLSession; import org.gcube.application.framework.core.session.ASLSession;
import org.gcube.applicationsupportlayer.social.ApplicationNotificationsManager; import org.gcube.applicationsupportlayer.social.ApplicationNotificationsManager;
import org.gcube.applicationsupportlayer.social.NotificationsManager; import org.gcube.applicationsupportlayer.social.NotificationsManager;
import org.gcube.applicationsupportlayer.social.shared.SocialNetworkingSite;
import org.gcube.applicationsupportlayer.social.shared.SocialNetworkingUser;
import org.gcube.common.homelibrary.util.WorkspaceUtil; import org.gcube.common.homelibrary.util.WorkspaceUtil;
import org.gcube.portal.databook.shared.NotificationType; import org.gcube.portal.databook.shared.NotificationType;
import org.gcube.portlets.user.td.gwtservice.shared.share.Contacts; import org.gcube.portlets.user.td.gwtservice.shared.share.Contacts;
@ -30,6 +34,9 @@ public class TDMNotifications extends Thread {
private ShareTabResource shareTabularResource; private ShareTabResource shareTabularResource;
private ShareRule shareRule; private ShareRule shareRule;
private ShareTemplate shareTemplate; private ShareTemplate shareTemplate;
private SocialNetworkingSite site;
private SocialNetworkingUser user;
private String scope;
/** /**
* Share Tabular Resource * Share Tabular Resource
@ -37,11 +44,16 @@ public class TDMNotifications extends Thread {
* @param aslSession * @param aslSession
* @param shareTabularResource * @param shareTabularResource
*/ */
public TDMNotifications(ASLSession aslSession, public TDMNotifications(HttpServletRequest request, ASLSession aslSession,
ShareTabResource shareTabularResource) { ShareTabResource shareTabularResource) {
this.aslSession = aslSession; this.aslSession = aslSession;
this.shareTabularResource = shareTabularResource; this.shareTabularResource = shareTabularResource;
this.notificationType = NotificationType.TDM_TAB_RESOURCE_SHARE; this.notificationType = NotificationType.TDM_TAB_RESOURCE_SHARE;
site = new SocialNetworkingSite(request);
user = new SocialNetworkingUser(aslSession.getUsername(),
aslSession.getUserEmailAddress(), aslSession.getUserFullName(),
aslSession.getUserAvatarId());
scope = aslSession.getScope();
} }
@ -50,10 +62,16 @@ public class TDMNotifications extends Thread {
* @param aslSession * @param aslSession
* @param shareRule * @param shareRule
*/ */
public TDMNotifications(ASLSession aslSession, ShareRule shareRule) { public TDMNotifications(HttpServletRequest request, ASLSession aslSession,
ShareRule shareRule) {
this.aslSession = aslSession; this.aslSession = aslSession;
this.shareRule = shareRule; this.shareRule = shareRule;
this.notificationType = NotificationType.TDM_RULE_SHARE; this.notificationType = NotificationType.TDM_RULE_SHARE;
site = new SocialNetworkingSite(request);
user = new SocialNetworkingUser(aslSession.getUsername(),
aslSession.getUserEmailAddress(), aslSession.getUserFullName(),
aslSession.getUserAvatarId());
scope = aslSession.getScope();
} }
@ -62,10 +80,16 @@ public class TDMNotifications extends Thread {
* @param aslSession * @param aslSession
* @param shareTemplate * @param shareTemplate
*/ */
public TDMNotifications(ASLSession aslSession, ShareTemplate shareTemplate) { public TDMNotifications(HttpServletRequest request, ASLSession aslSession,
ShareTemplate shareTemplate) {
this.aslSession = aslSession; this.aslSession = aslSession;
this.shareTemplate = shareTemplate; this.shareTemplate = shareTemplate;
this.notificationType = NotificationType.TDM_TEMPLATE_SHARE; this.notificationType = NotificationType.TDM_TEMPLATE_SHARE;
site = new SocialNetworkingSite(request);
user = new SocialNetworkingUser(aslSession.getUsername(),
aslSession.getUserEmailAddress(), aslSession.getUserFullName(),
aslSession.getUserAvatarId());
scope = aslSession.getScope();
} }
@ -87,8 +111,8 @@ public class TDMNotifications extends Thread {
} }
private void tabularResourceNotify() { private void tabularResourceNotify() {
NotificationsManager nm = new ApplicationNotificationsManager( NotificationsManager nm = new ApplicationNotificationsManager(site,
aslSession, Constants.APPLICATION_ID); scope, user, Constants.APPLICATION_ID);
for (Contacts contact : shareTabularResource.getContacts()) { for (Contacts contact : shareTabularResource.getContacts()) {
if (contact.isGroup()) { if (contact.isGroup()) {
@ -108,7 +132,8 @@ public class TDMNotifications extends Thread {
} catch (Exception e) { } catch (Exception e) {
logger.error("Error in the notification(Type: " logger.error("Error in the notification(Type: "
+ notificationType + " - " + notificationType
+ " - "
+ aslSession.getUsername() + aslSession.getUsername()
+ " share tabular resource id=" + " share tabular resource id="
+ shareTabularResource.getTabResource() + shareTabularResource.getTabResource()
@ -137,7 +162,8 @@ public class TDMNotifications extends Thread {
} catch (Exception e) { } catch (Exception e) {
logger.error("Error in the notification(Type: " logger.error("Error in the notification(Type: "
+ notificationType + " - " + notificationType
+ " - "
+ aslSession.getUsername() + aslSession.getUsername()
+ " share tabular resource id=" + " share tabular resource id="
+ shareTabularResource.getTabResource().getTrId() + shareTabularResource.getTabResource().getTrId()
@ -151,8 +177,8 @@ public class TDMNotifications extends Thread {
} }
private void ruleNotify() { private void ruleNotify() {
NotificationsManager nm = new ApplicationNotificationsManager( NotificationsManager nm = new ApplicationNotificationsManager(site,
aslSession, Constants.APPLICATION_ID); scope, user, Constants.APPLICATION_ID);
for (Contacts contact : shareRule.getContacts()) { for (Contacts contact : shareRule.getContacts()) {
if (contact.isGroup()) { if (contact.isGroup()) {
@ -168,7 +194,8 @@ public class TDMNotifications extends Thread {
} catch (Exception e) { } catch (Exception e) {
logger.error("Error in the notification(Type: " logger.error("Error in the notification(Type: "
+ notificationType + " - " + notificationType
+ " - "
+ aslSession.getUsername() + aslSession.getUsername()
+ " share rule id=" + " share rule id="
+ shareRule.getRuleDescriptionData() + shareRule.getRuleDescriptionData()
@ -208,8 +235,8 @@ public class TDMNotifications extends Thread {
} }
private void templateNotify() { private void templateNotify() {
NotificationsManager nm = new ApplicationNotificationsManager( NotificationsManager nm = new ApplicationNotificationsManager(site,
aslSession, Constants.APPLICATION_ID); scope, user, Constants.APPLICATION_ID);
for (Contacts contact : shareTemplate.getContacts()) { for (Contacts contact : shareTemplate.getContacts()) {
if (contact.isGroup()) { if (contact.isGroup()) {

View File

@ -15,7 +15,6 @@ import org.gcube.common.homelibrary.home.workspace.WorkspaceFolder;
import org.gcube.common.homelibrary.home.workspace.WorkspaceItem; import org.gcube.common.homelibrary.home.workspace.WorkspaceItem;
import org.gcube.common.homelibrary.util.WorkspaceUtil; import org.gcube.common.homelibrary.util.WorkspaceUtil;
import org.gcube.contentmanagement.blobstorage.service.IClient; import org.gcube.contentmanagement.blobstorage.service.IClient;
import org.gcube.contentmanager.storageclient.model.protocol.smp.SMPUrl;
import org.gcube.contentmanager.storageclient.wrapper.AccessType; import org.gcube.contentmanager.storageclient.wrapper.AccessType;
import org.gcube.contentmanager.storageclient.wrapper.MemoryType; import org.gcube.contentmanager.storageclient.wrapper.MemoryType;
import org.gcube.contentmanager.storageclient.wrapper.StorageClient; import org.gcube.contentmanager.storageclient.wrapper.StorageClient;
@ -35,6 +34,12 @@ public class FilesStorage {
public static final Logger logger = LoggerFactory public static final Logger logger = LoggerFactory
.getLogger(FilesStorage.class); .getLogger(FilesStorage.class);
/**
*
* @param user
* @param file
* @return
*/
public String storageCSVTempFile(String user, File file) { public String storageCSVTempFile(String user, File file) {
try { try {
IClient client = new StorageClient(user, AccessType.PUBLIC, IClient client = new StorageClient(user, AccessType.PUBLIC,
@ -43,7 +48,6 @@ public class FilesStorage {
logger.debug("remotePath: " + remotePath); logger.debug("remotePath: " + remotePath);
String id = client.put(true).LFile(file.getAbsolutePath()) String id = client.put(true).LFile(file.getAbsolutePath())
.RFile(remotePath); .RFile(remotePath);
// url = client.getUrl().RFile(remotePath);
return id; return id;
} catch (Throwable e) { } catch (Throwable e) {
@ -55,16 +59,20 @@ public class FilesStorage {
} }
/**
*
* @param user
* @param file
* @return
*/
public String storageCodelistMappingTempFile(String user, File file) { public String storageCodelistMappingTempFile(String user, File file) {
try { try {
// String url = null;
IClient client = new StorageClient(user, AccessType.PUBLIC, IClient client = new StorageClient(user, AccessType.PUBLIC,
MemoryType.VOLATILE).getClient(); MemoryType.VOLATILE).getClient();
String remotePath = "/CodelistMappingImport/" + file.getName(); String remotePath = "/CodelistMappingImport/" + file.getName();
logger.debug("remotePath: " + remotePath); logger.debug("remotePath: " + remotePath);
String id = client.put(true).LFile(file.getAbsolutePath()) String id = client.put(true).LFile(file.getAbsolutePath())
.RFile(remotePath); .RFile(remotePath);
// url = client.getUrl().RFile(remotePath);
return id; return id;
} catch (Throwable e) { } catch (Throwable e) {
logger.error("Error no codelist mapping file loaded on storage" logger.error("Error no codelist mapping file loaded on storage"
@ -75,6 +83,13 @@ public class FilesStorage {
} }
/**
*
* @param user
* @param url
* @return
* @throws TDGWTServiceException
*/
public String storageCodelistMappingTempFile(String user, String url) public String storageCodelistMappingTempFile(String user, String url)
throws TDGWTServiceException { throws TDGWTServiceException {
InputStream is = null; InputStream is = null;
@ -117,22 +132,20 @@ public class FilesStorage {
* Destination file * Destination file
* @throws TDGWTServiceException * @throws TDGWTServiceException
*/ */
public void retriveFile(String user, WorkspaceItem wi, File file) public void retrieveFile(String user, WorkspaceItem wi, File file)
throws TDGWTServiceException { throws TDGWTServiceException {
InputStream is = null; InputStream is = null;
try { try {
org.gcube.common.homelibrary.home.workspace.folder.items.File gcubeItem = ((org.gcube.common.homelibrary.home.workspace.folder.items.File) wi); org.gcube.common.homelibrary.home.workspace.folder.items.File gcubeItem = ((org.gcube.common.homelibrary.home.workspace.folder.items.File) wi);
SMPUrl smsHome = new SMPUrl(gcubeItem.getPublicLink()); //SMPUrl smsHome = new SMPUrl(gcubeItem.getPublicLink());
/* URL url=new URL(gcubeItem.getPublicLink());
* Handler.activateProtocol(); URL smsHome = null; smsHome = new
* URL(gcubeItem.getPublicLink()); logger.debug("smsHome: [host:" + url.getHost() + " path:"
*/ + url.getPath() + " ref:" + url.getRef()
logger.debug("smsHome: [host:" + smsHome.getHost() + " path:" + " userinfo:" + url.getUserInfo() + " ]");
+ smsHome.getPath() + " ref:" + smsHome.getRef()
+ " userinfo:" + smsHome.getUserInfo() + " ]");
URLConnection uc = null; URLConnection uc = null;
uc = (URLConnection) smsHome.openConnection(); uc = (URLConnection) url.openConnection();
is = uc.getInputStream(); is = uc.getInputStream();
} catch (Exception e) { } catch (Exception e) {
@ -174,28 +187,21 @@ public class FilesStorage {
* @return InputStream back to read the file * @return InputStream back to read the file
* @throws TDGWTServiceException * @throws TDGWTServiceException
*/ */
public InputStream retriveInputStream(String user, WorkspaceItem wi) public InputStream retrieveInputStream(String user, WorkspaceItem wi)
throws TDGWTServiceException { throws TDGWTServiceException {
InputStream is = null; InputStream is = null;
try { try {
org.gcube.common.homelibrary.home.workspace.folder.items.File gcubeItem = ((org.gcube.common.homelibrary.home.workspace.folder.items.File) wi); org.gcube.common.homelibrary.home.workspace.folder.items.File gcubeItem = ((org.gcube.common.homelibrary.home.workspace.folder.items.File) wi);
SMPUrl smsHome = new SMPUrl(gcubeItem.getPublicLink()); //SMPUrl smsHome = new SMPUrl(gcubeItem.getPublicLink());
URL url=new URL(gcubeItem.getPublicLink());
/*
* Handler.activateProtocol(); URL smsHome = null; smsHome = new logger.debug("smsHome: [host:" + url.getHost() + " path:"
* URL(null, gcubeItem.getPublicLink(), new URLStreamHandler() { + url.getPath() + " ref:" + url.getRef()
* + " userinfo:" + url.getUserInfo() + " ]");
* @Override protected URLConnection openConnection(URL u) throws
* IOException { return new SMPURLConnection(u); }
*
* });
*/
logger.debug("smsHome: [host:" + smsHome.getHost() + " path:"
+ smsHome.getPath() + " ref:" + smsHome.getRef()
+ " userinfo:" + smsHome.getUserInfo() + " ]");
URLConnection uc = null; URLConnection uc = null;
uc = (URLConnection) smsHome.openConnection(); uc = (URLConnection) url.openConnection();
is = uc.getInputStream(); is = uc.getInputStream();
} catch (Exception e) { } catch (Exception e) {
@ -224,22 +230,14 @@ public class FilesStorage {
InputStream is = null; InputStream is = null;
try { try {
SMPUrl smsHome = new SMPUrl(uri); //SMPUrl smsHome = new SMPUrl(uri);
/* URL url=new URL(uri);
* Handler.activateProtocol(); URL smsHome = null; smsHome = new
* URL(null, uri, new URLStreamHandler() { logger.debug("smsHome: [host:" + url.getHost() + " path:"
* + url.getPath() + " ref:" + url.getRef()
* @Override protected URLConnection openConnection(URL u) throws + " userinfo:" + url.getUserInfo() + " ]");
* IOException { return new SMPURLConnection(u); }
*
* });
*/
logger.debug("smsHome: [host:" + smsHome.getHost() + " path:"
+ smsHome.getPath() + " ref:" + smsHome.getRef()
+ " userinfo:" + smsHome.getUserInfo() + " ]");
URLConnection uc = null; URLConnection uc = null;
uc = (URLConnection) smsHome.openConnection(); uc = (URLConnection) url.openConnection();
is = uc.getInputStream(); is = uc.getInputStream();
} catch (Exception e) { } catch (Exception e) {
@ -269,24 +267,15 @@ public class FilesStorage {
InputStream is = null; InputStream is = null;
try { try {
SMPUrl smsHome = new SMPUrl(uri); //SMPUrl smsHome = new SMPUrl(uri);
URL url=new URL(uri);
/*
* URL smsHome = new SMPUrl(); smsHome = new URL(null, uri, new logger.debug("smsHome: [host:" + url.getHost() + " path:"
* URLStreamHandler() { + url.getPath() + " ref:" + url.getRef()
* + " userinfo:" + url.getUserInfo() + " ]");
* @Override protected URLConnection openConnection(URL u) throws
* IOException { return new SMPURLConnection(u); }
*
* });
*/
logger.debug("smsHome: [host:" + smsHome.getHost() + " path:"
+ smsHome.getPath() + " ref:" + smsHome.getRef()
+ " userinfo:" + smsHome.getUserInfo() + " ]");
URLConnection uc = null; URLConnection uc = null;
uc = (URLConnection) smsHome.openConnection(); uc = (URLConnection) url.openConnection();
is = uc.getInputStream(); is = uc.getInputStream();
Workspace ws = HomeLibrary.getUserWorkspace(user); Workspace ws = HomeLibrary.getUserWorkspace(user);
@ -338,8 +327,7 @@ public class FilesStorage {
+ ", uniqueName: " + uniqueName + ", description: " + ", uniqueName: " + uniqueName + ", description: "
+ item_description + ", mimetype: " + item_mimetype + item_description + ", mimetype: " + item_mimetype
+ ", StorageId: " + storageId + "]"); + ", StorageId: " + storageId + "]");
WorkspaceUtil.createExternalFile(folder, uniqueName, WorkspaceUtil.createExternalFile(folder, uniqueName,item_description, item_mimetype, storageId);
item_description, item_mimetype, storageId);
} catch (Exception e) { } catch (Exception e) {
logger.error("Error creating item on workspace", e); logger.error("Error creating item on workspace", e);