HI All,
I am referring the DFC developers guide 6.5 and have come across the example for communication with the content server.The example on
Chapter 4: Creating a Test Application (Page 43 )uses a Swing interface.As a starting point, i decided to try the connection with the Content Server. But i am not sure how to display the connection sucess or failure on my UI.I decided to use the configuration of "Hello World" JSP file which i display in the work area to internally trigger a call to my Java class thereby printing the Status of connection on the Tomcat console.
The following are the files,
1) menubar_component.xml:
The following line added:
actionmenuitem dynamic="genericnoselect" id="send_freeway" name="send_freeway" nlsid="MSG_FREEWAY" action="hello_world_action" showifinvalid="true"/> ("Send To Freeway" is the custom link i see on my menubar)
<
2) The following start page added also to menubar_component.xml:
<pages>
<start>/custom/classic/menubar/menubar.jsp</start>
</pages>
3) Created file hello_world_action.xml
<config version='1.0'><scope><action id="hello_world_action"><execution class="com.documentum.web.formext.action.LaunchComponent"><component>hello_world_component</component><navigation>jump</navigation></execution></action></scope></config>4) Created hello_world_component.xml <?xml version="1.0" encoding="ISO-8859-1" standalone="no"?><config version='1.0'><scope><!-- the following tag defines the id of the component --><component id="hello_world_component"><pages><start>/custom/hello_world/hello_world.jsp</start></pages><class>com.documentum.custom.library.DummyComponent</class></component></scope></config>5)Created hello_world.jsp <%@page contentType="text/html"%><%@ page errorPage="/wdk/errorhandler.jsp" %><%@ taglib uri="/WEB-INF/tlds/dmform_1_0.tld" prefix="dmf" %><%@ taglib uri="/WEB-INF/tlds/dmformext_1_0.tld" prefix="dmfx" %><html><head><dmf:webform /></head><body><dmf:form><font color="darkred"><b>Hello World</b></font></dmf:form></body></html>6) And finally the class file DummyComponent.javapackage com.documentum.custom.library;import com.documentum.web.common.ArgumentList;
import com.documentum.web.formext.component.Component;
import javax.servlet.http.*;
import java.util.Iterator;
import java.util.List;
import com.documentum.web.contentxfer.http.HttpTransportManager;
import java.util.Enumeration;
import java.io.File;
import java.io.FileInputStream;
import java.io.DataInputStream;
import java.io.ByteArrayOutputStream;import com.documentum.com.DfClientX;
import com.documentum.fc.client.IDfClient;
import com.documentum.fc.client.IDfCollection;
import com.documentum.fc.client.IDfSession;
import com.documentum.fc.client.IDfSessionManager;
import com.documentum.fc.client.IDfSysObject;
import com.documentum.fc.client.IDfTypedObject;
import com.documentum.fc.common.IDfId;
import com.documentum.fc.common.IDfLoginInfo;
import java.awt.Dimension;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.StringTokenizer;
import java.util.Vector;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JScrollPane;
import javax.swing.JSeparator;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.SwingConstants;public class DummyComponent extends Component
{
private IDfSessionManager m_sessionManager; private Boolean createSessionManager() {
try {
System.out.println("This is inside createSessionManager");
// The only class we instantiate directly is DfClientX.
DfClientX clientx = new DfClientX();
// Most objects are created using factory methods in interfaces.
// Create a client based on the DfClientX object.
IDfClient client = clientx.getLocalClient();
System.out.println("This is inside createSessionManager 11");
// Create a session manager based on the local client.
m_sessionManager = client.newSessionManager();
// Set the user information in the login information variable.
System.out.println("This is inside createSessionManager 22");
IDfLoginInfo loginInfo = clientx.getLoginInfo();
loginInfo.setUser("MyUserName");
loginInfo.setPassword("Password");
System.out.println("This is inside createSessionManager33");
// Set the identity of the session manager object based on the repository
// name and login information.
m_sessionManager.setIdentity( "documentum",loginInfo);
System.out.println("This is prior to True");
return true;
}
catch (Exception ex)
{
ex.printStackTrace();
System.out.println("Failed to instantiate Session Manager.");
return false;
}
}}What i expected was that my Tomcat console would print the Sysouts in the Java class file. But in actuality,
the Hello World JSP was displayed on my Content Area inside Work ,area without any Tomcat console messages.
Please guide me with my approach.Also i would like to have your pointers on how to go about implementing the Swing based example.
I hope i will get the help.
Thank You