throw new StatusException("Couldn't create document ", e);
}
XModel xTextMode1 = (XModel) UnoRuntime.queryInterface(XModel.class,
xTextDoc);
XController xTextController = xTextMode1.getCurrentController();
XFrame xTextFrame = xTextController.getFrame();
// get webdoc interfaces
try {
log.println("creating a web document");
xWebDoc = SOF.loadDocument("private:factory/swriter/web");
} catch (Exception e) {
e.printStackTrace(log);
throw new StatusException("Couldn't create document ", e);
}
XModel xWebMode1 = (XModel) UnoRuntime.queryInterface(XModel.class,
xWebDoc);
XController xWebController = xWebMode1.getCurrentController();
XFrame xWebFrame = xWebController.getFrame();
// get global document interfaces
try {
log.println("creating a global document");
xGlobalDoc = SOF.loadDocument("private:factory/swriter/GlobalDocument");
} catch (Exception e) {
e.printStackTrace(log);
throw new StatusException("Couldn't create document ", e);
}
XModel xGlobalMode1 = (XModel) UnoRuntime.queryInterface(XModel.class,
xGlobalDoc);
XController xGlobalController = xGlobalMode1.getCurrentController();
XFrame xGlobalFrame = xGlobalController.getFrame();
// get clac interfaces
try {
log.println("creating a spreadsheetdocument");
xSheetDoc = SOF.createCalcDoc(null);
} catch (Exception e) {
e.printStackTrace(log);
throw new StatusException("Couldn't create document ", e);
}
XModel xSheetMode1 = (XModel) UnoRuntime.queryInterface(XModel.class,
xSheetDoc);
XController xSheetController = xSheetMode1.getCurrentController();
XFrame xSheetFrame = xSheetController.getFrame();
// get draw interfaces
try {
log.println("creating a draw document");
xDrawDoc = SOF.createDrawDoc(null);
} catch (Exception e) {
e.printStackTrace(log);
throw new StatusException("Couldn't create document ", e);
}
XModel xDrawMode1 = (XModel) UnoRuntime.queryInterface(XModel.class,
xDrawDoc);
XController xDrawController = xDrawMode1.getCurrentController();
XFrame xDrawFrame = xDrawController.getFrame();
// get impress interfaces
try {
log.println("creating a impress document");
xImpressDoc = SOF.createImpressDoc(null);
} catch (Exception e) {
e.printStackTrace(log);
throw new StatusException("Couldn't create document ", e);
}
XModel xImpressMode1 = (XModel) UnoRuntime.queryInterface(XModel.class,
xImpressDoc);
XController xImpressController = xImpressMode1.getCurrentController();
XFrame xImpressFrame = xImpressController.getFrame();
// get math interfaces
try {
log.println("creating a math document");
xMathDoc = SOF.createMathDoc(null);
} catch (Exception e) {
e.printStackTrace(log);
throw new StatusException("Couldn't create document ", e);
}
XModel xMathMode1 = (XModel) UnoRuntime.queryInterface(XModel.class,
xMathDoc);
XController xMathController = xMathMode1.getCurrentController();
XFrame xMathFrame = xMathController.getFrame();
PropertyValue[] xFrameSeq = new PropertyValue[7];
xFrameSeq[0] = new PropertyValue();
xFrameSeq[0].Name = "com.sun.star.text.TextDocument";
xFrameSeq[0].Value = xTextFrame;