* set the application root
*/
System.out.println("APP ROOT is " + applicationPath);
System.setProperty("applicationRoot",applicationPath);
System.setProperty("portal.name","jetspped");
SpringJNDIStarter starter = new SpringJNDIStarter(context,applicationPath,getTokens(bootConfigFiles),getTokens(configFiles));
System.out.println("starter framework created " + starter);
try
{
starter.setUp();
}
catch (Exception e)
{
e.printStackTrace();
System.exit(1);
}
System.out.println("starter framework established " + starter);
String[] importList = null;
if (doImport)
importList = parseFiles(fileName);
if ((doImport) && (importList != null) && (importList.length > 0))
{
for (int i = 0; i < importList.length; i++)
{
try
{
System.out.println("processing import " + importList[i]);
if (processHelper == 2)
{
serializer = new JetspeedSerializerSecondaryImpl(starter.getComponentManager());
}
else
serializer = new JetspeedSerializerImpl(starter.getComponentManager());
serializer.importData(importList[i], settings);
System.out.println("processing import " + importList[i] + " done");
}
catch (Exception e)
{
System.err.println("Failed to process XML import for " + importList[i] + ":" + e);
e.printStackTrace();
}
finally
{
if (serializer != null)
serializer.closeUp();
}
}
}
if (doExport)
{
try
{
System.out.println("processing export to " + fileName);
if (processHelper == 2)
{
serializer = new JetspeedSerializerSecondaryImpl(starter.getComponentManager());
}
else
serializer = new JetspeedSerializerImpl(starter.getComponentManager());
serializer.exportData(name, fileName, settings);
}
catch (Exception e)
{
System.err.println("Failed to process XML export of " + fileName + ": " + e);
e.printStackTrace();
}
finally
{
if (serializer != null)
serializer.closeUp();
}
}
try
{
starter.tearDown();
logger.setLevel(level);;
}
catch (Exception e1)
{
System.out.println("starter framework teardown caused exception " + e1.getLocalizedMessage());