You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
82 lines
2.5 KiB
82 lines
2.5 KiB
15 years ago
|
/*
|
||
13 years ago
|
This file is part of tdepim.
|
||
15 years ago
|
|
||
|
Copyright (c) 2004 Cornelius Schumacher <schumacher@kde.org>
|
||
|
|
||
|
This program is free software; you can redistribute it and/or modify
|
||
|
it under the terms of the GNU General Public License as published by
|
||
|
the Free Software Foundation; either version 2 of the License, or
|
||
|
(at your option) any later version.
|
||
|
|
||
|
This program is distributed in the hope that it will be useful,
|
||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
GNU General Public License for more details.
|
||
|
|
||
|
You should have received a copy of the GNU General Public License
|
||
|
along with this program; if not, write to the Free Software
|
||
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||
|
*/
|
||
|
|
||
|
#include <config.h>
|
||
|
|
||
|
#include "webdavhandler.h"
|
||
|
|
||
|
#include <limits.h>
|
||
|
|
||
13 years ago
|
#include <libtdepim/kpimprefs.h>
|
||
15 years ago
|
|
||
|
#include <kdebug.h>
|
||
12 years ago
|
#include <tdeconfig.h>
|
||
15 years ago
|
|
||
15 years ago
|
#include <tqfile.h>
|
||
15 years ago
|
|
||
|
|
||
|
WebdavHandler::WebdavHandler()
|
||
|
{
|
||
|
}
|
||
|
|
||
|
|
||
15 years ago
|
TQDomElement WebdavHandler::addElement( TQDomDocument &doc, TQDomNode &node,
|
||
|
const TQString &tag )
|
||
15 years ago
|
{
|
||
15 years ago
|
TQDomElement el = doc.createElement( tag );
|
||
15 years ago
|
node.appendChild( el );
|
||
|
return el;
|
||
|
}
|
||
|
|
||
15 years ago
|
TQDomElement WebdavHandler::addDavElement( TQDomDocument &doc, TQDomNode &node,
|
||
|
const TQString &tag )
|
||
15 years ago
|
{
|
||
15 years ago
|
TQDomElement el = doc.createElementNS( "DAV", tag );
|
||
15 years ago
|
node.appendChild( el );
|
||
|
return el;
|
||
|
}
|
||
|
|
||
15 years ago
|
TQDomElement WebdavHandler::addSloxElement( TQDomDocument &doc, TQDomNode &node,
|
||
|
const TQString &tag,
|
||
|
const TQString &text )
|
||
15 years ago
|
{
|
||
15 years ago
|
TQDomElement el = doc.createElementNS( "SLOX", tag );
|
||
15 years ago
|
if ( !text.isEmpty() ) {
|
||
15 years ago
|
TQDomText textnode = doc.createTextNode( text );
|
||
15 years ago
|
el.appendChild( textnode );
|
||
|
}
|
||
|
node.appendChild( el );
|
||
|
return el;
|
||
|
}
|
||
|
|
||
15 years ago
|
TQDomDocument WebdavHandler::createAllPropsRequest()
|
||
15 years ago
|
{
|
||
15 years ago
|
TQDomDocument doc;
|
||
15 years ago
|
|
||
13 years ago
|
TQDomElement root = WebdavHandler::addDavElement( doc, doc, "propfind" );
|
||
15 years ago
|
TQDomElement prop = WebdavHandler::addDavElement( doc, root, "prop" );
|
||
15 years ago
|
WebdavHandler::addDavElement( doc, prop, "getcontentlength");
|
||
|
WebdavHandler::addDavElement( doc, prop, "getlastmodified" );
|
||
|
WebdavHandler::addDavElement( doc, prop, "displayname" );
|
||
|
WebdavHandler::addDavElement( doc, prop, "resourcetype" );
|
||
|
prop.appendChild( doc.createElementNS( "http://apache.org/dav/props/", "executable" ) );
|
||
|
return doc;
|
||
|
}
|