IBM SBT: com.ibm.sbt.services.client.connections.files.model.FileEntry no longer present in latest SDK?

StackOverflow https://stackoverflow.com/questions/21602243

  •  07-10-2022
  •  | 
  •  

Question

Getting Started Tutorial: http://www-10.lotus.com/ldd/appdevwiki.nsf/xpDocViewer.xsp?lookupName=IBM+Social+Business+Toolkit+SDK+documentation#action=openDocument&res_title=Creating_your_first_J2EE_application_SDK1.0&content=pdcontent&sa=true

I was looking through the getting started tutorial and i did step 1 but it just so happens that Step 1.I's FileEntry datatype couldn't be resolved. Is there a new tutorial up somewhere that I can use? I'm using the latest version of the IBM SBT SDK, BTW.

Here's a snippet of the code on step 1.I:

            <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
            <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
            <%@page import="com.ibm.sbt.services.client.connections.files.model.FileRequestParams"%>
            <%@page import="java.util.HashMap"%>
            <%@page import="com.ibm.sbt.services.client.connections.files.FileService"%>
            <%@page import="com.ibm.sbt.services.client.connections.files.model.FileEntry"%>
            <%@page import="java.util.List"%>
            <%@page import="java.util.Map"%>
            <%@page import="com.ibm.commons.runtime.Application"%>
            <%@page import="com.ibm.commons.runtime.Context"%>  
            <html>
                        <head><title>My Files</title></head>
                        <body>
                            <div id="content">
                            <%
                            try {       
                                FileService fileService = new FileService();
                                List<FileEntry> files = fileService.getPublicFiles(null);
                                if(files != null && ! files.isEmpty()) {
                                    for (Iterator iterator = files.iterator(); iterator.hasNext();) {
                                    FileEntry file = (FileEntry)iterator.next();
                                    out.println("<a href=\"" + file.getDownloadLink() + "\"> " + file.getLabel() + "</a><br/>" );
                                }
                                } else {
                                    out.println("No Results");
                                }
                            } catch (Throwable e) {}                    
                            %>
                            </div>
                        </body> 
            </html>
Was it helpful?

Solution

You should use...

com.ibm.sbt.services.client.connections.files.FileList i think it inherits from collection https://github.com/OpenNTF/SocialSDK/blob/master/sdk/com.ibm.sbt.core/src/main/java/com/ibm/sbt/services/client/connections/files/FileList.java

com.ibm.sbt.services.client.connections.files.File instead of FileEntry https://github.com/OpenNTF/SocialSDK/blob/master/sdk/com.ibm.sbt.core/src/main/java/com/ibm/sbt/services/client/connections/files/File.java

Based on this snippet... https://greenhouse.lotus.com/sbt/SBTPlayground.nsf/JavaSnippets.xsp#snippet=Social_Files_Get_File_Comments

try {   
    FileService fileService = new FileService();
   FileList files = fileService.getPublicFiles(null);
    if(files != null && ! files.isEmpty()) {
        for (File file : files) {
            out.println("<a href=\"" + file.getDownloadLink() + "\"> " + file.getLabel() + "</a><br/>" );
        }
    } else {
    out.println("No Results");
    }
} catch (Throwable e) {} 

I'm also reporting the documentation error

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top