1 'encoding UTF-8 Do not remove or change this line!
2 '**************************************************************************
3 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 '* Copyright 2008 by Sun Microsystems, Inc.
7 '* OpenOffice.org - a multi-platform office productivity suite
9 '* $RCSfile: xf_Submission.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 07:43:42 $
15 '* This file is part of OpenOffice.org.
17 '* OpenOffice.org is free software: you can redistribute it and/or modify
18 '* it under the terms of the GNU Lesser General Public License version 3
19 '* only, as published by the Free Software Foundation.
21 '* OpenOffice.org is distributed in the hope that it will be useful,
22 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
23 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 '* GNU Lesser General Public License version 3 for more details
25 '* (a copy is included in the LICENSE file that accompanied this code).
27 '* You should have received a copy of the GNU Lesser General Public License
28 '* version 3 along with OpenOffice.org. If not, see
29 '* <http://www.openoffice.org/license.html>
30 '* for a copy of the LGPLv3 License.
32 '/************************************************************************
34 '* owner : marc.neumann@sun.com
36 '* short description : XForms submission Test
38 '\***********************************************************************************
42 printlog "------------------ xf_Submission.inc ---------------------"
44 call tDataNavigatorSubmission
47 '-------------------------------------------------------------------------
48 testcase tDataNavigatorSubmission
50 '/// open new XML Form
51 printlog "open new XML Form"
53 FileOpen "FileName", "private:factory/swriter?slot=21053" , "FrameName", "_default", "SynchronMode" ,True
57 call hToolbarSelect("FormDesignTools",true)
61 '/// open the datanavigator
62 printlog "open the datanavigator"
63 Kontext "XFormsDataNavigator"
64 if ( not XFormsDataNavigator.exists(2) ) then
65 Kontext "FormDesignTools"
66 XFormsDataNavigator.Click
71 '/// select the instance tabpage
72 printlog "select the instance tabpage"
74 Kontext "XFormsDataNavigator"
75 while ( XFormsDataNavigatorTabControl.getPageID() <> 12 )
76 XFormsDataNavigatorTabControl.TypeKeys("<RIGHT>")
81 '/// click the add element icon
82 printlog "click the add element icon"
84 Kontext "XFormToolbar"
87 '/// insert element1 as name and click OK
88 printlog "insert element1 as name and click OK"
89 Kontext "XFormAddItemDLG"
90 ElementName.setText "element1"
93 '/// select the submisson tabpage
94 printlog "select the submisson tabpage"
96 Kontext "XFormsDataNavigator"
97 while ( XFormsDataNavigatorTabControl.getPageID() <> 10 )
98 XFormsDataNavigatorTabControl.TypeKeys("<RIGHT>")
101 '/// click the add submission icon
102 printlog "click the add submission icon"
104 Kontext "XFormToolbar"
107 '/// add a submission
108 Kontext "XFormAddSubmission"
109 SubmitName.setText("submission1")
110 if ( gPlatgroup = "w95" ) then
111 SubmitAction.setText("file:///" + ConvertPath(gOfficePath,"lin") + "user/work/test.xml")
113 SubmitAction.setText("file://" + gOfficePath + "user/work/test.xml")
115 SubmitMethod.select 2
117 '/// close the add submission dialog
118 printlog "close the add submission dialog"
119 Kontext "XFormAddSubmission"
120 XFormAddSubmission.OK
122 '/// close the xform data navigator
123 printlog "close the xform data navigator"
125 Kontext "XFormsDataNavigator"
126 XFormsDataNavigator.Close
128 '/// open the FormControl toolbar
129 call hToolbarSelect("FormControls",true)
131 '/// insert a control
132 Kontext "FormControls"
135 call hDrawingWithSelection(50,20,60,30)
139 '/// open the FormControl Properties Dialog
140 printlog "open the FormControl Properties Dialog"
141 Kontext "FormControls"
142 ControlProperties.Click
144 '/// select the first submission
145 printlog "select the first submission"
146 Kontext "TabGeneralControl"
149 TabGeneralControl.TypeKeys("<RETURN>", true)
152 '/// save the document
153 printlog "save the document"
154 call hFileSaveAsKill(gOfficePath + "user/work/test.odt")
156 '/// close the document
157 printlog "close the document"
161 '/// open the document
162 printlog "open the document"
163 call hFileOpen(gOfficePath + "user/work/test.odt")
165 '/// click on the button in the document
166 printlog "click on the button in the document"
167 Kontext "DocumentWriter"
168 DocumentWriter.TypeKeys "<MOD1 F5>" , true
169 DocumentWriter.TypeKeys "<RETURN>" , true
171 '/// close the document
172 printlog "close the document"
177 Open gOfficePath + "user/work/test.xml" For Input As 1
182 if sLine <> "<?xml version=""1.0""?>" then
183 warnlog "the first line in the xml document should <?xml version=""1.0""?> but it is " + sLine
186 if sLine <> "<instanceData><element1/></instanceData>" then
187 warnlog "the second line in the xml document should <instanceData><element1/></instanceData> but it is " + sLine
191 '-------------------------------------------------------------------------