diff --git a/samples/j2ee/snippets/com.ibm.sbt.automation.core/src/main/java/com/ibm/sbt/automation/core/test/BaseGridTestSetup.java b/samples/j2ee/snippets/com.ibm.sbt.automation.core/src/main/java/com/ibm/sbt/automation/core/test/BaseGridTestSetup.java index 241b732277..04293b9ab3 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.automation.core/src/main/java/com/ibm/sbt/automation/core/test/BaseGridTestSetup.java +++ b/samples/j2ee/snippets/com.ibm.sbt.automation.core/src/main/java/com/ibm/sbt/automation/core/test/BaseGridTestSetup.java @@ -7,10 +7,11 @@ import java.util.List; import java.util.Map; -import junit.framework.Assert; +import org.junit.Assert; import com.ibm.sbt.automation.core.utils.Trace; import com.ibm.sbt.security.authentication.AuthenticationException; +import com.ibm.sbt.services.client.ClientServicesException; import com.ibm.sbt.services.client.base.transformers.TransformerException; import com.ibm.sbt.services.client.connections.activity.Activity; import com.ibm.sbt.services.client.connections.activity.ActivityService; @@ -20,7 +21,6 @@ import com.ibm.sbt.services.client.connections.communities.CommunityServiceException; import com.ibm.sbt.services.client.connections.files.File; import com.ibm.sbt.services.client.connections.files.FileService; -import com.ibm.sbt.services.client.connections.files.FileServiceException; import com.ibm.sbt.services.client.connections.files.model.FileCreationParameters; import com.ibm.sbt.services.client.connections.forums.Forum; import com.ibm.sbt.services.client.connections.forums.ForumService; @@ -100,7 +100,7 @@ public void createBookmark(){ } catch (AuthenticationException e) { e.printStackTrace(); } - super.launchSnippet("Social_Bookmarks_API_CreateBookmark",this.authType.AUTO_DETECT); + super.launchSnippet("Social_Bookmarks_API_CreateBookmark",AuthType.AUTO_DETECT); } @@ -229,7 +229,7 @@ public void createFolder() { folder = fileService.createFolder("TestFolder"); fileService.pinFolder(folder.getFileId()); Trace.log("Created test folder: " + folder.getFileId()); - } catch (FileServiceException e) { + } catch (ClientServicesException e) { e.printStackTrace(); Assert.fail("Error creating test folder: " + e.getMessage()); } catch (TransformerException te) { @@ -274,10 +274,10 @@ public void createFile() { Trace.log("Created test file: " + fileEntry.getFileId()); - } catch (FileServiceException fse) { + } catch (ClientServicesException cse) { fileEntry = null; - fse.printStackTrace(); - Assert.fail("Error creating test file: " + fse.getMessage()); + cse.printStackTrace(); + Assert.fail("Error creating test file: " + cse.getMessage()); } catch (TransformerException te) { te.printStackTrace(); Assert.fail("Error creating test file: " + te.getMessage()); @@ -288,22 +288,22 @@ public void deleteFileAndQuit() { if (fileEntry != null) { try { fileService.deleteFile(fileEntry.getFileId()); - } catch (FileServiceException fse) { + } catch (ClientServicesException cse) { fileEntry = null; if (failIfAfterDeletionFails()) { - Assert.fail("Error deleting test file: " + fse.getMessage()); - fse.printStackTrace(); + Assert.fail("Error deleting test file: " + cse.getMessage()); + cse.printStackTrace(); } } } if (folder != null) { try { fileService.deleteFolder(folder.getFileId()); - } catch (FileServiceException fse) { + } catch (ClientServicesException cse) { folder = null; if (failIfAfterDeletionFails()) { - Assert.fail("Error deleting test folder: " + fse.getMessage()); - fse.printStackTrace(); + Assert.fail("Error deleting test folder: " + cse.getMessage()); + cse.printStackTrace(); } } } @@ -313,7 +313,7 @@ public void deleteFileAndQuit() { public void emptyTrash(){ try { fileService.deleteAllFilesFromRecycleBin(); - } catch (FileServiceException e) { + } catch (ClientServicesException e) { // TODO Auto-generated catch block e.printStackTrace(); } diff --git a/samples/j2ee/snippets/com.ibm.sbt.automation.core/src/main/java/com/ibm/sbt/automation/core/test/connections/BaseFilesTest.java b/samples/j2ee/snippets/com.ibm.sbt.automation.core/src/main/java/com/ibm/sbt/automation/core/test/connections/BaseFilesTest.java index bac0fdd7bf..88598db8cc 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.automation.core/src/main/java/com/ibm/sbt/automation/core/test/connections/BaseFilesTest.java +++ b/samples/j2ee/snippets/com.ibm.sbt.automation.core/src/main/java/com/ibm/sbt/automation/core/test/connections/BaseFilesTest.java @@ -1,5 +1,5 @@ /* - * © Copyright IBM Corp. 2013 + * © Copyright IBM Corp. 2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,7 +38,6 @@ import com.ibm.sbt.services.client.connections.communities.CommunityServiceException; import com.ibm.sbt.services.client.connections.files.File; import com.ibm.sbt.services.client.connections.files.FileService; -import com.ibm.sbt.services.client.connections.files.FileServiceException; import com.ibm.sbt.services.client.connections.files.model.FileCreationParameters; /** @@ -183,7 +182,7 @@ public void createFolder() { try { folder = fileService.createFolder("TestFolder"); Trace.log("Created test folder: " + folder.getFileId()); - } catch (FileServiceException e) { + } catch (ClientServicesException e) { e.printStackTrace(); fail("Error creating test folder: ", e); } catch (TransformerException te) { @@ -219,7 +218,7 @@ public void createFile(String id) { "Comment added by BaseFilesTest", params); Trace.log("Created test file: " + fileEntry.getFileId()); - } catch (FileServiceException fse) { + } catch (ClientServicesException fse) { fileEntry = null; fse.printStackTrace(); fail("Error creating test file: ", fse); @@ -237,7 +236,7 @@ public void deleteFileAndQuit() { try { fileService.deleteFile(fileEntry.getFileId()); - } catch (FileServiceException fse) { + } catch (ClientServicesException fse) { fileEntry = null; if (failIfAfterDeletionFails()) { fail("Error deleting test file: ", fse); @@ -251,7 +250,7 @@ public void deleteFileAndQuit() { try { fileService.deleteFolder(folder.getFileId()); - } catch (FileServiceException fse) { + } catch (ClientServicesException fse) { folder = null; if (failIfAfterDeletionFails()) { fail("Error deleting test folder: ", fse); @@ -277,7 +276,7 @@ public void deleteFile(File file) { if (file != null) { try { fileService.deleteFile(file.getFileId()); - } catch (FileServiceException fse) { + } catch (ClientServicesException fse) { if (failIfAfterDeletionFails()) { fail("Error deleting test file: ", fse); fse.printStackTrace(); diff --git a/samples/j2ee/snippets/com.ibm.sbt.automation.test/src/main/java/com/ibm/sbt/test/js/connections/files/api/GetFile.java b/samples/j2ee/snippets/com.ibm.sbt.automation.test/src/main/java/com/ibm/sbt/test/js/connections/files/api/GetFile.java index 180c0356c7..0860b3a5f4 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.automation.test/src/main/java/com/ibm/sbt/test/js/connections/files/api/GetFile.java +++ b/samples/j2ee/snippets/com.ibm.sbt.automation.test/src/main/java/com/ibm/sbt/test/js/connections/files/api/GetFile.java @@ -8,8 +8,8 @@ import com.ibm.commons.util.io.json.JsonJavaObject; import com.ibm.sbt.automation.core.test.connections.BaseFilesTest; import com.ibm.sbt.automation.core.test.pageobjects.JavaScriptPreviewPage; +import com.ibm.sbt.services.client.ClientServicesException; import com.ibm.sbt.services.client.connections.files.File; -import com.ibm.sbt.services.client.connections.files.FileServiceException; public class GetFile extends BaseFilesTest { @@ -24,7 +24,7 @@ public void init() { addSnippetParam("sample.fileId", fileEntry.getFileId()); fileService = getFileService(); file = fileService.getFile(fileEntry.getFileId(), true); - } catch (FileServiceException e) { + } catch (ClientServicesException e) { Assert.fail(e.getMessage()); e.printStackTrace(); } diff --git a/samples/j2ee/snippets/com.ibm.sbt.automation.test/src/main/java/com/ibm/sbt/test/js/connections/files/api/GetFilesSharedByMe.java b/samples/j2ee/snippets/com.ibm.sbt.automation.test/src/main/java/com/ibm/sbt/test/js/connections/files/api/GetFilesSharedByMe.java index f4d70c0451..b6756e89b2 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.automation.test/src/main/java/com/ibm/sbt/test/js/connections/files/api/GetFilesSharedByMe.java +++ b/samples/j2ee/snippets/com.ibm.sbt.automation.test/src/main/java/com/ibm/sbt/test/js/connections/files/api/GetFilesSharedByMe.java @@ -11,8 +11,8 @@ import com.ibm.commons.util.io.json.JsonJavaObject; import com.ibm.sbt.automation.core.test.connections.BaseFilesTest; import com.ibm.sbt.automation.core.test.pageobjects.JavaScriptPreviewPage; +import com.ibm.sbt.services.client.ClientServicesException; import com.ibm.sbt.services.client.connections.files.File; -import com.ibm.sbt.services.client.connections.files.FileServiceException; public class GetFilesSharedByMe extends BaseFilesTest { @@ -25,7 +25,7 @@ public void init() { try { fileService = getFileService(); files = fileService.getFilesSharedByMe(new HashMap()); - } catch (FileServiceException e) { + } catch (ClientServicesException e) { Assert.fail(e.getMessage()); e.printStackTrace(); } diff --git a/samples/j2ee/snippets/com.ibm.sbt.automation.test/src/main/java/com/ibm/sbt/test/js/connections/files/api/GetFilesSharedWithMe.java b/samples/j2ee/snippets/com.ibm.sbt.automation.test/src/main/java/com/ibm/sbt/test/js/connections/files/api/GetFilesSharedWithMe.java index 5022a712de..6dafab639f 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.automation.test/src/main/java/com/ibm/sbt/test/js/connections/files/api/GetFilesSharedWithMe.java +++ b/samples/j2ee/snippets/com.ibm.sbt.automation.test/src/main/java/com/ibm/sbt/test/js/connections/files/api/GetFilesSharedWithMe.java @@ -11,8 +11,8 @@ import com.ibm.commons.util.io.json.JsonJavaObject; import com.ibm.sbt.automation.core.test.connections.BaseFilesTest; import com.ibm.sbt.automation.core.test.pageobjects.JavaScriptPreviewPage; +import com.ibm.sbt.services.client.ClientServicesException; import com.ibm.sbt.services.client.connections.files.File; -import com.ibm.sbt.services.client.connections.files.FileServiceException; public class GetFilesSharedWithMe extends BaseFilesTest { @@ -25,7 +25,7 @@ public void init() { try { fileService = getFileService(); files = fileService.getFilesSharedWithMe(new HashMap()); - } catch (FileServiceException e) { + } catch (ClientServicesException e) { Assert.fail(e.getMessage()); e.printStackTrace(); } diff --git a/samples/j2ee/snippets/com.ibm.sbt.automation.test/src/main/java/com/ibm/sbt/test/js/connections/files/api/GetMyFiles.java b/samples/j2ee/snippets/com.ibm.sbt.automation.test/src/main/java/com/ibm/sbt/test/js/connections/files/api/GetMyFiles.java index 498589f313..177e2a43b6 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.automation.test/src/main/java/com/ibm/sbt/test/js/connections/files/api/GetMyFiles.java +++ b/samples/j2ee/snippets/com.ibm.sbt.automation.test/src/main/java/com/ibm/sbt/test/js/connections/files/api/GetMyFiles.java @@ -11,8 +11,8 @@ import com.ibm.commons.util.io.json.JsonJavaObject; import com.ibm.sbt.automation.core.test.connections.BaseFilesTest; import com.ibm.sbt.automation.core.test.pageobjects.JavaScriptPreviewPage; +import com.ibm.sbt.services.client.ClientServicesException; import com.ibm.sbt.services.client.connections.files.File; -import com.ibm.sbt.services.client.connections.files.FileServiceException; public class GetMyFiles extends BaseFilesTest { @@ -25,7 +25,7 @@ public void init() { try { fileService = getFileService(); files = fileService.getMyFiles(new HashMap()); - } catch (FileServiceException e) { + } catch (ClientServicesException e) { Assert.fail(e.getMessage()); e.printStackTrace(); } diff --git a/samples/j2ee/snippets/com.ibm.sbt.automation.test/src/main/java/com/ibm/sbt/test/js/connections/files/api/GetMyFolders.java b/samples/j2ee/snippets/com.ibm.sbt.automation.test/src/main/java/com/ibm/sbt/test/js/connections/files/api/GetMyFolders.java index 6e3308936f..1108e1e0ea 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.automation.test/src/main/java/com/ibm/sbt/test/js/connections/files/api/GetMyFolders.java +++ b/samples/j2ee/snippets/com.ibm.sbt.automation.test/src/main/java/com/ibm/sbt/test/js/connections/files/api/GetMyFolders.java @@ -12,8 +12,8 @@ import com.ibm.commons.util.io.json.JsonJavaObject; import com.ibm.sbt.automation.core.test.connections.BaseFilesTest; import com.ibm.sbt.automation.core.test.pageobjects.JavaScriptPreviewPage; +import com.ibm.sbt.services.client.ClientServicesException; import com.ibm.sbt.services.client.connections.files.File; -import com.ibm.sbt.services.client.connections.files.FileServiceException; public class GetMyFolders extends BaseFilesTest { @@ -29,7 +29,7 @@ public void init() { createFolder(); } folders = fileService.getMyFolders(new HashMap()); - } catch (FileServiceException e) { + } catch (ClientServicesException e) { Assert.fail(e.getMessage()); } } diff --git a/samples/j2ee/snippets/com.ibm.sbt.automation.test/src/main/java/com/ibm/sbt/test/js/connections/files/api/GetMyPinnedFiles.java b/samples/j2ee/snippets/com.ibm.sbt.automation.test/src/main/java/com/ibm/sbt/test/js/connections/files/api/GetMyPinnedFiles.java index 5c68239e3c..c681182e85 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.automation.test/src/main/java/com/ibm/sbt/test/js/connections/files/api/GetMyPinnedFiles.java +++ b/samples/j2ee/snippets/com.ibm.sbt.automation.test/src/main/java/com/ibm/sbt/test/js/connections/files/api/GetMyPinnedFiles.java @@ -13,8 +13,8 @@ import com.ibm.commons.util.io.json.JsonJavaObject; import com.ibm.sbt.automation.core.test.connections.BaseFilesTest; import com.ibm.sbt.automation.core.test.pageobjects.JavaScriptPreviewPage; +import com.ibm.sbt.services.client.ClientServicesException; import com.ibm.sbt.services.client.connections.files.File; -import com.ibm.sbt.services.client.connections.files.FileServiceException; public class GetMyPinnedFiles extends BaseFilesTest { @@ -30,7 +30,7 @@ public void init() { fileService = getFileService(); files = fileService.getPinnedFiles(new HashMap()); assertNotNull(files); - } catch (FileServiceException e) { + } catch (ClientServicesException e) { e.printStackTrace(); Assert.fail(e.getMessage()); } diff --git a/samples/j2ee/snippets/com.ibm.sbt.automation.test/src/main/java/com/ibm/sbt/test/js/connections/files/api/GetPinnedFiles.java b/samples/j2ee/snippets/com.ibm.sbt.automation.test/src/main/java/com/ibm/sbt/test/js/connections/files/api/GetPinnedFiles.java index e65648d5a9..f0771a486d 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.automation.test/src/main/java/com/ibm/sbt/test/js/connections/files/api/GetPinnedFiles.java +++ b/samples/j2ee/snippets/com.ibm.sbt.automation.test/src/main/java/com/ibm/sbt/test/js/connections/files/api/GetPinnedFiles.java @@ -13,8 +13,8 @@ import com.ibm.commons.util.io.json.JsonJavaObject; import com.ibm.sbt.automation.core.test.connections.BaseFilesTest; import com.ibm.sbt.automation.core.test.pageobjects.JavaScriptPreviewPage; +import com.ibm.sbt.services.client.ClientServicesException; import com.ibm.sbt.services.client.connections.files.File; -import com.ibm.sbt.services.client.connections.files.FileServiceException; public class GetPinnedFiles extends BaseFilesTest { @@ -30,7 +30,7 @@ public void init() { fileService = getFileService(); files = fileService.getPinnedFiles(new HashMap()); assertNotNull(files); - } catch (FileServiceException e) { + } catch (ClientServicesException e) { e.printStackTrace(); Assert.fail(e.getMessage()); } diff --git a/samples/j2ee/snippets/com.ibm.sbt.automation.test/src/main/java/com/ibm/sbt/test/js/connections/files/api/GetPublicFileComments.java b/samples/j2ee/snippets/com.ibm.sbt.automation.test/src/main/java/com/ibm/sbt/test/js/connections/files/api/GetPublicFileComments.java index 74beb38d09..f283099e73 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.automation.test/src/main/java/com/ibm/sbt/test/js/connections/files/api/GetPublicFileComments.java +++ b/samples/j2ee/snippets/com.ibm.sbt.automation.test/src/main/java/com/ibm/sbt/test/js/connections/files/api/GetPublicFileComments.java @@ -12,8 +12,8 @@ import com.ibm.commons.util.io.json.JsonJavaObject; import com.ibm.sbt.automation.core.test.connections.BaseFilesTest; import com.ibm.sbt.automation.core.test.pageobjects.JavaScriptPreviewPage; +import com.ibm.sbt.services.client.ClientServicesException; import com.ibm.sbt.services.client.connections.files.Comment; -import com.ibm.sbt.services.client.connections.files.FileServiceException; public class GetPublicFileComments extends BaseFilesTest { @@ -30,7 +30,7 @@ public void init() { addSnippetParam("sample.fileId", fileEntry.getFileId()); try { comments = fileService.getAllFileComments(fileEntry.getFileId(), new HashMap()); - } catch (FileServiceException e) { + } catch (ClientServicesException e) { Assert.fail(e.getMessage()); e.printStackTrace(); } diff --git a/samples/j2ee/snippets/com.ibm.sbt.automation.test/src/main/java/com/ibm/sbt/test/js/connections/files/api/GetPublicFiles.java b/samples/j2ee/snippets/com.ibm.sbt.automation.test/src/main/java/com/ibm/sbt/test/js/connections/files/api/GetPublicFiles.java index 403bae7b0e..143620156f 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.automation.test/src/main/java/com/ibm/sbt/test/js/connections/files/api/GetPublicFiles.java +++ b/samples/j2ee/snippets/com.ibm.sbt.automation.test/src/main/java/com/ibm/sbt/test/js/connections/files/api/GetPublicFiles.java @@ -1,7 +1,5 @@ package com.ibm.sbt.test.js.connections.files.api; -import static org.junit.Assert.fail; - import java.util.HashMap; import java.util.List; @@ -14,8 +12,8 @@ import com.ibm.commons.util.io.json.JsonJavaObject; import com.ibm.sbt.automation.core.test.connections.BaseFilesTest; import com.ibm.sbt.automation.core.test.pageobjects.JavaScriptPreviewPage; +import com.ibm.sbt.services.client.ClientServicesException; import com.ibm.sbt.services.client.connections.files.File; -import com.ibm.sbt.services.client.connections.files.FileServiceException; public class GetPublicFiles extends BaseFilesTest { @@ -33,7 +31,7 @@ public void init() { addSnippetParam("sample.fileId", fileEntry.getFileId()); try { files = fileService.getPublicFiles(new HashMap()); - } catch (FileServiceException e) { + } catch (ClientServicesException e) { Assert.fail(e.getMessage()); e.printStackTrace(); } diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/ActivityStreams/Updates From Community.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/ActivityStreams/Updates From Community.jsp index 1185f5ac5e..7d50f7c7a4 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/ActivityStreams/Updates From Community.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/ActivityStreams/Updates From Community.jsp @@ -20,10 +20,10 @@ <%@page import="java.io.PrintWriter"%> <%@page import="com.ibm.sbt.services.client.connections.activitystreams.model.Reply"%> <%@page import="com.ibm.sbt.services.client.connections.activitystreams.ActivityStreamEntity"%> -<%@page import="com.ibm.sbt.services.client.connections.activitystreams.ActivityStreamEntityList"%> <%@page import="com.ibm.sbt.services.client.connections.activitystreams.ActivityStreamService"%> -<%@page import="com.ibm.sbt.services.client.connections.communities.CommunityList"%> <%@page import="com.ibm.sbt.services.client.connections.communities.CommunityService"%> +<%@page import="com.ibm.sbt.services.client.connections.communities.Community"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="java.util.List"%> <%@page import="java.util.Iterator"%> @@ -41,13 +41,13 @@ // Fetch list of my communities, we need to community uuid for making call in ActivityStreamService. CommunityService comService = new CommunityService(); - CommunityList listOfCommunities = comService.getMyCommunities(); + EntityList listOfCommunities = comService.getMyCommunities(); if(listOfCommunities.size()<=0){ out.println("You are not owner of any community"); }else{ ActivityStreamService _service = new ActivityStreamService(); - ActivityStreamEntityList _entries = _service.getUpdatesFromCommunity(listOfCommunities.get(0).getCommunityUuid()); + EntityList _entries = _service.getUpdatesFromCommunity(listOfCommunities.get(0).getCommunityUuid()); if (_entries.size() <= 0){ out.println("No updates to be displayed"); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Accept Invite.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Accept Invite.jsp index 7cf6d2d846..b76e4e8956 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Accept Invite.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Accept Invite.jsp @@ -21,7 +21,7 @@ <%@page import="com.ibm.sbt.services.client.connections.communities.Community"%> <%@page import="com.ibm.sbt.services.client.connections.communities.CommunityService"%> <%@page import="com.ibm.sbt.services.client.connections.communities.Invite"%> -<%@page import="com.ibm.sbt.services.client.connections.communities.InviteList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> @@ -35,7 +35,7 @@ <% try { CommunityService svc = new CommunityService(); - InviteList invites = svc.getMyInvites(); + EntityList invites = svc.getMyInvites(); if(invites.size()>0){ String communityId = invites.get(0).getCommunityUuid(); String userId = invites.get(0).getContributor().getUserid(); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Add Member.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Add Member.jsp index c4eb7c660d..c1a2d741a2 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Add Member.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Add Member.jsp @@ -18,9 +18,9 @@ <%@page import="com.ibm.commons.runtime.Application"%> <%@page import="com.ibm.commons.runtime.Context"%> <%@page import="com.ibm.sbt.services.client.connections.communities.Community"%> -<%@page import="com.ibm.sbt.services.client.connections.communities.CommunityList"%> <%@page import="com.ibm.sbt.services.client.connections.communities.CommunityService"%> <%@page import="com.ibm.sbt.services.client.connections.communities.Member"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="java.util.HashMap"%> <%@page import="java.util.Collection"%> <%@page @@ -38,7 +38,7 @@ <% try { CommunityService communityService = new CommunityService(); - CommunityList communities = communityService.getMyCommunities(); + EntityList communities = communityService.getMyCommunities(); Community community = communities.iterator().next(); String id = Context.get().getProperty("sample.id2"); Member newMember = new Member(communityService,id); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Create Forum Topic.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Create Forum Topic.jsp index 85ce50927b..54a3fea6e9 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Create Forum Topic.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Create Forum Topic.jsp @@ -14,11 +14,11 @@ * permissions and limitations under the License. */--> -<%@page import="com.ibm.sbt.services.client.connections.communities.CommunityList"%> +<%@page import="com.ibm.sbt.services.client.connections.communities.Community"%> <%@page import="com.ibm.sbt.services.client.connections.communities.CommunityService"%> <%@page import="com.ibm.sbt.services.client.connections.forums.ForumTopic"%> <%@page import="com.ibm.sbt.services.client.connections.forums.ForumService"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.ForumList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="com.ibm.sbt.services.client.connections.forums.Forum"%> <%@page import="java.util.Collection"%> <%@page import="java.io.PrintWriter"%> @@ -39,7 +39,7 @@ try { CommunityService comService = new CommunityService(); - CommunityList comList = comService.getMyCommunities(); + EntityList comList = comService.getMyCommunities(); if(comList.size() > 0 ){ String communityId = comList.get(0).getCommunityUuid(); ForumTopic topic = new ForumTopic(new ForumService(), ""); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Create Invite.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Create Invite.jsp index 5a8c14f90a..fb214066e3 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Create Invite.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Create Invite.jsp @@ -21,9 +21,7 @@ <%@page import="com.ibm.sbt.services.client.connections.communities.Community"%> <%@page import="com.ibm.sbt.services.client.connections.communities.CommunityService"%> <%@page import="com.ibm.sbt.services.client.connections.communities.Invite"%> -<%@page import="com.ibm.sbt.services.client.connections.communities.InviteList"%> - -<%@page import="com.ibm.sbt.services.client.connections.communities.CommunityList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> @@ -38,7 +36,7 @@ <% try { CommunityService svc = new CommunityService(); - CommunityList communities = svc.getMyCommunities(); + EntityList communities = svc.getMyCommunities(); if(communities.size()>0){ String communityId = communities.get(0).getCommunityUuid(); String userId = Context.get().getProperty("sample.id2"); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Decline Invite.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Decline Invite.jsp index bcbf867651..f5f31764c1 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Decline Invite.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Decline Invite.jsp @@ -21,7 +21,7 @@ <%@page import="com.ibm.sbt.services.client.connections.communities.Community"%> <%@page import="com.ibm.sbt.services.client.connections.communities.CommunityService"%> <%@page import="com.ibm.sbt.services.client.connections.communities.Invite"%> -<%@page import="com.ibm.sbt.services.client.connections.communities.InviteList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> @@ -35,7 +35,7 @@ <% try { CommunityService svc = new CommunityService(); - InviteList invites = svc.getMyInvites(); + EntityList invites = svc.getMyInvites(); if(invites.size()>0){ String communityId = invites.get(0).getCommunityUuid(); String userId = invites.get(0).getContributor().getUserid(); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get Bookmarks.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get Bookmarks.jsp index 9c8316e169..cf720e928a 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get Bookmarks.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get Bookmarks.jsp @@ -21,7 +21,7 @@ <%@page import="com.ibm.sbt.services.client.connections.communities.Community"%> <%@page import="com.ibm.sbt.services.client.connections.communities.CommunityService"%> <%@page import="com.ibm.sbt.services.client.connections.communities.Bookmark"%> -<%@page import="com.ibm.sbt.services.client.connections.communities.BookmarkList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> @@ -37,7 +37,7 @@ Collection communities = communityService.getPublicCommunities(); Community community = communities.iterator().next(); - BookmarkList bookmarks = communityService.getBookmarks(community.getCommunityUuid()); + EntityList bookmarks = communityService.getBookmarks(community.getCommunityUuid()); if(bookmarks.getTotalResults() > 0 ){ out.println("
Listing Bookmarks of a Community
"); for (Bookmark bookmark : bookmarks) { diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get Community Data By Entity.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get Community Data By Entity.jsp index 014fcc5d2d..2a57296290 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get Community Data By Entity.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get Community Data By Entity.jsp @@ -19,9 +19,8 @@ <%@page import="com.ibm.commons.runtime.Context"%> <%@page import="com.ibm.sbt.services.client.connections.communities.CommunityService"%> <%@page import="com.ibm.sbt.services.client.connections.communities.Community"%> -<%@page import="com.ibm.sbt.services.client.connections.communities.CommunityList"%> <%@page import="com.ibm.sbt.services.client.connections.communities.Member"%> -<%@page import="com.ibm.sbt.services.client.connections.communities.MemberList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="java.util.*"%> @@ -41,7 +40,7 @@ CommunityService communityService = new CommunityService(); Collection communities = communityService.getPublicCommunities(); Community community = communities.iterator().next(); - CommunityList subCommunities = community.getSubCommunities(); + EntityList subCommunities = community.getSubCommunities(); if(subCommunities.getTotalResults() > 0 ){ out.println("
Listing sub communities of a Community
"); for (Community subCommunity : subCommunities) { @@ -49,7 +48,7 @@ out.println("
"); } } - MemberList members = community.getMembers(); + EntityList members = community.getMembers(); out.println("
Listing members of a Community
"); for (Member member : members) { out.println("Member name : " + member.getName()); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get Community.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get Community.jsp index 032f0a4b90..e6a4ca0c2a 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get Community.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get Community.jsp @@ -19,7 +19,7 @@ <%@page import="com.ibm.commons.runtime.Context"%> <%@page import="com.ibm.sbt.services.client.connections.communities.CommunityService"%> <%@page import="com.ibm.sbt.services.client.connections.communities.Community"%> -<%@page import="com.ibm.sbt.services.client.connections.communities.CommunityList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="java.util.*"%> @@ -36,7 +36,7 @@ <% try { CommunityService svc = new CommunityService(); - CommunityList communities = svc.getPublicCommunities(); + EntityList communities = svc.getPublicCommunities(); Community community = communities.iterator().next(); community = svc.getCommunity(community.getCommunityUuid()); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get Forum Topics.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get Forum Topics.jsp index f079279dc9..dce759ecfe 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get Forum Topics.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get Forum Topics.jsp @@ -18,10 +18,10 @@ <%@page import="java.util.Collection"%> <%@page import="com.ibm.commons.runtime.Application"%> <%@page import="com.ibm.commons.runtime.Context"%> +<%@page import="com.ibm.sbt.services.client.connections.forums.ForumTopic"%> <%@page import="com.ibm.sbt.services.client.connections.communities.Community"%> <%@page import="com.ibm.sbt.services.client.connections.communities.CommunityService"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.model.BaseForumEntity"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.TopicList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> @@ -37,10 +37,10 @@ Collection communities = communityService.getPublicCommunities(); Community community = communities.iterator().next(); - TopicList forumTopics = communityService.getForumTopics(community.getCommunityUuid()); + EntityList forumTopics = communityService.getForumTopics(community.getCommunityUuid()); if(forumTopics.getTotalResults() > 0 ){ out.println("
Listing forum topics of a Community
"); - for (BaseForumEntity forumTopic : forumTopics) { + for (ForumTopic forumTopic : forumTopics) { out.println("Forum Topic Title : " + forumTopic.getTitle()+"
"); out.println("Forum Topic id : " + forumTopic.getUid()+"
"); out.println("Forum Topic updated : " + forumTopic.getUpdated()+"
"); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get Forums.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get Forums.jsp index 5cf7dac2ad..5d8589d4ec 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get Forums.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get Forums.jsp @@ -19,9 +19,9 @@ <%@page import="com.ibm.commons.runtime.Application"%> <%@page import="com.ibm.commons.runtime.Context"%> <%@page import="com.ibm.sbt.services.client.connections.communities.Community"%> +<%@page import="com.ibm.sbt.services.client.connections.forums.Forum"%> <%@page import="com.ibm.sbt.services.client.connections.communities.CommunityService"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.model.BaseForumEntity"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.ForumList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> @@ -38,10 +38,10 @@ Collection communities = communityService.getPublicCommunities(); Community community = communities.iterator().next(); - ForumList forums = communityService.getForums(community.getCommunityUuid()); + EntityList forums = communityService.getForums(community.getCommunityUuid()); if(forums.getTotalResults() > 0 ){ out.println("
Listing forums of a Community
"); - for (BaseForumEntity forum : forums) { + for (Forum forum : forums) { out.println("Forum Title : " + forum.getTitle()+"
"); out.println("Forum Uuid : " + forum.getUid()+"
"); out.println("Forum updated : " + forum.getUpdated()+"
"); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get Invite.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get Invite.jsp index 90091c840c..0e41cd4114 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get Invite.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get Invite.jsp @@ -17,7 +17,7 @@ <%@page import="java.io.PrintWriter"%> <%@page import="com.ibm.sbt.services.client.connections.communities.CommunityService"%> <%@page import="com.ibm.sbt.services.client.connections.communities.Invite"%> -<%@page import="com.ibm.sbt.services.client.connections.communities.InviteList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="java.util.*"%> <%@page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> @@ -30,7 +30,7 @@ <% try { CommunityService svc = new CommunityService(); - InviteList invites = svc.getMyInvites(); + EntityList invites = svc.getMyInvites(); if(invites.size() > 0){ String communityUuid = invites.get(0).getCommunityUuid(); String inviteUuid = invites.get(0).getInviteUuid(); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get Members.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get Members.jsp index 0d2b05a798..68c25c1d7d 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get Members.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get Members.jsp @@ -18,9 +18,8 @@ <%@page import="com.ibm.commons.runtime.Context"%> <%@page import="com.ibm.sbt.services.client.connections.communities.CommunityService"%> <%@page import="com.ibm.sbt.services.client.connections.communities.Community"%> -<%@page import="com.ibm.sbt.services.client.connections.communities.CommunityList"%> -<%@page import="com.ibm.sbt.services.client.connections.communities.MemberList"%> <%@page import="com.ibm.sbt.services.client.connections.communities.Member"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="java.util.*"%> @@ -39,10 +38,10 @@ <% try { CommunityService communityService = new CommunityService(); - CommunityList communities = communityService.getPublicCommunities(); + EntityList communities = communityService.getPublicCommunities(); Community community = communities.iterator().next(); - MemberList members = communityService.getMembers(community.getCommunityUuid()); + EntityList members = communityService.getMembers(community.getCommunityUuid()); out.println("
Listing Members of a Community
"); for (Member member : members) { diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get My Communities.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get My Communities.jsp index 86459a7f54..d099722da3 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get My Communities.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get My Communities.jsp @@ -19,7 +19,7 @@ <%@page import="com.ibm.commons.runtime.Context"%> <%@page import="com.ibm.sbt.services.client.connections.communities.CommunityService"%> <%@page import="com.ibm.sbt.services.client.connections.communities.Community"%> -<%@page import="com.ibm.sbt.services.client.connections.communities.CommunityList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="java.util.*"%> @@ -39,7 +39,7 @@ CommunityService svc = new CommunityService(); Map parameters = new HashMap(); parameters.put("ps", "5"); - CommunityList communities = svc.getMyCommunities(parameters); + EntityList communities = svc.getMyCommunities(parameters); out.println("
Listing my communities , Total communities found : "+communities.getTotalResults()); out.println("
"); for (Community community : communities) { diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get My Invites.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get My Invites.jsp index 5a50656d09..a56a522465 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get My Invites.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get My Invites.jsp @@ -21,7 +21,7 @@ <%@page import="com.ibm.sbt.services.client.connections.communities.Community"%> <%@page import="com.ibm.sbt.services.client.connections.communities.CommunityService"%> <%@page import="com.ibm.sbt.services.client.connections.communities.Invite"%> -<%@page import="com.ibm.sbt.services.client.connections.communities.InviteList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> @@ -35,7 +35,7 @@ <% try { CommunityService svc = new CommunityService(); - InviteList invites = svc.getMyInvites(); + EntityList invites = svc.getMyInvites(); out.println("
Listing Invites
"); for (Invite invite : invites) { diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get Public Communities.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get Public Communities.jsp index 765d617387..2707dfa776 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get Public Communities.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get Public Communities.jsp @@ -19,7 +19,7 @@ <%@page import="com.ibm.commons.runtime.Context"%> <%@page import="com.ibm.sbt.services.client.connections.communities.CommunityService"%> <%@page import="com.ibm.sbt.services.client.connections.communities.Community"%> -<%@page import="com.ibm.sbt.services.client.connections.communities.CommunityList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="java.util.*"%> @@ -37,7 +37,7 @@ try { CommunityService svc = new CommunityService(); - CommunityList communities = svc.getPublicCommunities(); + EntityList communities = svc.getPublicCommunities(); out.println("
Listing public communities , Total communities found : "+communities.getTotalResults()); out.println("
"); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get Sub Communities.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get Sub Communities.jsp index 5896b96460..85480357a4 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get Sub Communities.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Get Sub Communities.jsp @@ -20,7 +20,7 @@ <%@page import="com.ibm.commons.runtime.Context"%> <%@page import="com.ibm.sbt.services.client.connections.communities.Community"%> <%@page import="com.ibm.sbt.services.client.connections.communities.CommunityService"%> -<%@page import="com.ibm.sbt.services.client.connections.communities.CommunityList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> @@ -36,7 +36,7 @@ CommunityService communityService = new CommunityService(); Collection communities = communityService.getPublicCommunities(); Community community = communities.iterator().next(); - CommunityList subCommunities = communityService.getSubCommunities(community.getCommunityUuid()); + EntityList subCommunities = communityService.getSubCommunities(community.getCommunityUuid()); if(subCommunities.getTotalResults() > 0 ){ out.println("
Listing sub communities of a Community
"); for (Community subCommunity : subCommunities) { diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Remove Community.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Remove Community.jsp index 008ffa5869..f75db94529 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Remove Community.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Remove Community.jsp @@ -21,6 +21,7 @@ <%@page import="com.ibm.sbt.services.client.connections.communities.Community"%> <%@page import="com.ibm.sbt.services.client.connections.communities.CommunityList"%> <%@page import="com.ibm.sbt.services.client.connections.communities.CommunityService"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="java.util.HashMap"%> <%@page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> @@ -35,7 +36,7 @@ <% try { CommunityService communityService = new CommunityService(); - CommunityList communities = communityService.getMyCommunities(); + EntityList communities = communityService.getMyCommunities(); if(communities != null && !communities.isEmpty()){ Community community = communities.iterator().next(); out.println("Community Title : "+community.getTitle()); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Remove Member.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Remove Member.jsp index a16e901825..d3da525216 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Remove Member.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Remove Member.jsp @@ -20,8 +20,8 @@ <%@page import="com.ibm.sbt.services.client.connections.communities.Community"%> <%@page import="com.ibm.sbt.services.client.connections.communities.CommunityService"%> -<%@page import="com.ibm.sbt.services.client.connections.communities.MemberList"%> <%@page import="com.ibm.sbt.services.client.connections.communities.Member"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="java.util.HashMap"%> <%@page import="java.util.Collection"%> <%@page @@ -40,7 +40,7 @@ CommunityService communityService = new CommunityService(); Collection communities = communityService.getMyCommunities(); Community community = communities.iterator().next(); - MemberList members = communityService.getMembers(community.getCommunityUuid()); + EntityList members = communityService.getMembers(community.getCommunityUuid()); if(members != null && !members.isEmpty()){ if(members.getTotalResults() > 1){ Member member = members.iterator().next(); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Update Community Logo.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Update Community Logo.jsp index 0ec5cd4c9b..8d573eb65d 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Update Community Logo.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Update Community Logo.jsp @@ -9,8 +9,8 @@ org.apache.commons.fileupload.disk.DiskFileItemFactory,org.apache.commons.fileupload.servlet.ServletFileUpload"%> <%@page import="org.apache.commons.fileupload.FileUploadBase.InvalidContentTypeException"%> <%@page import="com.ibm.sbt.services.client.connections.communities.CommunityService"%> -<%@page import="com.ibm.sbt.services.client.connections.communities.CommunityList"%> <%@page import="com.ibm.sbt.services.client.connections.communities.Community"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> @@ -33,7 +33,7 @@ org.apache.commons.fileupload.disk.DiskFileItemFactory,org.apache.commons.fileup File file = convertToFile(fileItem); //Create CommunityService instance and call updateCommunityLogo wrapper function to update Community Logo CommunityService communityService = new CommunityService(); - CommunityList communities = communityService.getMyCommunities(); + EntityList communities = communityService.getMyCommunities(); String communityId = communities.get(0).getCommunityUuid(); communityService.updateCommunityLogo(file, communityId); request.setAttribute("message", "Logo updated successfully"); @@ -77,7 +77,7 @@ org.apache.commons.fileupload.disk.DiskFileItemFactory,org.apache.commons.fileup <% if (request.getAttribute("success") != null) { if (request.getAttribute("success").equals("true")) { CommunityService communityService = new CommunityService(); - CommunityList communities = communityService.getMyCommunities(); + EntityList communities = communityService.getMyCommunities(); Community myCommunity = communities.get(0); out.println("Logo for Community with title: " + myCommunity.getTitle()+ " and CommunityUuid: "+myCommunity.getCommunityUuid()+"
"); out.println(""); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Update Community.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Update Community.jsp index 725d4f38d9..23ad62e11a 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Update Community.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Update Community.jsp @@ -18,8 +18,8 @@ <%@page import="java.io.PrintWriter"%> <%@page import="com.ibm.commons.runtime.Context"%> <%@page import="com.ibm.sbt.services.client.connections.communities.Community"%> -<%@page import="com.ibm.sbt.services.client.connections.communities.CommunityList"%> <%@page import="com.ibm.sbt.services.client.connections.communities.CommunityService"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="java.util.HashMap"%> <%@page import="java.util.ArrayList"%> <%@page import="java.util.List"%> @@ -37,7 +37,7 @@ <% try { CommunityService communityService = new CommunityService(); - CommunityList communities = communityService.getMyCommunities(); + EntityList communities = communityService.getMyCommunities(); if(communities!=null && !communities.isEmpty()){ Community community = communities.iterator().next(); community.setTitle("Test Community" + System.currentTimeMillis()); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Update Member.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Update Member.jsp index d361b7a8da..d0edd290d9 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Update Member.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Communities/Update Member.jsp @@ -18,10 +18,9 @@ <%@page import="com.ibm.commons.runtime.Application"%> <%@page import="com.ibm.commons.runtime.Context"%> <%@page import="com.ibm.sbt.services.client.connections.communities.Community"%> -<%@page import="com.ibm.sbt.services.client.connections.communities.CommunityList"%> <%@page import="com.ibm.sbt.services.client.connections.communities.CommunityService"%> -<%@page import="com.ibm.sbt.services.client.connections.communities.MemberList"%> <%@page import="com.ibm.sbt.services.client.connections.communities.Member"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="java.util.HashMap"%> <%@page import="java.util.Collection"%> <%@page @@ -38,10 +37,10 @@ <% try { CommunityService communityService = new CommunityService(); - CommunityList communities = communityService.getMyCommunities(); + EntityList communities = communityService.getMyCommunities(); String communityId = communities.get(0).getCommunityUuid(); - MemberList members = communityService.getMembers(communityId); + EntityList members = communityService.getMembers(communityId); if(members !=null && members.size()>1){ // size>1 so as to ensure we do not change onwnership of already a owner Boolean roleMemberFound = false; for (Member member :members){ diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Add Comment To File.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Add Comment To File.jsp index 094f619f5e..9673535a39 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Add Comment To File.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Add Comment To File.jsp @@ -17,7 +17,7 @@ <%@page import="com.ibm.sbt.services.client.connections.files.FileService"%> <%@page import="com.ibm.sbt.services.client.connections.files.Comment"%> <%@page import="com.ibm.sbt.services.client.connections.files.File"%> -<%@page import="com.ibm.sbt.services.client.connections.files.FileList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="java.util.List"%> <%@page import="com.ibm.commons.runtime.Application"%> <%@page import="com.ibm.commons.runtime.Context"%> @@ -41,7 +41,7 @@ <% try { FileService fileService = new FileService(); - FileList fileEntries = fileService.getMyFiles(); + EntityList fileEntries = fileService.getMyFiles(); File fileEntry = fileEntries.get(0); Comment commentEntry = fileService.addCommentToFile(fileEntry.getFileId(), "Comment added by Add Comment To File java sample at " + System.currentTimeMillis(), null); if (commentEntry != null) { diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Add and Get Community File Comments.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Add and Get Community File Comments.jsp index 640a211057..4803253bde 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Add and Get Community File Comments.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Add and Get Community File Comments.jsp @@ -15,15 +15,14 @@ */--> <%@page import="com.ibm.commons.util.StringUtil"%> -<%@page import="com.ibm.sbt.services.client.connections.files.CommentList"%> -<%@page import="com.ibm.sbt.services.client.connections.communities.CommunityList"%> <%@page import="java.io.ByteArrayOutputStream"%> <%@page import="java.io.InputStream"%> <%@page import="com.ibm.sbt.services.client.connections.communities.CommunityService"%> <%@page import="com.ibm.sbt.services.client.connections.files.FileService"%> <%@page import="com.ibm.sbt.services.client.connections.files.Comment"%> <%@page import="com.ibm.sbt.services.client.connections.files.File"%> -<%@page import="com.ibm.sbt.services.client.connections.files.FileList"%> +<%@page import="com.ibm.sbt.services.client.connections.communities.Community"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="java.nio.charset.Charset"%> <%@page import="java.io.ByteArrayInputStream"%> <%@page import="java.io.PrintWriter"%> @@ -45,7 +44,7 @@ <% try { CommunityService commService = new CommunityService(); - CommunityList communities = commService.getMyCommunities(); + EntityList communities = commService.getMyCommunities(); if(communities != null && ! communities.isEmpty()) { String communityId = communities.get(0).getCommunityUuid(); @@ -59,7 +58,7 @@ fileService.addCommentToCommunityFile(fileUploaded.getFileId(), "JSP Added community file comment"+System.currentTimeMillis(), communityId, null); // Get All community File Comments - CommentList comments = fileService.getAllCommunityFileComments(fileUploaded.getFileId(), communityId, null); + EntityList comments = fileService.getAllCommunityFileComments(fileUploaded.getFileId(), communityId, null); if(comments != null && ! comments.isEmpty()) { for(Comment comment : comments) { out.println(comment.getComment()); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Download Upload Community File.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Download Upload Community File.jsp index 463c6f9b1d..7581a06b84 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Download Upload Community File.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Download Upload Community File.jsp @@ -16,15 +16,15 @@ <%@page import="com.ibm.sbt.services.client.connections.files.FileService"%> <%@page import="com.ibm.sbt.services.client.connections.files.File"%> +<%@page import="com.ibm.sbt.services.client.connections.communities.Community"%> <%@page import="com.ibm.commons.util.io.StreamUtil"%> <%@page import="java.io.ByteArrayInputStream"%> <%@page import="java.io.InputStream"%> <%@page import="java.io.ByteArrayOutputStream"%> <%@page import="java.io.FileOutputStream"%> <%@page import="java.io.OutputStream"%> -<%@page import="com.ibm.sbt.services.client.connections.files.FileList"%> -<%@page import="com.ibm.sbt.services.client.connections.communities.CommunityList"%> <%@page import="com.ibm.sbt.services.client.connections.communities.CommunityService"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="com.ibm.commons.util.StringUtil"%> <%@page import="com.ibm.commons.runtime.Application"%> <%@page import="com.ibm.commons.runtime.Context"%> @@ -43,11 +43,11 @@ try { CommunityService service = new CommunityService(); FileService serviceFS = new FileService(); - CommunityList communities = service.getMyCommunities(); + EntityList communities = service.getMyCommunities(); String communityId = ""; if(communities != null && ! communities.isEmpty()) { communityId = communities.get(0).getCommunityUuid(); - FileList list = serviceFS.getCommunityFiles(communityId, null); + EntityList list = serviceFS.getCommunityFiles(communityId, null); String fileId = ""; if(list != null && ! list.isEmpty()) { fileId = list.get(0).getFileId(); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Get Community Files.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Get Community Files.jsp index 5009b451d5..3a022e573b 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Get Community Files.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Get Community Files.jsp @@ -22,9 +22,9 @@ <%@page import="java.io.ByteArrayOutputStream"%> <%@page import="java.io.FileOutputStream"%> <%@page import="java.io.OutputStream"%> -<%@page import="com.ibm.sbt.services.client.connections.files.FileList"%> -<%@page import="com.ibm.sbt.services.client.connections.communities.CommunityList"%> <%@page import="com.ibm.sbt.services.client.connections.communities.CommunityService"%> +<%@page import="com.ibm.sbt.services.client.connections.communities.Community"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="com.ibm.commons.util.StringUtil"%> <%@page import="com.ibm.commons.runtime.Application"%> <%@page import="com.ibm.commons.runtime.Context"%> @@ -43,12 +43,12 @@ try { CommunityService service = new CommunityService(); FileService serviceFs = new FileService(); - CommunityList communities = service.getMyCommunities(); + EntityList communities = service.getMyCommunities(); if(communities != null && ! communities.isEmpty()) { String communityId = communities.get(0).getCommunityUuid(); out.println("
Getting Community Owned Files
"); - FileList list = serviceFs.getCommunityFiles(communityId, null); + EntityList list = serviceFs.getCommunityFiles(communityId, null); String fileId = ""; if(list != null && ! list.isEmpty()) { for (File fileEntry : list) { diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Get File Comments.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Get File Comments.jsp index b0dc1de4ed..e663c1e392 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Get File Comments.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Get File Comments.jsp @@ -14,11 +14,10 @@ * permissions and limitations under the License. */--> -<%@page import="com.ibm.sbt.services.client.connections.files.CommentList"%> <%@page import="com.ibm.sbt.services.client.connections.files.FileService"%> <%@page import="com.ibm.sbt.services.client.connections.files.Comment"%> <%@page import="com.ibm.sbt.services.client.connections.files.File"%> -<%@page import="com.ibm.sbt.services.client.connections.files.FileList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="java.util.HashMap"%> <%@page import="java.util.List"%> <%@page import="java.util.Map"%> @@ -40,9 +39,9 @@ <% try { FileService fileService = new FileService(); - FileList fileEntries = fileService.getMyFiles(); + EntityList fileEntries = fileService.getMyFiles(); File fileEntry = fileEntries.get(0); - CommentList commentEntries = fileService.getAllFileComments(fileEntry.getFileId(), null); + EntityList commentEntries = fileService.getAllFileComments(fileEntry.getFileId(), null); if (commentEntries != null && !commentEntries.isEmpty()) { for (Comment commentEntry : commentEntries) { out.println("Comment Id : " + commentEntry.getCommentId() + " , "); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Get Files Shared By Me.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Get Files Shared By Me.jsp index f9bca1acc1..2f7e5aa6b2 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Get Files Shared By Me.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Get Files Shared By Me.jsp @@ -17,7 +17,7 @@ <%@page import="com.ibm.sbt.services.client.connections.files.FileService"%> <%@page import="com.ibm.sbt.services.client.connections.files.Comment"%> <%@page import="com.ibm.sbt.services.client.connections.files.File"%> -<%@page import="com.ibm.sbt.services.client.connections.files.FileList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="com.ibm.commons.runtime.Application"%> <%@page import="com.ibm.commons.runtime.Context"%> <%@page import="java.io.PrintWriter"%> @@ -39,7 +39,7 @@ <% try { FileService fileService = new FileService(); - FileList fileEntries = fileService.getFilesSharedByMe(); + EntityList fileEntries = fileService.getFilesSharedByMe(); if(fileEntries != null && ! fileEntries.isEmpty()) { for (File fileEntry : fileEntries) { out.println(" " + fileEntry.getLabel() + "
" ); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Get Files Shared With Me.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Get Files Shared With Me.jsp index 795136e8d7..08b0008320 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Get Files Shared With Me.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Get Files Shared With Me.jsp @@ -17,7 +17,7 @@ <%@page import="com.ibm.sbt.services.client.connections.files.FileService"%> <%@page import="com.ibm.sbt.services.client.connections.files.Comment"%> <%@page import="com.ibm.sbt.services.client.connections.files.File"%> -<%@page import="com.ibm.sbt.services.client.connections.files.FileList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="com.ibm.commons.runtime.Application"%> <%@page import="com.ibm.commons.runtime.Context"%> <%@page import="java.util.List"%> @@ -38,7 +38,7 @@ <% try { FileService fileService = new FileService(); - FileList fileEntries = fileService.getFilesSharedWithMe(); + EntityList fileEntries = fileService.getFilesSharedWithMe(); if(fileEntries != null && ! fileEntries.isEmpty()) { for (File fileEntry : fileEntries) { out.println(" " + fileEntry.getLabel() + "
" ); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Get My Files.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Get My Files.jsp index d34e7b2e35..49d6d823a8 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Get My Files.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Get My Files.jsp @@ -17,7 +17,7 @@ <%@page import="com.ibm.sbt.services.client.connections.files.FileService"%> <%@page import="com.ibm.sbt.services.client.connections.files.Comment"%> <%@page import="com.ibm.sbt.services.client.connections.files.File"%> -<%@page import="com.ibm.sbt.services.client.connections.files.FileList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="java.util.HashMap"%> <%@page import="java.util.List"%> <%@page import="java.util.Map"%> @@ -41,7 +41,7 @@ <% try { FileService fileService = new FileService(); - FileList files = fileService.getMyFiles(); + EntityList files = fileService.getMyFiles(); if(files != null && ! files.isEmpty()) { for (File file : files) { out.println(" " + file.getLabel() + "
" ); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Get My Folders.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Get My Folders.jsp index d4e754b419..e66d514acf 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Get My Folders.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Get My Folders.jsp @@ -17,7 +17,7 @@ <%@page import="com.ibm.sbt.services.client.connections.files.FileService"%> <%@page import="com.ibm.sbt.services.client.connections.files.Comment"%> <%@page import="com.ibm.sbt.services.client.connections.files.File"%> -<%@page import="com.ibm.sbt.services.client.connections.files.FileList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="com.ibm.commons.runtime.Application"%> <%@page import="com.ibm.commons.runtime.Context"%> <%@page import="java.io.PrintWriter"%> @@ -39,7 +39,7 @@ <% try { FileService fileService = new FileService(); - FileList fileEntries = fileService.getMyFolders(null); + EntityList fileEntries = fileService.getMyFolders(null); if(fileEntries != null && ! fileEntries.isEmpty()) { for (File fileEntry : fileEntries) { out.println("Name : " + fileEntry.getLabel() ); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Lock File.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Lock File.jsp index 1a6bea7fba..a33979d79f 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Lock File.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Lock File.jsp @@ -17,7 +17,7 @@ <%@page import="com.ibm.sbt.services.client.connections.files.FileService"%> <%@page import="com.ibm.sbt.services.client.connections.files.Comment"%> <%@page import="com.ibm.sbt.services.client.connections.files.File"%> -<%@page import="com.ibm.sbt.services.client.connections.files.FileList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="java.util.List"%> <%@page import="com.ibm.commons.runtime.Application"%> <%@page import="com.ibm.commons.runtime.Context"%> @@ -37,7 +37,7 @@ <% try { FileService fileService = new FileService(); - FileList fileEntries = fileService.getMyFiles(); + EntityList fileEntries = fileService.getMyFiles(); File fileEntry = fileEntries.get(0); String fileId = fileEntry.getFileId(); out.println(" Locking File" + fileId); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Lock Unlock File.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Lock Unlock File.jsp index 63a86fcff7..527a8e3ab5 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Lock Unlock File.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Lock Unlock File.jsp @@ -17,7 +17,7 @@ <%@page import="com.ibm.sbt.services.client.connections.files.FileService"%> <%@page import="com.ibm.sbt.services.client.connections.files.Comment"%> <%@page import="com.ibm.sbt.services.client.connections.files.File"%> -<%@page import="com.ibm.sbt.services.client.connections.files.FileList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="com.ibm.commons.runtime.Application"%> <%@page import="com.ibm.commons.runtime.Context"%> <%@page import="java.util.Map"%> @@ -39,7 +39,7 @@ <% try { FileService fileService = new FileService(); - FileList fileEntries = fileService.getMyFiles(); + EntityList fileEntries = fileService.getMyFiles(); File fileEntry = fileEntries.get(0); String lock = fileEntry.getLockType(); if ("NONE".equalsIgnoreCase(lock)) { diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Unlock A File.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Unlock A File.jsp index 68b446a3f7..d5b0127383 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Unlock A File.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Unlock A File.jsp @@ -17,7 +17,7 @@ <%@page import="com.ibm.sbt.services.client.connections.files.FileService"%> <%@page import="com.ibm.sbt.services.client.connections.files.Comment"%> <%@page import="com.ibm.sbt.services.client.connections.files.File"%> -<%@page import="com.ibm.sbt.services.client.connections.files.FileList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="java.util.List"%> <%@page import="com.ibm.commons.runtime.Application"%> <%@page import="com.ibm.commons.runtime.Context"%> @@ -35,7 +35,7 @@ <% try { FileService fileService = new FileService(); - FileList fileEntries = fileService.getMyFiles(); + EntityList fileEntries = fileService.getMyFiles(); File fileEntry = fileEntries.get(0); String fileId = fileEntry.getFileId(); out.println(" UnLocking File" + fileId); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Update Community File.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Update Community File.jsp index 57888c4aff..46ecfc4f2a 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Update Community File.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Update Community File.jsp @@ -18,15 +18,14 @@ <%@page import="java.util.Map"%> <%@page import="com.ibm.commons.util.StringUtil"%> <%@page import="com.ibm.sbt.services.client.connections.communities.model.CommunityXPath"%> -<%@page import="com.ibm.sbt.services.client.connections.files.CommentList"%> -<%@page import="com.ibm.sbt.services.client.connections.communities.CommunityList"%> <%@page import="java.io.ByteArrayOutputStream"%> <%@page import="java.io.InputStream"%> <%@page import="com.ibm.sbt.services.client.connections.communities.CommunityService"%> +<%@page import="com.ibm.sbt.services.client.connections.communities.Community"%> <%@page import="com.ibm.sbt.services.client.connections.files.FileService"%> <%@page import="com.ibm.sbt.services.client.connections.files.Comment"%> <%@page import="com.ibm.sbt.services.client.connections.files.File"%> -<%@page import="com.ibm.sbt.services.client.connections.files.FileList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="java.nio.charset.Charset"%> <%@page import="java.io.ByteArrayInputStream"%> <%@page import="java.io.PrintWriter"%> @@ -48,7 +47,7 @@ <% try { CommunityService commService = new CommunityService(); - CommunityList communities = commService.getMyCommunities(); + EntityList communities = commService.getMyCommunities(); if(communities != null && ! communities.isEmpty()) { String communityId = communities.get(0).getCommunityUuid(); @@ -59,7 +58,7 @@ //update Community File's metadata FileService fileService = new FileService(); - FileList files = fileService.getCommunityFiles(communityId, null); + EntityList files = fileService.getCommunityFiles(communityId, null); if(files != null && ! files.isEmpty()) { File fileEntry = files.get(0); String communityLibraryId = fileEntry.getLibraryId(); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Update File.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Update File.jsp index f26d9538f3..ffafd76b9b 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Update File.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Update File.jsp @@ -19,7 +19,7 @@ <%@page import="com.ibm.sbt.services.client.connections.files.FileService"%> <%@page import="com.ibm.sbt.services.client.connections.files.Comment"%> <%@page import="com.ibm.sbt.services.client.connections.files.File"%> -<%@page import="com.ibm.sbt.services.client.connections.files.FileList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="java.util.List"%> <%@page import="java.util.Date"%> <%@page import="com.ibm.sbt.services.endpoints.Endpoint"%> @@ -42,7 +42,7 @@ <% try { FileService fileService = new FileService(); - FileList fileEntries = fileService.getMyFiles(); + EntityList fileEntries = fileService.getMyFiles(); if(fileEntries != null) { File fileEntry = fileEntries.get(0); String fileId = fileEntry.getFileId(); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Upload New Version of a File.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Upload New Version of a File.jsp index d7e656b4fd..d20128fd86 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Upload New Version of a File.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Files/Upload New Version of a File.jsp @@ -14,8 +14,8 @@ * permissions and limitations under the License. */--> -<%@page import="com.ibm.sbt.services.client.connections.communities.CommunityList"%> <%@page import="com.ibm.sbt.services.client.connections.communities.CommunityService"%> +<%@page import="com.ibm.sbt.services.client.connections.communities.Community"%> <%@page import="com.ibm.sbt.services.client.connections.communities.CommunityServiceException"%> <%@page import="java.nio.charset.Charset"%> <%@page import="java.io.ByteArrayInputStream"%> @@ -25,7 +25,7 @@ <%@page import="com.ibm.sbt.services.client.connections.files.FileService"%> <%@page import="com.ibm.sbt.services.client.connections.files.Comment"%> <%@page import="com.ibm.sbt.services.client.connections.files.File"%> -<%@page import="com.ibm.sbt.services.client.connections.files.FileList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="java.util.List"%> <%@page import="java.util.Date"%> <%@page import="com.ibm.sbt.services.endpoints.Endpoint"%> @@ -48,7 +48,7 @@ <% try { FileService fileService = new FileService(); - FileList fileEntries = fileService.getMyFiles(); + EntityList fileEntries = fileService.getMyFiles(); if(fileEntries != null && !fileEntries.isEmpty()) { File fileEntry = fileService.getFile(fileEntries.get(0).getFileId(), false); Map paramsMap = new HashMap(); @@ -65,7 +65,7 @@ // Community Files CommunityService commSvc = new CommunityService(); - CommunityList commList = commSvc.getMyCommunities(); + EntityList commList = commSvc.getMyCommunities(); if(commList != null && !commList.isEmpty()) { // Create Community File diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Create Community Forum Reply.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Create Community Forum Reply.jsp index 388a984ebc..d8c000b2b6 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Create Community Forum Reply.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Create Community Forum Reply.jsp @@ -17,17 +17,13 @@ <%@page import="com.ibm.sbt.services.client.connections.forums.ForumTopic"%> <%@page import="com.ibm.sbt.services.client.connections.forums.ForumReply"%> <%@page import="com.ibm.sbt.services.client.connections.forums.ForumService"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.ForumList"%> <%@page import="com.ibm.sbt.services.client.connections.forums.Forum"%> <%@page import="java.util.Collection"%> <%@page import="java.io.PrintWriter"%> <%@page import="com.ibm.commons.runtime.Context"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.TopicList"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.ReplyList"%> - +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="com.ibm.sbt.services.client.connections.communities.CommunityService"%> <%@page import="com.ibm.sbt.services.client.connections.communities.Community"%> -<%@page import="com.ibm.sbt.services.client.connections.communities.CommunityList"%> <%@page import="java.util.HashMap"%> <%@page import="java.util.ArrayList"%> <%@page import="java.util.List"%> @@ -47,14 +43,14 @@ <% try { CommunityService svc = new CommunityService(); - CommunityList communities = svc.getMyCommunities(); + EntityList communities = svc.getMyCommunities(); Community community = communities.get(0); ForumService service = new ForumService(); Map parameters = new HashMap(); parameters.put("communityUuid", community.getCommunityUuid()); - TopicList topics = service.getPublicForumTopics(parameters); + EntityList topics = service.getPublicForumTopics(parameters); if (topics.size() > 0) { String topicId = ((ForumTopic) topics.get(0)).getTopicUuid(); ForumReply reply = new ForumReply(service, ""); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Create Community Forum Topic.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Create Community Forum Topic.jsp index 564a31be19..6d7fc52607 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Create Community Forum Topic.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Create Community Forum Topic.jsp @@ -14,11 +14,11 @@ * permissions and limitations under the License. */--> -<%@page import="com.ibm.sbt.services.client.connections.communities.CommunityList"%> +<%@page import="com.ibm.sbt.services.client.connections.communities.Community"%> <%@page import="com.ibm.sbt.services.client.connections.communities.CommunityService"%> <%@page import="com.ibm.sbt.services.client.connections.forums.ForumTopic"%> <%@page import="com.ibm.sbt.services.client.connections.forums.ForumService"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.ForumList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="com.ibm.sbt.services.client.connections.forums.Forum"%> <%@page import="java.util.Collection"%> <%@page import="java.io.PrintWriter"%> @@ -40,7 +40,7 @@ try { CommunityService comService = new CommunityService(); - CommunityList comList = comService.getMyCommunities(); + EntityList comList = comService.getMyCommunities(); String communityId = comList.get(0).getCommunityUuid(); ForumService service = new ForumService(); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Create Reply.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Create Reply.jsp index 669e5a6b30..1d3dd8f201 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Create Reply.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Create Reply.jsp @@ -17,13 +17,11 @@ <%@page import="com.ibm.sbt.services.client.connections.forums.ForumTopic"%> <%@page import="com.ibm.sbt.services.client.connections.forums.ForumReply"%> <%@page import="com.ibm.sbt.services.client.connections.forums.ForumService"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.ForumList"%> <%@page import="com.ibm.sbt.services.client.connections.forums.Forum"%> <%@page import="java.util.Collection"%> <%@page import="java.io.PrintWriter"%> <%@page import="com.ibm.commons.runtime.Context"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.TopicList"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.ReplyList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="java.util.HashMap"%> <%@page import="java.util.ArrayList"%> <%@page import="java.util.List"%> @@ -42,7 +40,7 @@ <% try { ForumService service = new ForumService(); - TopicList topics = service.getMyForumTopics(); + EntityList topics = service.getMyForumTopics(); if(topics.size()>0){ String topicId = ((ForumTopic)topics.get(0)).getTopicUuid(); ForumReply reply = new ForumReply(service); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Create Topic.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Create Topic.jsp index 5fdf67d16b..5ed04fa0c5 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Create Topic.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Create Topic.jsp @@ -16,7 +16,7 @@ <%@page import="com.ibm.sbt.services.client.connections.forums.ForumTopic"%> <%@page import="com.ibm.sbt.services.client.connections.forums.ForumService"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.ForumList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="com.ibm.sbt.services.client.connections.forums.Forum"%> <%@page import="java.util.Collection"%> <%@page import="java.io.PrintWriter"%> @@ -40,7 +40,7 @@ try { ForumService service = new ForumService(); - ForumList forums = service.getMyForums(); + EntityList forums = service.getMyForums(); String forumId = ((Forum)forums.get(0)).getForumUuid(); ForumTopic topic = new ForumTopic(service); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Forum By Id.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Forum By Id.jsp index fb59cc406b..90e81be9cf 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Forum By Id.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Forum By Id.jsp @@ -19,7 +19,7 @@ <%@page import="java.io.PrintWriter"%> <%@page import="com.ibm.commons.runtime.Application"%> <%@page import="com.ibm.commons.runtime.Context"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.ForumList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="java.util.*"%> @@ -37,7 +37,7 @@ try { ForumService svc = new ForumService(); - ForumList forums = svc.getPublicForums(); + EntityList forums = svc.getPublicForums(); Forum forum = (Forum)forums.iterator().next(); forum = svc.getForum(forum.getForumUuid()); String title = forum.getTitle(); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Forum Topics Tags.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Forum Topics Tags.jsp index 01dc0e8079..c52fc6d25f 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Forum Topics Tags.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Forum Topics Tags.jsp @@ -23,9 +23,8 @@ <%@page import="java.util.HashMap"%> <%@page import="com.ibm.sbt.services.client.connections.forums.ForumService"%> <%@page import="com.ibm.sbt.services.client.connections.forums.Forum"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.ForumList"%> <%@page import="com.ibm.sbt.services.client.connections.forums.Tag"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.TagList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> @@ -37,10 +36,10 @@ <% try { ForumService svc = new ForumService(); - ForumList forums = svc.getPublicForums(); + EntityList forums = svc.getPublicForums(); String forumId = forums.get(0).getUid(); - TagList tags = svc.getForumTopicsTags(forumId); + EntityList tags = svc.getForumTopicsTags(forumId); if (tags.size() <= 0) { out.println("No tags to be displayed"); } diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Forums Tags.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Forums Tags.jsp index aa769558c3..f71c9761eb 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Forums Tags.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Forums Tags.jsp @@ -23,7 +23,7 @@ <%@page import="java.util.HashMap"%> <%@page import="com.ibm.sbt.services.client.connections.forums.ForumService"%> <%@page import="com.ibm.sbt.services.client.connections.forums.Tag"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.TagList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> @@ -36,7 +36,7 @@ try { ForumService svc = new ForumService(); Map params = new HashMap(); - TagList tags = svc.getForumsTags(); + EntityList tags = svc.getForumsTags(); if (tags.size() <= 0) { out.println("No tags to be displayed"); } diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Get My Forum Entities.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Get My Forum Entities.jsp index 5abe465ab8..bb526b12f1 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Get My Forum Entities.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Get My Forum Entities.jsp @@ -23,15 +23,8 @@ <%@page import="java.io.PrintWriter"%> <%@page import="com.ibm.commons.runtime.Application"%> <%@page import="com.ibm.commons.runtime.Context"%> -<%@page - import="com.ibm.sbt.services.client.connections.forums.model.BaseForumEntity"%> <%@page import="com.ibm.sbt.services.client.connections.forums.Forum"%> -<%@page - import="com.ibm.sbt.services.client.connections.forums.ForumList"%> -<%@page - import="com.ibm.sbt.services.client.connections.forums.TopicList"%> -<%@page - import="com.ibm.sbt.services.client.connections.forums.ReplyList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="com.ibm.sbt.services.client.connections.forums.ForumReply"%> <%@page import="com.ibm.commons.util.StringUtil"%> @@ -50,11 +43,11 @@
<%! String addForumReply(ForumService svc, String postUuid) throws Exception { - ReplyList replyReplies = svc.getForumReplyReplies(postUuid); + EntityList replyReplies = svc.getForumReplyReplies(postUuid); StringBuilder tree = new StringBuilder(); tree.append("
    "); if (replyReplies.size() > 0) { - for (BaseForumEntity replyOnAReply : replyReplies) { + for (ForumReply replyOnAReply : replyReplies) { if (StringUtil.equalsIgnoreCase(((ForumReply) replyOnAReply).getReplyToPostUuid(),postUuid)) { tree.append("
    • "+ replyOnAReply.getTitle()); if (!(((ForumReply) replyOnAReply).isDeleted())) { @@ -69,11 +62,11 @@ } String addTopicReply(ForumService svc, String postUuid) throws Exception { - ReplyList topicReplies = svc.getForumTopicReplies(postUuid); + EntityList topicReplies = svc.getForumTopicReplies(postUuid); StringBuilder tree = new StringBuilder(); tree.append("
        "); if (topicReplies.size() > 0) { - for (BaseForumEntity replyOnATopic : topicReplies) { + for (ForumReply replyOnATopic : topicReplies) { if (StringUtil.equalsIgnoreCase(((ForumReply) replyOnATopic).getReplyToPostUuid(),postUuid)) { tree.append("
        • "+ replyOnATopic.getTitle()); if (!(((ForumReply) replyOnATopic).isDeleted())) { @@ -91,11 +84,11 @@ ForumService svc = new ForumService(); String myForumId = svc.getMyForums().get(0).getUid(); - TopicList topics = svc.getForumTopics(myForumId); + EntityList topics = svc.getForumTopics(myForumId); if (topics.size() > 0) { out.println("Total No. of Topics in Forum :"+topics.size()+"

          "); - for (Iterator iterator = topics.iterator(); iterator.hasNext();) { - ForumTopic topic = (ForumTopic)iterator.next(); + for (Iterator iterator = topics.iterator(); iterator.hasNext();) { + ForumTopic topic = iterator.next(); out.println("Topic Title:"+topic.getTitle()+"
          "); StringBuilder heiararchy = new StringBuilder(); heiararchy.append(addTopicReply(svc,topic.getUid())); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Get Recommendations.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Get Recommendations.jsp index 0d40b63079..d49258547f 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Get Recommendations.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Get Recommendations.jsp @@ -16,9 +16,8 @@ <%@page import="com.ibm.sbt.services.client.connections.forums.ForumTopic"%> <%@page import="com.ibm.sbt.services.client.connections.forums.ForumService"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.TopicList"%> <%@page import="com.ibm.sbt.services.client.connections.forums.Recommendation"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.RecommendationList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="java.io.PrintWriter"%> <%@page import="com.ibm.commons.runtime.Application"%> <%@page import="com.ibm.commons.runtime.Context"%> @@ -36,9 +35,9 @@ try { ForumService svc = new ForumService(); - TopicList forums = svc.getMyForumTopics(); + EntityList forums = svc.getMyForumTopics(); ForumTopic topic = (ForumTopic) forums.iterator().next(); - RecommendationList recommendations = svc.getRecommendations(topic.getTopicUuid()); + EntityList recommendations = svc.getRecommendations(topic.getTopicUuid()); if (recommendations.size() > 0) { out.println("List of users who recommended this thread"+ topic.getRecommendationCount()); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/My Forums.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/My Forums.jsp index dfcc69c397..219d0a6026 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/My Forums.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/My Forums.jsp @@ -15,13 +15,12 @@ */--> <%@page import="com.ibm.sbt.services.client.connections.forums.ForumService"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.model.BaseForumEntity"%> <%@page import="com.ibm.sbt.services.client.base.BaseEntity"%> <%@page import="com.ibm.sbt.services.client.connections.forums.Forum"%> <%@page import="java.io.PrintWriter"%> <%@page import="com.ibm.commons.runtime.Application"%> <%@page import="com.ibm.commons.runtime.Context"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.ForumList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="java.util.*"%> @@ -41,11 +40,11 @@ try { ForumService svc = new ForumService(); - ForumList forums = svc.getMyForums(); + EntityList forums = svc.getMyForums(); out.println("
          Listing My forums , Total forums found : "+forums.getTotalResults()); out.println("
          "); - for (BaseForumEntity forum : forums) { + for (Forum forum : forums) { out.println("Name : " + forum.getTitle()); out.println("
          "); } diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/My Topics.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/My Topics.jsp index 2e63a497a6..8c06cbf19d 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/My Topics.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/My Topics.jsp @@ -18,8 +18,8 @@ <%@page import="com.ibm.sbt.services.client.connections.forums.ForumService"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.model.BaseForumEntity"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.TopicList"%> +<%@page import="com.ibm.sbt.services.client.connections.forums.ForumTopic"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="com.ibm.sbt.services.client.connections.common.Person"%> <%@page import="java.io.PrintWriter"%> <%@page import="com.ibm.sbt.services.client.connections.activitystreams.model.Reply"%> @@ -37,12 +37,12 @@ <% try { ForumService _service = new ForumService(); - TopicList _entries = (TopicList)_service.getMyForumTopics(); + EntityList _entries = _service.getMyForumTopics(); if (_entries.size() <= 0) out.println("No updates to be displayed"); - for (BaseForumEntity entry : _entries) { + for (ForumTopic entry : _entries) { Person author = entry.getAuthor(); out.println("uid of forum :"+entry.getUid()+"
          "); out.println("date published :"+entry.getPublished()+"
          "); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Public Forums.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Public Forums.jsp index 6ebfe18567..f4607b3911 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Public Forums.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Public Forums.jsp @@ -18,10 +18,9 @@ <%@page import="com.ibm.sbt.services.client.connections.forums.ForumService"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.model.BaseForumEntity"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.TopicList"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.ForumList"%> +<%@page import="com.ibm.sbt.services.client.connections.forums.Forum"%> <%@page import="com.ibm.sbt.services.client.connections.common.Person"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="java.io.PrintWriter"%> <%@page import="com.ibm.sbt.services.client.connections.activitystreams.model.Reply"%> <%@page import="java.util.List"%> @@ -40,12 +39,12 @@ <% try { ForumService _service = new ForumService(); - ForumList _entries = _service.getPublicForums(); + EntityList _entries = _service.getPublicForums(); if (_entries.size() <= 0) out.println("No updates to be displayed"); - for (BaseForumEntity entry : _entries) { + for (Forum entry : _entries) { Person author = entry.getAuthor(); out.println("uid of forum :"+entry.getUid()); out.println("date published :"+entry.getPublished()); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Remove Forum.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Remove Forum.jsp index 151ff2177a..a489bf4e45 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Remove Forum.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Remove Forum.jsp @@ -20,7 +20,7 @@ <%@page import="com.ibm.commons.runtime.Application"%> <%@page import="com.ibm.commons.runtime.Context"%> <%@page import="com.ibm.sbt.services.client.connections.forums.Forum"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.ForumList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="java.util.HashMap"%> <%@page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> @@ -36,7 +36,7 @@ <% try { ForumService service = new ForumService(); - ForumList forums = service.getMyForums(); + EntityList forums = service.getMyForums(); if(forums != null && !forums.isEmpty()){ Forum forum = (Forum)forums.iterator().next(); out.println(" Forum Title : "+forum.getTitle()); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Remove Reply.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Remove Reply.jsp index a80f3e401b..594ee30d7b 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Remove Reply.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Remove Reply.jsp @@ -22,9 +22,7 @@ <%@page import="com.ibm.commons.runtime.Application"%> <%@page import="com.ibm.commons.runtime.Context"%> <%@page import="com.ibm.sbt.services.client.connections.forums.Forum"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.ForumList"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.TopicList"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.ReplyList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="java.util.HashMap"%> <%@page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> @@ -41,10 +39,10 @@ try { ForumService svc = new ForumService(); - TopicList topics = svc.getMyForumTopics(); + EntityList topics = svc.getMyForumTopics(); if(topics.size()>0){ ForumTopic topic = (ForumTopic)topics.iterator().next(); - ReplyList replies = svc.getForumTopicReplies(topic.getTopicUuid()); + EntityList replies = svc.getForumTopicReplies(topic.getTopicUuid()); if(replies.size()>0){ ForumReply reply = (ForumReply)replies.iterator().next(); ForumReply retrievedReply = svc.getForumReply(reply.getReplyUuid()); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Remove Topic.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Remove Topic.jsp index bd77a74bd2..d801e6e738 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Remove Topic.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Remove Topic.jsp @@ -16,7 +16,7 @@ <%@page import="com.ibm.sbt.services.client.connections.forums.ForumTopic"%> <%@page import="com.ibm.sbt.services.client.connections.forums.ForumService"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.TopicList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="java.io.PrintWriter"%> <%@page import="java.util.Collection"%> <%@page import="com.ibm.commons.runtime.Application"%> @@ -36,7 +36,7 @@ <% try { ForumService service = new ForumService(); - TopicList topics = service.getMyForumTopics(); + EntityList topics = service.getMyForumTopics(); if(topics != null && !topics.isEmpty()){ ForumTopic topic = (ForumTopic)topics.iterator().next(); out.println(" Topic Title : "+topic.getTitle()); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Replies For A Topic.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Replies For A Topic.jsp index 877fbdb47d..2f9e5c07c5 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Replies For A Topic.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Replies For A Topic.jsp @@ -20,12 +20,9 @@ <%@page import="java.io.PrintWriter"%> <%@page import="com.ibm.commons.runtime.Application"%> <%@page import="com.ibm.commons.runtime.Context"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.model.BaseForumEntity"%> <%@page import="com.ibm.sbt.services.client.connections.forums.Forum"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.ForumList"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.TopicList"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.ReplyList"%> <%@page import="com.ibm.sbt.services.client.connections.forums.ForumReply"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="java.util.*"%> @@ -45,12 +42,12 @@ try { ForumService svc = new ForumService(); - TopicList topics = svc.getMyForumTopics(); + EntityList topics = svc.getMyForumTopics(); if(topics.size()>0){ ForumTopic topic = (ForumTopic)topics.iterator().next(); - ReplyList replies = svc.getForumTopicReplies(topic.getTopicUuid()); + EntityList replies = svc.getForumTopicReplies(topic.getTopicUuid()); if(replies.size()>0){ - for (BaseForumEntity reply : replies) { + for (ForumReply reply : replies) { out.println("reply title : "+reply.getTitle()+"
          "); out.println("replied on Post with Id : "+((ForumReply)reply).getReplyToPostUuid()+"
          "); out.println("

          "); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Reply By Id.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Reply By Id.jsp index 17b633e7c8..e94792e515 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Reply By Id.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Reply By Id.jsp @@ -17,11 +17,8 @@ <%@page import="com.ibm.sbt.services.client.connections.forums.ForumReply"%> <%@page import="com.ibm.sbt.services.client.connections.forums.ForumTopic"%> <%@page import="com.ibm.sbt.services.client.connections.forums.ForumService"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.model.BaseForumEntity"%> <%@page import="com.ibm.sbt.services.client.connections.forums.Forum"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.ForumList"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.TopicList"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.ReplyList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="java.io.PrintWriter"%> <%@page import="com.ibm.commons.runtime.Application"%> <%@page import="com.ibm.commons.runtime.Context"%> @@ -44,13 +41,12 @@ try { ForumService svc = new ForumService(); - TopicList topics = svc.getMyForumTopics(); + EntityList topics = svc.getMyForumTopics(); if(topics.size()>0){ - ForumTopic topic = (ForumTopic)topics.iterator().next(); - ReplyList replies = svc.getForumTopicReplies(topic.getTopicUuid()); + ForumTopic topic = topics.iterator().next(); + EntityList replies = svc.getForumTopicReplies(topic.getTopicUuid()); if(replies.size()>0){ - ForumReply reply = (ForumReply)replies.iterator().next(); - + ForumReply reply = replies.iterator().next(); if(!reply.isDeleted()){ ForumReply retrievedReply = svc.getForumReply(reply.getReplyUuid()); out.println("reply title : "+retrievedReply.getTitle()); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Topic By Id.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Topic By Id.jsp index 1bde585151..99114496c9 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Topic By Id.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Topic By Id.jsp @@ -16,9 +16,8 @@ <%@page import="com.ibm.sbt.services.client.connections.forums.ForumTopic"%> <%@page import="com.ibm.sbt.services.client.connections.forums.ForumService"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.TopicList"%> <%@page import="com.ibm.sbt.services.client.connections.forums.Recommendation"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.RecommendationList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="java.io.PrintWriter"%> <%@page import="com.ibm.commons.runtime.Application"%> <%@page import="com.ibm.commons.runtime.Context"%> @@ -38,7 +37,7 @@ try { ForumService svc = new ForumService(); - TopicList forums = svc.getMyForumTopics(); + EntityList forums = svc.getMyForumTopics(); ForumTopic topic = (ForumTopic) forums.iterator().next(); ForumTopic retrievedtopic = svc.getForumTopic(topic .getTopicUuid()); @@ -48,7 +47,7 @@ out.println("Topic is locked : " + topic.isLocked() + "
          "); out.println("Topic is question : " + topic.isQuestion() + "
          "); - RecommendationList recommendations = retrievedtopic.getRecommendations(); + EntityList recommendations = retrievedtopic.getRecommendations(); if (recommendations.size() > 0) { out.println("List of users who recommended this thread"+ topic.getRecommendationCount()); for (Recommendation recommendation : recommendations) diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Topics For A Forum.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Topics For A Forum.jsp index ec51a28b40..4dd3832270 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Topics For A Forum.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Topics For A Forum.jsp @@ -16,18 +16,14 @@ <%@page import="com.ibm.sbt.services.client.connections.forums.ForumService"%> -<%@page - import="com.ibm.sbt.services.client.connections.forums.model.BaseForumEntity"%> -<%@page - import="com.ibm.sbt.services.client.connections.forums.TopicList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="com.ibm.sbt.services.client.connections.forums.Forum"%> +<%@page import="com.ibm.sbt.services.client.connections.forums.ForumTopic"%> <%@page import="com.ibm.sbt.services.client.connections.common.Person"%> <%@page import="java.io.PrintWriter"%> <%@page import="com.ibm.commons.runtime.Application"%> <%@page import="com.ibm.commons.runtime.Context"%> -<%@page - import="com.ibm.sbt.services.client.connections.forums.ForumList"%> <%@page import="java.util.*"%> @@ -47,11 +43,11 @@ try { ForumService svc = new ForumService(); - ForumList forums = svc.getPublicForums(); + EntityList forums = svc.getPublicForums(); Forum forum = (Forum) forums.iterator().next(); - TopicList topics = svc.getForumTopics(forum.getForumUuid()); + EntityList topics = svc.getForumTopics(forum.getForumUuid()); if (topics.size() > 0) { - for (BaseForumEntity entry : topics) { + for (ForumTopic entry : topics) { Person author = entry.getAuthor(); out.println("uid of forum :" + entry.getUid() + "
          "); out.println("date published :" + entry.getPublished() + "
          "); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Update Forum.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Update Forum.jsp index 48d74c6e36..2f1e38dd46 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Update Forum.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Update Forum.jsp @@ -19,7 +19,7 @@ <%@page import="java.util.Collection"%> <%@page import="java.io.PrintWriter"%> <%@page import="com.ibm.commons.runtime.Context"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.ForumList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="java.util.HashMap"%> <%@page import="java.util.ArrayList"%> <%@page import="java.util.List"%> @@ -38,7 +38,7 @@ <% try { ForumService service = new ForumService(); - ForumList forums = service.getMyForums(); + EntityList forums = service.getMyForums(); if(forums.size() > 0){ Forum forum = (Forum)forums.get(0); long randomNumber = System.currentTimeMillis(); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Update Reply.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Update Reply.jsp index 16121677ff..5828627fab 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Update Reply.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Update Reply.jsp @@ -16,14 +16,12 @@ <%@page import="com.ibm.sbt.services.client.connections.forums.ForumReply"%> <%@page import="com.ibm.sbt.services.client.connections.forums.ForumService"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.ForumList"%> <%@page import="com.ibm.sbt.services.client.connections.forums.Forum"%> <%@page import="java.util.Collection"%> <%@page import="java.io.PrintWriter"%> <%@page import="com.ibm.commons.runtime.Context"%> <%@page import="com.ibm.sbt.services.client.connections.forums.ForumTopic"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.TopicList"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.ReplyList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="java.util.HashMap"%> <%@page import="java.util.ArrayList"%> <%@page import="java.util.List"%> @@ -43,10 +41,10 @@ try { ForumService service = new ForumService(); - TopicList topics = service.getMyForumTopics(); + EntityList topics = service.getMyForumTopics(); if(topics.size()>0){ String topicId = topics.get(0).getUid(); - ReplyList replies = service.getForumTopicReplies(topicId); + EntityList replies = service.getForumTopicReplies(topicId); if(replies.size()>0){ ForumReply reply = (ForumReply)replies.iterator().next(); reply.setTopicUuid(topicId); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Update Topic.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Update Topic.jsp index 6909c8f187..45c8cc447a 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Update Topic.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Forums/Update Topic.jsp @@ -16,12 +16,11 @@ <%@page import="com.ibm.sbt.services.client.connections.forums.ForumTopic"%> <%@page import="com.ibm.sbt.services.client.connections.forums.ForumService"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.TopicList"%> <%@page import="com.ibm.sbt.services.client.connections.forums.Forum"%> <%@page import="java.util.Collection"%> <%@page import="java.io.PrintWriter"%> <%@page import="com.ibm.commons.runtime.Context"%> -<%@page import="com.ibm.sbt.services.client.connections.forums.ForumList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="java.util.HashMap"%> <%@page import="java.util.ArrayList"%> <%@page import="java.util.List"%> @@ -40,7 +39,7 @@ <% try { ForumService service = new ForumService(); - TopicList topicList = service.getMyForumTopics(); + EntityList topicList = service.getMyForumTopics(); if(topicList.size() > 0){ ForumTopic topic = (ForumTopic)topicList.iterator().next(); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Profiles/Check Colleague.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Profiles/Check Colleague.jsp index 8ee0f2a14d..053de89714 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Profiles/Check Colleague.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Profiles/Check Colleague.jsp @@ -22,7 +22,7 @@ <%@page import="com.ibm.sbt.services.client.connections.profiles.ProfileService"%> <%@page import="com.ibm.sbt.services.client.connections.profiles.Profile"%> <%@page import="com.ibm.sbt.services.client.connections.profiles.ColleagueConnection"%> -<%@page import="com.ibm.sbt.services.client.connections.profiles.ColleagueConnectionList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> @@ -36,7 +36,7 @@ String sourceUserId = Context.get().getProperty("sample.id1"); String targetUserId; ProfileService connProfSvc = new ProfileService(); - ColleagueConnectionList colleagues = connProfSvc.getColleagueConnections(sourceUserId); + EntityList colleagues = connProfSvc.getColleagueConnections(sourceUserId); if(colleagues != null && ! colleagues.isEmpty()) { ColleagueConnection colleague = colleagues.iterator().next(); targetUserId = colleague.getContributorUserId(); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Profiles/Get Colleagues By Profile Entity.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Profiles/Get Colleagues By Profile Entity.jsp index 3fa107051b..b1af9267b1 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Profiles/Get Colleagues By Profile Entity.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Profiles/Get Colleagues By Profile Entity.jsp @@ -21,7 +21,7 @@ <%@page import="java.io.PrintWriter"%> <%@page import="com.ibm.sbt.services.client.connections.profiles.ProfileService"%> <%@page import="com.ibm.sbt.services.client.connections.profiles.Profile"%> -<%@page import="com.ibm.sbt.services.client.connections.profiles.ProfileList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page import="java.util.Map"%> <%@page import="java.util.HashMap"%> <%@page import="java.util.List"%> @@ -42,7 +42,7 @@ Profile profile = connProfSvc.getProfile(userId); if (profile != null) { - ProfileList colleagues = profile.getColleagues(); + EntityList colleagues = profile.getColleagues(); if(colleagues != null && ! colleagues.isEmpty()) { for (Profile colleague : colleagues) { diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Profiles/Get Colleagues.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Profiles/Get Colleagues.jsp index 478d92e67c..fa5abfa68b 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Profiles/Get Colleagues.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Profiles/Get Colleagues.jsp @@ -25,7 +25,7 @@ <%@page import="java.util.Iterator"%> <%@page import="com.ibm.sbt.services.client.connections.profiles.ProfileService"%> <%@page import="com.ibm.sbt.services.client.connections.profiles.Profile"%> -<%@page import="com.ibm.sbt.services.client.connections.profiles.ProfileList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> @@ -38,10 +38,10 @@ try { String userId = Context.get().getProperty("sample.userId1"); ProfileService connProfSvc = new ProfileService(); - ProfileList profiles = connProfSvc.getColleagues(userId); + EntityList profiles = connProfSvc.getColleagues(userId); if(profiles != null && ! profiles.isEmpty()) { - for (Iterator iterator = profiles.iterator(); iterator.hasNext();) { - Profile profile = (Profile)iterator.next(); + for (Iterator iterator = profiles.iterator(); iterator.hasNext();) { + Profile profile = iterator.next(); out.println("Name : " + profile.getName()); out.println("
          "); } diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Profiles/Get Common Colleagues.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Profiles/Get Common Colleagues.jsp index 10e270495d..d6a06c2d98 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Profiles/Get Common Colleagues.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Profiles/Get Common Colleagues.jsp @@ -25,7 +25,7 @@ <%@page import="java.util.Iterator"%> <%@page import="com.ibm.sbt.services.client.connections.profiles.ProfileService"%> <%@page import="com.ibm.sbt.services.client.connections.profiles.Profile"%> -<%@page import="com.ibm.sbt.services.client.connections.profiles.ProfileList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> @@ -43,13 +43,13 @@ Map params = new HashMap(); params.put("inclMessage", "true"); - ProfileList entries = connProfSvc.getCommonColleagues(userId1, userId2); + EntityList entries = connProfSvc.getCommonColleagues(userId1, userId2); if (entries != null && !entries.isEmpty()) { out.println(" User's colleagues "); out.println("
          "); - for (Iterator iterator = entries.iterator(); iterator.hasNext();) { - Profile entry = (Profile) iterator.next(); + for (Iterator iterator = entries.iterator(); iterator.hasNext();) { + Profile entry = iterator.next(); out.println(entry.getName()); out.println("
          "); } diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Profiles/Get People Managed.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Profiles/Get People Managed.jsp index 2d7ad0c6f6..c487d0b12d 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Profiles/Get People Managed.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Profiles/Get People Managed.jsp @@ -25,7 +25,7 @@ <%@page import="java.util.Iterator"%> <%@page import="com.ibm.sbt.services.client.connections.profiles.ProfileService"%> <%@page import="com.ibm.sbt.services.client.connections.profiles.Profile"%> -<%@page import="com.ibm.sbt.services.client.connections.profiles.ProfileList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> @@ -39,9 +39,9 @@ ProfileService connProfSvc = new ProfileService(); Map params = new HashMap(); params.put("userid", userId); - ProfileList profiles = connProfSvc.getPeopleManaged(userId,params); + EntityList profiles = connProfSvc.getPeopleManaged(userId,params); if(profiles != null && ! profiles.isEmpty()) { - for (Iterator iterator = profiles.iterator(); iterator.hasNext();) { + for (Iterator iterator = profiles.iterator(); iterator.hasNext();) { Profile profile = (Profile)iterator.next(); out.println("Name : " + profile.getName()); out.println("
          "); diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Profiles/Get Reporting Chain.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Profiles/Get Reporting Chain.jsp index 35787dcc20..cbabc7f76b 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Profiles/Get Reporting Chain.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Profiles/Get Reporting Chain.jsp @@ -25,7 +25,7 @@ <%@page import="java.util.Iterator"%> <%@page import="com.ibm.sbt.services.client.connections.profiles.ProfileService"%> <%@page import="com.ibm.sbt.services.client.connections.profiles.Profile"%> -<%@page import="com.ibm.sbt.services.client.connections.profiles.ProfileList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> @@ -39,10 +39,10 @@ ProfileService connProfSvc = new ProfileService(); Map params = new HashMap(); params.put("userid", userId); - ProfileList profiles = connProfSvc.getReportingChain(userId, params); + EntityList profiles = connProfSvc.getReportingChain(userId, params); if(profiles != null && ! profiles.isEmpty()) { - for (Iterator iterator = profiles.iterator(); iterator.hasNext();) { - Profile profile = (Profile)iterator.next(); + for (Iterator iterator = profiles.iterator(); iterator.hasNext();) { + Profile profile = iterator.next(); out.println("Name : " + profile.getName()); out.println("
          "); } diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Profiles/Get Tags.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Profiles/Get Tags.jsp index 79adf2c32b..bc0daaa86e 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Profiles/Get Tags.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Profiles/Get Tags.jsp @@ -21,11 +21,9 @@ <%@page import="java.io.PrintWriter"%> <%@page import="java.util.Map"%> <%@page import="java.util.HashMap"%> -<%@page - import="com.ibm.sbt.services.client.connections.profiles.ProfileService"%> +<%@page import="com.ibm.sbt.services.client.connections.profiles.ProfileService"%> <%@page import="com.ibm.sbt.services.client.connections.profiles.Tag"%> -<%@page - import="com.ibm.sbt.services.client.connections.profiles.TagList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> @@ -39,7 +37,7 @@ String userEmail = Context.get().getProperty("sample.email1"); ProfileService connProfSvc = new ProfileService(); Map params = new HashMap(); - TagList tags = connProfSvc.getTags(userEmail, params); + EntityList tags = connProfSvc.getTags(userEmail, params); if (tags.size() <= 0) { out.println("No tags to be displayed"); } diff --git a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Profiles/Search Profiles.jsp b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Profiles/Search Profiles.jsp index 34aedf9ca9..ce8f6758b9 100644 --- a/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Profiles/Search Profiles.jsp +++ b/samples/j2ee/snippets/com.ibm.sbt.sample.web/src/main/webapp/samples/java/Social/Profiles/Search Profiles.jsp @@ -25,7 +25,7 @@ <%@page import="java.util.HashMap"%> <%@page import="com.ibm.sbt.services.client.connections.profiles.ProfileService"%> <%@page import="com.ibm.sbt.services.client.connections.profiles.Profile"%> -<%@page import="com.ibm.sbt.services.client.connections.profiles.ProfileList"%> +<%@page import="com.ibm.sbt.services.client.base.datahandlers.EntityList"%> <%@page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> @@ -38,9 +38,9 @@ ProfileService connProfSvc = new ProfileService(); Map params = new HashMap(); params.put("name","Frank"); - ProfileList profiles = connProfSvc.searchProfiles(params); + EntityList profiles = connProfSvc.searchProfiles(params); if(profiles != null && ! profiles.isEmpty()) { - for (Iterator iterator = profiles.iterator(); iterator.hasNext();) { + for (Iterator iterator = profiles.iterator(); iterator.hasNext();) { Profile profile = (Profile)iterator.next(); out.println("Name : " + profile.getName()); out.println("
          "); diff --git a/sdk/com.ibm.sbt.core.test/src/test/java/com/ibm/sbt/services/client/connections/files/FileDownloadTest.java b/sdk/com.ibm.sbt.core.test/src/test/java/com/ibm/sbt/services/client/connections/files/FileDownloadTest.java index 41d85b5539..d1f763a34c 100644 --- a/sdk/com.ibm.sbt.core.test/src/test/java/com/ibm/sbt/services/client/connections/files/FileDownloadTest.java +++ b/sdk/com.ibm.sbt.core.test/src/test/java/com/ibm/sbt/services/client/connections/files/FileDownloadTest.java @@ -26,6 +26,7 @@ import com.ibm.commons.util.StringUtil; import com.ibm.commons.xml.XMLException; import com.ibm.sbt.services.BaseUnitTest; +import com.ibm.sbt.services.client.ClientServicesException; import com.ibm.sbt.services.client.base.datahandlers.EntityList; import com.ibm.sbt.services.client.connections.communities.CommunityService; import com.ibm.sbt.services.client.connections.communities.CommunityServiceException; @@ -155,7 +156,7 @@ private String createCommunity(String baseName, String type) throws CommunitySer return communityService.createCommunity(title, content, type); } - private File uploadCommunityFile(String baseName, String communityUuid) throws FileServiceException, XMLException { + private File uploadCommunityFile(String baseName, String communityUuid) throws ClientServicesException, XMLException { String name = baseName + System.currentTimeMillis(); byte[] bytes = name.getBytes(); @@ -168,7 +169,7 @@ private File uploadCommunityFile(String baseName, String communityUuid) throws F return file; } - private File uploadFile(String baseName) throws FileServiceException, XMLException { + private File uploadFile(String baseName) throws ClientServicesException, XMLException { String name = baseName + System.currentTimeMillis(); byte[] bytes = name.getBytes(); diff --git a/sdk/com.ibm.sbt.core.test/src/test/java/com/ibm/sbt/services/client/connections/files/FileServiceTest.java b/sdk/com.ibm.sbt.core.test/src/test/java/com/ibm/sbt/services/client/connections/files/FileServiceTest.java index 31f2bb52ac..76ed42cc34 100644 --- a/sdk/com.ibm.sbt.core.test/src/test/java/com/ibm/sbt/services/client/connections/files/FileServiceTest.java +++ b/sdk/com.ibm.sbt.core.test/src/test/java/com/ibm/sbt/services/client/connections/files/FileServiceTest.java @@ -51,7 +51,7 @@ public class FileServiceTest extends BaseUnitTest { @Test public void testReadFile() throws Exception { FileService fileService = new FileService(); - FileList listOfFiles = fileService.getMyFiles(); + EntityList listOfFiles = fileService.getMyFiles(); String testFileId = listOfFiles.get(0).getFileId(); File entry = fileService.getFile(testFileId, true); assertEquals(entry.getCategory(), "document"); @@ -61,7 +61,7 @@ public void testReadFile() throws Exception { @Test public void testReadFileWithLoadFalse() throws Exception { FileService fileService = new FileService(); - FileList listOfFiles = fileService.getMyFiles(); + EntityList listOfFiles = fileService.getMyFiles(); String testFileId = listOfFiles.get(0).getFileId(); File entry = fileService.getFile(testFileId, false); assertNull(entry.getCategory()); @@ -189,7 +189,7 @@ public void testGetFilesInFolder() throws Exception { //TODO: fix for smartcloud if (TestEnvironment.isSmartCloudEnvironment()) return; FileService fileService = new FileService(); - FileList listOfFolders = fileService.getMyFolders(); + EntityList listOfFolders = fileService.getMyFolders(); String testFolderId = listOfFolders.get(0).getFileId(); List fileEntries = fileService.getFilesInFolder(testFolderId, null); if (fileEntries != null && !fileEntries.isEmpty()) { @@ -215,9 +215,9 @@ public void testGetAllUserFiles() throws Exception { @Test public void testGetAllFileComments() throws Exception { FileService fileService = new FileService(); - FileList files = fileService.getMyFiles(); + EntityList files = fileService.getMyFiles(); String fileId = files.get(0).getFileId(); - CommentList commentEntries = fileService.getAllFileComments(fileId, null); + EntityList commentEntries = fileService.getAllFileComments(fileId, null); if (commentEntries != null && !commentEntries.isEmpty()) { for (Comment fEntry : commentEntries) { assertNotNull(fEntry.getComment()); @@ -230,7 +230,7 @@ public void testGetFilesComments() throws Exception { //TODO: fix for smartcloud if (TestEnvironment.isSmartCloudEnvironment()) return; FileService fileService = new FileService(); - FileList files = fileService.getPublicFiles(); + EntityList files = fileService.getPublicFiles(); assertNotNull(files); File file = files.get(0); if (null == file) { @@ -238,7 +238,7 @@ public void testGetFilesComments() throws Exception { return; } String fileId = file.getFileId(); - CommentList commentEntries = fileService.getAllUserFileComments(fileId, TestEnvironment.getCurrentUserUuid(), true, null); + EntityList commentEntries = fileService.getAllUserFileComments(fileId, TestEnvironment.getCurrentUserUuid(), true, null); if (!commentEntries.isEmpty()) { if (commentEntries != null && !commentEntries.isEmpty()) { for (Comment fEntry : commentEntries) { @@ -262,7 +262,7 @@ public void testGetFilesInMyRecycleBin() throws Exception { @Test public void testUpdateFileMetadata() throws Exception { FileService fileService = new FileService(); - FileList listOfFiles = fileService.getMyFiles(); + EntityList listOfFiles = fileService.getMyFiles(); String testFileId = listOfFiles.get(0).getFileId(); File fileEntry = fileService.getFile(testFileId, false); Map paramsMap = new HashMap(); @@ -279,7 +279,7 @@ public void testLock() throws Exception { //TODO: fix for smartcloud if (TestEnvironment.isSmartCloudEnvironment()) return; FileService fileService = new FileService(); - FileList listOfFiles = fileService.getMyFiles(); + EntityList listOfFiles = fileService.getMyFiles(); File file = listOfFiles.get(0); if (file.isLocked()) { file.unlock(); @@ -296,7 +296,7 @@ public void testUnlock() throws Exception { //TODO: fix for smartcloud if (TestEnvironment.isSmartCloudEnvironment()) return; FileService fileService = new FileService(); - FileList listOfFiles = fileService.getMyFiles(); + EntityList listOfFiles = fileService.getMyFiles(); File file = listOfFiles.get(0); if (!file.isLocked()) { file.lock(); @@ -313,7 +313,7 @@ public void testPinAndUnPin() throws Exception { //TODO: fix for smartcloud if (TestEnvironment.isSmartCloudEnvironment()) return; FileService fileService = new FileService(); - FileList listOfFiles = fileService.getMyFiles(); + EntityList listOfFiles = fileService.getMyFiles(); String testFileId = listOfFiles.get(0).getFileId(); fileService.pinFile(testFileId); @@ -332,7 +332,7 @@ public void testPinAndUnPin() throws Exception { @Test public void testDelete() throws Exception { FileService fileService = new FileService(); - FileList listOfFiles = fileService.getMyFiles(); + EntityList listOfFiles = fileService.getMyFiles(); String testDeleteFileId = listOfFiles.get(0).getFileId(); fileService.deleteFile(testDeleteFileId); } @@ -340,7 +340,7 @@ public void testDelete() throws Exception { @Test public void testAddCommentToFile() throws Exception { FileService fileService = new FileService(); - FileList listOfFiles = fileService.getMyFiles(); + EntityList listOfFiles = fileService.getMyFiles(); String testFileId = listOfFiles.get(0).getFileId(); File fileEntry = fileService.getFile(testFileId, true); String comment = "Junit Comment - Added from FileServiceTest, testAddCommentToFile"; @@ -352,7 +352,7 @@ public void testAddCommentToFile() throws Exception { @Test public void testAddCommentToMyFile() throws Exception { FileService fileService = new FileService(); - FileList listOfFiles = fileService.getMyFiles(); + EntityList listOfFiles = fileService.getMyFiles(); String testFileId = listOfFiles.get(0).getFileId(); File fileEntry = fileService.getFile(testFileId, true); String comment = "Junit Comment - Added from FileServiceTest, testAddCommentToMyFile"; @@ -381,7 +381,7 @@ public void testGetNonce() { String nonce = null; try { nonce = fileService.getNonce(); - } catch (FileServiceException e) { + } catch (ClientServicesException e) { } assertNotNull(nonce); @@ -392,12 +392,12 @@ public void testAddRemoveFileToFolders() throws Exception { //TODO: fix for smartcloud if (TestEnvironment.isSmartCloudEnvironment()) return; FileService fileService = new FileService(); - FileList folders = fileService.getMyFolders(); + EntityList folders = fileService.getMyFolders(); List listOfFolderIds = new ArrayList(); for(File folder : folders) { listOfFolderIds.add(folder.getFileId()); } - FileList listOfFiles = fileService.getMyFiles(); + EntityList listOfFiles = fileService.getMyFiles(); String fileId = listOfFiles.get(0).getFileId(); fileService.addFileToFolders(fileId, listOfFolderIds); @@ -410,7 +410,7 @@ public void testAddRemoveFileToFolders() throws Exception { @Test public void testCreateComment() throws Exception { FileService fileService = new FileService(); - FileList listOfFiles = fileService.getMyFiles(); + EntityList listOfFiles = fileService.getMyFiles(); String fileId = listOfFiles.get(0).getFileId(); String comment = "TestCreateComment From FileServiceTest"; Comment commentObject = fileService.createComment(fileId, comment); @@ -432,9 +432,9 @@ public void testCreateDeleteFolder() throws Exception { @Test public void testDeleteComment() throws Exception { FileService fileService = new FileService(); - FileList listOfFiles = fileService.getMyFiles(); + EntityList listOfFiles = fileService.getMyFiles(); String fileId = listOfFiles.get(0).getFileId(); - CommentList commentObject = fileService.getAllFileComments(fileId, null); + EntityList commentObject = fileService.getAllFileComments(fileId, null); if (!commentObject.isEmpty()) { String commentId = commentObject.get(0).getCommentId(); fileService.deleteComment(fileId, commentId); @@ -444,7 +444,7 @@ public void testDeleteComment() throws Exception { @Test public void testDeleteFileFromRecycleBin() throws Exception { FileService fileService = new FileService(); - FileList listOfFiles = fileService.getFilesInMyRecycleBin(); + EntityList listOfFiles = fileService.getFilesInMyRecycleBin(); String fileId = listOfFiles.get(0).getFileId(); fileService.deleteFileFromRecycleBin(fileId); } @@ -452,7 +452,7 @@ public void testDeleteFileFromRecycleBin() throws Exception { @Test public void testGetFileShares() throws Exception { FileService fileService = new FileService(); - FileList listOfFiles = fileService.getFileShares(); + EntityList listOfFiles = fileService.getFileShares(); } @Test @@ -460,7 +460,7 @@ public void testGetFolder() throws Exception { //TODO: fix for smartcloud if (TestEnvironment.isSmartCloudEnvironment()) return; FileService fileService = new FileService(); - FileList folders = fileService.getMyFolders(); + EntityList folders = fileService.getMyFolders(); if(folders != null) { File folder = fileService.getFolder(folders.get(0).getFileId()); assertNotNull(folder.getTitle()); @@ -470,7 +470,7 @@ public void testGetFolder() throws Exception { @Test public void testRestoreFileFromRecycleBin() throws Exception { FileService fileService = new FileService(); - FileList files = fileService.getFilesInMyRecycleBin(); + EntityList files = fileService.getFilesInMyRecycleBin(); if(files != null) { fileService.restoreFileFromRecycleBin(files.get(0).getFileId()); } @@ -479,7 +479,7 @@ public void testRestoreFileFromRecycleBin() throws Exception { @Test public void testUpdateComment() throws Exception { FileService fileService = new FileService(); - FileList listOfFiles = fileService.getMyFiles(); + EntityList listOfFiles = fileService.getMyFiles(); String fileId = listOfFiles.get(0).getFileId(); Comment commentObject = fileService.createComment(fileId, "CommentCreated" + System.currentTimeMillis()); if(commentObject != null) { diff --git a/sdk/com.ibm.sbt.core.test/src/test/java/com/ibm/sbt/services/client/connections/files/FileUpdateTest.java b/sdk/com.ibm.sbt.core.test/src/test/java/com/ibm/sbt/services/client/connections/files/FileUpdateTest.java index a46dc9e78f..832b48de96 100644 --- a/sdk/com.ibm.sbt.core.test/src/test/java/com/ibm/sbt/services/client/connections/files/FileUpdateTest.java +++ b/sdk/com.ibm.sbt.core.test/src/test/java/com/ibm/sbt/services/client/connections/files/FileUpdateTest.java @@ -26,6 +26,7 @@ import com.ibm.commons.xml.DOMUtil; import com.ibm.commons.xml.XMLException; import com.ibm.sbt.services.BaseUnitTest; +import com.ibm.sbt.services.client.ClientServicesException; import com.ibm.sbt.services.client.base.datahandlers.EntityList; import com.ibm.sbt.services.client.connections.communities.CommunityService; import com.ibm.sbt.services.client.connections.communities.CommunityServiceException; @@ -157,7 +158,7 @@ private String createCommunity(String baseName, String type) throws CommunitySer return communityService.createCommunity(title, content, type); } - private File uploadCommunityFile(String baseName, String communityUuid) throws FileServiceException, XMLException { + private File uploadCommunityFile(String baseName, String communityUuid) throws ClientServicesException, XMLException { String name = baseName + System.currentTimeMillis(); byte[] bytes = name.getBytes(); @@ -170,7 +171,7 @@ private File uploadCommunityFile(String baseName, String communityUuid) throws F return file; } - private File uploadFile(String baseName) throws FileServiceException, XMLException { + private File uploadFile(String baseName) throws ClientServicesException, XMLException { String name = baseName + System.currentTimeMillis(); byte[] bytes = name.getBytes(); @@ -183,7 +184,7 @@ private File uploadFile(String baseName) throws FileServiceException, XMLExcepti return file; } - private File updateFile(File file, String baseName) throws FileServiceException, XMLException { + private File updateFile(File file, String baseName) throws ClientServicesException, XMLException { String name = baseName + System.currentTimeMillis(); byte[] bytes = name.getBytes(); diff --git a/sdk/com.ibm.sbt.core/META-INF/MANIFEST.MF b/sdk/com.ibm.sbt.core/META-INF/MANIFEST.MF index 2ee0265fdb..b0a561dfb9 100644 --- a/sdk/com.ibm.sbt.core/META-INF/MANIFEST.MF +++ b/sdk/com.ibm.sbt.core/META-INF/MANIFEST.MF @@ -64,7 +64,6 @@ Export-Package: com.ibm.sbt.core.configuration, com.ibm.sbt.services.client.connections.communities.transformers, com.ibm.sbt.services.client.connections.communities.util, com.ibm.sbt.services.client.connections.files, - com.ibm.sbt.services.client.connections.files.feedHandler, com.ibm.sbt.services.client.connections.files.model, com.ibm.sbt.services.client.connections.files.transformers, com.ibm.sbt.services.client.connections.files.util, diff --git a/sdk/com.ibm.sbt.core/src/main/java/com/ibm/sbt/services/client/base/IFeedHandler.java b/sdk/com.ibm.sbt.core/src/main/java/com/ibm/sbt/services/client/base/IFeedHandler.java index 70fedb8505..253f0f3eb9 100644 --- a/sdk/com.ibm.sbt.core/src/main/java/com/ibm/sbt/services/client/base/IFeedHandler.java +++ b/sdk/com.ibm.sbt.core/src/main/java/com/ibm/sbt/services/client/base/IFeedHandler.java @@ -1,5 +1,5 @@ /* - * © Copyright IBM Corp. 2013 + * © Copyright IBM Corp. 2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/sdk/com.ibm.sbt.core/src/main/java/com/ibm/sbt/services/client/base/datahandlers/EntityList.java b/sdk/com.ibm.sbt.core/src/main/java/com/ibm/sbt/services/client/base/datahandlers/EntityList.java index 39819e0efc..5d72d0014f 100644 --- a/sdk/com.ibm.sbt.core/src/main/java/com/ibm/sbt/services/client/base/datahandlers/EntityList.java +++ b/sdk/com.ibm.sbt.core/src/main/java/com/ibm/sbt/services/client/base/datahandlers/EntityList.java @@ -1,5 +1,5 @@ /* - * � Copyright IBM Corp. 2013 + * © Copyright IBM Corp. 2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,8 +16,6 @@ package com.ibm.sbt.services.client.base.datahandlers; -import static com.ibm.sbt.services.client.base.ConnectionsConstants.nameSpaceCtx; - import java.io.Externalizable; import java.io.IOException; import java.io.ObjectInput; @@ -35,7 +33,6 @@ import com.ibm.sbt.services.client.Response; import com.ibm.sbt.services.client.base.BaseEntity; import com.ibm.sbt.services.client.base.BaseService; -import com.ibm.sbt.services.client.base.ConnectionsFeedXpath; import com.ibm.sbt.services.client.base.IFeedHandler; diff --git a/sdk/com.ibm.sbt.core/src/main/java/com/ibm/sbt/services/client/connections/communities/CommunityService.java b/sdk/com.ibm.sbt.core/src/main/java/com/ibm/sbt/services/client/connections/communities/CommunityService.java index 8679b20499..8095c509e9 100644 --- a/sdk/com.ibm.sbt.core/src/main/java/com/ibm/sbt/services/client/connections/communities/CommunityService.java +++ b/sdk/com.ibm.sbt.core/src/main/java/com/ibm/sbt/services/client/connections/communities/CommunityService.java @@ -51,7 +51,6 @@ import com.ibm.sbt.services.client.connections.communities.util.Messages; import com.ibm.sbt.services.client.connections.files.File; import com.ibm.sbt.services.client.connections.files.FileService; -import com.ibm.sbt.services.client.connections.files.FileServiceException; import com.ibm.sbt.services.client.connections.forums.Forum; import com.ibm.sbt.services.client.connections.forums.ForumService; import com.ibm.sbt.services.client.connections.forums.ForumServiceException; @@ -1004,7 +1003,7 @@ public EntityList getCommunityFiles(String communityId, HashMap getTags() { - return this.getAsList(FileEntryXPath.Tags); + return getAsList(FileEntryXPath.Tags); } /** @@ -468,7 +469,7 @@ public List getTags() { * @return File * @throws FileServiceException */ - public File load() throws FileServiceException { + public File load() throws ClientServicesException { return getService().getFile(getFileId()); } @@ -480,48 +481,48 @@ public File load() throws FileServiceException { * @throws FileServiceException * @throws TransformerException */ - public Comment addComment(String comment, Map params) throws FileServiceException, TransformerException { - return this.getService().addCommentToFile(this.getFileId(), comment, this.getAuthor().getId(), params); + public Comment addComment(String comment, Map params) throws ClientServicesException, TransformerException { + return getService().addCommentToFile(getFileId(), comment, getAuthor().getId(), params); } /** * Method to Pin a File * @throws FileServiceException */ - public void pin() throws FileServiceException { - this.getService().pinFile(this.getFileId()); + public void pin() throws ClientServicesException { + getService().pinFile(getFileId()); } /** * Method to Un Pin a File * @throws FileServiceException */ - public void unpin() throws FileServiceException { - this.getService().unPinFile(this.getFileId()); + public void unpin() throws ClientServicesException { + getService().unPinFile(getFileId()); } /** * Method to Lock a File * @throws FileServiceException */ - public void lock() throws FileServiceException { - this.getService().lock(this.getFileId()); + public void lock() throws ClientServicesException { + getService().lock(getFileId()); } /** * Method to un Lock a File * @throws FileServiceException */ - public void unlock() throws FileServiceException { - this.getService().unlock(this.getFileId()); + public void unlock() throws ClientServicesException { + getService().unlock(getFileId()); } /** * Method to remove/delete a File * @throws FileServiceException */ - public void remove() throws FileServiceException { - this.getService().deleteFile(this.getFileId()); + public void remove() throws ClientServicesException { + getService().deleteFile(getFileId()); } /** @@ -530,8 +531,8 @@ public void remove() throws FileServiceException { * @throws FileServiceException * @throws TransformerException */ - public void update(Map params) throws FileServiceException, TransformerException { - this.getService().updateFileMetadata(this, params); + public void update(Map params) throws ClientServicesException, TransformerException { + getService().updateFileMetadata(this, params); } /** @@ -540,9 +541,9 @@ public void update(Map params) throws FileServiceException, Tran * @throws FileServiceException * @throws TransformerException */ - public void save(Map params) throws FileServiceException, TransformerException { + public void save(Map params) throws ClientServicesException, TransformerException { //TODO - this.getService().updateFileMetadata(this, params); + getService().updateFileMetadata(this, params); } @Override diff --git a/sdk/com.ibm.sbt.core/src/main/java/com/ibm/sbt/services/client/connections/files/FileService.java b/sdk/com.ibm.sbt.core/src/main/java/com/ibm/sbt/services/client/connections/files/FileService.java index 9718ecb4f2..bc6d4e1c98 100644 --- a/sdk/com.ibm.sbt.core/src/main/java/com/ibm/sbt/services/client/connections/files/FileService.java +++ b/sdk/com.ibm.sbt.core/src/main/java/com/ibm/sbt/services/client/connections/files/FileService.java @@ -53,6 +53,7 @@ import com.ibm.sbt.services.client.base.BaseService; import com.ibm.sbt.services.client.base.IFeedHandler; import com.ibm.sbt.services.client.base.NamedUrlPart; +import com.ibm.sbt.services.client.base.datahandlers.EntityList; import com.ibm.sbt.services.client.base.transformers.TransformerException; import com.ibm.sbt.services.client.connections.communities.CommunityServiceException; import com.ibm.sbt.services.client.connections.files.model.FileCommentParameterBuilder; @@ -150,11 +151,6 @@ public IFeedHandler getFileFeedHandler() { protected File entityInstance(BaseService service, Node node, XPathExpression xpath) { return new File(service, node, nameSpaceCtx, xpath); } - - @Override - public FileList createEntityList(Response requestData) { - return new FileList((Response)requestData, this); - } }; } @@ -168,16 +164,11 @@ public IFeedHandler getCommentFeedHandler() { protected Comment entityInstance(BaseService service, Node node, XPathExpression xpath) { return new Comment(service, node, nameSpaceCtx, xpath); } - - @Override - public CommentList createEntityList(Response requestData) { - return new CommentList((Response)requestData, this); - } }; } public void actOnCommentAwaitingApproval(String commentId, String action, String actionReason) - throws FileServiceException, TransformerException { + throws ClientServicesException, TransformerException { // get thr uri from here :: // In the service document, locate the workspace with the // child element, and then find the collection with the @@ -194,18 +185,18 @@ public void actOnCommentAwaitingApproval(String commentId, String action, String String content = ModerationContentTypes.COMMENT.get(); requestUri = FileUrls.MODERATION.format(this, FileUrlParts.accessType.get(accessType), FileUrlParts.action.get(action), FileUrlParts.contentType.get(content)); } - Object payload = this.constructPayloadForModeration(commentId, action, actionReason, "comment"); + Object payload = constructPayloadForModeration(commentId, action, actionReason, "comment"); Map headers = new HashMap(); headers.put(Headers.ContentType, Headers.ATOM); try { - super.updateData(requestUri, null, headers, payload, commentId); - } catch (Exception e) { - throw new FileServiceException(e, Messages.MessageExceptionInStatusChange); + updateData(requestUri, null, headers, payload, commentId); + } catch (IOException e) { + throw new ClientServicesException(e, Messages.MessageExceptionInStatusChange); } } public void actOnFileAwaitingApproval(String fileId, String action, String actionReason) - throws FileServiceException, TransformerException { + throws ClientServicesException, TransformerException { // get the uri // In the service document, locate the workspace with the // child element, and then find the collection with the @@ -221,18 +212,18 @@ public void actOnFileAwaitingApproval(String fileId, String action, String actio String content = ModerationContentTypes.DOCUMENTS.get(); requestUri = FileUrls.MODERATION.format(this, FileUrlParts.accessType.get(accessType), FileUrlParts.action.get(action), FileUrlParts.contentType.get(content)); } - Object payload = this.constructPayloadForModeration(fileId, action, actionReason, "file"); + Object payload = constructPayloadForModeration(fileId, action, actionReason, "file"); Map headers = new HashMap(); headers.put(Headers.ContentType, Headers.ATOM); try { - super.updateData(requestUri, null, headers, payload, fileId); - } catch (Exception e) { - throw new FileServiceException(e, Messages.MessageExceptionInStatusChange); + updateData(requestUri, null, headers, payload, fileId); + } catch (IOException e) { + throw new ClientServicesException(e, Messages.MessageExceptionInStatusChange); } } public void actOnFlaggedComment(String commentId, String action, String actionReason) - throws FileServiceException, TransformerException { + throws ClientServicesException, TransformerException { // get thr uri from here :: // In the service document, locate the workspace with the // child element, and then find the collection with the @@ -249,18 +240,18 @@ public void actOnFlaggedComment(String commentId, String action, String actionRe String content = ModerationContentTypes.COMMENT.get(); requestUri = FileUrls.MODERATION.format(this, FileUrlParts.accessType.get(accessType), FileUrlParts.action.get(action), FileUrlParts.contentType.get(content)); } - Object payload = this.constructPayloadForModeration(commentId, action, actionReason, "comment"); + Object payload = constructPayloadForModeration(commentId, action, actionReason, "comment"); Map headers = new HashMap(); headers.put(Headers.ContentType, Headers.ATOM); try { - super.updateData(requestUri, null, headers, payload, commentId); - } catch (Exception e) { - throw new FileServiceException(e, Messages.MessageExceptionInFlaggingComment); + updateData(requestUri, null, headers, payload, commentId); + } catch (IOException e) { + throw new ClientServicesException(e, Messages.MessageExceptionInFlaggingComment); } } public void actOnFlaggedFile(String fileId, String action, String actionReason) - throws FileServiceException, TransformerException { + throws ClientServicesException, TransformerException { // get the uri // In the service document, locate the workspace with the // child element, and then find the collection with the @@ -276,13 +267,13 @@ public void actOnFlaggedFile(String fileId, String action, String actionReason) String content = ModerationContentTypes.DOCUMENTS.get(); requestUri = FileUrls.MODERATION.format(this, FileUrlParts.accessType.get(accessType), FileUrlParts.action.get(action), FileUrlParts.contentType.get(content)); } - Object payload = this.constructPayloadForModeration(fileId, action, actionReason, "file"); + Object payload = constructPayloadForModeration(fileId, action, actionReason, "file"); Map headers = new HashMap(); headers.put(Headers.ContentType, Headers.ATOM); try { - super.updateData(requestUri, null, headers, payload, fileId); - } catch (Exception e) { - throw new FileServiceException(e, Messages.MesssageExceptionInFlaggingFile); + updateData(requestUri, null, headers, payload, fileId); + } catch (IOException e) { + throw new ClientServicesException(e, Messages.MesssageExceptionInFlaggingFile); } } @@ -295,11 +286,11 @@ public void actOnFlaggedFile(String fileId, String action, String actionReason) * @param params - Map of Parameters. See {@link FileRequestParams} for possible values. * @param comment - Comment to be added to the File * @return Comment - * @throws FileServiceException + * @throws ClientServiceException * @throws TransformerException */ - public Comment addCommentToFile(String fileId, String comment, Map params) throws FileServiceException, TransformerException { - return this.addCommentToFile(fileId, comment, null, params); + public Comment addCommentToFile(String fileId, String comment, Map params) throws ClientServicesException, TransformerException { + return addCommentToFile(fileId, comment, null, params); } /** @@ -312,14 +303,14 @@ public Comment addCommentToFile(String fileId, String comment, Map params) throws FileServiceException, TransformerException { + Map params) throws ClientServicesException, TransformerException { //FIX: DUPLICATE METHOD see createComment() if (StringUtil.isEmpty(fileId)) { - throw new FileServiceException(null, Messages.Invalid_FileId); + throw new ClientServicesException(null, Messages.Invalid_FileId); } String accessType = AccessType.AUTHENTICATED.getText(); String requestUri; @@ -328,12 +319,12 @@ public Comment addCommentToFile(String fileId, String comment, String userId, } else { requestUri = FileUrls.USERLIBRARY_DOCUMENT_FEED.format(this, FileUrlParts.accessType.get(accessType), FileUrlParts.userId.get(userId), FileUrlParts.fileId.get(fileId)); } - Document payload = this.constructPayloadForComments(comment); + Document payload = constructPayloadForComments(comment); try { - Response result = (Response) super.createData(requestUri, null, new ClientService.ContentXml(payload,"application/atom+xml")); + Response result = (Response) createData(requestUri, null, new ClientService.ContentXml(payload,"application/atom+xml")); return getCommentFeedHandler().createEntity(result); - } catch (Exception e) { - throw new FileServiceException(e, Messages.MessageExceptionInCreatingComment); + } catch (IOException e) { + throw new ClientServicesException(e, Messages.MessageExceptionInCreatingComment); } } @@ -347,10 +338,10 @@ public Comment addCommentToFile(String fileId, String comment, String userId, * @param comment * @param communityId * @return Comment - * @throws FileServiceException + * @throws ClientServicesException * @throws TransformerException */ - public Comment addCommentToCommunityFile(String fileId, String comment, String communityId) throws FileServiceException, TransformerException { + public Comment addCommentToCommunityFile(String fileId, String comment, String communityId) throws ClientServicesException, TransformerException { return addCommentToCommunityFile(fileId, comment, communityId, null); } @@ -365,27 +356,27 @@ public Comment addCommentToCommunityFile(String fileId, String comment, String c * @param communityId * @param params * @return Comment - * @throws FileServiceException + * @throws ClientServicesException * @throws TransformerException */ public Comment addCommentToCommunityFile(String fileId, String comment, String communityId, - Map params) throws FileServiceException, TransformerException { + Map params) throws ClientServicesException, TransformerException { if (StringUtil.isEmpty(fileId)) { - throw new FileServiceException(null, Messages.Invalid_FileId); + throw new ClientServicesException(null, Messages.Invalid_FileId); } if (StringUtil.isEmpty(communityId) || StringUtil.equalsIgnoreCase(communityId, null)) { - throw new FileServiceException(null, Messages.Invalid_CommunityId); + throw new ClientServicesException(null, Messages.Invalid_CommunityId); } String accessType = AccessType.AUTHENTICATED.getText(); String requestUri = FileUrls.COMMUNITY_FILE_COMMENT.format(this, FileUrlParts.accessType.get(accessType), FileUrlParts.communityId.get(communityId), FileUrlParts.fileId.get(fileId)); - Document payload = this.constructPayloadForComments(comment); + Document payload = constructPayloadForComments(comment); try { - Response result = (Response) super.createData(requestUri, null, new ClientService.ContentXml(payload,"application/atom+xml")); + Response result = (Response) createData(requestUri, null, new ClientService.ContentXml(payload,"application/atom+xml")); return getCommentFeedHandler().createEntity(result); - } catch (Exception e) { - throw new FileServiceException(e, Messages.MessageExceptionInCreatingComment); + } catch (IOException e) { + throw new ClientServicesException(e, Messages.MessageExceptionInCreatingComment); } } @@ -393,9 +384,9 @@ public Comment addCommentToCommunityFile(String fileId, String comment, String c * Method to get a list of Community Files * @param communityId * @return - * @throws FileServiceException + * @throws ClientServicesException */ - public FileList getCommunityFiles(String communityId) throws FileServiceException { + public EntityList getCommunityFiles(String communityId) throws ClientServicesException { return getCommunityFiles(communityId, null); } @@ -406,9 +397,9 @@ public FileList getCommunityFiles(String communityId) throws FileServiceExceptio * @return FileList * @throws CommunityServiceException */ - public FileList getCommunityFiles(String communityId, HashMap params) throws FileServiceException { + public EntityList getCommunityFiles(String communityId, HashMap params) throws ClientServicesException { if (StringUtil.isEmpty(communityId)) { - throw new FileServiceException(null, Messages.Invalid_CommunityId); + throw new ClientServicesException(null, Messages.Invalid_CommunityId); } String accessType = AccessType.AUTHENTICATED.getText(); String requestUrl = FileUrls.COMMUNITYLIBRARY_FEED.format(this, FileUrlParts.accessType.get(accessType), FileUrlParts.communityId.get(communityId)); @@ -421,9 +412,9 @@ public FileList getCommunityFiles(String communityId, HashMap pa * @param communityId * @param fileId * @return File - * @throws FileServiceException + * @throws ClientServicesException */ - public File getCommunityFile(String communityId, String fileId) throws FileServiceException { + public File getCommunityFile(String communityId, String fileId) throws ClientServicesException { return getCommunityFile(communityId, fileId, null); } @@ -433,14 +424,14 @@ public File getCommunityFile(String communityId, String fileId) throws FileServi * @param fileId * @param params * @return File - * @throws FileServiceException + * @throws ClientServicesException */ - public File getCommunityFile(String communityId, String fileId, HashMap params) throws FileServiceException { + public File getCommunityFile(String communityId, String fileId, HashMap params) throws ClientServicesException { if (StringUtil.isEmpty(fileId)) { - throw new FileServiceException(null, Messages.Invalid_FileId); + throw new ClientServicesException(null, Messages.Invalid_FileId); } if (StringUtil.isEmpty(communityId)) { - throw new FileServiceException(null, Messages.Invalid_CommunityId); + throw new ClientServicesException(null, Messages.Invalid_CommunityId); } String accessType = AccessType.AUTHENTICATED.getText(); String requestUrl = FileUrls.GET_COMMUNITY_FILE.format(this, FileUrlParts.accessType.get(accessType), FileUrlParts.communityId.get(communityId), FileUrlParts.fileId.get(fileId)); @@ -452,9 +443,9 @@ public File getCommunityFile(String communityId, String fileId, HashMap getCommunitySharedFiles(String communityId) throws ClientServicesException { return getCommunitySharedFiles(communityId, null); } @@ -463,11 +454,11 @@ public FileList getCommunitySharedFiles(String communityId) throws FileServiceEx * @param communityId * @param params * @return FileList - * @throws FileServiceException + * @throws ClientServicesException */ - public FileList getCommunitySharedFiles(String communityId, HashMap params) throws FileServiceException { + public EntityList getCommunitySharedFiles(String communityId, HashMap params) throws ClientServicesException { if (StringUtil.isEmpty(communityId)) { - throw new FileServiceException(null, Messages.Invalid_CommunityId); + throw new ClientServicesException(null, Messages.Invalid_CommunityId); } String accessType = AccessType.AUTHENTICATED.getText(); String requestUrl = FileUrls.GET_COMMUNITY_COLLECTION.format(this, FileUrlParts.accessType.get(accessType), FileUrlParts.communityId.get(communityId)); @@ -481,9 +472,9 @@ public FileList getCommunitySharedFiles(String communityId, HashMap params) throws FileServiceException { + public long downloadCommunityFile(OutputStream ostream, final String fileId, final String libraryId, Map params) throws ClientServicesException { return downloadFile(ostream, fileId, libraryId, params, true); } @@ -504,10 +495,10 @@ public long downloadCommunityFile(OutputStream ostream, final String fileId, fin * @param ostream - output stream which contains the binary content of the file * @param fileId * @return long - no of bytes - * @throws FileServiceException + * @throws ClientServicesException */ - public long downloadFile(OutputStream ostream, final String fileId) throws FileServiceException { - return this.downloadFile(ostream, fileId, null, false); + public long downloadFile(OutputStream ostream, final String fileId) throws ClientServicesException { + return downloadFile(ostream, fileId, null, false); } /** @@ -517,9 +508,9 @@ public long downloadFile(OutputStream ostream, final String fileId) throws FileS * @param libraryId - required in case of public files * @param isPublic - flag to indicate public file * @return long - no of bytes - * @throws FileServiceException + * @throws ClientServicesException */ - public long downloadFile(OutputStream ostream, final String fileId, final String libraryId, boolean isPublic) throws FileServiceException { + public long downloadFile(OutputStream ostream, final String fileId, final String libraryId, boolean isPublic) throws ClientServicesException { return downloadFile(ostream, fileId, libraryId, null, isPublic); } @@ -530,10 +521,10 @@ public long downloadFile(OutputStream ostream, final String fileId, final String * @param libraryId - required in case of public file * @param params * @return long - no of bytes - * @throws FileServiceException + * @throws ClientServicesException */ - public long downloadFile(OutputStream ostream, final String fileId, Map params) throws FileServiceException { - return this.downloadFile(ostream, fileId, null, params, false); + public long downloadFile(OutputStream ostream, final String fileId, Map params) throws ClientServicesException { + return downloadFile(ostream, fileId, null, params, false); } /** @@ -544,9 +535,9 @@ public long downloadFile(OutputStream ostream, final String fileId, Map params, boolean isPublic) throws FileServiceException { + public long downloadFile(OutputStream ostream, final String fileId, final String libraryId, Map params, boolean isPublic) throws ClientServicesException { File file = !isPublic ? getFile(fileId) : getPublicFile(fileId, libraryId, null); // now we have the file.. we need to download it.. String accessType = !isPublic ? AccessType.AUTHENTICATED.getText() : AccessType.PUBLIC.getText(); @@ -559,11 +550,7 @@ public long downloadFile(OutputStream ostream, final String fileId, final String Map headers = new HashMap(); headers.put(Headers.ContentType, Headers.BINARY); Response response = null; - try { - response = this.getClientService().get(requestUrl, params, headers, ClientService.FORMAT_INPUTSTREAM); - } catch (ClientServicesException e) { - throw new FileServiceException(e, Messages.MessageExceptionInDownloadingFile); - } + response = getClientService().get(requestUrl, params, headers, ClientService.FORMAT_INPUTSTREAM); InputStream istream = (InputStream) response.getData(); long noOfBytes = 0; try { @@ -572,9 +559,9 @@ public long downloadFile(OutputStream ostream, final String fileId, final String ostream.flush(); } } catch (IllegalStateException e) { - throw new FileServiceException(e, Messages.MessageExceptionInDownloadingFile); + throw new ClientServicesException(e, Messages.MessageExceptionInDownloadingFile); } catch (IOException e) { - throw new FileServiceException(e, Messages.MessageExceptionInDownloadingFile); + throw new ClientServicesException(e, Messages.MessageExceptionInDownloadingFile); } return noOfBytes; } @@ -587,9 +574,9 @@ public long downloadFile(OutputStream ostream, final String fileId, final String * @param params * * @return long - no of bytes - * @throws FileServiceException + * @throws ClientServicesException */ - public long downloadFile(OutputStream ostream, File file, Map params) throws FileServiceException { + public long downloadFile(OutputStream ostream, File file, Map params) throws ClientServicesException { // file content url String requestUrl = file.getEditMediaUrl(); @@ -599,11 +586,7 @@ public long downloadFile(OutputStream ostream, File file, Map pa // trigger request to download the file Response response = null; - try { - response = this.getClientService().get(requestUrl, params, headers, ClientService.FORMAT_INPUTSTREAM); - } catch (ClientServicesException e) { - throw new FileServiceException(e, Messages.MessageExceptionInDownloadingFile); - } + response = getClientService().get(requestUrl, params, headers, ClientService.FORMAT_INPUTSTREAM); // read the file data InputStream istream = (InputStream) response.getData(); @@ -614,9 +597,9 @@ public long downloadFile(OutputStream ostream, File file, Map pa ostream.flush(); } } catch (IllegalStateException e) { - throw new FileServiceException(e, Messages.MessageExceptionInDownloadingFile); + throw new ClientServicesException(e, Messages.MessageExceptionInDownloadingFile); } catch (IOException e) { - throw new FileServiceException(e, Messages.MessageExceptionInDownloadingFile); + throw new ClientServicesException(e, Messages.MessageExceptionInDownloadingFile); } return noOfBytes; } @@ -631,30 +614,33 @@ public long downloadFile(OutputStream ostream, File file, Map pa * @param communityLibraryId * @param params * @return File - * @throws FileServiceException + * @throws ClientServicesException */ - public File updateCommunityFileMetadata(File fileEntry, String communityLibraryId, Map params) throws FileServiceException { + public File updateCommunityFileMetadata(File fileEntry, String communityLibraryId, Map params) throws ClientServicesException { if (fileEntry == null) { - throw new FileServiceException(null, Messages.Invalid_File); + throw new ClientServicesException(null, Messages.Invalid_File); } if (StringUtil.isEmpty(fileEntry.getFileId())) { - throw new FileServiceException(null, Messages.Invalid_FileId); + throw new ClientServicesException(null, Messages.Invalid_FileId); } if (StringUtil.isEmpty(communityLibraryId)) { - throw new FileServiceException(null, Messages.Invalid_CommunityLibraryId); + throw new ClientServicesException(null, Messages.Invalid_CommunityLibraryId); } String accessType = AccessType.AUTHENTICATED.getText(); String requestUri = FileUrls.COMMUNITY_FILE_METADATA.format(this, FileUrlParts.accessType.get(accessType), FileUrlParts.communityId.get(communityLibraryId), FileUrlParts.fileId.get(fileEntry.getFileId())); Document updateFilePayload = null; try { - updateFilePayload = this.constructPayload(fileEntry.getFileId(), fileEntry.getFieldsMap()); - Response result = (Response) super.updateData(requestUri, params, new ClientService.ContentXml( + updateFilePayload = constructPayload(fileEntry.getFileId(), fileEntry.getFieldsMap()); + Response result = (Response) updateData(requestUri, params, new ClientService.ContentXml( updateFilePayload, "application/atom+xml"), null); return getFileFeedHandler().createEntity(result); - } catch (Exception e) { - throw new FileServiceException(e, Messages.MessageExceptionInUpdate); + } catch (IOException e) { + throw new ClientServicesException(e, Messages.MessageExceptionInUpdate); + } catch (TransformerException e) { + throw new ClientServicesException(e, Messages.MessageExceptionInUpdate); } } + /** * addFilesToFolder *

          @@ -664,17 +650,17 @@ public File updateCommunityFileMetadata(File fileEntry, String communityLibraryI * @param listOfFileIds A list of file Ids, which need to be added to the collection. * @param params - Map of Parameters. See {@link FileRequestParams} for possible values. * @return FileList - * @throws FileServiceException + * @throws ClientServicesException * @throws TransformerException */ public FileList addFilesToFolder(String folderId, List listOfFileIds, - Map params) throws FileServiceException, TransformerException { + Map params) throws ClientServicesException, TransformerException { if (StringUtil.isEmpty(folderId)) { - throw new FileServiceException(null, Messages.Invalid_CollectionId); + throw new ClientServicesException(null, Messages.Invalid_CollectionId); } for (String fileId : listOfFileIds) { if (StringUtil.isEmpty(fileId)) { - throw new FileServiceException(null, Messages.Invalid_FileId); + throw new ClientServicesException(null, Messages.Invalid_FileId); } } String accessType = AccessType.AUTHENTICATED.getText(); @@ -682,16 +668,16 @@ public FileList addFilesToFolder(String folderId, List listOfFileIds, String requestUri = FileUrls.COLLECTION_FEED.format(this, FileUrlParts.accessType.get(accessType), FileUrlParts.folderId.get(folderId)); Map headers = new HashMap(); headers.put(Headers.ContentType, Headers.ATOM); - Object payload = this.constructPayloadForMultipleEntries(listOfFileIds, + Object payload = constructPayloadForMultipleEntries(listOfFileIds, FileRequestParams.ITEMID.getFileRequestParams()); try { Response result; - result = (Response) super.createData(requestUri, params, headers, payload); + result = (Response) createData(requestUri, params, headers, payload); return (FileList) getFileFeedHandler().createEntityList(result); - } catch (Exception e) { - throw new FileServiceException(e, Messages.MessageGenericException); + } catch (IOException e) { + throw new ClientServicesException(e, Messages.MessageGenericException); } } @@ -703,11 +689,11 @@ public FileList addFilesToFolder(String folderId, List listOfFileIds, * * @param fileId * @param folderIds - list of folder Ids to which the file needs to be added. - * @throws FileServiceException + * @throws ClientServicesException * @throws TransformerException */ - public void addFileToFolders(String fileId, List folderIds) throws FileServiceException, TransformerException { - this.addFileToFolders(fileId, folderIds, null, null); + public void addFileToFolders(String fileId, List folderIds) throws ClientServicesException, TransformerException { + addFileToFolders(fileId, folderIds, null, null); } /** @@ -719,12 +705,12 @@ public void addFileToFolders(String fileId, List folderIds) throws FileS * @param fileId * @param folderIds - list of folder Ids to which the file needs to be added. * @param params - * @throws FileServiceException + * @throws ClientServicesException * @throws TransformerException */ public void addFileToFolders(String fileId, List folderIds, Map params) - throws FileServiceException, TransformerException { - this.addFileToFolders(fileId, folderIds, null, params); + throws ClientServicesException, TransformerException { + addFileToFolders(fileId, folderIds, null, params); } /** @@ -736,12 +722,12 @@ public void addFileToFolders(String fileId, List folderIds, Map folderIds, String userId) - throws FileServiceException, TransformerException { - this.addFileToFolders(fileId, folderIds, userId, null); + throws ClientServicesException, TransformerException { + addFileToFolders(fileId, folderIds, userId, null); } /** @@ -754,13 +740,13 @@ public void addFileToFolders(String fileId, List folderIds, String userI * @param folderIds - list of folder Ids to which the file needs to be added. * @param userId * @param params - * @throws FileServiceException + * @throws ClientServicesException * @throws TransformerException */ public void addFileToFolders(String fileId, List folderIds, String userId, - Map params) throws FileServiceException, TransformerException { + Map params) throws ClientServicesException, TransformerException { if (fileId == null) { - throw new FileServiceException(null, Messages.Invalid_File); + throw new ClientServicesException(null, Messages.Invalid_File); } String accessType = AccessType.AUTHENTICATED.getText(); @@ -776,17 +762,17 @@ public void addFileToFolders(String fileId, List folderIds, String userI headers.put(Headers.ContentLanguage, Headers.UTF); params = (null == params)?new HashMap():params; - Object payload = this.constructPayloadForMultipleEntries(folderIds, + Object payload = constructPayloadForMultipleEntries(folderIds, FileRequestParams.ITEMID.getFileRequestParams(), "collection"); try { - super.createData(requestUri, params, headers, payload); - } catch (Exception e) { - throw new FileServiceException(e, Messages.MessageGenericException); + createData(requestUri, params, headers, payload); + } catch (IOException e) { + throw new ClientServicesException(e, Messages.MessageGenericException); } } - public Comment createComment(String fileId, String comment) throws FileServiceException, TransformerException { - return this.createComment(fileId, comment, null, null); + public Comment createComment(String fileId, String comment) throws ClientServicesException, TransformerException { + return createComment(fileId, comment, null, null); } /** @@ -799,12 +785,12 @@ public Comment createComment(String fileId, String comment) throws FileServiceEx * @param comment * @param userId * @return - * @throws FileServiceException + * @throws ClientServicesException * @throws TransformerException */ public Comment createComment(String fileId, String comment, String userId) - throws FileServiceException, TransformerException { - return this.createComment(fileId, comment, userId, null); + throws ClientServicesException, TransformerException { + return createComment(fileId, comment, userId, null); } /** @@ -818,14 +804,14 @@ public Comment createComment(String fileId, String comment, String userId) * @param userId * @param params * @return Comment - * @throws FileServiceException + * @throws ClientServicesException * @throws TransformerException */ public Comment createComment(String fileId, String comment, String userId, Map params) - throws FileServiceException, TransformerException { + throws ClientServicesException, TransformerException { //FIX: DUPLICATE METHOD see addCommentToFile() if (StringUtil.isEmpty(fileId)) { - throw new FileServiceException(null, Messages.Invalid_FileId); + throw new ClientServicesException(null, Messages.Invalid_FileId); } String accessType = AccessType.AUTHENTICATED.getText(); String requestUri; @@ -835,20 +821,20 @@ public Comment createComment(String fileId, String comment, String userId, Map headers = new HashMap(); try { - Response result = (Response) super.createData(requestUri, params, headers, new ClientService.ContentXml( + Response result = (Response) createData(requestUri, params, headers, new ClientService.ContentXml( payload, "application/atom+xml")); return getCommentFeedHandler().createEntity(result); - } catch (Exception e) { - throw new FileServiceException(e, Messages.MessageExceptionInCreatingComment); + } catch (IOException e) { + throw new ClientServicesException(e, Messages.MessageExceptionInCreatingComment); } } - public File createFolder(String name) throws FileServiceException, TransformerException { - return this.createFolder(name, null, null); + public File createFolder(String name) throws ClientServicesException, TransformerException { + return createFolder(name, null, null); } /** @@ -862,27 +848,27 @@ public File createFolder(String name) throws FileServiceException, TransformerEx * Pass Coma separated List of id, (person/community/group) or role(reader/Contributor/owner) * in order * @return File - * @throws FileServiceException + * @throws ClientServicesException * @throws TransformerException */ - public File createFolder(String name, String description) throws FileServiceException, TransformerException { - return this.createFolder(name, description, null); + public File createFolder(String name, String description) throws ClientServicesException, TransformerException { + return createFolder(name, description, null); } public File createFolder(String name, String description, String shareWith) - throws FileServiceException, TransformerException { + throws ClientServicesException, TransformerException { String accessType = AccessType.AUTHENTICATED.getText(); String requestUri = FileUrls.COLLECTIONS_FEED.format(this, FileUrlParts.accessType.get(accessType)); - Document payload = this.constructPayloadFolder(name, description, shareWith, "create"); + Document payload = constructPayloadFolder(name, description, shareWith, "create"); try { - Response result = (Response) super.createData(requestUri, null, + Response result = (Response) createData(requestUri, null, new ClientService.ContentXml( payload, "application/atom+xml")); return getFileFeedHandler().createEntity(result); } catch (Exception e) { - throw new FileServiceException(e, Messages.MessageExceptionInCreatingFolder); + throw new ClientServicesException(e, Messages.MessageExceptionInCreatingFolder); } } @@ -893,19 +879,19 @@ public File createFolder(String name, String description, String shareWith) * Rest API used : /files/basic/api/myuserlibrary/document/{document-id}/entry
          * * @param fileId - id of the file to be deleted - * @throws FileServiceException + * @throws ClientServicesException */ - public void deleteFile(String fileId) throws FileServiceException { + public void deleteFile(String fileId) throws ClientServicesException { if (StringUtil.isEmpty(fileId)) { - throw new FileServiceException(null, Messages.Invalid_FileId); + throw new ClientServicesException(null, Messages.Invalid_FileId); } String accessType = AccessType.AUTHENTICATED.getText(); String requestUri = FileUrls.MYUSERLIBRARY_DOCUMENT_ENTRY.format(this, FileUrlParts.accessType.get(accessType), FileUrlParts.fileId.get(fileId)); try { - super.deleteData(requestUri, null, null); + deleteData(requestUri, null, null); } catch (Exception e) { - throw new FileServiceException(e, Messages.MessageExceptionInDeletingFile); + throw new ClientServicesException(e, Messages.MessageExceptionInDeletingFile); } } @@ -917,10 +903,10 @@ public void deleteFile(String fileId) throws FileServiceException { * Rest API Used : /files/basic/api/myuserlibrary/view/recyclebin/{document-id}/entry * * @param fileId - * @throws FileServiceException + * @throws ClientServicesException */ - public void deleteAllFilesFromRecycleBin() throws FileServiceException { - this.deleteAllFilesFromRecycleBin(null); + public void deleteAllFilesFromRecycleBin() throws ClientServicesException { + deleteAllFilesFromRecycleBin(null); } /** @@ -931,9 +917,9 @@ public void deleteAllFilesFromRecycleBin() throws FileServiceException { * * @param fileId * @param userId - * @throws FileServiceException + * @throws ClientServicesException */ - public void deleteAllFilesFromRecycleBin(String userId) throws FileServiceException { + public void deleteAllFilesFromRecycleBin(String userId) throws ClientServicesException { String requestUri; String accessType = AccessType.AUTHENTICATED.getText(); if (StringUtil.isEmpty(userId)){ @@ -942,9 +928,9 @@ public void deleteAllFilesFromRecycleBin(String userId) throws FileServiceExcept requestUri = FileUrls.EMPTY_RECYCLE_BIN.format(this, FileUrlParts.accessType.get(accessType), FileUrlParts.userId.get(userId)); } try { - super.deleteData(requestUri, null, null); - } catch (Exception e) { - throw new FileServiceException(e, Messages.MessageExceptionInDeletingFile); + deleteData(requestUri, null, null); + } catch (IOException e) { + throw new ClientServicesException(e, Messages.MessageExceptionInDeletingFile); } } @@ -963,15 +949,15 @@ public void deleteAllFilesFromRecycleBin(String userId) throws FileServiceExcept * expectation that the URL contains the value from the element of a file Atom entry, * so the value uuid is used. Specify label if the URL instead contains the value from the * element of the file Atom entry. - * @throws FileServiceException + * @throws ClientServicesException */ public void deleteAllVersionsOfFile(String fileId, String versionLabel, Map params) - throws FileServiceException { + throws ClientServicesException { if (StringUtil.isEmpty(fileId)) { - throw new FileServiceException(null, Messages.Invalid_FileId); + throw new ClientServicesException(null, Messages.Invalid_FileId); } if (StringUtil.isEmpty(versionLabel)) { - throw new FileServiceException(null, Messages.InvalidArgument_VersionLabel); + throw new ClientServicesException(null, Messages.InvalidArgument_VersionLabel); } String accessType = AccessType.AUTHENTICATED.getText(); String requestUri = FileUrls.MYUSERLIBRARY_DOCUMENT_FEED.format(this, FileUrlParts.accessType.get(accessType), FileUrlParts.fileId.get(fileId)); @@ -980,9 +966,9 @@ public void deleteAllVersionsOfFile(String fileId, String versionLabel, Map - * @throws FileServiceException + * @throws ClientServicesException */ - public void deleteFileShare(String fileId) throws FileServiceException { - this.deleteFileShare(fileId, null); + public void deleteFileShare(String fileId) throws ClientServicesException { + deleteFileShare(fileId, null); } /** @@ -1114,11 +1100,11 @@ public void deleteFileShare(String fileId) throws FileServiceException { * users as targets of the share will be deleted. The default is to delete the document's * shares with all users. * @param userId - * @throws FileServiceException + * @throws ClientServicesException */ - public void deleteFileShare(String fileId, String userId) throws FileServiceException { + public void deleteFileShare(String fileId, String userId) throws ClientServicesException { if (StringUtil.isEmpty(fileId)) { - throw new FileServiceException(null, Messages.Invalid_FileId); + throw new ClientServicesException(null, Messages.Invalid_FileId); } String accessType = AccessType.AUTHENTICATED.getText(); String requestUri = FileUrls.DELETE_FILE_SHARE.format(this, FileUrlParts.accessType.get(accessType)); @@ -1129,39 +1115,39 @@ public void deleteFileShare(String fileId, String userId) throws FileServiceExce params.put(FileRequestParams.SHAREDWITH.getFileRequestParams(), userId); } try { - super.deleteData(requestUri, params, null); - } catch (Exception e) { - throw new FileServiceException(e, Messages.MessageExceptionInDeletingFileShare); + deleteData(requestUri, params, null); + } catch (IOException e) { + throw new ClientServicesException(e, Messages.MessageExceptionInDeletingFileShare); } } - public void deleteFlaggedComment(String commentId) throws FileServiceException { + public void deleteFlaggedComment(String commentId) throws ClientServicesException { if (StringUtil.isEmpty(commentId)) { - throw new FileServiceException(null, Messages.Invalid_CommentId); + throw new ClientServicesException(null, Messages.Invalid_CommentId); } - String requestUri = this.getModerationUri(commentId, Categories.REVIEW.get(), ModerationContentTypes.COMMENT.get()); + String requestUri = getModerationUri(commentId, Categories.REVIEW.get(), ModerationContentTypes.COMMENT.get()); if (StringUtil.isEmpty(requestUri)) { return; } try { - super.deleteData(requestUri, null, null); - } catch (Exception e) { - throw new FileServiceException(e, Messages.MessageExceptionInDeletingComment); + deleteData(requestUri, null, null); + } catch (IOException e) { + throw new ClientServicesException(e, Messages.MessageExceptionInDeletingComment); } } - public void deleteFlaggedFiles(String fileId) throws FileServiceException { + public void deleteFlaggedFiles(String fileId) throws ClientServicesException { if (StringUtil.isEmpty(fileId)) { - throw new FileServiceException(null, Messages.Invalid_FileId); + throw new ClientServicesException(null, Messages.Invalid_FileId); } - String requestUri = this.getModerationUri(fileId, Categories.REVIEW.get(), ModerationContentTypes.DOCUMENTS.get()); + String requestUri = getModerationUri(fileId, Categories.REVIEW.get(), ModerationContentTypes.DOCUMENTS.get()); if (StringUtil.isEmpty(requestUri)) { return; } try { - super.deleteData(requestUri, null, null); - } catch (Exception e) { - throw new FileServiceException(e, Messages.MessageExceptionInDeletingFile); + deleteData(requestUri, null, null); + } catch (IOException e) { + throw new ClientServicesException(e, Messages.MessageExceptionInDeletingFile); } } @@ -1172,15 +1158,15 @@ public void deleteFlaggedFiles(String fileId) throws FileServiceException { * Rest API Used : /basic/api/collection/{collection-id}/entry * * @param folderId - * @throws FileServiceException + * @throws ClientServicesException */ - public void deleteFolder(String folderId) throws FileServiceException { + public void deleteFolder(String folderId) throws ClientServicesException { String accessType = AccessType.AUTHENTICATED.getText(); String requestUri = FileUrls.COLLECTION_ENTRY.format(this, FileUrlParts.accessType.get(accessType), FileUrlParts.folderId.get(folderId)); try { - super.deleteData(requestUri, null, null); - } catch (Exception e) { - throw new FileServiceException(e, Messages.MessageExceptionInDeleteFolder); + deleteData(requestUri, null, null); + } catch (IOException e) { + throw new ClientServicesException(e, Messages.MessageExceptionInDeleteFolder); } } @@ -1194,32 +1180,32 @@ public void deleteFolder(String folderId) throws FileServiceException { * @param flagReason - reason , why the file/comment is being flagged as inappropriate. * @param flagWhat - If flagging file as inappropriate, flagWhat should be the string "file". If flagging * a comment, then flagWhat should be the String "comment". - * @throws FileServiceException + * @throws ClientServicesException * @throws TransformerException */ public void flagAsInappropriate(String id, String flagReason, String flagWhat) - throws FileServiceException, TransformerException { + throws ClientServicesException, TransformerException { if (StringUtil.isEmpty(id)) { - throw new FileServiceException(null, Messages.Invalid_FileId); + throw new ClientServicesException(null, Messages.Invalid_FileId); } if (StringUtil.isEmpty(flagWhat)) { - throw new FileServiceException(null, Messages.Invalid_FileId); + throw new ClientServicesException(null, Messages.Invalid_FileId); } String accessType = AccessType.AUTHENTICATED.getText(); String requestUri = FileUrls.COLLECTION_ENTRY.format(this, FileUrlParts.accessType.get(accessType)); Map headers = new HashMap(); headers.put(Headers.ContentType, Headers.ATOM); - Object payload = this.constructPayloadForFlagging(id, flagReason, flagWhat); + Object payload = constructPayloadForFlagging(id, flagReason, flagWhat); try { - super.updateData(requestUri, null, headers, payload, id); + updateData(requestUri, null, headers, payload, id); } catch (Exception e) { - throw new FileServiceException(e, Messages.MessageExceptionInFlaggingInappropriate); + throw new ClientServicesException(e, Messages.MessageExceptionInFlaggingInappropriate); } } - public FileList getAllUserFiles(String userId) throws FileServiceException { - return this.getAllUserFiles(userId, null); + public EntityList getAllUserFiles(String userId) throws ClientServicesException { + return getAllUserFiles(userId, null); } /** @@ -1231,21 +1217,21 @@ public FileList getAllUserFiles(String userId) throws FileServiceException { * @param userId * @param params - Map of Parameters. See {@link FileRequestParams} for possible values. * @return FileList - * @throws FileServiceException + * @throws ClientServicesException */ - public FileList getAllUserFiles(String userId, Map params) - throws FileServiceException { + public EntityList getAllUserFiles(String userId, Map params) + throws ClientServicesException { if (StringUtil.isEmpty(userId)) { - throw new FileServiceException(null, Messages.Invalid_UserId); + throw new ClientServicesException(null, Messages.Invalid_UserId); } String accessType = AccessType.PUBLIC.getText(); String requestUri = FileUrls.GET_ALL_USER_FILES.format(this, FileUrlParts.accessType.get(accessType), FileUrlParts.userId.get(userId)); return getFileEntityList(requestUri, params); } - public CommentList getCommentsAwaitingApproval(Map params) - throws FileServiceException { + public EntityList getCommentsAwaitingApproval(Map params) + throws ClientServicesException { String accessType = AccessType.AUTHENTICATED.getText(); String requestUri = FileUrls.GET_COMMENTS_AWAITING_APPROVAL.format(this, FileUrlParts.accessType.get(accessType)); return getCommentEntityList(requestUri, params, null); @@ -1256,10 +1242,10 @@ public CommentList getCommentsAwaitingApproval(Map params) * * @param fileId - ID of the file to be fetched from the Connections Server * @return File - * @throws FileServiceException + * @throws ClientServicesException */ - public File getFile(String fileId) throws FileServiceException { - return this.getFile(fileId, true); + public File getFile(String fileId) throws ClientServicesException { + return getFile(fileId, true); } /** @@ -1271,10 +1257,10 @@ public File getFile(String fileId) throws FileServiceException { * file load - false : an empty File object is returned, and then updations can be made on * this object. * @return File - * @throws FileServiceException + * @throws ClientServicesException */ - public File getFile(String fileId, boolean load) throws FileServiceException { - return this.getFile(fileId, null, load); + public File getFile(String fileId, boolean load) throws ClientServicesException { + return getFile(fileId, null, load); } /** @@ -1289,12 +1275,12 @@ public File getFile(String fileId, boolean load) throws FileServiceException { * file load - false : an empty File object is returned, and then updations can be made on * this object. * @return File - * @throws FileServiceException + * @throws ClientServicesException */ public File getFile(String fileId, Map parameters, boolean load) - throws FileServiceException { + throws ClientServicesException { if (StringUtil.isEmpty(fileId)) { - throw new FileServiceException(null, Messages.Invalid_FileId); + throw new ClientServicesException(null, Messages.Invalid_FileId); } File file = new File(fileId); if (load) { @@ -1315,14 +1301,14 @@ public File getFile(String fileId, Map parameters, boolean load) * @param libraryId - ID of the library to which the public file belongs * @param parameters - Map of Parameters. See {@link FileRequestParams} for possible values. * @return File - * @throws FileServiceException + * @throws ClientServicesException */ - public File getFile(String fileId, String libraryId, Map parameters) throws FileServiceException { + public File getFile(String fileId, String libraryId, Map parameters) throws ClientServicesException { if (StringUtil.isEmpty(fileId)) { - throw new FileServiceException(null, Messages.Invalid_FileId); + throw new ClientServicesException(null, Messages.Invalid_FileId); } if (StringUtil.isEmpty(libraryId)) { - throw new FileServiceException(null, Messages.Invalid_LibraryId); + throw new ClientServicesException(null, Messages.Invalid_LibraryId); } String accessType = AccessType.AUTHENTICATED.getText(); String requestUri = FileUrls.MYUSERLIBRARY_DOCUMENT_ENTRY.format(this, FileUrlParts.accessType.get(accessType), FileUrlParts.libraryId.get(libraryId), FileUrlParts.fileId.get(fileId)); @@ -1338,23 +1324,23 @@ public File getFile(String fileId, String libraryId, Map paramet * @param libraryId - ID of the library to which the public file belongs * @param parameters - Map of Parameters. See {@link FileRequestParams} for possible values. * @return File - * @throws FileServiceException + * @throws ClientServicesException */ public File getPublicFile(String fileId, String libraryId, Map parameters) - throws FileServiceException { + throws ClientServicesException { if (StringUtil.isEmpty(fileId)) { - throw new FileServiceException(null, Messages.Invalid_FileId); + throw new ClientServicesException(null, Messages.Invalid_FileId); } String accessType = AccessType.PUBLIC.getText(); String requestUri = FileUrls.MYUSERLIBRARY_DOCUMENT_ENTRY.format(this, FileUrlParts.accessType.get(accessType), FileUrlParts.libraryId.get(libraryId), FileUrlParts.fileId.get(fileId)); return getFileEntity(requestUri, parameters); } - public File getFileAwaitingAction(String fileId) throws FileServiceException { + public File getFileAwaitingAction(String fileId) throws ClientServicesException { if (StringUtil.isEmpty(fileId)) { - throw new FileServiceException(null, Messages.Invalid_FileId); + throw new ClientServicesException(null, Messages.Invalid_FileId); } - String requestUri = this.getModerationUri(fileId, Categories.APPROVAL.get(), ModerationContentTypes.DOCUMENTS.get()); + String requestUri = getModerationUri(fileId, Categories.APPROVAL.get(), ModerationContentTypes.DOCUMENTS.get()); return getFileEntity(requestUri, null); } @@ -1366,18 +1352,18 @@ public File getFileAwaitingAction(String fileId) throws FileServiceException { * @param anonymousAccess * @param parameters a map of paramters; can be generated using the {@link FileCommentParameterBuilder} * @return - * @throws FileServiceException + * @throws ClientServicesException */ - public CommentList getUserFileComment(String fileId, String userId, String commentId, boolean anonymousAccess, Map parameters, Map headers) throws FileServiceException { + public EntityList getUserFileComment(String fileId, String userId, String commentId, boolean anonymousAccess, Map parameters, Map headers) throws ClientServicesException { if (StringUtil.isEmpty(fileId)) { - throw new FileServiceException(null, Messages.Invalid_FileId); + throw new ClientServicesException(null, Messages.Invalid_FileId); } if (StringUtil.isEmpty(userId)) { - throw new FileServiceException(null, Messages.Invalid_UserId); + throw new ClientServicesException(null, Messages.Invalid_UserId); } if (StringUtil.isEmpty(commentId)) { - throw new FileServiceException(null, Messages.Invalid_CommentId); + throw new ClientServicesException(null, Messages.Invalid_CommentId); } String accessType = anonymousAccess?AccessType.PUBLIC.getText():AccessType.AUTHENTICATED.getText(); @@ -1391,14 +1377,14 @@ public CommentList getUserFileComment(String fileId, String userId, String comme * @param commentId * @param parameters a map of paramters; can be generated using the {@link FileCommentsParameterBuilder} * @return - * @throws FileServiceException + * @throws ClientServicesException */ - public CommentList getFileComment(String fileId, String commentId, Map parameters, Map headers) throws FileServiceException { + public EntityList getFileComment(String fileId, String commentId, Map parameters, Map headers) throws ClientServicesException { if (StringUtil.isEmpty(fileId)) { - throw new FileServiceException(null, Messages.Invalid_FileId); + throw new ClientServicesException(null, Messages.Invalid_FileId); } if (StringUtil.isEmpty(commentId)) { - throw new FileServiceException(null, Messages.Invalid_CommentId); + throw new ClientServicesException(null, Messages.Invalid_CommentId); } String accessType = AccessType.AUTHENTICATED.getText(); @@ -1412,14 +1398,14 @@ public CommentList getFileComment(String fileId, String commentId, Map parameters) throws FileServiceException { + public EntityList getAllUserFileComments(String fileId, String userId, boolean anonymousAccess, Map parameters) throws ClientServicesException { if (StringUtil.isEmpty(fileId)) { - throw new FileServiceException(null, Messages.Invalid_FileId); + throw new ClientServicesException(null, Messages.Invalid_FileId); } if (StringUtil.isEmpty(userId)) { - throw new FileServiceException(null, Messages.Invalid_UserId); + throw new ClientServicesException(null, Messages.Invalid_UserId); } String accessType = anonymousAccess?AccessType.PUBLIC.getText():AccessType.AUTHENTICATED.getText(); String requestUri = FileUrls.USERLIBRARY_DOCUMENT_FEED.format(this, FileUrlParts.accessType.get(accessType), FileUrlParts.userId.get(userId), FileUrlParts.fileId.get(fileId)); @@ -1431,11 +1417,11 @@ public CommentList getAllUserFileComments(String fileId, String userId, boolean * @param fileId * @param parameters a map of paramters; can be generated using the {@link FileCommentsFeedParameterBuilder} * @return - * @throws FileServiceException + * @throws ClientServicesException */ - public CommentList getAllFileComments(String fileId, Map parameters) throws FileServiceException { + public EntityList getAllFileComments(String fileId, Map parameters) throws ClientServicesException { if (StringUtil.isEmpty(fileId)) { - throw new FileServiceException(null, Messages.Invalid_FileId); + throw new ClientServicesException(null, Messages.Invalid_FileId); } String accessType = AccessType.AUTHENTICATED.getText(); String requestUri = FileUrls.MYUSERLIBRARY_DOCUMENT_FEED.format(this, FileUrlParts.accessType.get(accessType), FileUrlParts.fileId.get(fileId)); @@ -1451,9 +1437,9 @@ public CommentList getAllFileComments(String fileId, Map paramet * @param fileId * @param communityId * @return CommentList - * @throws FileServiceException + * @throws ClientServicesException */ - public CommentList getAllCommunityFileComments(String fileId, String communityId) throws FileServiceException { + public EntityList getAllCommunityFileComments(String fileId, String communityId) throws ClientServicesException { return getAllCommunityFileComments(fileId, communityId, null); } @@ -1467,14 +1453,14 @@ public CommentList getAllCommunityFileComments(String fileId, String communityId * @param communityId * @param parameters * @return CommentList - * @throws FileServiceException + * @throws ClientServicesException */ - public CommentList getAllCommunityFileComments(String fileId, String communityId, Map parameters) throws FileServiceException { + public EntityList getAllCommunityFileComments(String fileId, String communityId, Map parameters) throws ClientServicesException { if (StringUtil.isEmpty(fileId)) { - throw new FileServiceException(null, Messages.Invalid_FileId); + throw new ClientServicesException(null, Messages.Invalid_FileId); } if (StringUtil.isEmpty(communityId)) { - throw new FileServiceException(null, Messages.Invalid_CommunityId); + throw new ClientServicesException(null, Messages.Invalid_CommunityId); } String accessType =AccessType.AUTHENTICATED.getText(); String requestUri = FileUrls.COMMUNITY_FILE_COMMENT.format(this, FileUrlParts.accessType.get(accessType), FileUrlParts.communityId.get(communityId), FileUrlParts.fileId.get(fileId)); @@ -1487,10 +1473,10 @@ public CommentList getAllCommunityFileComments(String fileId, String communityId * * @param fileId * @return - * @throws FileServiceException + * @throws ClientServicesException */ - public File getFileFromRecycleBin(String fileId) throws FileServiceException { - return this.getFileFromRecycleBin(fileId, null, null); + public File getFileFromRecycleBin(String fileId) throws ClientServicesException { + return getFileFromRecycleBin(fileId, null, null); } /** @@ -1500,10 +1486,10 @@ public File getFileFromRecycleBin(String fileId) throws FileServiceException { * @param fileId * @param userId * @return - * @throws FileServiceException + * @throws ClientServicesException */ - public File getFileFromRecycleBin(String fileId, String userId) throws FileServiceException { - return this.getFileFromRecycleBin(fileId, userId, null); + public File getFileFromRecycleBin(String fileId, String userId) throws ClientServicesException { + return getFileFromRecycleBin(fileId, userId, null); } /** @@ -1516,12 +1502,12 @@ public File getFileFromRecycleBin(String fileId, String userId) throws FileServi * @param userId * @param params * @return File - * @throws FileServiceException + * @throws ClientServicesException */ public File getFileFromRecycleBin(String fileId, String userId, Map params) - throws FileServiceException { + throws ClientServicesException { if (StringUtil.isEmpty(fileId)) { - throw new FileServiceException(null, Messages.Invalid_FileId); + throw new ClientServicesException(null, Messages.Invalid_FileId); } String accessType = AccessType.AUTHENTICATED.getText(); String requestUri; @@ -1539,9 +1525,9 @@ public File getFileFromRecycleBin(String fileId, String userId, Map params) throws FileServiceException { + public EntityList getFilesAwaitingApproval(Map params) throws ClientServicesException { String accessType = AccessType.AUTHENTICATED.getText(); String requestUri = FileUrls.GET_FILES_AWAITING_APPROVAL.format(this, FileUrlParts.accessType.get(accessType)); return getFileEntityList(requestUri, params); @@ -1555,10 +1541,10 @@ public FileList getFilesAwaitingApproval(Map params) throws File * Rest API used : /files/basic/api/documents/shared/feed * * @return - * @throws FileServiceException + * @throws ClientServicesException */ - public FileList getFileShares() throws FileServiceException { - return this.getFileShares(null); + public EntityList getFileShares() throws ClientServicesException { + return getFileShares(null); } /** @@ -1570,16 +1556,16 @@ public FileList getFileShares() throws FileServiceException { * * @param params * @return - * @throws FileServiceException + * @throws ClientServicesException */ - public FileList getFileShares(Map params) throws FileServiceException { + public EntityList getFileShares(Map params) throws ClientServicesException { String accessType = AccessType.AUTHENTICATED.getText(); String requestUri = FileUrls.DOCUMENTS_SHARED_FEED.format(this, FileUrlParts.accessType.get(accessType)); return getFileEntityList(requestUri, params); } - public FileList getFilesInFolder(String folderId) throws FileServiceException { - return this.getFilesInFolder(folderId, null); + public EntityList getFilesInFolder(String folderId) throws ClientServicesException { + return getFilesInFolder(folderId, null); } /** @@ -1590,13 +1576,12 @@ public FileList getFilesInFolder(String folderId) throws FileServiceException { * @param folderId - uuid of the folder/collection. * @param params - Map of Parameters. See {@link FileRequestParams} for possible values. * @return FileList - * @throws FileServiceException + * @throws ClientServicesException */ - - public FileList getFilesInFolder(String folderId, Map params) - throws FileServiceException { + public EntityList getFilesInFolder(String folderId, Map params) + throws ClientServicesException { if (StringUtil.isEmpty(folderId)) { - throw new FileServiceException(null, Messages.Invalid_CollectionId); + throw new ClientServicesException(null, Messages.Invalid_CollectionId); } String accessType = AccessType.AUTHENTICATED.getText(); String requestUri = FileUrls.COLLECTION_FEED.format(this, FileUrlParts.accessType.get(accessType), FileUrlParts.folderId.get(folderId)); @@ -1607,10 +1592,10 @@ public FileList getFilesInFolder(String folderId, Map params) * getFilesInMyRecycleBin * * @return - * @throws FileServiceException + * @throws ClientServicesException */ - public FileList getFilesInMyRecycleBin() throws FileServiceException { - return this.getFilesInMyRecycleBin(null); + public EntityList getFilesInMyRecycleBin() throws ClientServicesException { + return getFilesInMyRecycleBin(null); } /** @@ -1620,10 +1605,10 @@ public FileList getFilesInMyRecycleBin() throws FileServiceException { * * @param params - Map of Parameters. See {@link FileRequestParams} for possible values. * @return FileList - * @throws FileServiceException + * @throws ClientServicesException */ - public FileList getFilesInMyRecycleBin(Map params) throws FileServiceException { + public EntityList getFilesInMyRecycleBin(Map params) throws ClientServicesException { String accessType = AccessType.AUTHENTICATED.getText(); String requestUri = FileUrls.MYUSERLIBRARY_RECYCLEBIN_FEED.format(this, FileUrlParts.accessType.get(accessType)); return getFileEntityList(requestUri, params); @@ -1635,21 +1620,21 @@ public FileList getFilesInMyRecycleBin(Map params) throws FileSe * Rest API Used : /files/basic/api/moderation/atomsvc * * @return - * @throws FileServiceException + * @throws ClientServicesException */ - protected Document getFilesModerationServiceDocument() throws FileServiceException { + protected Document getFilesModerationServiceDocument() throws ClientServicesException { String accessType = AccessType.AUTHENTICATED.getText(); String requestUri = FileUrls.MODERATION_SERVICE_DOCUMENT.format(this, FileUrlParts.accessType.get(accessType)); Response result = null; try { - result = super.retrieveData(requestUri, null); - } catch (Exception e) { - throw new FileServiceException(e, Messages.MessageExceptionInFetchingServiceDocument); + result = retrieveData(requestUri, null); + } catch (IOException e) { + throw new ClientServicesException(e, Messages.MessageExceptionInFetchingServiceDocument); } return (Document) result.getData(); } - protected FilesModerationDocumentEntry getFilesModerationDocumentEntry() throws FileServiceException { + protected FilesModerationDocumentEntry getFilesModerationDocumentEntry() throws ClientServicesException { return new FilesModerationDocumentEntry(getFilesModerationServiceDocument()); } @@ -1659,17 +1644,13 @@ protected FilesModerationDocumentEntry getFilesModerationDocumentEntry() throws * Rest API Used : /files/basic/api/introspection * * @return - * @throws FileServiceException + * @throws ClientServicesException */ - public Document getFilesServiceDocument() throws FileServiceException { + public Document getFilesServiceDocument() throws ClientServicesException { String accessType = AccessType.AUTHENTICATED.getText(); String requestUri = FileUrls.SERVICE_DOCUMENT.format(this, FileUrlParts.accessType.get(accessType)); Object result = null; - try { - result = this.getClientService().get(requestUri, null, ClientService.FORMAT_XML); - } catch (Exception e) { - throw new FileServiceException(e, Messages.MessageExceptionInFetchingServiceDocument); - } + result = getClientService().get(requestUri, null, ClientService.FORMAT_XML); return (Document) result; } @@ -1679,9 +1660,9 @@ public Document getFilesServiceDocument() throws FileServiceException { * This method calls getFilesSharedByMe(Map params) with null params * * @return FileList - * @throws FileServiceException - */ public FileList getFilesSharedByMe() throws FileServiceException { - return this.getFilesSharedByMe(null); + * @throws ClientServicesException + */ public EntityList getFilesSharedByMe() throws ClientServicesException { + return getFilesSharedByMe(null); } /** @@ -1692,15 +1673,13 @@ public Document getFilesServiceDocument() throws FileServiceException { * * @param params - Map of Parameters. See {@link FileRequestParams} for possible values. * @return FileList - * @throws FileServiceException + * @throws ClientServicesException */ - public FileList getFilesSharedByMe(Map params) throws FileServiceException { - if (null == params) { - params = new HashMap(); - } + public EntityList getFilesSharedByMe(Map params) throws ClientServicesException { String accessType = AccessType.AUTHENTICATED.getText(); String requestUri = FileUrls.DOCUMENTS_SHARED_FEED.format(this, FileUrlParts.accessType.get(accessType)); + params = getParameters(params); params.put(FileRequestParams.DIRECTION.getFileRequestParams(), "outbound"); return getFileEntityList(requestUri, params); } @@ -1711,11 +1690,11 @@ public FileList getFilesSharedByMe(Map params) throws FileServic * calls getFilesSharedWithMe(Map params) with null params * * @return FileList - * @throws FileServiceException + * @throws ClientServicesException */ - public FileList getFilesSharedWithMe() throws FileServiceException { - return this.getFilesSharedWithMe(null); + public EntityList getFilesSharedWithMe() throws ClientServicesException { + return getFilesSharedWithMe(null); } /** @@ -1726,10 +1705,10 @@ public FileList getFilesSharedWithMe() throws FileServiceException { * * @param params - Map of Parameters. See {@link FileRequestParams} for possible values. * @return FileList - * @throws FileServiceException + * @throws ClientServicesException */ - public FileList getFilesSharedWithMe(Map params) throws FileServiceException { + public EntityList getFilesSharedWithMe(Map params) throws ClientServicesException { if (null == params) { params = new HashMap(); } @@ -1748,10 +1727,10 @@ public FileList getFilesSharedWithMe(Map params) throws FileServ * @param fileId * @param versionId * @return File - * @throws FileServiceException + * @throws ClientServicesException */ - public File getFileWithGivenVersion(String fileId, String versionId) throws FileServiceException { - return this.getFileWithGivenVersion(fileId, versionId, null, null); + public File getFileWithGivenVersion(String fileId, String versionId) throws ClientServicesException { + return getFileWithGivenVersion(fileId, versionId, null, null); } /** @@ -1772,11 +1751,11 @@ public File getFileWithGivenVersion(String fileId, String versionId) throws File * > inline : Specifies whether the version content should be included in the content element * of the returned Atom document. Options are true or false. The default value is false. * @return File - * @throws FileServiceException + * @throws ClientServicesException */ public File getFileWithGivenVersion(String fileId, String versionId, Map params) - throws FileServiceException { - return this.getFileWithGivenVersion(fileId, versionId, params, null); + throws ClientServicesException { + return getFileWithGivenVersion(fileId, versionId, params, null); } /** @@ -1804,62 +1783,62 @@ public File getFileWithGivenVersion(String fileId, String versionId, Map params, - Map headers) throws FileServiceException { + Map headers) throws ClientServicesException { if (StringUtil.isEmpty(fileId)) { - throw new FileServiceException(null, Messages.Invalid_FileId); + throw new ClientServicesException(null, Messages.Invalid_FileId); } if (StringUtil.isEmpty(versionId)) { - return this.getFile(fileId, params, true); + return getFile(fileId, params, true); } String accessType = AccessType.AUTHENTICATED.getText(); String requestUri = FileUrls.GET_FILE_WITH_GIVEN_VERSION.format(this, FileUrlParts.accessType.get(accessType), FileUrlParts.fileId.get(fileId), FileUrlParts.versionId.get(versionId)); return getFileEntity(requestUri, params); } - public Comment getFlaggedComment(String commentId) throws FileServiceException { + public Comment getFlaggedComment(String commentId) throws ClientServicesException { if (StringUtil.isEmpty(commentId)) { - throw new FileServiceException(null, Messages.Invalid_CommentId); + throw new ClientServicesException(null, Messages.Invalid_CommentId); } - String requestUri = this.getModerationUri(commentId, Categories.REVIEW.get(), ModerationContentTypes.COMMENT.get()); + String requestUri = getModerationUri(commentId, Categories.REVIEW.get(), ModerationContentTypes.COMMENT.get()); return getCommentEntity(requestUri, null); } // /files/basic/api/review/comments - public CommentList getFlaggedComments(Map params) throws FileServiceException { + public EntityList getFlaggedComments(Map params) throws ClientServicesException { String accessType = AccessType.AUTHENTICATED.getText(); String requestUri = FileUrls.GET_FLAGGED_COMMENTS.format(this, FileUrlParts.accessType.get(accessType)); return getCommentEntityList(requestUri, params, null); } - public File getFlaggedFile(String fileId) throws FileServiceException { + public File getFlaggedFile(String fileId) throws ClientServicesException { if (StringUtil.isEmpty(fileId)) { - throw new FileServiceException(null, Messages.Invalid_FileId); + throw new ClientServicesException(null, Messages.Invalid_FileId); } - String requestUri = this.getModerationUri(fileId, Categories.REVIEW.get(), ModerationContentTypes.DOCUMENTS.get()); + String requestUri = getModerationUri(fileId, Categories.REVIEW.get(), ModerationContentTypes.DOCUMENTS.get()); return getFileEntity(requestUri, null); } // /files/basic/api/review/actions/documents/{document-id} public Document getFlaggedFileHistory(String fileId, Map params) - throws FileServiceException { + throws ClientServicesException { if (StringUtil.isEmpty(fileId)) { - throw new FileServiceException(null, Messages.Invalid_FileId); + throw new ClientServicesException(null, Messages.Invalid_FileId); } String accessType = AccessType.AUTHENTICATED.getText(); String requestUri = FileUrls.GET_FLAGGED_FILE_HISTORY.format(this, FileUrlParts.accessType.get(accessType), FileUrlParts.fileId.get(fileId)); try { - return (Document) super.retrieveData(requestUri, params).getData(); - } catch (Exception e) { - throw new FileServiceException(e, Messages.MessageExceptionInReadingObject); + return (Document) retrieveData(requestUri, params).getData(); + } catch (IOException e) { + throw new ClientServicesException(e, Messages.MessageExceptionInReadingObject); } } // /files/basic/api/review/documents - public FileList getFlaggedFiles(Map params) throws FileServiceException { + public EntityList getFlaggedFiles(Map params) throws ClientServicesException { String accessType = AccessType.AUTHENTICATED.getText(); String requestUri = FileUrls.GET_FLAGGED_FILES.format(this, FileUrlParts.accessType.get(accessType)); return getFileEntityList(requestUri, params); @@ -1873,16 +1852,16 @@ public FileList getFlaggedFiles(Map params) throws FileServiceEx * * @param folderId * @return - * @throws FileServiceException + * @throws ClientServicesException */ - public File getFolder(String folderId) throws FileServiceException { + public File getFolder(String folderId) throws ClientServicesException { String accessType = AccessType.AUTHENTICATED.getText(); String requestUri = FileUrls.COLLECTION_ENTRY.format(this, FileUrlParts.accessType.get(accessType), FileUrlParts.folderId.get(folderId)); return getFileEntity(requestUri, null); } - public FileList getFoldersWithRecentlyAddedFiles() throws FileServiceException { - return this.getFoldersWithRecentlyAddedFiles(null); + public EntityList getFoldersWithRecentlyAddedFiles() throws ClientServicesException { + return getFoldersWithRecentlyAddedFiles(null); } /** @@ -1892,10 +1871,10 @@ public FileList getFoldersWithRecentlyAddedFiles() throws FileServiceException { * * @param params - Map of Parameters. See {@link FileRequestParams} for possible values. * @return FileList - * @throws FileServiceException + * @throws ClientServicesException */ - public FileList getFoldersWithRecentlyAddedFiles(Map params) - throws FileServiceException { + public EntityList getFoldersWithRecentlyAddedFiles(Map params) + throws ClientServicesException { String accessType = AccessType.AUTHENTICATED.getText(); String requestUri = FileUrls.GET_FOLDERS_WITH_RECENT_FILES.format(this, FileUrlParts.accessType.get(accessType)); return getFileEntityList(requestUri, params); @@ -1908,11 +1887,11 @@ public FileList getFoldersWithRecentlyAddedFiles(Map params) * any params * * @return FileList - * @throws FileServiceException + * @throws ClientServicesException */ - public FileList getMyFiles() throws FileServiceException { - return this.getMyFiles(null); + public EntityList getMyFiles() throws ClientServicesException { + return getMyFiles(null); } /** @@ -1923,17 +1902,17 @@ public FileList getMyFiles() throws FileServiceException { * * @param params - Map of Parameters. See {@link FileRequestParams} for possible values. * @return FileList - * @throws FileServiceException + * @throws ClientServicesException */ - public FileList getMyFiles(Map params) throws FileServiceException { + public EntityList getMyFiles(Map params) throws ClientServicesException { String accessType = AccessType.AUTHENTICATED.getText(); String requestUri = FileUrls.MYUSERLIBRARY_FEED.format(this, FileUrlParts.accessType.get(accessType)); return getFileEntityList(requestUri, params); } - public FileList getMyFolders() throws FileServiceException { - return this.getMyFolders(null); + public EntityList getMyFolders() throws ClientServicesException { + return getMyFolders(null); } /** @@ -1943,9 +1922,9 @@ public FileList getMyFolders() throws FileServiceException { * * @param params - Map of Parameters. See {@link FileRequestParams} for possible values. * @return FileList - * @throws FileServiceException + * @throws ClientServicesException */ - public FileList getMyFolders(Map params) throws FileServiceException { + public EntityList getMyFolders(Map params) throws ClientServicesException { String accessType = AccessType.AUTHENTICATED.getText(); String requestUri = FileUrls.COLLECTIONS_FEED.format(this, FileUrlParts.accessType.get(accessType)); return getFileEntityList(requestUri, params); @@ -1958,25 +1937,21 @@ public FileList getMyFolders(Map params) throws FileServiceExcep * Rest API used : /files/basic/api/nonce * * @return String - nonce value - * @throws FileServiceException + * @throws ClientServicesException */ - public String getNonce() throws FileServiceException { + public String getNonce() throws ClientServicesException { String accessType = AccessType.AUTHENTICATED.getText(); String requestUri = FileUrls.GET_NONCE.format(this, FileUrlParts.accessType.get(accessType)); Object result = null; - try { - result = this.getClientService().get(requestUri, null, ClientService.FORMAT_TEXT); - } catch (Exception e) { - throw new FileServiceException(e, Messages.MessageExceptionInGettingNonce); - } + result = getClientService().get(requestUri, null, ClientService.FORMAT_TEXT); if (result == null) { return null; } return (String)((Response) result).getData(); } - public FileList getPinnedFiles() throws FileServiceException { - return this.getPinnedFiles(null); + public EntityList getPinnedFiles() throws ClientServicesException { + return getPinnedFiles(null); } /** @@ -1986,16 +1961,16 @@ public FileList getPinnedFiles() throws FileServiceException { * * @param params - Map of Parameters. See {@link FileRequestParams} for possible values. * @return FileList - * @throws FileServiceException + * @throws ClientServicesException */ - public FileList getPinnedFiles(Map params) throws FileServiceException { + public EntityList getPinnedFiles(Map params) throws ClientServicesException { String accessType = AccessType.AUTHENTICATED.getText(); String requestUri = FileUrls.MYFAVORITES_DOCUMENTS_FEED.format(this, FileUrlParts.accessType.get(accessType)); return getFileEntityList(requestUri, params); } - public FileList getPinnedFolders() throws FileServiceException { - return this.getPinnedFolders(null); + public EntityList getPinnedFolders() throws ClientServicesException { + return getPinnedFolders(null); } /** @@ -2005,17 +1980,17 @@ public FileList getPinnedFolders() throws FileServiceException { * * @param params - Map of Parameters. See {@link FileRequestParams} for possible values. * @return FileList - * @throws FileServiceException + * @throws ClientServicesException */ - public FileList getPinnedFolders(Map params) throws FileServiceException { + public EntityList getPinnedFolders(Map params) throws ClientServicesException { String accessType = AccessType.AUTHENTICATED.getText(); String requestUri = FileUrls.MYFAVORITES_COLLECTIONS_FEED.format(this, FileUrlParts.accessType.get(accessType)); return getFileEntityList(requestUri, params); } - public FileList getPublicFiles() throws FileServiceException { - return this.getPublicFiles(null); + public EntityList getPublicFiles() throws ClientServicesException { + return getPublicFiles(null); } /** @@ -2026,9 +2001,9 @@ public FileList getPublicFiles() throws FileServiceException { * * @param params - Map of Parameters. See {@link FileRequestParams} for possible values. * @return FileList - * @throws FileServiceException + * @throws ClientServicesException */ - public FileList getPublicFiles(Map params) throws FileServiceException { + public EntityList getPublicFiles(Map params) throws ClientServicesException { String accessType = AccessType.PUBLIC.getText(); String requestUri = FileUrls.GET_PUBLIC_FILES.format(this, FileUrlParts.accessType.get(accessType)); params = (null == params)?new HashMap():params; @@ -2036,8 +2011,8 @@ public FileList getPublicFiles(Map params) throws FileServiceExc return getFileEntityList(requestUri, params); } - public FileList getPublicFolders() throws FileServiceException { - return this.getPublicFolders(null); + public EntityList getPublicFolders() throws ClientServicesException { + return getPublicFolders(null); } /** @@ -2048,10 +2023,10 @@ public FileList getPublicFolders() throws FileServiceException { * * @param params - Map of Parameters. See {@link FileRequestParams} for possible values. * @return FileList - * @throws FileServiceException + * @throws ClientServicesException */ - public FileList getPublicFolders(Map params) throws FileServiceException { + public EntityList getPublicFolders(Map params) throws ClientServicesException { String accessType = AccessType.PUBLIC.getText(); String requestUri = FileUrls.COLLECTIONS_FEED.format(this, FileUrlParts.accessType.get(accessType)); return getFileEntityList(requestUri, params); @@ -2064,20 +2039,20 @@ public FileList getPublicFolders(Map params) throws FileServiceE * Rest API used : /files/basic/api/document/{document-id}/lock
          * * @param fileId - fileId of the file to be locked. - * @throws FileServiceException + * @throws ClientServicesException */ - public void lock(String fileId) throws FileServiceException { + public void lock(String fileId) throws ClientServicesException { if (StringUtil.isEmpty(fileId)) { - throw new FileServiceException(null, Messages.Invalid_FileId); + throw new ClientServicesException(null, Messages.Invalid_FileId); } String accessType = AccessType.AUTHENTICATED.getText(); String requestUri = FileUrls.LOCK_FILE.format(this, FileUrlParts.accessType.get(accessType), FileUrlParts.fileId.get(fileId)); Map params = new HashMap(); params.put(FileRequestParams.LOCK.getFileRequestParams(), FileConstants.LockType_HARD); try { - super.createData(requestUri, params, null); - } catch (Exception e) { - throw new FileServiceException(e, Messages.MessageExceptionInLockingFile); + createData(requestUri, params, null); + } catch (IOException e) { + throw new ClientServicesException(e, Messages.MessageExceptionInLockingFile); } } @@ -2088,20 +2063,20 @@ public void lock(String fileId) throws FileServiceException { * Rest API Used : /files/basic/api/myfavorites/documents/feed * * @param fileId - * @throws FileServiceException + * @throws ClientServicesException */ - public void pinFile(String fileId) throws FileServiceException { + public void pinFile(String fileId) throws ClientServicesException { if (StringUtil.isEmpty(fileId)) { - throw new FileServiceException(null, Messages.Invalid_FileId); + throw new ClientServicesException(null, Messages.Invalid_FileId); } String accessType = AccessType.AUTHENTICATED.getText(); String requestUri = FileUrls.MYFAVORITES_DOCUMENTS_FEED.format(this, FileUrlParts.accessType.get(accessType), FileUrlParts.fileId.get(fileId)); Map params = new HashMap(); params.put(FileRequestParams.ITEMID.getFileRequestParams(), fileId); try { - super.createData(requestUri, params, null); - } catch (Exception e) { - throw new FileServiceException(e, Messages.MessageExceptionInPinningFile); + createData(requestUri, params, null); + } catch (IOException e) { + throw new ClientServicesException(e, Messages.MessageExceptionInPinningFile); } } /** @@ -2111,10 +2086,10 @@ public void pinFile(String fileId) throws FileServiceException { * Rest API Used : /files/basic/api/myfavorites/collections/feed * * @param folderId - * @throws FileServiceException + * @throws ClientServicesException */ - public void pinFolder(String folderId) throws FileServiceException { - this.pinFolder(folderId, null); + public void pinFolder(String folderId) throws ClientServicesException { + pinFolder(folderId, null); } /** @@ -2126,17 +2101,17 @@ public void pinFolder(String folderId) throws FileServiceException { * @param folderId * @param params filesAddedNotification - String. Indicates whether the collection should be added to * notification at the same time. Options are on and off. The default value is on. - * @throws FileServiceException + * @throws ClientServicesException */ - public void pinFolder(String folderId, Map params) throws FileServiceException { + public void pinFolder(String folderId, Map params) throws ClientServicesException { String accessType = AccessType.AUTHENTICATED.getText(); String requestUri = FileUrls.MYFAVORITES_COLLECTIONS_FEED.format(this, FileUrlParts.accessType.get(accessType), FileUrlParts.folderId.get(folderId)); params = (null == params)?new HashMap():params; params.put(FileRequestParams.ITEMID.getFileRequestParams(), folderId); try { - super.createData(requestUri, params, null); - } catch (Exception e) { - throw new FileServiceException(e, Messages.MessageExceptionInPinningFolder); + createData(requestUri, params, null); + } catch (IOException e) { + throw new ClientServicesException(e, Messages.MessageExceptionInPinningFolder); } } @@ -2149,23 +2124,23 @@ public void pinFolder(String folderId, Map params) throws FileSe * * @param folderId ID of the Collection / Folder from which the File needs to be removed. * @param fileId file Id of the file which need to be removed from the collection. - * @throws FileServiceException + * @throws ClientServicesException */ - public void removeFileFromFolder(String folderId, String fileId) throws FileServiceException { + public void removeFileFromFolder(String folderId, String fileId) throws ClientServicesException { if (StringUtil.isEmpty(folderId)) { - throw new FileServiceException(null, Messages.Invalid_CollectionId); + throw new ClientServicesException(null, Messages.Invalid_CollectionId); } if (StringUtil.isEmpty(fileId)) { - throw new FileServiceException(null, Messages.Invalid_FileId); + throw new ClientServicesException(null, Messages.Invalid_FileId); } String accessType = AccessType.AUTHENTICATED.getText(); String requestUri = FileUrls.COLLECTION_FEED.format(this, FileUrlParts.accessType.get(accessType), FileUrlParts.folderId.get(folderId)); Map params = new HashMap(); params.put(FileRequestParams.ITEMID.getFileRequestParams(), fileId); try { - super.deleteData(requestUri, params, null); - } catch (Exception e) { - throw new FileServiceException(e, Messages.MessageExceptionInDeletingFile); + deleteData(requestUri, params, null); + } catch (IOException e) { + throw new ClientServicesException(e, Messages.MessageExceptionInDeletingFile); } } @@ -2178,10 +2153,10 @@ public void removeFileFromFolder(String folderId, String fileId) throws FileServ * * @param fileId * @return - * @throws FileServiceException + * @throws ClientServicesException */ - public File restoreFileFromRecycleBin(String fileId) throws FileServiceException { - return this.restoreFileFromRecycleBin(fileId, null); + public File restoreFileFromRecycleBin(String fileId) throws ClientServicesException { + return restoreFileFromRecycleBin(fileId, null); } /** @@ -2194,11 +2169,11 @@ public File restoreFileFromRecycleBin(String fileId) throws FileServiceException * @param fileId * @param userId * @return - * @throws FileServiceException + * @throws ClientServicesException */ - public File restoreFileFromRecycleBin(String fileId, String userId) throws FileServiceException { + public File restoreFileFromRecycleBin(String fileId, String userId) throws ClientServicesException { if (StringUtil.isEmpty(fileId)) { - throw new FileServiceException(null, Messages.Invalid_FileId); + throw new ClientServicesException(null, Messages.Invalid_FileId); } String accessType = AccessType.AUTHENTICATED.getText(); String requestUri; @@ -2211,10 +2186,10 @@ public File restoreFileFromRecycleBin(String fileId, String userId) throws FileS params.put(FileRequestParams.UNDELETE.getFileRequestParams(), "true"); Map headers = new HashMap(); try { - Response data = (Response) this.updateData(requestUri, params, headers, null, null); + Response data = (Response) updateData(requestUri, params, headers, null, null); return getFileFeedHandler().createEntity(data); - } catch (Exception e) { - throw new FileServiceException(e, Messages.MessageExceptionInRestoreFile); + } catch (IOException e) { + throw new ClientServicesException(e, Messages.MessageExceptionInRestoreFile); } } @@ -2229,31 +2204,31 @@ public File restoreFileFromRecycleBin(String fileId, String userId) throws FileS * @param communityIds Id/Ids of the communities with which the file needs to be shared * @param params * @return - * @throws FileServiceException + * @throws ClientServicesException * @throws TransformerException */ public void shareFileWithCommunities(String fileId, List communityIds, Map params) - throws FileServiceException, TransformerException { + throws ClientServicesException, TransformerException { if (StringUtil.isEmpty(fileId)) { - throw new FileServiceException(null, Messages.Invalid_FileId); + throw new ClientServicesException(null, Messages.Invalid_FileId); } for (String communityId : communityIds) { if (StringUtil.isEmpty(communityId)) { - throw new FileServiceException(null, Messages.Invalid_CommunityId); + throw new ClientServicesException(null, Messages.Invalid_CommunityId); } } String accessType = AccessType.AUTHENTICATED.getText(); String requestUri = FileUrls.MYUSERLIBRARY_RECYCLEBIN_ENTRY.format(this, FileUrlParts.accessType.get(accessType), FileUrlParts.fileId.get(fileId)); params = (null == params)?new HashMap():params; - Object payload = this.constructPayloadForMultipleEntries(communityIds, + Object payload = constructPayloadForMultipleEntries(communityIds, FileRequestParams.ITEMID.getFileRequestParams(), "community"); Map headers = new HashMap(); headers.put(Headers.ContentType, Headers.ATOM); headers.put(Headers.ContentLanguage, Headers.UTF); try { - super.createData(requestUri, params, headers, payload); - } catch (Exception e) { - throw new FileServiceException(e, "Error sharing the file"); + createData(requestUri, params, headers, payload); + } catch (IOException e) { + throw new ClientServicesException(e, "Error sharing the file"); } } @@ -2264,20 +2239,20 @@ public void shareFileWithCommunities(String fileId, List communityIds, M * Rest API used : /files/basic/api/document/{document-id}/lock
          * * @param fileId - fileId of the file to be unlocked. - * @throws FileServiceException + * @throws ClientServicesException */ - public void unlock(String fileId) throws FileServiceException { + public void unlock(String fileId) throws ClientServicesException { if (StringUtil.isEmpty(fileId)) { - throw new FileServiceException(null, Messages.Invalid_FileId); + throw new ClientServicesException(null, Messages.Invalid_FileId); } String accessType = AccessType.AUTHENTICATED.getText(); String requestUri = FileUrls.LOCK_FILE.format(this, FileUrlParts.accessType.get(accessType), FileUrlParts.fileId.get(fileId)); Map params = new HashMap(); params.put(FileRequestParams.LOCK.getFileRequestParams(), "NONE"); try { - super.createData(requestUri, params, null); - } catch (Exception e) { - throw new FileServiceException(e, "Error unlocking the file"); + createData(requestUri, params, null); + } catch (IOException e) { + throw new ClientServicesException(e, "Error unlocking the file"); } } @@ -2288,32 +2263,32 @@ public void unlock(String fileId) throws FileServiceException { * Rest API Used : /files/basic/api/myfavorites/documents/feed * * @param fileId - * @throws FileServiceException + * @throws ClientServicesException */ - public void unPinFile(String fileId) throws FileServiceException { + public void unPinFile(String fileId) throws ClientServicesException { if (StringUtil.isEmpty(fileId)) { - throw new FileServiceException(null, Messages.Invalid_FileId); + throw new ClientServicesException(null, Messages.Invalid_FileId); } String accessType = AccessType.AUTHENTICATED.getText(); String requestUri = FileUrls.MYFAVORITES_DOCUMENTS_FEED.format(this, FileUrlParts.accessType.get(accessType), FileUrlParts.fileId.get(fileId)); Map params = new HashMap(); params.put(FileRequestParams.ITEMID.getFileRequestParams(), fileId); try { - super.deleteData(requestUri, params ,null); - } catch (Exception e) { - throw new FileServiceException(e, "Error unpinning the file"); + deleteData(requestUri, params ,null); + } catch (IOException e) { + throw new ClientServicesException(e, "Error unpinning the file"); } } - public void unPinFolder(String folderId) throws FileServiceException { + public void unPinFolder(String folderId) throws ClientServicesException { String accessType = AccessType.AUTHENTICATED.getText(); String requestUri = FileUrls.MYFAVORITES_COLLECTIONS_FEED.format(this, FileUrlParts.accessType.get(accessType), FileUrlParts.folderId.get(folderId)); Map params = new HashMap(); params.put(FileRequestParams.ITEMID.getFileRequestParams(), folderId); try { - super.deleteData(requestUri, params, null); - } catch (Exception e) { - throw new FileServiceException(e, "Error unpinning the folder"); + deleteData(requestUri, params, null); + } catch (IOException e) { + throw new ClientServicesException(e, "Error unpinning the folder"); } } @@ -2326,12 +2301,12 @@ public void unPinFolder(String folderId) throws FileServiceException { * @param params * @param comment * @return - * @throws FileServiceException + * @throws ClientServicesException * @throws TransformerException */ public Comment updateComment(String fileId, String commentId, Map params, - String comment) throws FileServiceException, TransformerException { - return this.updateComment(fileId, commentId, comment, "", params); + String comment) throws ClientServicesException, TransformerException { + return updateComment(fileId, commentId, comment, "", params); } /** @@ -2342,12 +2317,12 @@ public Comment updateComment(String fileId, String commentId, Map params) throws FileServiceException, TransformerException { + Map params) throws ClientServicesException, TransformerException { if (StringUtil.isEmpty(fileId)) { - throw new FileServiceException(null, Messages.Invalid_FileId); + throw new ClientServicesException(null, Messages.Invalid_FileId); } if (StringUtil.isEmpty(commentId)) { - throw new FileServiceException(null, Messages.Invalid_CommentId); + throw new ClientServicesException(null, Messages.Invalid_CommentId); } String accessType = AccessType.AUTHENTICATED.getText(); String requestUri; @@ -2399,14 +2374,14 @@ public Comment updateComment(String fileId, String commentId, String comment, St } Map headers = new HashMap(); headers.put(Headers.ContentType, Headers.ATOM); - Object payload = this.constructPayloadForComments(comment); + Object payload = constructPayloadForComments(comment); try { - Response result = (Response) this.updateData(requestUri, params, headers, payload, null); + Response result = (Response) updateData(requestUri, params, headers, payload, null); return getCommentFeedHandler().createEntity(result); } catch (Exception e) { - throw new FileServiceException(e, Messages.MessageExceptionInUpdatingComment); + throw new ClientServicesException(e, Messages.MessageExceptionInUpdatingComment); } } @@ -2422,14 +2397,14 @@ public Comment updateComment(String fileId, String commentId, String comment, St * @param title * @param params * @return File - * @throws FileServiceException + * @throws ClientServicesException */ - public File updateFile(java.io.InputStream iStream, String fileId, String title, Map params) throws FileServiceException { + public File updateFile(InputStream iStream, String fileId, String title, Map params) throws ClientServicesException { File newVersionFile = uploadNewVersionFile(iStream, fileId, title, params); try { return updateFileMetadata(newVersionFile, params); } catch (TransformerException e) { - throw new FileServiceException(e, Messages.MessageExceptionInUpdate); + throw new ClientServicesException(e, Messages.MessageExceptionInUpdate); } } @@ -2443,9 +2418,9 @@ public File updateFile(java.io.InputStream iStream, String fileId, String title, * @param title * @param params * @return File - * @throws FileServiceException + * @throws ClientServicesException */ - public File updateCommunityFile(java.io.InputStream iStream, String fileId, String title, String communityLibraryId, Map params) throws FileServiceException { + public File updateCommunityFile(java.io.InputStream iStream, String fileId, String title, String communityLibraryId, Map params) throws ClientServicesException { File newVersionFile = uploadNewVersionCommunityFile(iStream, fileId, title, communityLibraryId, params); return updateCommunityFileMetadata(newVersionFile, communityLibraryId, params); } @@ -2462,18 +2437,18 @@ public File updateCommunityFile(java.io.InputStream iStream, String fileId, Stri * @param fileName * @param params * @return File - * @throws FileServiceException + * @throws ClientServicesException */ public File uploadNewVersionFile(java.io.InputStream iStream, String fileId, String title, Map params) - throws FileServiceException { + throws ClientServicesException { if (StringUtil.isEmpty(fileId)) { - throw new FileServiceException(null, Messages.Invalid_FileId); + throw new ClientServicesException(null, Messages.Invalid_FileId); } if (iStream == null) { - throw new FileServiceException(null, Messages.Invalid_Stream); + throw new ClientServicesException(null, Messages.Invalid_Stream); } if (StringUtil.isEmpty(title)) { - throw new FileServiceException(null, Messages.Invalid_Name); + throw new ClientServicesException(null, Messages.Invalid_Name); } String accessType = AccessType.AUTHENTICATED.getText(); String requestUri = FileUrls.MYUSERLIBRARY_DOCUMENT_ENTRY.format(this, FileUrlParts.accessType.get(accessType), FileUrlParts.fileId.get(fileId)); @@ -2483,10 +2458,10 @@ public File uploadNewVersionFile(java.io.InputStream iStream, String fileId, Str headers.put("X-Update-Nonce", getNonce()); // It is not clearly documented which Content Type requires Nonce, thus adding nonce in header for all upload requests. try { //TODO: check get data wrapping - Response result = (Response) this.updateData(requestUri, params, headers, contentFile, null); + Response result = (Response) updateData(requestUri, params, headers, contentFile, null); return getFileFeedHandler().createEntity(result); - } catch (Exception e) { - throw new FileServiceException(e, Messages.MessageExceptionInUpdate); + } catch (IOException e) { + throw new ClientServicesException(e, Messages.MessageExceptionInUpdate); } } @@ -2497,9 +2472,9 @@ public File uploadNewVersionFile(java.io.InputStream iStream, String fileId, Str * @param file * @param params * @return - * @throws FileServiceException + * @throws ClientServicesException */ - public File updateFile(java.io.InputStream inputStream, File file, Map params) throws FileServiceException { + public File updateFile(java.io.InputStream inputStream, File file, Map params) throws ClientServicesException { String requestUrl = file.getEditMediaUrl(); Content contentFile = getContentObject(file.getTitle(), inputStream); @@ -2508,10 +2483,10 @@ public File updateFile(java.io.InputStream inputStream, File file, Map params) - throws FileServiceException { + throws ClientServicesException { if (StringUtil.isEmpty(fileId)) { - throw new FileServiceException(null, Messages.Invalid_FileId); + throw new ClientServicesException(null, Messages.Invalid_FileId); } if (iStream == null) { - throw new FileServiceException(null, Messages.Invalid_Stream); + throw new ClientServicesException(null, Messages.Invalid_Stream); } if (title == null) { - throw new FileServiceException(null, Messages.Invalid_Name); + throw new ClientServicesException(null, Messages.Invalid_Name); } if (StringUtil.isEmpty(communityId)) { - throw new FileServiceException(null, Messages.Invalid_CommunityId); + throw new ClientServicesException(null, Messages.Invalid_CommunityId); } String accessType = AccessType.AUTHENTICATED.getText(); String requestUri = FileUrls.UPLOAD_NEW_VERSION_COMMUNITY_FILE.format(this, FileUrlParts.accessType.get(accessType), FileUrlParts.communityId.get(communityId), FileUrlParts.fileId.get(fileId)); @@ -2551,8 +2526,8 @@ public File uploadNewVersionCommunityFile(java.io.InputStream iStream, String fi headers.put("X-Update-Nonce", getNonce()); // It is not clearly documented which Content Type requires Nonce, thus adding nonce in header for all upload requests. try { return uploadNewVersion(requestUri, contentFile, params, headers); - } catch (Exception e) { - throw new FileServiceException(e, Messages.MessageExceptionInUpload); + } catch (IOException e) { + throw new ClientServicesException(e, Messages.MessageExceptionInUpload); } } @@ -2567,7 +2542,7 @@ public File uploadNewVersionCommunityFile(java.io.InputStream iStream, String fi */ private File uploadNewVersion(String requestUri, ContentStream stream, Map params, Map headers) throws ClientServicesException, IOException { //TODO: check get data wrapping - Response result = (Response) this.updateData(requestUri, params, headers, stream, null); + Response result = (Response) updateData(requestUri, params, headers, stream, null); return getFileFeedHandler().createEntity(result); } @@ -2578,17 +2553,17 @@ private File uploadNewVersion(String requestUri, ContentStream stream, Map headers = new HashMap(); headers.put("X-Update-Nonce", getNonce()); // It is not clearly documented which Content Type requires Nonce, thus adding nonce in header for all upload requests. try { - Response data = (Response) super.createData(requestUri, null, headers, contentFile); + Response data = (Response) createData(requestUri, null, headers, contentFile); return getFileFeedHandler().createEntity(data); - } catch (ClientServicesException e) { - throw new FileServiceException(e, Messages.MessageExceptionInUpload); } catch (IOException e) { - throw new FileServiceException(e, Messages.MessageExceptionInUpload); + throw new ClientServicesException(e, Messages.MessageExceptionInUpload); } } @@ -2612,16 +2585,16 @@ public File uploadCommunityFile(InputStream iStream, String communityId, final S * @param params * @param requestBody * @return File - * @throws FileServiceException + * @throws ClientServicesException */ - public File updateFileMetadata(File fileEntry, Map params, Document requestBody) throws FileServiceException { + public File updateFileMetadata(File fileEntry, Map params, Document requestBody) throws ClientServicesException { if (fileEntry == null) { - throw new FileServiceException(null, Messages.Invalid_File); + throw new ClientServicesException(null, Messages.Invalid_File); } if (StringUtil.isEmpty(fileEntry.getFileId())) { - throw new FileServiceException(null, Messages.Invalid_FileId); + throw new ClientServicesException(null, Messages.Invalid_FileId); } - return this.updateFileMetadata(fileEntry.getFileId(), params, requestBody); + return updateFileMetadata(fileEntry.getFileId(), params, requestBody); } /** @@ -2631,17 +2604,17 @@ public File updateFileMetadata(File fileEntry, Map params, Docum * @param params * @param payloadMap * @return - * @throws FileServiceException + * @throws ClientServicesException * @throws TransformerException */ - public File updateFileMetadata(File fileEntry, Map params) throws FileServiceException, TransformerException { + public File updateFileMetadata(File fileEntry, Map params) throws ClientServicesException, TransformerException { if (fileEntry == null) { - throw new FileServiceException(null, Messages.Invalid_FileEntry); + throw new ClientServicesException(null, Messages.Invalid_FileEntry); } if (StringUtil.isEmpty(fileEntry.getFileId())) { - throw new FileServiceException(null, Messages.Invalid_FileId); + throw new ClientServicesException(null, Messages.Invalid_FileId); } - return this.updateFileMetadata(fileEntry.getFileId(), params, fileEntry.getFieldsMap()); + return updateFileMetadata(fileEntry.getFileId(), params, fileEntry.getFieldsMap()); } /** @@ -2650,15 +2623,15 @@ public File updateFileMetadata(File fileEntry, Map params) throw * @param fileId * @param updationsMap a Map of updations which need to be done to the file. * @return - * @throws FileServiceException + * @throws ClientServicesException * @throws TransformerException */ public File updateFileMetadata(String fileId, Map updationsMap) - throws FileServiceException, TransformerException { + throws ClientServicesException, TransformerException { Map payloadMap = new HashMap(); Map paramsMap = new HashMap(); - this.parseUpdationsMap(updationsMap, payloadMap, paramsMap); - return this.updateFileMetadata(fileId, paramsMap, payloadMap); + parseUpdationsMap(updationsMap, payloadMap, paramsMap); + return updateFileMetadata(fileId, paramsMap, payloadMap); } /** @@ -2673,21 +2646,21 @@ public File updateFileMetadata(String fileId, Map updationsMap) * @param requestBody - Document which is passed directly as requestBody to the execute request. This * method is used to update the metadata/content of File in Connections. * @return File - * @throws FileServiceException + * @throws ClientServicesException */ public File updateFileMetadata(String fileId, Map params, Document requestBody) - throws FileServiceException { + throws ClientServicesException { String accessType = AccessType.AUTHENTICATED.getText(); if (StringUtil.isEmpty(fileId)) { return new File(); } String requestUri = FileUrls.MYUSERLIBRARY_DOCUMENT_ENTRY.format(this, FileUrlParts.accessType.get(accessType), FileUrlParts.fileId.get(fileId)); try { - Response result = (Response) super.updateData(requestUri, params, new ClientService.ContentXml( + Response result = (Response) updateData(requestUri, params, new ClientService.ContentXml( requestBody, "application/atom+xml"), null); return getFileFeedHandler().createEntity(result); - } catch (Exception e) { - throw new FileServiceException(e, Messages.MessageExceptionInRestoreFile); + } catch (IOException e) { + throw new ClientServicesException(e, Messages.MessageExceptionInRestoreFile); } } @@ -2703,27 +2676,27 @@ public File updateFileMetadata(String fileId, Map params, Docume * @param payloadMap - Map of entries for which we will construct a Request Body. See * {@link FileRequestPayload} for possible values. * @return File - * @throws FileServiceException + * @throws ClientServicesException * @throws TransformerException */ public File updateFileMetadata(String fileId, Map params, - Map payloadMap) throws FileServiceException, TransformerException { + Map payloadMap) throws ClientServicesException, TransformerException { if (StringUtil.isEmpty(fileId)) { return new File(); } Document updateFilePayload = null; - updateFilePayload = this.constructPayload(fileId, payloadMap); - return this.updateFileMetadata(fileId, params, updateFilePayload); + updateFilePayload = constructPayload(fileId, payloadMap); + return updateFileMetadata(fileId, params, updateFilePayload); } // Need to figure out what should be done with the label updation of comment. Connection Doc states that // comment updations here can be done on comment content and on label. But what is the label of the // comment ? Need to check this. - public void updateFlaggedComment(String commentId, String updatedComment) throws FileServiceException, TransformerException { + public void updateFlaggedComment(String commentId, String updatedComment) throws ClientServicesException, TransformerException { if (StringUtil.isEmpty(commentId)) { - throw new FileServiceException(null, Messages.Invalid_CommentId); + throw new ClientServicesException(null, Messages.Invalid_CommentId); } - String requestUri = this.getModerationUri(commentId, Categories.REVIEW.get(), ModerationContentTypes.COMMENT.get()); + String requestUri = getModerationUri(commentId, Categories.REVIEW.get(), ModerationContentTypes.COMMENT.get()); // File File = (File) executeGet(requestUri, null, ClientService.FORMAT_XML, // null).get(0); @@ -2734,52 +2707,52 @@ public void updateFlaggedComment(String commentId, String updatedComment) throws // if (payloadMap != null && !payloadMap.isEmpty()) { headers.put(Headers.ContentType, Headers.ATOM); // } - Document payload = this.constructPayloadForComments(updatedComment); // TODO + Document payload = constructPayloadForComments(updatedComment); // TODO try { - this.updateData(requestUri, null, headers, payload, null); - } catch (Exception e) { - throw new FileServiceException(e, Messages.MessageExceptionInRestoreFile); + updateData(requestUri, null, headers, payload, null); + } catch (IOException e) { + throw new ClientServicesException(e, Messages.MessageExceptionInRestoreFile); } } public void updateFlaggedFile(String fileId, Map updationsMap/* to title, tag and content */) - throws FileServiceException, TransformerException { + throws ClientServicesException, TransformerException { if (StringUtil.isEmpty(fileId)) { - throw new FileServiceException(null, Messages.Invalid_FileId); + throw new ClientServicesException(null, Messages.Invalid_FileId); } - String requestUri = this.getModerationUri(fileId, Categories.REVIEW.get(), ModerationContentTypes.DOCUMENTS.get()); + String requestUri = getModerationUri(fileId, Categories.REVIEW.get(), ModerationContentTypes.DOCUMENTS.get()); // File File = (File) executeGet(requestUri, null, ClientService.FORMAT_XML, // null).get(0); Map payloadMap = new HashMap(); Map paramsMap = new HashMap(); Map headers = new HashMap(); - this.parseUpdationsMap(updationsMap, payloadMap, paramsMap); + parseUpdationsMap(updationsMap, payloadMap, paramsMap); if (payloadMap != null && !payloadMap.isEmpty()) { headers.put(Headers.ContentType, Headers.ATOM); } - Document payload = this.constructPayload(fileId, payloadMap); + Document payload = constructPayload(fileId, payloadMap); try { - this.updateData(requestUri, null, headers, payload, null); - } catch (Exception e) { - throw new FileServiceException(e, Messages.MessageExceptionInRestoreFile); + updateData(requestUri, null, headers, payload, null); + } catch (IOException e) { + throw new ClientServicesException(e, Messages.MessageExceptionInRestoreFile); } } public File updateFolder(String folderId, String name, String description, String shareWith) - throws FileServiceException, TransformerException { + throws ClientServicesException, TransformerException { String accessType = AccessType.AUTHENTICATED.getText(); String requestUri = FileUrls.COLLECTION_ENTRY.format(this, FileUrlParts.accessType.get(accessType), FileUrlParts.folderId.get(folderId)); - Document payload = this.constructPayloadFolder(name, description, shareWith, "update"); + Document payload = constructPayloadFolder(name, description, shareWith, "update"); Map headers = new HashMap(); headers.put(Headers.ContentType, Headers.ATOM); try { - Response result = (Response) this.updateData(requestUri, null, headers, payload, null); + Response result = (Response) updateData(requestUri, null, headers, payload, null); return getFileFeedHandler().createEntity(result); - } catch (Exception e) { - throw new FileServiceException(e, Messages.MessageExceptionInRestoreFile); + } catch (IOException e) { + throw new ClientServicesException(e, Messages.MessageExceptionInRestoreFile); } } @@ -2791,10 +2764,10 @@ public File updateFolder(String folderId, String name, String description, Strin * * @param file - a readable file on the server * @return File - * @throws FileServiceException + * @throws ClientServicesException */ - public File uploadFile(java.io.File file) throws FileServiceException { - return this.uploadFile(file, null); + public File uploadFile(java.io.File file) throws ClientServicesException { + return uploadFile(file, null); } /** @@ -2805,21 +2778,21 @@ public File uploadFile(java.io.File file) throws FileServiceException { * @param file - a readable file on the server * @param parameters - file creation parameters, can be null * @return File - * @throws FileServiceException + * @throws ClientServicesException */ - public File uploadFile(java.io.File file, Map parameters) throws FileServiceException { + public File uploadFile(java.io.File file, Map parameters) throws ClientServicesException { if (file == null) { - throw new FileServiceException(null, Messages.Invalid_FileId); + throw new ClientServicesException(null, Messages.Invalid_FileId); } if (!file.canRead()) { - throw new FileServiceException(null, Messages.MessageCannotReadFile, + throw new ClientServicesException(null, Messages.MessageCannotReadFile, file.getAbsolutePath()); } try { - return this.uploadFile(new FileInputStream(file), file.getName(), file.length(), parameters); + return uploadFile(new FileInputStream(file), file.getName(), file.length(), parameters); } catch (FileNotFoundException e) { - throw new FileServiceException(null, Messages.MessageCannotReadFile, + throw new ClientServicesException(null, Messages.MessageCannotReadFile, file.getAbsolutePath()); } } @@ -2832,9 +2805,9 @@ public File uploadFile(java.io.File file, Map parameters) throws * @param title * @param length * @return File - * @throws FileServiceException + * @throws ClientServicesException */ - public File uploadFile(java.io.InputStream stream, final String title, long length) throws FileServiceException { + public File uploadFile(java.io.InputStream stream, final String title, long length) throws ClientServicesException { return uploadFile(stream, title, length, null); } @@ -2848,15 +2821,15 @@ public File uploadFile(java.io.InputStream stream, final String title, long leng * @param length * @param p - parameters * @return File - * @throws FileServiceException + * @throws ClientServicesException */ public File uploadFile(java.io.InputStream stream, final String title, long length, - Map p) throws FileServiceException { + Map p) throws ClientServicesException { if (stream == null) { - throw new FileServiceException(null, Messages.Invalid_Stream); + throw new ClientServicesException(null, Messages.Invalid_Stream); } if (title == null) { - throw new FileServiceException(null, Messages.Invalid_Name); + throw new ClientServicesException(null, Messages.Invalid_Name); } Content contentFile = getContentObject(title, stream, length); String accessType = AccessType.AUTHENTICATED.getText(); @@ -2864,18 +2837,18 @@ public File uploadFile(java.io.InputStream stream, final String title, long leng Map headers = new HashMap(); headers.put("X-Update-Nonce", getNonce()); // It is not clearly documented which Content Type requires Nonce, thus adding nonce in header for all upload requests. try { - Response data = (Response) super.createData(requestUri, p, headers, contentFile); + Response data = (Response) createData(requestUri, p, headers, contentFile); if (logger.isLoggable(Level.FINEST)) { logger.exiting(sourceClass, "uploadFile", data); } return getFileFeedHandler().createEntity(data); - } catch (Exception e) { + } catch (IOException e) { if (logger.isLoggable(Level.FINE)) { String msg = MessageFormat.format("Error uploading file {0} length {1}", title, length); logger.log(Level.FINE, msg, e); } - throw new FileServiceException(e, Messages.MessageExceptionInUpload); + throw new ClientServicesException(e, Messages.MessageExceptionInUpload); } } @@ -2953,7 +2926,7 @@ private Document constructPayload(String fileId, Map payloadMap) */ private Document constructPayloadFolder(String name, String description, String shareWith, String operation) throws TransformerException { - return this.constructPayloadFolder(name, description, shareWith, operation, null); + return constructPayloadFolder(name, description, shareWith, operation, null); } private Document constructPayloadFolder(String name, String description, String shareWith, @@ -2996,7 +2969,7 @@ private Document constructPayloadFolder(String name, String description, String */ private Document constructPayloadForComments(String comment) throws TransformerException { - return this.constructPayloadForComments(null, comment); + return constructPayloadForComments(null, comment); } /** @@ -3020,7 +2993,7 @@ private Document constructPayloadForComments(String operation, String commentToB } CommentTransformer commentTransformer = new CommentTransformer(); String payload = commentTransformer.transform(fieldsMap); - return this.convertToXML(payload.toString()); + return convertToXML(payload.toString()); } /** @@ -3044,7 +3017,7 @@ private Object constructPayloadForFlagging(String fileId, String content, String ModerationTransformer moderationTransformer = new ModerationTransformer(); String payload = moderationTransformer.transform(fieldsMap); - return this.convertToXML(payload.toString()); + return convertToXML(payload.toString()); } private Object constructPayloadForModeration(String fileId, String action, String actionReason, @@ -3059,11 +3032,11 @@ private Object constructPayloadForModeration(String fileId, String action, Strin fieldsMap.put("action", action); ModerationTransformer moderationTransformer = new ModerationTransformer(); String payload = moderationTransformer.transform(fieldsMap); - return this.convertToXML(payload.toString()); + return convertToXML(payload.toString()); } private Document constructPayloadForMultipleEntries(List listOfFileIds, String multipleEntryId) throws TransformerException { - return this.constructPayloadForMultipleEntries(listOfFileIds, multipleEntryId, null); + return constructPayloadForMultipleEntries(listOfFileIds, multipleEntryId, null); } private Document constructPayloadForMultipleEntries(List listOfIds, String multipleEntryId, @@ -3071,7 +3044,7 @@ private Document constructPayloadForMultipleEntries(List listOfIds, Stri MultipleFileTransformer mfTransformer = new MultipleFileTransformer(); String payload = mfTransformer.transform(listOfIds, category); - return this.convertToXML(payload.toString()); + return convertToXML(payload.toString()); } /** @@ -3114,8 +3087,7 @@ private boolean fileRequestParamsContains(String key) { return false; } - private String getModerationUri(String contentId, String action, String content) - throws FileServiceException { + private String getModerationUri(String contentId, String action, String content) throws ClientServicesException { FilesModerationDocumentEntry fileModDocEntry = getFilesModerationDocumentEntry(); // get the request URI from the service document. String requestUri = fileModDocEntry.get(ContentMapFiles.moderationMap.get("getFileUrl")); // TODO @@ -3127,9 +3099,9 @@ private String getModerationUri(String contentId, String action, String content) } FileList resultantEntries; try { - resultantEntries = (FileList) this.getEntities(requestUri, null, getFileFeedHandler()); - } catch (Exception e) { - throw new FileServiceException(e, Messages.MessageExceptionInReadingObject); + resultantEntries = (FileList) getEntities(requestUri, null, getFileFeedHandler()); + } catch (IOException e) { + throw new ClientServicesException(e, Messages.MessageExceptionInReadingObject); } String uri = null; @@ -3151,9 +3123,9 @@ private void parseUpdationsMap(Map updationsMap, Map fieldMapPairs = entries.next(); String key = fieldMapPairs.getKey(); - if (this.fileRequestParamsContains(key)) { + if (fileRequestParamsContains(key)) { paramsMap.put(key, fieldMapPairs.getValue()); - } else if (this.filePayloadParamsContains(key)) { + } else if (filePayloadParamsContains(key)) { payloadMap.put(key, fieldMapPairs.getValue()); } else { // these parameters currently will get ignored. check this .. TODO @@ -3161,52 +3133,44 @@ private void parseUpdationsMap(Map updationsMap, Map c = Arrays.asList(new String[] { folderId }); addFileToFolders(fileId, c); } - protected File getFileEntity(String requestUrl, Map parameters) throws FileServiceException { + protected File getFileEntity(String requestUrl, Map parameters) throws ClientServicesException { try { - return (File)getEntity(requestUrl, getParameters(parameters), getFileFeedHandler()); + return getEntity(requestUrl, getParameters(parameters), getFileFeedHandler()); } catch (IOException e) { - throw new FileServiceException(e); - } catch(ClientServicesException e){ - throw new FileServiceException(e); + throw new ClientServicesException(e); } } - protected FileList getFileEntityList(String requestUrl, Map parameters) throws FileServiceException { + protected EntityList getFileEntityList(String requestUrl, Map parameters) throws ClientServicesException { try { - return (FileList)getEntities(requestUrl, getParameters(parameters), getFileFeedHandler()); + return getEntities(requestUrl, getParameters(parameters), getFileFeedHandler()); } catch (IOException e) { - throw new FileServiceException(e); - } catch(ClientServicesException e){ - throw new FileServiceException(e); + throw new ClientServicesException(e); } } - protected Comment getCommentEntity(String requestUrl, Map parameters) throws FileServiceException { + protected Comment getCommentEntity(String requestUrl, Map parameters) throws ClientServicesException { try { if (parameters == null) parameters = getCommentParams(); else parameters.putAll(getCommentParams()); - return (Comment)getEntity(requestUrl, getParameters(parameters), getCommentFeedHandler()); + return getEntity(requestUrl, getParameters(parameters), getCommentFeedHandler()); } catch (IOException e) { - throw new FileServiceException(e); - } catch(ClientServicesException e){ - throw new FileServiceException(e); + throw new ClientServicesException(e); } } - protected CommentList getCommentEntityList(String requestUrl, Map parameters, Map headers) throws FileServiceException { + protected EntityList getCommentEntityList(String requestUrl, Map parameters, Map headers) throws ClientServicesException { try { - return (CommentList)getEntities(requestUrl, getParameters(parameters), headers, getCommentFeedHandler()); + return getEntities(requestUrl, getParameters(parameters), headers, getCommentFeedHandler()); } catch (IOException e) { - throw new FileServiceException(e); - } catch(ClientServicesException e){ - throw new FileServiceException(e); + throw new ClientServicesException(e); } } }