Hi!
Habe im Internet ein Programm gefunden, das in meine gewünschte Richtung geht. Was braucht man, um dass Ding zu starten?
//Required Imports
import com.ugsolutions.util.Registry;
import com.ugsolutions.iman.kernel.*;
import com.ugsolutions.aif.*;
import com.ugsolutions.aif.kernel.*;
import com.ugsolutions.iman.commands.newfolder.*;
import java.lang.*;
// Command line program to create new folder,
// the name being passed as the command line argument
public class NewFolder
{
private static Registry registry = null;
private static IMANServerConnection serverConnection;
private static AIFPortal portal;
private static AIFKernel kernel;
private static IMANSession imanSession;
public static void main (String[] args)
{
// Login into Portal from command line
login ();
// Create folder by passing the name through command line argument
createFolder (args[0]);
System.exit(0);
}
// This method will be used to do the commandline login to Portal
public static void login()
{
try
{
portal = new AIFPortal(false);
AbstractAIFSession session = portal.getKernel().getSessionManager()
.getASession("com.ugsolutions.iman.kernel.IMANSession", null);
imanSession = (IMANSession)session;
session.login();
}
catch (Exception ex)
{
ex.printStackTrace();
System.exit(1);
}
}
public static void createFolder (String folderName)
{
if ( folderName == null )
return;
IMANComponent newFolder = null;
// Get the FolderType component from the session
IMANComponentFolderType folderTypeComponent;
try
{
folderTypeComponent = (IMANComponentFolderType)
imanSession.getTypeComponent("Folder");
// Create the component from the Folder super-type component
newFolder = folderTypeComponent.create(folderName, null, "Folder");
}
catch ( IMANException ex )
{
ex.printStackTrace();
}
// Logout from the i-man session
try
{
if ( imanSession.isLoggedIn() )
imanSession.logout();
}
catch ( Exception ex )
{
ex.printStackTrace();
}
if ( newFolder != null )
System.out.println ( "Folder created successfully" );
}
}
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP