forms: CSS -> css
Change-Id: Ib2fb1f4f4b64a67cebdebb6ebfb36dbe6878bef6
This commit is contained in:
@@ -31,8 +31,6 @@
|
||||
#include <com/sun/star/xml/xpath/XXPathObject.hpp>
|
||||
#include <com/sun/star/xml/dom/XDocumentFragment.hpp>
|
||||
|
||||
namespace CSS = com::sun::star;
|
||||
|
||||
/**
|
||||
Serialize an XObject
|
||||
*/
|
||||
@@ -42,7 +40,7 @@ typedef std::map<OUString, OUString> PropMap;
|
||||
class CSerialization
|
||||
{
|
||||
protected:
|
||||
CSS::uno::Reference< CSS::xml::dom::XDocumentFragment > m_aFragment;
|
||||
css::uno::Reference< css::xml::dom::XDocumentFragment > m_aFragment;
|
||||
PropMap m_properties;
|
||||
|
||||
public:
|
||||
@@ -51,7 +49,7 @@ public:
|
||||
/**
|
||||
sets the XObject that is to serialized
|
||||
*/
|
||||
virtual void setSource(const CSS::uno::Reference< CSS::xml::dom::XDocumentFragment >& aFragment)
|
||||
virtual void setSource(const css::uno::Reference< css::xml::dom::XDocumentFragment >& aFragment)
|
||||
{
|
||||
m_aFragment = aFragment;
|
||||
}
|
||||
@@ -61,7 +59,7 @@ public:
|
||||
that control aspects of the serialization
|
||||
eachs serialization may support individual properties
|
||||
*/
|
||||
void setProperties(const CSS::uno::Sequence< CSS::beans::NamedValue >& props)
|
||||
void setProperties(const css::uno::Sequence< css::beans::NamedValue >& props)
|
||||
{
|
||||
m_properties.clear();
|
||||
OUString aValue;
|
||||
@@ -83,7 +81,7 @@ public:
|
||||
bytes read.
|
||||
returns -1 on error
|
||||
*/
|
||||
virtual CSS::uno::Reference< CSS::io::XInputStream > getInputStream() = 0;
|
||||
virtual css::uno::Reference< css::io::XInputStream > getInputStream() = 0;
|
||||
|
||||
};
|
||||
|
||||
|
@@ -61,16 +61,16 @@ using ::com::sun::star::xml::sax::Writer;
|
||||
using ::com::sun::star::xml::sax::XDocumentHandler;
|
||||
|
||||
CSerializationAppXML::CSerializationAppXML()
|
||||
: m_xBuffer(CSS::io::Pipe::create(comphelper::getProcessComponentContext()))
|
||||
: m_xBuffer(css::io::Pipe::create(comphelper::getProcessComponentContext()))
|
||||
{
|
||||
}
|
||||
|
||||
Reference< CSS::io::XInputStream >
|
||||
Reference< css::io::XInputStream >
|
||||
CSerializationAppXML::getInputStream()
|
||||
{
|
||||
// The pipes output is provided through it's
|
||||
// XOutputStream interface aspect
|
||||
return Reference< CSS::io::XInputStream >(m_xBuffer, UNO_QUERY);
|
||||
return Reference< css::io::XInputStream >(m_xBuffer, UNO_QUERY);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -107,8 +107,8 @@ CSerializationAppXML::serialize_node(const Reference< XNode >& rNode)
|
||||
"CSerializationAppXML::serialize_node: no serialization access to the node/document!" );
|
||||
|
||||
// create a SAXWriter to take the serialization events, and connect it to our pipe
|
||||
Reference< CSS::xml::sax::XWriter > const xSaxWriter = Writer::create( comphelper::getProcessComponentContext() );
|
||||
xSaxWriter->setOutputStream( Reference< CSS::io::XOutputStream >( m_xBuffer, UNO_QUERY_THROW) );
|
||||
Reference< css::xml::sax::XWriter > const xSaxWriter = Writer::create( comphelper::getProcessComponentContext() );
|
||||
xSaxWriter->setOutputStream( Reference< css::io::XOutputStream >( m_xBuffer, UNO_QUERY_THROW) );
|
||||
|
||||
// do the serialization
|
||||
xSerializer->serialize( Reference< XDocumentHandler >(xSaxWriter, UNO_QUERY_THROW), Sequence< StringPair >() );
|
||||
|
@@ -27,16 +27,16 @@
|
||||
class CSerializationAppXML : public CSerialization
|
||||
{
|
||||
private:
|
||||
CSS::uno::Reference< CSS::io::XPipe > m_xBuffer;
|
||||
css::uno::Reference< css::io::XPipe > m_xBuffer;
|
||||
|
||||
void serialize_node(const CSS::uno::Reference< CSS::xml::dom::XNode >& aNode);
|
||||
void serialize_node(const css::uno::Reference< css::xml::dom::XNode >& aNode);
|
||||
void serialize_nodeset();
|
||||
|
||||
public:
|
||||
CSerializationAppXML();
|
||||
|
||||
virtual void serialize() SAL_OVERRIDE;
|
||||
virtual CSS::uno::Reference< CSS::io::XInputStream > getInputStream() SAL_OVERRIDE;
|
||||
virtual css::uno::Reference< css::io::XInputStream > getInputStream() SAL_OVERRIDE;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -34,10 +34,10 @@
|
||||
|
||||
#include "serialization_urlencoded.hxx"
|
||||
|
||||
using namespace CSS::uno;
|
||||
using namespace CSS::io;
|
||||
using namespace CSS::xml::xpath;
|
||||
using namespace CSS::xml::dom;
|
||||
using namespace css::uno;
|
||||
using namespace css::io;
|
||||
using namespace css::xml::xpath;
|
||||
using namespace css::xml::dom;
|
||||
|
||||
CSerializationURLEncoded::CSerializationURLEncoded()
|
||||
: m_aPipe(Pipe::create(comphelper::getProcessComponentContext()))
|
||||
@@ -164,7 +164,7 @@ void CSerializationURLEncoded::serialize()
|
||||
// output stream to the pipe buffer
|
||||
Reference< XOutputStream > out(m_aPipe, UNO_QUERY);
|
||||
|
||||
CSS::uno::Reference< CSS::xml::dom::XNode > cur = m_aFragment->getFirstChild();
|
||||
css::uno::Reference< css::xml::dom::XNode > cur = m_aFragment->getFirstChild();
|
||||
while (cur.is())
|
||||
{
|
||||
serialize_node(cur);
|
||||
|
@@ -29,17 +29,17 @@
|
||||
class CSerializationURLEncoded : public CSerialization
|
||||
{
|
||||
private:
|
||||
CSS::uno::Reference< CSS::io::XPipe > m_aPipe;
|
||||
css::uno::Reference< css::io::XPipe > m_aPipe;
|
||||
|
||||
bool is_unreserved(sal_Char);
|
||||
void encode_and_append(const OUString& aString, OStringBuffer& aBuffer);
|
||||
void serialize_node(const CSS::uno::Reference< CSS::xml::dom::XNode >& aNode);
|
||||
void serialize_node(const css::uno::Reference< css::xml::dom::XNode >& aNode);
|
||||
void serialize_nodeset();
|
||||
|
||||
public:
|
||||
CSerializationURLEncoded();
|
||||
virtual void serialize() SAL_OVERRIDE;
|
||||
virtual CSS::uno::Reference< CSS::io::XInputStream > getInputStream() SAL_OVERRIDE;
|
||||
virtual css::uno::Reference< css::io::XInputStream > getInputStream() SAL_OVERRIDE;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -48,13 +48,11 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace CSS = com::sun::star;
|
||||
|
||||
class CSubmissionPut;
|
||||
class CSubmissionPost;
|
||||
class CSubmissionGet;
|
||||
|
||||
class CCommandEnvironmentHelper : public cppu::WeakImplHelper1< CSS::ucb::XCommandEnvironment >
|
||||
class CCommandEnvironmentHelper : public cppu::WeakImplHelper1< css::ucb::XCommandEnvironment >
|
||||
{
|
||||
friend class CSubmissionPut;
|
||||
friend class CSubmissionPost;
|
||||
@@ -62,21 +60,21 @@ class CCommandEnvironmentHelper : public cppu::WeakImplHelper1< CSS::ucb::XComma
|
||||
friend class CSubmission;
|
||||
|
||||
protected:
|
||||
CSS::uno::Reference< CSS::task::XInteractionHandler > m_aInteractionHandler;
|
||||
CSS::uno::Reference< CSS::ucb::XProgressHandler > m_aProgressHandler;
|
||||
css::uno::Reference< css::task::XInteractionHandler > m_aInteractionHandler;
|
||||
css::uno::Reference< css::ucb::XProgressHandler > m_aProgressHandler;
|
||||
|
||||
public:
|
||||
virtual CSS::uno::Reference< CSS::task::XInteractionHandler > SAL_CALL getInteractionHandler() throw (CSS::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
||||
virtual css::uno::Reference< css::task::XInteractionHandler > SAL_CALL getInteractionHandler() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
||||
{
|
||||
return m_aInteractionHandler;
|
||||
}
|
||||
virtual CSS::uno::Reference< CSS::ucb::XProgressHandler > SAL_CALL getProgressHandler() throw (CSS::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
||||
virtual css::uno::Reference< css::ucb::XProgressHandler > SAL_CALL getProgressHandler() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
|
||||
{
|
||||
return m_aProgressHandler;
|
||||
}
|
||||
};
|
||||
|
||||
class CProgressHandlerHelper : public cppu::WeakImplHelper1< CSS::ucb::XProgressHandler >
|
||||
class CProgressHandlerHelper : public cppu::WeakImplHelper1< css::ucb::XProgressHandler >
|
||||
{
|
||||
friend class CSubmissionPut;
|
||||
friend class CSubmissionPost;
|
||||
@@ -113,10 +111,10 @@ class CSubmission
|
||||
|
||||
protected:
|
||||
INetURLObject m_aURLObj;
|
||||
CSS::uno::Reference< CSS::xml::xpath::XXPathObject > m_aXPathObject;
|
||||
CSS::uno::Reference< CSS::xml::dom::XDocumentFragment > m_aFragment;
|
||||
CSS::uno::Reference< CSS::io::XInputStream > m_aResultStream;
|
||||
CSS::uno::Reference< CSS::uno::XComponentContext > m_xContext;
|
||||
css::uno::Reference< css::xml::xpath::XXPathObject > m_aXPathObject;
|
||||
css::uno::Reference< css::xml::dom::XDocumentFragment > m_aFragment;
|
||||
css::uno::Reference< css::io::XInputStream > m_aResultStream;
|
||||
css::uno::Reference< css::uno::XComponentContext > m_xContext;
|
||||
OUString m_aEncoding;
|
||||
|
||||
::std::auto_ptr< CSerialization > createSerialization(const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& aHandler
|
||||
@@ -132,7 +130,7 @@ public:
|
||||
UNKNOWN_ERROR
|
||||
};
|
||||
|
||||
CSubmission(const OUString& aURL, const CSS::uno::Reference< CSS::xml::dom::XDocumentFragment >& aFragment)
|
||||
CSubmission(const OUString& aURL, const css::uno::Reference< css::xml::dom::XDocumentFragment >& aFragment)
|
||||
: m_aURLObj(aURL)
|
||||
, m_aFragment(aFragment)
|
||||
, m_xContext(::comphelper::getProcessComponentContext())
|
||||
@@ -144,9 +142,9 @@ public:
|
||||
{
|
||||
m_aEncoding = aEncoding;
|
||||
}
|
||||
virtual SubmissionResult submit(const CSS::uno::Reference< CSS::task::XInteractionHandler >& ) = 0;
|
||||
virtual SubmissionResult submit(const css::uno::Reference< css::task::XInteractionHandler >& ) = 0;
|
||||
|
||||
virtual SubmissionResult replace(const OUString&, const CSS::uno::Reference< CSS::xml::dom::XDocument >&, const CSS::uno::Reference< CSS::frame::XFrame>&);
|
||||
virtual SubmissionResult replace(const OUString&, const css::uno::Reference< css::xml::dom::XDocument >&, const css::uno::Reference< css::frame::XFrame>&);
|
||||
|
||||
};
|
||||
|
||||
|
@@ -32,29 +32,29 @@
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
||||
using namespace CSS::uno;
|
||||
using namespace CSS::ucb;
|
||||
using namespace CSS::task;
|
||||
using namespace CSS::io;
|
||||
using namespace css::uno;
|
||||
using namespace css::ucb;
|
||||
using namespace css::task;
|
||||
using namespace css::io;
|
||||
using namespace osl;
|
||||
using namespace ucbhelper;
|
||||
using namespace std;
|
||||
|
||||
|
||||
|
||||
CSubmissionGet::CSubmissionGet(const OUString& aURL, const CSS::uno::Reference< CSS::xml::dom::XDocumentFragment >& aFragment)
|
||||
CSubmissionGet::CSubmissionGet(const OUString& aURL, const css::uno::Reference< css::xml::dom::XDocumentFragment >& aFragment)
|
||||
: CSubmission(aURL, aFragment)
|
||||
{
|
||||
}
|
||||
|
||||
CSubmission::SubmissionResult CSubmissionGet::submit(const CSS::uno::Reference< CSS::task::XInteractionHandler >& aInteractionHandler)
|
||||
CSubmission::SubmissionResult CSubmissionGet::submit(const css::uno::Reference< css::task::XInteractionHandler >& aInteractionHandler)
|
||||
{
|
||||
// GET always uses apllicatin/x-www-formurlencoded
|
||||
boost::scoped_ptr< CSerialization > apSerialization(new CSerializationURLEncoded());
|
||||
apSerialization->setSource(m_aFragment);
|
||||
apSerialization->serialize();
|
||||
|
||||
CSS::uno::Reference< XInputStream > aInStream = apSerialization->getInputStream();
|
||||
css::uno::Reference< XInputStream > aInStream = apSerialization->getInputStream();
|
||||
|
||||
// create a commandEnvironment and use the default interaction handler
|
||||
CCommandEnvironmentHelper *pHelper = new CCommandEnvironmentHelper;
|
||||
@@ -62,12 +62,12 @@ CSubmission::SubmissionResult CSubmissionGet::submit(const CSS::uno::Reference<
|
||||
pHelper->m_aInteractionHandler = aInteractionHandler;
|
||||
else
|
||||
pHelper->m_aInteractionHandler.set(
|
||||
CSS::task::InteractionHandler::createWithParent(m_xContext, 0), UNO_QUERY_THROW);
|
||||
css::task::InteractionHandler::createWithParent(m_xContext, 0), UNO_QUERY_THROW);
|
||||
CProgressHandlerHelper *pProgressHelper = new CProgressHandlerHelper;
|
||||
pHelper->m_aProgressHandler = CSS::uno::Reference< XProgressHandler >(pProgressHelper);
|
||||
pHelper->m_aProgressHandler = css::uno::Reference< XProgressHandler >(pProgressHelper);
|
||||
|
||||
// UCB has ownership of environment...
|
||||
CSS::uno::Reference< XCommandEnvironment > aEnvironment(pHelper);
|
||||
css::uno::Reference< XCommandEnvironment > aEnvironment(pHelper);
|
||||
|
||||
// append query string to the URL
|
||||
try {
|
||||
@@ -87,7 +87,7 @@ CSubmission::SubmissionResult CSubmissionGet::submit(const CSS::uno::Reference<
|
||||
}
|
||||
OUString aQueryURL = OStringToOUString(aUTF8QueryURL.makeStringAndClear(), RTL_TEXTENCODING_UTF8);
|
||||
ucbhelper::Content aContent(aQueryURL, aEnvironment, m_xContext);
|
||||
CSS::uno::Reference< XOutputStream > aPipe( CSS::io::Pipe::create(m_xContext), UNO_QUERY_THROW );
|
||||
css::uno::Reference< XOutputStream > aPipe( css::io::Pipe::create(m_xContext), UNO_QUERY_THROW );
|
||||
aContent.openStream(aPipe);
|
||||
// get reply
|
||||
try {
|
||||
|
@@ -27,10 +27,10 @@
|
||||
class CSubmissionGet : public CSubmission
|
||||
{
|
||||
private:
|
||||
CSS::uno::Reference< CSS::uno::XComponentContext > m_xContext;
|
||||
css::uno::Reference< css::uno::XComponentContext > m_xContext;
|
||||
public:
|
||||
CSubmissionGet(const OUString& aURL, const CSS::uno::Reference< CSS::xml::dom::XDocumentFragment >& aFragment);
|
||||
virtual SubmissionResult submit(const CSS::uno::Reference< CSS::task::XInteractionHandler >& aInteractionHandler) SAL_OVERRIDE;
|
||||
CSubmissionGet(const OUString& aURL, const css::uno::Reference< css::xml::dom::XDocumentFragment >& aFragment);
|
||||
virtual SubmissionResult submit(const css::uno::Reference< css::task::XInteractionHandler >& aInteractionHandler) SAL_OVERRIDE;
|
||||
|
||||
};
|
||||
#endif
|
||||
|
@@ -29,25 +29,25 @@
|
||||
#include <ucbhelper/activedatasink.hxx>
|
||||
#include <com/sun/star/ucb/PostCommandArgument2.hpp>
|
||||
|
||||
using namespace CSS::uno;
|
||||
using namespace CSS::ucb;
|
||||
using namespace CSS::task;
|
||||
using namespace CSS::io;
|
||||
using namespace css::uno;
|
||||
using namespace css::ucb;
|
||||
using namespace css::task;
|
||||
using namespace css::io;
|
||||
using namespace osl;
|
||||
using namespace ucbhelper;
|
||||
using namespace std;
|
||||
|
||||
|
||||
|
||||
CSubmissionPost::CSubmissionPost(const OUString& aURL, const CSS::uno::Reference< CSS::xml::dom::XDocumentFragment >& aFragment)
|
||||
CSubmissionPost::CSubmissionPost(const OUString& aURL, const css::uno::Reference< css::xml::dom::XDocumentFragment >& aFragment)
|
||||
: CSubmission(aURL, aFragment)
|
||||
{
|
||||
}
|
||||
|
||||
CSubmission::SubmissionResult CSubmissionPost::submit(const CSS::uno::Reference< CSS::task::XInteractionHandler >& aInteractionHandler)
|
||||
CSubmission::SubmissionResult CSubmissionPost::submit(const css::uno::Reference< css::task::XInteractionHandler >& aInteractionHandler)
|
||||
{
|
||||
// PUT always uses application/xml
|
||||
CSS::uno::Reference< XCommandEnvironment > aEnvironment;
|
||||
css::uno::Reference< XCommandEnvironment > aEnvironment;
|
||||
auto_ptr< CSerialization > apSerialization(createSerialization(aInteractionHandler,aEnvironment));
|
||||
|
||||
try {
|
||||
@@ -57,7 +57,7 @@ CSubmission::SubmissionResult CSubmissionPost::submit(const CSS::uno::Reference<
|
||||
OUString aCommandName("post");
|
||||
PostCommandArgument2 aPostArgument;
|
||||
aPostArgument.Source = apSerialization->getInputStream();
|
||||
CSS::uno::Reference< XActiveDataSink > aSink(new ucbhelper::ActiveDataSink);
|
||||
css::uno::Reference< XActiveDataSink > aSink(new ucbhelper::ActiveDataSink);
|
||||
aPostArgument.Sink = aSink;
|
||||
aPostArgument.MediaType = "application/xml";
|
||||
aPostArgument.Referer = "";
|
||||
|
@@ -25,8 +25,8 @@
|
||||
class CSubmissionPost : public CSubmission
|
||||
{
|
||||
public:
|
||||
CSubmissionPost(const OUString& aURL, const CSS::uno::Reference< CSS::xml::dom::XDocumentFragment >& aFragment);
|
||||
virtual SubmissionResult submit(const CSS::uno::Reference< CSS::task::XInteractionHandler >& aInteractionHandler) SAL_OVERRIDE;
|
||||
CSubmissionPost(const OUString& aURL, const css::uno::Reference< css::xml::dom::XDocumentFragment >& aFragment);
|
||||
virtual SubmissionResult submit(const css::uno::Reference< css::task::XInteractionHandler >& aInteractionHandler) SAL_OVERRIDE;
|
||||
|
||||
};
|
||||
#endif
|
||||
|
@@ -28,30 +28,30 @@
|
||||
#include <comphelper/processfactory.hxx>
|
||||
#include <ucbhelper/content.hxx>
|
||||
|
||||
using namespace CSS::uno;
|
||||
using namespace CSS::ucb;
|
||||
using namespace CSS::task;
|
||||
using namespace CSS::io;
|
||||
using namespace css::uno;
|
||||
using namespace css::ucb;
|
||||
using namespace css::task;
|
||||
using namespace css::io;
|
||||
using namespace osl;
|
||||
using namespace ucbhelper;
|
||||
using namespace std;
|
||||
|
||||
|
||||
CSubmissionPut::CSubmissionPut(const OUString& aURL, const CSS::uno::Reference< CSS::xml::dom::XDocumentFragment >& aFragment)
|
||||
CSubmissionPut::CSubmissionPut(const OUString& aURL, const css::uno::Reference< css::xml::dom::XDocumentFragment >& aFragment)
|
||||
: CSubmission(aURL, aFragment)
|
||||
{
|
||||
}
|
||||
|
||||
CSubmission::SubmissionResult CSubmissionPut::submit(const CSS::uno::Reference< CSS::task::XInteractionHandler >& aInteractionHandler)
|
||||
CSubmission::SubmissionResult CSubmissionPut::submit(const css::uno::Reference< css::task::XInteractionHandler >& aInteractionHandler)
|
||||
{
|
||||
CSS::uno::Reference< XCommandEnvironment > aEnvironment;
|
||||
css::uno::Reference< XCommandEnvironment > aEnvironment;
|
||||
auto_ptr< CSerialization > apSerialization(createSerialization(aInteractionHandler,aEnvironment));
|
||||
|
||||
try {
|
||||
ucbhelper::Content aContent(m_aURLObj.GetMainURL(INetURLObject::NO_DECODE), aEnvironment, comphelper::getProcessComponentContext());
|
||||
|
||||
// insert serialized data to content -> PUT
|
||||
CSS::uno::Reference< XInputStream > aInStream = apSerialization->getInputStream();
|
||||
css::uno::Reference< XInputStream > aInStream = apSerialization->getInputStream();
|
||||
aContent.writeStream(aInStream, true);
|
||||
//aContent.closeStream();
|
||||
|
||||
|
@@ -28,8 +28,8 @@
|
||||
class CSubmissionPut : public CSubmission
|
||||
{
|
||||
public:
|
||||
CSubmissionPut(const OUString& aURL, const CSS::uno::Reference< CSS::xml::dom::XDocumentFragment >& aFragment);
|
||||
virtual SubmissionResult submit(const CSS::uno::Reference< CSS::task::XInteractionHandler >& aInteractionHandler) SAL_OVERRIDE;
|
||||
CSubmissionPut(const OUString& aURL, const css::uno::Reference< css::xml::dom::XDocumentFragment >& aFragment);
|
||||
virtual SubmissionResult submit(const css::uno::Reference< css::task::XInteractionHandler >& aInteractionHandler) SAL_OVERRIDE;
|
||||
|
||||
};
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user