LibreOffice Module forms (master) 1
submission.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include "submission.hxx"
21
22#include "model.hxx"
23#include "binding.hxx"
24#include "mip.hxx"
25#include "evaluationcontext.hxx"
29
30#include <rtl/ustring.hxx>
31#include <com/sun/star/lang/NoSupportException.hpp>
32#include <com/sun/star/uno/Sequence.hxx>
33#include <com/sun/star/uno/Reference.hxx>
34#include <com/sun/star/xforms/XModel.hpp>
35#include <com/sun/star/uno/RuntimeException.hpp>
36#include <com/sun/star/xml/dom/XNodeList.hpp>
37#include <com/sun/star/xml/dom/XDocument.hpp>
38#include <com/sun/star/xml/dom/DocumentBuilder.hpp>
39#include <com/sun/star/xml/dom/XDocumentFragment.hpp>
40#include <com/sun/star/xml/dom/NodeType.hpp>
41#include <com/sun/star/task/XInteractionHandler.hpp>
42#include <com/sun/star/task/XInteractionRequest.hpp>
43#include <com/sun/star/task/XInteractionContinuation.hpp>
44#include <com/sun/star/xforms/InvalidDataOnSubmitException.hpp>
45#include <com/sun/star/form/runtime/XFormController.hpp>
46#include <com/sun/star/frame/XFrame.hpp>
51#include <vcl/svapp.hxx>
52#include <vcl/weld.hxx>
53#include <frm_resource.hxx>
54#include <strings.hrc>
55#include <memory>
56#include <string_view>
57
58using com::sun::star::util::VetoException;
59using com::sun::star::form::submission::XSubmissionVetoListener;
60using com::sun::star::lang::WrappedTargetException;
61using com::sun::star::lang::NoSupportException;
62using com::sun::star::task::XInteractionHandler;
63using com::sun::star::xforms::XModel;
64using com::sun::star::xforms::InvalidDataOnSubmitException;
65using com::sun::star::xml::xpath::XXPathObject;
66using com::sun::star::frame::XFrame;
68using xforms::Model;
69using xforms::MIP;
70
71using namespace com::sun::star::uno;
72using namespace com::sun::star::lang;
73using namespace com::sun::star::xml::dom;
74
75Submission::Submission() :
76 mbIndent(),
77 mbOmitXmlDeclaration(),
78 mbStandalone(),
79 msReplace( "none" )
80{
82}
83
85{
86}
87
88
90{
91 mxModel = dynamic_cast<Model*>(xModel.get());
92 assert(bool(mxModel)==bool(xModel) && "we only support an instance of Model here");
93}
94
95
96void Submission::setID( const OUString& sID )
97{
98 msID = sID;
99}
100
101
102void Submission::setBind( const OUString& sBind )
103{
104 msBind = sBind;
105}
106
107OUString Submission::getRef() const
108{
109 return maRef.getExpression();
110}
111
112void Submission::setRef( const OUString& sRef )
113{
114 maRef.setExpression( sRef );
115}
116
117
118void Submission::setAction( const OUString& sAction )
119{
120 msAction = sAction;
121}
122
123
124void Submission::setMethod( const OUString& sMethod )
125{
126 msMethod = sMethod;
127}
128
129
130void Submission::setVersion( const OUString& sVersion )
131{
132 msVersion = sVersion;
133}
134
135
136void Submission::setIndent( bool bIndent )
137{
138 mbIndent = bIndent;
139}
140
141
142void Submission::setMediaType( const OUString& sMediaType )
143{
145}
146
147
148void Submission::setEncoding( const OUString& sEncoding )
149{
150 msEncoding = sEncoding;
151}
152
153
154void Submission::setOmitXmlDeclaration( bool bOmitXmlDeclaration )
155{
156 mbOmitXmlDeclaration = bOmitXmlDeclaration;
157}
158
159
160void Submission::setStandalone( bool bStandalone )
161{
162 mbStandalone = bStandalone;
163}
164
165
166void Submission::setCDataSectionElement( const OUString& sCDataSectionElement )
167{
168 msCDataSectionElement = sCDataSectionElement;
169}
170
171
172void Submission::setReplace( const OUString& sReplace )
173{
174 msReplace = sReplace;
175}
176
177
178void Submission::setSeparator( const OUString& sSeparator )
179{
180 msSeparator = sSeparator;
181}
182
183
184void Submission::setIncludeNamespacePrefixes( const Sequence< OUString >& rIncludeNamespacePrefixes )
185{
186 msIncludeNamespacePrefixes = rIncludeNamespacePrefixes;
187}
188
190{
191 liveCheck();
192
193 // construct XXPathObject for submission doc; use bind in preference of ref
194 EvaluationContext aEvalContext;
195 ComputedExpression aExpression;
196 if( !msBind.isEmpty() )
197 {
198 Binding* pBinding = comphelper::getFromUnoTunnel<Binding>( mxModel->getBinding(msBind) );
199 if( pBinding != nullptr )
200 {
201 aExpression.setExpression( pBinding->getBindingExpression() );
202 aEvalContext = pBinding->getEvaluationContext();
203 }
204 // TODO: else: illegal binding name -> raise error
205 }
206 else if( !maRef.getExpression().isEmpty() )
207 {
208 aExpression.setExpression( maRef.getExpression() );
209 aEvalContext = mxModel->getEvaluationContext();
210 }
211 else
212 {
213 aExpression.setExpression( "/" );
214 aEvalContext = mxModel->getEvaluationContext();
215 }
216 aExpression.evaluate( aEvalContext );
217 Reference<XXPathObject> xResult = aExpression.getXPath();
218 OSL_ENSURE( xResult.is(), "no result?" );
219
220 // early out if we have not obtained any result
221 if( ! xResult.is() )
222 return false;
223
224
225 // Reference< XNodeList > aList = xResult->getNodeList();
226 OUString aMethod = getMethod();
227
228 // strip whitespace-only text node for get submission
230 xResult, aMethod.equalsIgnoreAsciiCase("get"));
231
232 // submit result; set encoding, etc.
233 std::unique_ptr<CSubmission> xSubmission;
234 if (aMethod.equalsIgnoreAsciiCase("PUT"))
235 xSubmission.reset(new CSubmissionPut( getAction(), aFragment));
236 else if (aMethod.equalsIgnoreAsciiCase("post"))
237 xSubmission.reset(new CSubmissionPost( getAction(), aFragment));
238 else if (aMethod.equalsIgnoreAsciiCase("get"))
239 xSubmission.reset(new CSubmissionGet( getAction(), aFragment));
240 else
241 {
242 OSL_FAIL("Unsupported xforms submission method");
243 return false;
244 }
245
246 const INetURLObject& rURLObject = xSubmission->GetURLObject();
247 INetProtocol eProtocol = rURLObject.GetProtocol();
248 // tdf#154337 continue to allow submitting to http[s]: without further
249 // interaction. Don't allow for other protocols, except for file:
250 // where the user has to agree first.
251 if (eProtocol != INetProtocol::Http && eProtocol != INetProtocol::Https)
252 {
253 if (eProtocol != INetProtocol::File)
254 return false;
255 else
256 {
257 Reference<css::form::runtime::XFormController> xFormController(xHandler, UNO_QUERY);
258 Reference<css::awt::XControl> xContainerControl(xFormController ? xFormController->getContainer() : nullptr, UNO_QUERY);
259 Reference<css::awt::XWindow> xParent(xContainerControl ? xContainerControl->getPeer() : nullptr, UNO_QUERY);
260
261 OUString aFileName(rURLObject.getFSysPath(FSysStyle::Detect));
262 std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(Application::GetFrameWeld(xParent),
263 VclMessageType::Question, VclButtonsType::YesNo,
264 frm::ResourceManager::loadString(RID_STR_XFORMS_WARN_TARGET_IS_FILE).replaceFirst("$", aFileName)));
265 xQueryBox->set_default_response(RET_NO);
266
267 if (xQueryBox->run() != RET_YES)
268 return false;
269 }
270 }
271
272 CSubmission::SubmissionResult aResult = xSubmission->submit( xHandler );
273
274 if (aResult == CSubmission::SUCCESS)
275 {
276 Reference< XDocument > aInstanceDoc = getInstanceDocument(xResult);
277 aResult = xSubmission->replace(getReplace(), aInstanceDoc, Reference< XFrame >());
278 }
279
280 return ( aResult == CSubmission::SUCCESS );
281}
282
284{
285 bool bValid = mxModel.is();
286
287 if( ! bValid )
288 throw RuntimeException();
289}
290
291css::uno::Reference<XModel> Submission::getModel() const
292{
293 return mxModel;
294}
295
296
297// Property-Set implementation
298
299
300#define HANDLE_ID 0
301#define HANDLE_Bind 1
302#define HANDLE_Ref 2
303#define HANDLE_Action 3
304#define HANDLE_Method 4
305#define HANDLE_Version 5
306#define HANDLE_Indent 6
307#define HANDLE_MediaType 7
308#define HANDLE_Encoding 8
309#define HANDLE_OmitXmlDeclaration 9
310#define HANDLE_Standalone 10
311#define HANDLE_CDataSectionElement 11
312#define HANDLE_Replace 12
313#define HANDLE_Separator 13
314#define HANDLE_IncludeNamespacePrefixes 14
315#define HANDLE_Model 15
316
318{
319 registerProperty( css::beans::Property("ID", HANDLE_ID, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND ),
321
322 registerProperty( css::beans::Property("Bind", HANDLE_Bind, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND ),
324
325 registerProperty( css::beans::Property("Ref", HANDLE_Ref, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND ),
327
328 registerProperty( css::beans::Property("Action", HANDLE_Action, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND ),
330
331 registerProperty( css::beans::Property("Method", HANDLE_Method, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND ),
333
334 registerProperty( css::beans::Property("Version", HANDLE_Version, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND ),
336
337 registerProperty( css::beans::Property("Indent", HANDLE_Indent, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::BOUND ),
339
340 registerProperty( css::beans::Property("MediaType", HANDLE_MediaType, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND ),
342
343 registerProperty( css::beans::Property("Encoding", HANDLE_Encoding, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND ),
345
346 registerProperty( css::beans::Property("OmitXmlDeclaration", HANDLE_OmitXmlDeclaration, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::BOUND ),
348
349 registerProperty( css::beans::Property("Standalone", HANDLE_Standalone, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::BOUND ),
351
352 registerProperty( css::beans::Property("CDataSectionElement", HANDLE_CDataSectionElement, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND ),
354
355 registerProperty( css::beans::Property("Replace", HANDLE_Replace, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND ),
357
358 registerProperty( css::beans::Property("Separator", HANDLE_Separator, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND ),
360
361 registerProperty( css::beans::Property("IncludeNamespacePrefixes", HANDLE_IncludeNamespacePrefixes, cppu::UnoType<Sequence<OUString>>::get(), css::beans::PropertyAttribute::BOUND ),
363
364 registerProperty( css::beans::Property("Model", HANDLE_Model, cppu::UnoType<Reference<XModel>>::get(), css::beans::PropertyAttribute::BOUND ),
366
367 initializePropertyValueCache( HANDLE_Indent );
368 initializePropertyValueCache( HANDLE_OmitXmlDeclaration );
369 initializePropertyValueCache( HANDLE_Standalone );
370}
371
373 Any& rConvertedValue, Any& rOldValue, sal_Int32 nHandle, const Any& rValue )
374{
376 {
377 // for convenience reasons (????), we accept a string which contains
378 // a comma-separated list of namespace prefixes
379 OUString sTokenList;
380 if ( rValue >>= sTokenList )
381 {
382 std::vector< OUString > aPrefixes;
383 sal_Int32 p = 0;
384 while ( p >= 0 )
385 aPrefixes.push_back( sTokenList.getToken( 0, ',', p ) );
386
387 Sequence< OUString > aConvertedPrefixes( aPrefixes.data(), aPrefixes.size() );
388 return PropertySetBase::convertFastPropertyValue( rConvertedValue, rOldValue, nHandle, Any( aConvertedPrefixes ) );
389 }
390 }
391
392 return PropertySetBase::convertFastPropertyValue( rConvertedValue, rOldValue, nHandle, rValue );
393}
394
395OUString SAL_CALL Submission::getName()
396{
397 return getID();
398}
399
400void SAL_CALL Submission::setName( const OUString& sID )
401{
402 setID( sID );
403}
404
405
406static OUString lcl_message( std::u16string_view rID, std::u16string_view rText )
407{
408 OUString aMessage = OUString::Concat("XForms submission '") + rID + "' failed" + rText + ".";
409 return aMessage;
410}
411
413 const Reference<XInteractionHandler>& _rxHandler )
414{
415 // as long as this class is not really threadsafe, we need to copy
416 // the members we're interested in
418 OUString sID( msID );
419
420 if ( !xModel.is() || msID.isEmpty() )
421 throw RuntimeException(
422 "This is not a valid submission object.",
423 *this
424 );
425
426 // #i36765# #i47248# warning on submission of illegal data
427 // check for validity (and query user if invalid)
428 bool bValid = xModel->isValid();
429 if( ! bValid )
430 {
431 InvalidDataOnSubmitException aInvalidDataException(
432 lcl_message(sID, u" due to invalid data" ), *this );
433
434 if( _rxHandler.is() )
435 {
436 // laboriously create interaction request
439 Any( aInvalidDataException ) );
440
443 pRequest->addContinuation( pContinue );
444
447 pRequest->addContinuation( pCancel );
448
449 // ask the handler...
450 _rxHandler->handle( pRequest );
451 OSL_ENSURE( pContinue->wasSelected() || pCancel->wasSelected(),
452 "handler didn't select" );
453
454 // and continue, if user chose 'continue'
455 if( pContinue->wasSelected() )
456 bValid = true;
457 }
458
459 // abort if invalid (and user didn't tell us to continue)
460 if( ! bValid )
461 throw aInvalidDataException;
462 }
463
464 // attempt submission
465 bool bResult = false;
466 try
467 {
468 bResult = doSubmit( _rxHandler );
469 }
470 catch( const VetoException& )
471 {
472 OSL_FAIL( "Model::submit: Hmm. How can a single submission have a veto right?" );
473 // allowed to leave
474 throw;
475 }
476 catch( const Exception& )
477 {
478 css::uno::Any anyEx = cppu::getCaughtException();
479 // exception caught: re-throw as wrapped target exception
480 throw WrappedTargetException(
481 lcl_message( sID, u" due to exception being thrown" ),
482 *this, anyEx );
483 }
484
485 if( !bResult )
486 {
487 // other failure: throw wrapped target exception, too.
488 throw WrappedTargetException(
489 lcl_message( sID, std::u16string_view() ), *this, Any() );
490 }
491 mxModel->rebuild();
492}
493
494void SAL_CALL Submission::submit( )
495{
496 submitWithInteraction( nullptr );
497}
498
500{
501 // TODO
502 throw NoSupportException();
503}
504
506{
507 // TODO
508 throw NoSupportException();
509}
510
511static bool isIgnorable(const Reference< XNode >& aNode)
512{
513 // ignore whitespace-only textnodes
514 if (aNode->getNodeType() == NodeType_TEXT_NODE)
515 {
516 OUString aTrimmedValue = aNode->getNodeValue().trim();
517 if (aTrimmedValue.isEmpty()) return true;
518 }
519
520 return false;
521}
522
523// recursively copy relevant nodes from A to B
524static void cloneNodes(Model& aModel, const Reference< XNode >& dstParent, const Reference< XNode >& source, bool bRemoveWSNodes)
525{
526 if (!source.is()) return;
527
528 Reference< XNode > cur = source;
529 Reference< XDocument > dstDoc = dstParent->getOwnerDocument();
530 Reference< XNode > imported;
531
532 if (!cur.is())
533 return;
534
535 // is this node relevant?
536 MIP mip = aModel.queryMIP(cur);
537 if(mip.isRelevant() && !(bRemoveWSNodes && isIgnorable(cur)))
538 {
539 imported = dstDoc->importNode(cur, false);
540 imported = dstParent->appendChild(imported);
541 // append source children to new imported parent
542 for( cur = cur->getFirstChild(); cur.is(); cur = cur->getNextSibling() )
543 cloneNodes(aModel, imported, cur, bRemoveWSNodes);
544 }
545}
547{
548 using namespace css::xml::xpath;
549 // result
551
552 if (aObj->getObjectType() == XPathObjectType_XPATH_NODESET)
553 {
554 Reference< XNodeList > aList = aObj->getNodeList();
555 if (aList->getLength() > 0)
556 aDocument = aList->item(0)->getOwnerDocument();
557 }
558 return aDocument;
559}
560
562{
563 using namespace css::xml::xpath;
564 Reference< XDocumentBuilder > aDocBuilder = DocumentBuilder::create(comphelper::getProcessComponentContext());
565 Reference< XDocument > aDocument = aDocBuilder->newDocument();
566 Reference< XDocumentFragment > aFragment = aDocument->createDocumentFragment();
567
568
569 if (aObj->getObjectType() == XPathObjectType_XPATH_NODESET)
570 {
571 Reference< XNodeList > aList = aObj->getNodeList();
572 Reference< XNode > aListItem;
573 for (sal_Int32 i=0; i < aList->getLength(); i++)
574 {
575 aListItem = aList->item(i);
576 if (aListItem->getNodeType()==NodeType_DOCUMENT_NODE)
577 aListItem = (Reference< XDocument >(aListItem, UNO_QUERY))->getDocumentElement();
578 // copy relevant nodes from instance into fragment
579 cloneNodes(*getModelImpl(), aFragment, aListItem, bRemoveWSNodes);
580 }
581 }
582 return aFragment;
583}
584
585// some forwarding: XPropertySet is implemented in our base class,
586// but also available as base of XSubmission
588{
590}
591void SAL_CALL Submission::setPropertyValue( const OUString& aPropertyName, const Any& aValue )
592{
593 PropertySetBase::setPropertyValue( aPropertyName, aValue );
594}
595Any SAL_CALL Submission::getPropertyValue( const OUString& PropertyName )
596{
597 return PropertySetBase::getPropertyValue( PropertyName );
598}
599void SAL_CALL Submission::addPropertyChangeListener( const OUString& aPropertyName, const Reference< css::beans::XPropertyChangeListener >& xListener )
600{
601 PropertySetBase::addPropertyChangeListener( aPropertyName, xListener );
602}
603void SAL_CALL Submission::removePropertyChangeListener( const OUString& aPropertyName, const Reference< css::beans::XPropertyChangeListener >& aListener )
604{
605 PropertySetBase::removePropertyChangeListener( aPropertyName, aListener );
606}
607void SAL_CALL Submission::addVetoableChangeListener( const OUString& PropertyName, const Reference< css::beans::XVetoableChangeListener >& aListener )
608{
609 PropertySetBase::addVetoableChangeListener( PropertyName, aListener );
610}
611void SAL_CALL Submission::removeVetoableChangeListener( const OUString& PropertyName, const Reference< css::beans::XVetoableChangeListener >& aListener )
612{
613 PropertySetBase::removeVetoableChangeListener( PropertyName, aListener );
614}
615
616/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
constexpr OUStringLiteral sMediaType
ScriptDocument aDocument
static weld::Window * GetFrameWeld(const css::uno::Reference< css::awt::XWindow > &rWindow)
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
helper class for implementing non-UNO accessors to a boolean property
helper class for implementing property accessors via non-UNO methods
INetProtocol GetProtocol() const
OUString getFSysPath(FSysStyle eStyle, sal_Unicode *pDelimiter=nullptr) const
virtual sal_Bool SAL_CALL convertFastPropertyValue(css::uno::Any &rConvertedValue, css::uno::Any &rOldValue, sal_Int32 nHandle, const css::uno::Any &rValue) override
OPropertysetHelper methods.
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
xforms::EvaluationContext getEvaluationContext() const
get this binding's context node
Definition: binding.cxx:286
OUString getBindingExpression() const
set ID for this binding
Definition: binding.cxx:316
ComputedExpression represents an XPath Expression and caches results.
css::uno::Reference< css::xml::xpath::XXPathObject > const & getXPath() const
const OUString & getExpression() const
get the expression string
bool evaluate(const xforms::EvaluationContext &rContext)
evaluate the expression relative to the content node.
void setExpression(const OUString &rExpression)
set a new expression string
define the context for the evaluation of an XPath expression
represents the XForms *m*odel *i*tem *p*roperties (MIPs) for a given XNode in the instance data at a ...
Definition: mip.hxx:31
bool isRelevant() const
Definition: mip.hxx:77
MIP queryMIP(const XNode_t &xNode) const
query which MIPs apply to the given node
Definition: model.cxx:191
void setBind(const OUString &)
Definition: submission.cxx:102
void initializePropertySet()
Definition: submission.cxx:317
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: submission.cxx:603
OUString getRef() const
Definition: submission.cxx:107
void setAction(const OUString &)
Definition: submission.cxx:118
OUString getMethod() const
Definition: submission.hxx:118
bool doSubmit(const css::uno::Reference< css::task::XInteractionHandler > &aHandler)
perform the submission
Definition: submission.cxx:189
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: submission.cxx:591
css::uno::Sequence< OUString > msIncludeNamespacePrefixes
Definition: submission.hxx:74
bool getIndent() const
Definition: submission.hxx:124
OUString getReplace() const
Definition: submission.hxx:142
void setEncoding(const OUString &)
Definition: submission.cxx:148
OUString getBind() const
set ID for this submission
Definition: submission.hxx:109
void setOmitXmlDeclaration(bool)
Definition: submission.cxx:154
void setMethod(const OUString &)
Definition: submission.cxx:124
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: submission.cxx:595
void setSeparator(const OUString &)
Definition: submission.cxx:178
OUString getMediaType() const
Definition: submission.hxx:127
void setIndent(bool)
Definition: submission.cxx:136
void setMediaType(const OUString &)
Definition: submission.cxx:142
OUString getVersion() const
Definition: submission.hxx:121
virtual OUString SAL_CALL getName() override
Definition: submission.cxx:395
void setID(const OUString &)
get ID for this submission
Definition: submission.cxx:96
xforms::Model * getModelImpl() const
get the model implementation
Definition: submission.hxx:100
void liveCheck()
check whether object is live, and throw suitable exception if not (to be used be API methods before a...
Definition: submission.cxx:283
css::uno::Reference< css::xforms::XModel > getModel() const
get XForms model
Definition: submission.cxx:291
OUString msCDataSectionElement
Definition: submission.hxx:71
OUString getSeparator() const
Definition: submission.hxx:145
css::uno::Reference< css::xml::dom::XDocumentFragment > createSubmissionDocument(const css::uno::Reference< css::xml::xpath::XXPathObject > &aObject, bool bRemoveWSNodes)
Definition: submission.cxx:561
static css::uno::Reference< css::xml::dom::XDocument > getInstanceDocument(const css::uno::Reference< css::xml::xpath::XXPathObject > &aObject)
Definition: submission.cxx:546
void setStandalone(bool)
Definition: submission.cxx:160
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: submission.cxx:599
void setCDataSectionElement(const OUString &)
Definition: submission.cxx:166
virtual ~Submission() noexcept override
Definition: submission.cxx:84
virtual sal_Bool SAL_CALL convertFastPropertyValue(css::uno::Any &rConvertedValue, css::uno::Any &rOldValue, sal_Int32 nHandle, const css::uno::Any &rValue) override
Definition: submission.cxx:372
virtual void SAL_CALL submitWithInteraction(const css::uno::Reference< css::task::XInteractionHandler > &aHandler) override
Definition: submission.cxx:412
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: submission.cxx:587
ComputedExpression maRef
Definition: submission.hxx:62
void setReplace(const OUString &)
Definition: submission.cxx:172
void setRef(const OUString &)
Definition: submission.cxx:112
OUString msMediaType
Definition: submission.hxx:67
virtual void SAL_CALL submit() override
Definition: submission.cxx:494
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: submission.cxx:611
bool getStandalone() const
Definition: submission.hxx:136
OUString getCDataSectionElement() const
Definition: submission.hxx:139
OUString getID() const
Definition: submission.hxx:106
void setModel(const css::uno::Reference< css::xforms::XModel > &)
set XForms model
Definition: submission.cxx:89
OUString getAction() const
Definition: submission.hxx:115
virtual void SAL_CALL removeSubmissionVetoListener(const css::uno::Reference< css::form::submission::XSubmissionVetoListener > &listener) override
Definition: submission.cxx:505
virtual void SAL_CALL setName(const OUString &) override
Definition: submission.cxx:400
void setVersion(const OUString &)
Definition: submission.cxx:130
void setIncludeNamespacePrefixes(const css::uno::Sequence< OUString > &)
Definition: submission.cxx:184
OUString msSeparator
Definition: submission.hxx:73
OUString getEncoding() const
Definition: submission.hxx:130
rtl::Reference< Model > mxModel
the Model to which this Submission belongs; may be NULL
Definition: submission.hxx:79
bool getOmitXmlDeclaration() const
Definition: submission.hxx:133
virtual void SAL_CALL addSubmissionVetoListener(const css::uno::Reference< css::form::submission::XSubmissionVetoListener > &listener) override
Definition: submission.cxx:499
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: submission.cxx:607
css::uno::Sequence< OUString > getIncludeNamespacePrefixes() const
Definition: submission.hxx:148
float u
void * p
@ Exception
OInteraction< css::task::XInteractionDisapprove > OInteractionDisapprove
OInteraction< css::task::XInteractionApprove > OInteractionApprove
Reference< XComponentContext > getProcessComponentContext()
Any SAL_CALL getCaughtException()
OUString loadString(TranslateId aResId)
loads the string with the specified resource id from the FormLayer mo file
int i
sal_Int32 nHandle
Reference< XModel > xModel
static bool isIgnorable(const Reference< XNode > &aNode)
Definition: submission.cxx:511
#define HANDLE_Encoding
Definition: submission.cxx:308
#define HANDLE_IncludeNamespacePrefixes
Definition: submission.cxx:314
#define HANDLE_MediaType
Definition: submission.cxx:307
#define HANDLE_Method
Definition: submission.cxx:304
#define HANDLE_Replace
Definition: submission.cxx:312
#define HANDLE_OmitXmlDeclaration
Definition: submission.cxx:309
#define HANDLE_Standalone
Definition: submission.cxx:310
#define HANDLE_Separator
Definition: submission.cxx:313
#define HANDLE_Bind
Definition: submission.cxx:301
static void cloneNodes(Model &aModel, const Reference< XNode > &dstParent, const Reference< XNode > &source, bool bRemoveWSNodes)
Definition: submission.cxx:524
#define HANDLE_Version
Definition: submission.cxx:305
#define HANDLE_Action
Definition: submission.cxx:303
#define HANDLE_CDataSectionElement
Definition: submission.cxx:311
#define HANDLE_ID
Definition: submission.cxx:300
#define HANDLE_Indent
Definition: submission.cxx:306
static OUString lcl_message(std::u16string_view rID, std::u16string_view rText)
Definition: submission.cxx:406
#define HANDLE_Model
Definition: submission.cxx:315
#define HANDLE_Ref
Definition: submission.cxx:302
unsigned char sal_Bool
INetProtocol
RET_NO
RET_YES