This example opens 2 documents, creates a document based on a template, and displays the name of second document opened in Lotus Symphony, at last saves and closes all the documents.
import com.ibm.symphony.javaapi.Application; import com.ibm.symphony.javaapi.document.Document; import com.ibm.symphony.javaapi.document.Documents; public class DocumentsExample { public void example() { try { Application application = Application.getInstance(); Documents documents = application.getDocuments(); Document doc1 = documents.openDocument("D:\\test.odt", true); Document doc2 = documents.addDocument("D:\\test.ott", false, true); Document doc3 = documents.openDocument("D:\\test3.odt", true); System.out.println(documents.item(2).getName()); documents.saveDocuments(); documents.closeDocuments(false); } catch (Exception e) { e.printStackTrace(); } } }
Related information