LibreOffice Module desktop (master)  1
dp_backenddb.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 
21 #include <rtl/string.h>
22 #include <rtl/strbuf.hxx>
23 #include <rtl/bootstrap.hxx>
24 #include <cppuhelper/exc_hlp.hxx>
25 #include <osl/file.hxx>
26 #include <com/sun/star/deployment/DeploymentException.hpp>
27 #include <com/sun/star/uno/XComponentContext.hpp>
28 #include <com/sun/star/xml/dom/DocumentBuilder.hpp>
29 #include <com/sun/star/xml/xpath/XPathAPI.hpp>
30 #include <com/sun/star/io/XActiveDataSource.hpp>
31 #include <com/sun/star/io/XActiveDataControl.hpp>
32 #include <dp_ucb.h>
33 #include <dp_misc.h>
34 #include <ucbhelper/content.hxx>
35 #include <xmlscript/xml_helper.hxx>
36 #include <dp_backenddb.hxx>
37 
38 
39 using namespace ::com::sun::star::uno;
40 
41 
42 namespace dp_registry::backend {
43 
45  Reference<css::uno::XComponentContext> const & xContext,
46  OUString const & url):
47  m_xContext(xContext)
48 {
49  m_urlDb = dp_misc::expandUnoRcUrl(url);
50 }
51 
53 {
54  const Reference<css::io::XActiveDataSource> xDataSource(m_doc,css::uno::UNO_QUERY_THROW);
55  std::vector<sal_Int8> bytes;
56  xDataSource->setOutputStream(::xmlscript::createOutputStream(&bytes));
57  const Reference<css::io::XActiveDataControl> xDataControl(m_doc,css::uno::UNO_QUERY_THROW);
58  xDataControl->start();
59 
60  const Reference<css::io::XInputStream> xData(
62  ::ucbhelper::Content ucbDb(m_urlDb, nullptr, m_xContext);
63  ucbDb.writeStream(xData, true /*replace existing*/);
64 }
65 
66 css::uno::Reference<css::xml::dom::XDocument> const & BackendDb::getDocument()
67 {
68  if (!m_doc.is())
69  {
70  const Reference<css::xml::dom::XDocumentBuilder> xDocBuilder(
72 
73  ::osl::DirectoryItem item;
74  ::osl::File::RC err = ::osl::DirectoryItem::get(m_urlDb, item);
75  if (err == ::osl::File::E_None)
76  {
77  ::ucbhelper::Content descContent(
78  m_urlDb, css::uno::Reference<css::ucb::XCommandEnvironment>(),
79  m_xContext);
80  Reference<css::io::XInputStream> xIn = descContent.openStream();
81  m_doc = xDocBuilder->parse(xIn);
82  }
83  else if (err == ::osl::File::E_NOENT)
84  {
85  //Create a new document and insert some basic stuff
86  m_doc = xDocBuilder->newDocument();
87  const Reference<css::xml::dom::XElement> rootNode =
88  m_doc->createElementNS(getDbNSName(), getNSPrefix() +
89  ":" + getRootElementName());
90 
91  m_doc->appendChild(Reference<css::xml::dom::XNode>(
92  rootNode, UNO_QUERY_THROW));
93  save();
94  }
95  else
96  throw css::uno::RuntimeException(
97  "Extension manager could not access database file:"
98  + m_urlDb, nullptr);
99 
100  if (!m_doc.is())
101  throw css::uno::RuntimeException(
102  "Extension manager could not get root node of data base file: "
103  + m_urlDb, nullptr);
104  }
105 
106  return m_doc;
107 }
108 
109 Reference<css::xml::xpath::XXPathAPI> const & BackendDb::getXPathAPI()
110 {
111  if (!m_xpathApi.is())
112  {
114 
115  m_xpathApi->registerNS( getNSPrefix(), getDbNSName() );
116  }
117 
118  return m_xpathApi;
119 }
120 
121 void BackendDb::removeElement(OUString const & sXPathExpression)
122 {
123  try
124  {
125  const Reference<css::xml::dom::XDocument> doc = getDocument();
126  const Reference<css::xml::dom::XNode> root = doc->getFirstChild();
127  const Reference<css::xml::xpath::XXPathAPI> xpathApi = getXPathAPI();
128  //find the extension element that is to be removed
129  const Reference<css::xml::dom::XNode> aNode =
130  xpathApi->selectSingleNode(root, sXPathExpression);
131 
132  if (aNode.is())
133  {
134  root->removeChild(aNode);
135  save();
136  }
137 
138 #if OSL_DEBUG_LEVEL > 0
139  //There must not be any other entry with the same url
140  const Reference<css::xml::dom::XNode> nextNode =
141  xpathApi->selectSingleNode(root, sXPathExpression);
142  OSL_ASSERT(! nextNode.is());
143 #endif
144  }
145  catch(const css::uno::Exception &)
146  {
147  Any exc( ::cppu::getCaughtException() );
148  throw css::deployment::DeploymentException(
149  "Extension Manager: failed to write data entry in backend db: " +
150  m_urlDb, nullptr, exc);
151  }
152 }
153 
154 void BackendDb::removeEntry(OUString const & url)
155 {
156  const OUString sKeyElement = getKeyElementName();
157  const OUString sPrefix = getNSPrefix();
158  OUString sExpression =
159  sPrefix +
160  ":" +
161  sKeyElement +
162  "[@url = \"" +
163  url +
164  "\"]";
165 
166  removeElement(sExpression);
167 }
168 
169 void BackendDb::revokeEntry(OUString const & url)
170 {
171  try
172  {
173  Reference<css::xml::dom::XElement> entry(getKeyElement(url), UNO_QUERY);
174  if (entry.is())
175  {
176  entry->setAttribute("revoked", "true");
177  save();
178  }
179  }
180  catch(const css::uno::Exception &)
181  {
182  Any exc( ::cppu::getCaughtException() );
183  throw css::deployment::DeploymentException(
184  "Extension Manager: failed to revoke data entry in backend db: " +
185  m_urlDb, nullptr, exc);
186  }
187 }
188 
189 bool BackendDb::activateEntry(OUString const & url)
190 {
191  try
192  {
193  bool ret = false;
194  Reference<css::xml::dom::XElement> entry(getKeyElement(url), UNO_QUERY);
195  if (entry.is())
196  {
197  //no attribute "active" means it is active, that is, registered.
198  entry->removeAttribute("revoked");
199  save();
200  ret = true;
201  }
202  return ret;
203  }
204  catch(const css::uno::Exception &)
205  {
206  Any exc( ::cppu::getCaughtException() );
207  throw css::deployment::DeploymentException(
208  "Extension Manager: failed to revoke data entry in backend db: " +
209  m_urlDb, nullptr, exc);
210  }
211 }
212 
213 bool BackendDb::hasActiveEntry(OUString const & url)
214 {
215  try
216  {
217  bool ret = false;
218  Reference<css::xml::dom::XElement> entry(getKeyElement(url), UNO_QUERY);
219  if (entry.is())
220  {
221  OUString sActive = entry->getAttribute("revoked");
222  if (!(sActive == "true"))
223  ret = true;
224  }
225  return ret;
226 
227  }
228  catch(const css::uno::Exception &)
229  {
230  Any exc( ::cppu::getCaughtException() );
231  throw css::deployment::DeploymentException(
232  "Extension Manager: failed to determine an active entry in backend db: " +
233  m_urlDb, nullptr, exc);
234  }
235 }
236 
237 Reference<css::xml::dom::XNode> BackendDb::getKeyElement(
238  OUString const & url)
239 {
240  try
241  {
242  const OUString sPrefix = getNSPrefix();
243  const OUString sKeyElement = getKeyElementName();
244  OUString sExpression =
245  sPrefix +
246  ":" +
247  sKeyElement +
248  "[@url = \"" +
249  url +
250  "\"]";
251 
252  const Reference<css::xml::dom::XDocument> doc = getDocument();
253  const Reference<css::xml::dom::XNode> root = doc->getFirstChild();
254  const Reference<css::xml::xpath::XXPathAPI> xpathApi = getXPathAPI();
255  return xpathApi->selectSingleNode(root, sExpression);
256  }
257  catch(const css::uno::Exception &)
258  {
259  Any exc( ::cppu::getCaughtException() );
260  throw css::deployment::DeploymentException(
261  "Extension Manager: failed to read key element in backend db: " +
262  m_urlDb, nullptr, exc);
263  }
264 }
265 
266 //Only writes the data if there is at least one entry
268  std::vector< std::pair< OUString, OUString > > const & vecPairs,
269  OUString const & sVectorTagName,
270  OUString const & sPairTagName,
271  OUString const & sFirstTagName,
272  OUString const & sSecondTagName,
273  css::uno::Reference<css::xml::dom::XNode> const & xParent)
274 {
275  try{
276  if (vecPairs.empty())
277  return;
278  const OUString sNameSpace = getDbNSName();
279  OSL_ASSERT(!sNameSpace.isEmpty());
280  const OUString sPrefix(getNSPrefix() + ":");
281  const Reference<css::xml::dom::XDocument> doc = getDocument();
282  const Reference<css::xml::dom::XNode> root = doc->getFirstChild();
283 
284  const Reference<css::xml::dom::XElement> vectorNode(
285  doc->createElementNS(sNameSpace, sPrefix + sVectorTagName));
286 
287  xParent->appendChild(
288  Reference<css::xml::dom::XNode>(
289  vectorNode, css::uno::UNO_QUERY_THROW));
290  for (auto const& vecPair : vecPairs)
291  {
292  const Reference<css::xml::dom::XElement> pairNode(
293  doc->createElementNS(sNameSpace, sPrefix + sPairTagName));
294 
295  vectorNode->appendChild(
296  Reference<css::xml::dom::XNode>(
297  pairNode, css::uno::UNO_QUERY_THROW));
298 
299  const Reference<css::xml::dom::XElement> firstNode(
300  doc->createElementNS(sNameSpace, sPrefix + sFirstTagName));
301 
302  pairNode->appendChild(
303  Reference<css::xml::dom::XNode>(
304  firstNode, css::uno::UNO_QUERY_THROW));
305 
306  const Reference<css::xml::dom::XText> firstTextNode(
307  doc->createTextNode( vecPair.first));
308 
309  firstNode->appendChild(
310  Reference<css::xml::dom::XNode>(
311  firstTextNode, css::uno::UNO_QUERY_THROW));
312 
313  const Reference<css::xml::dom::XElement> secondNode(
314  doc->createElementNS(sNameSpace, sPrefix + sSecondTagName));
315 
316  pairNode->appendChild(
317  Reference<css::xml::dom::XNode>(
318  secondNode, css::uno::UNO_QUERY_THROW));
319 
320  const Reference<css::xml::dom::XText> secondTextNode(
321  doc->createTextNode( vecPair.second));
322 
323  secondNode->appendChild(
324  Reference<css::xml::dom::XNode>(
325  secondTextNode, css::uno::UNO_QUERY_THROW));
326  }
327  }
328  catch(const css::uno::Exception &)
329  {
330  Any exc( ::cppu::getCaughtException() );
331  throw css::deployment::DeploymentException(
332  "Extension Manager: failed to write data entry in backend db: " +
333  m_urlDb, nullptr, exc);
334  }
335 }
336 
337 std::vector< std::pair< OUString, OUString > >
339  Reference<css::xml::dom::XNode> const & parent,
340  OUString const & sListTagName,
341  OUString const & sPairTagName,
342  OUString const & sFirstTagName,
343  OUString const & sSecondTagName)
344 {
345  try
346  {
347  OSL_ASSERT(parent.is());
348  const OUString sPrefix(getNSPrefix() + ":");
349  const Reference<css::xml::xpath::XXPathAPI> xpathApi = getXPathAPI();
350  const OUString sExprPairs(
351  sPrefix + sListTagName + "/" + sPrefix + sPairTagName);
352  const Reference<css::xml::dom::XNodeList> listPairs =
353  xpathApi->selectNodeList(parent, sExprPairs);
354 
355  std::vector< std::pair< OUString, OUString > > retVector;
356  sal_Int32 length = listPairs->getLength();
357  for (sal_Int32 i = 0; i < length; i++)
358  {
359  const Reference<css::xml::dom::XNode> aPair = listPairs->item(i);
360  const OUString sExprFirst(sPrefix + sFirstTagName + "/text()");
361  const Reference<css::xml::dom::XNode> first =
362  xpathApi->selectSingleNode(aPair, sExprFirst);
363 
364  const OUString sExprSecond(sPrefix + sSecondTagName + "/text()");
365  const Reference<css::xml::dom::XNode> second =
366  xpathApi->selectSingleNode(aPair, sExprSecond);
367  OSL_ASSERT(first.is() && second.is());
368 
369  retVector.emplace_back(
370  first->getNodeValue(), second->getNodeValue());
371  }
372  return retVector;
373  }
374  catch(const css::uno::Exception &)
375  {
376  Any exc( ::cppu::getCaughtException() );
377  throw css::deployment::DeploymentException(
378  "Extension Manager: failed to read data entry in backend db: " +
379  m_urlDb, nullptr, exc);
380  }
381 }
382 
383 //Only writes the data if there is at least one entry
385  std::deque< OUString> const & list,
386  OUString const & sListTagName,
387  OUString const & sMemberTagName,
388  Reference<css::xml::dom::XNode> const & xParent)
389 {
390  try
391  {
392  if (list.empty())
393  return;
394  const OUString sNameSpace = getDbNSName();
395  const OUString sPrefix(getNSPrefix() + ":");
396  const Reference<css::xml::dom::XDocument> doc = getDocument();
397 
398  const Reference<css::xml::dom::XElement> listNode(
399  doc->createElementNS(sNameSpace, sPrefix + sListTagName));
400 
401  xParent->appendChild(
402  Reference<css::xml::dom::XNode>(
403  listNode, css::uno::UNO_QUERY_THROW));
404 
405  for (auto const& elem : list)
406  {
407  const Reference<css::xml::dom::XNode> memberNode(
408  doc->createElementNS(sNameSpace, sPrefix + sMemberTagName), css::uno::UNO_QUERY_THROW);
409 
410  listNode->appendChild(memberNode);
411 
412  const Reference<css::xml::dom::XNode> textNode(
413  doc->createTextNode(elem), css::uno::UNO_QUERY_THROW);
414 
415  memberNode->appendChild(textNode);
416  }
417  }
418  catch(const css::uno::Exception &)
419  {
420  Any exc( ::cppu::getCaughtException() );
421  throw css::deployment::DeploymentException(
422  "Extension Manager: failed to write data entry in backend db: " +
423  m_urlDb, nullptr, exc);
424  }
425 }
426 
427 //Writes only the element if is has a value.
428 //The prefix is automatically added to the element name
430  OUString const & sElementName, OUString const & value,
431  Reference<css::xml::dom::XNode> const & xParent)
432 {
433  try
434  {
435  if (value.isEmpty())
436  return;
437  const OUString sPrefix = getNSPrefix();
438  const Reference<css::xml::dom::XDocument> doc = getDocument();
439  const OUString sNameSpace = getDbNSName();
440  const Reference<css::xml::dom::XNode> dataNode(
441  doc->createElementNS(sNameSpace, sPrefix + ":" + sElementName),
442  UNO_QUERY_THROW);
443  xParent->appendChild(dataNode);
444 
445  const Reference<css::xml::dom::XNode> dataValue(
446  doc->createTextNode(value), UNO_QUERY_THROW);
447  dataNode->appendChild(dataValue);
448  }
449  catch(const css::uno::Exception &)
450  {
451  Any exc( ::cppu::getCaughtException() );
452  throw css::deployment::DeploymentException(
453  "Extension Manager: failed to write data entry(writeSimpleElement) in backend db: " +
454  m_urlDb, nullptr, exc);
455  }
456 
457 }
458 
460 Reference<css::xml::dom::XNode> BackendDb::writeKeyElement(
461  OUString const & url)
462 {
463  try
464  {
465  const OUString sNameSpace = getDbNSName();
466  const OUString sPrefix = getNSPrefix();
467  const OUString sElementName = getKeyElementName();
468  const Reference<css::xml::dom::XDocument> doc = getDocument();
469  const Reference<css::xml::dom::XNode> root = doc->getFirstChild();
470 
471  //Check if there are an entry with the same url. This can be the case if the
472  //status of an XPackage is ambiguous. In this case a call to activateExtension
473  //(dp_extensionmanager.cxx), will register the package again. See also
474  //Package::processPackage_impl in dp_backend.cxx.
475  //A package can become
476  //invalid after its successful registration, for example if a second extension with
477  //the same service is installed.
478  const OUString sExpression(
479  sPrefix + ":" + sElementName + "[@url = \"" + url + "\"]");
480  const Reference<css::xml::dom::XNode> existingNode =
481  getXPathAPI()->selectSingleNode(root, sExpression);
482  if (existingNode.is())
483  {
484  OSL_ASSERT(false);
485  //replace the existing entry.
486  removeEntry(url);
487  }
488 
489  const Reference<css::xml::dom::XElement> keyElement(
490  doc->createElementNS(sNameSpace, sPrefix + ":" + sElementName));
491 
492  keyElement->setAttribute("url", url);
493 
494  const Reference<css::xml::dom::XNode> keyNode(
495  keyElement, UNO_QUERY_THROW);
496  root->appendChild(keyNode);
497  return keyNode;
498  }
499  catch(const css::uno::Exception &)
500  {
501  Any exc( ::cppu::getCaughtException() );
502  throw css::deployment::DeploymentException(
503  "Extension Manager: failed to write key element in backend db: " +
504  m_urlDb, nullptr, exc);
505  }
506 }
507 
509  OUString const & sElementName, Reference<css::xml::dom::XNode> const & xParent)
510 {
511  try
512  {
513  const OUString sPrefix = getNSPrefix();
514  const OUString sExpr(sPrefix + ":" + sElementName + "/text()");
515  const Reference<css::xml::xpath::XXPathAPI> xpathApi = getXPathAPI();
516  const Reference<css::xml::dom::XNode> val =
517  xpathApi->selectSingleNode(xParent, sExpr);
518  if (val.is())
519  return val->getNodeValue();
520  return OUString();
521  }
522  catch(const css::uno::Exception &)
523  {
524  Any exc( ::cppu::getCaughtException() );
525  throw css::deployment::DeploymentException(
526  "Extension Manager: failed to read data (readSimpleElement) in backend db: " +
527  m_urlDb, nullptr, exc);
528  }
529 }
530 
531 
532 std::deque< OUString> BackendDb::readList(
533  Reference<css::xml::dom::XNode> const & parent,
534  OUString const & sListTagName,
535  OUString const & sMemberTagName)
536 {
537  try
538  {
539  OSL_ASSERT(parent.is());
540  const OUString sPrefix(getNSPrefix() + ":");
541  const Reference<css::xml::xpath::XXPathAPI> xpathApi = getXPathAPI();
542  const OUString sExprList(
543  sPrefix + sListTagName + "/" + sPrefix + sMemberTagName + "/text()");
544  const Reference<css::xml::dom::XNodeList> list =
545  xpathApi->selectNodeList(parent, sExprList);
546 
547  std::deque<OUString > retList;
548  sal_Int32 length = list->getLength();
549  for (sal_Int32 i = 0; i < length; i++)
550  {
551  const Reference<css::xml::dom::XNode> member = list->item(i);
552  retList.push_back(member->getNodeValue());
553  }
554  return retList;
555  }
556  catch(const css::uno::Exception &)
557  {
558  Any exc( ::cppu::getCaughtException() );
559  throw css::deployment::DeploymentException(
560  "Extension Manager: failed to read data entry in backend db: " +
561  m_urlDb, nullptr, exc);
562  }
563 }
564 
566  OUString const & name)
567 {
568  try
569  {
570  std::vector<OUString> listRet;
571  Reference<css::xml::dom::XDocument> doc = getDocument();
572  Reference<css::xml::dom::XNode> root = doc->getFirstChild();
573 
574  Reference<css::xml::xpath::XXPathAPI> xpathApi = getXPathAPI();
575  const OUString sPrefix = getNSPrefix();
576  const OUString sKeyElement = getKeyElementName();
577  OUString sNodeSelectExpr =
578  sPrefix +
579  ":" +
580  sKeyElement +
581  "/" +
582  sPrefix +
583  ":" +
584  name +
585  "/text()";
586 
587  Reference<css::xml::dom::XNodeList> nodes =
588  xpathApi->selectNodeList(root, sNodeSelectExpr);
589  if (nodes.is())
590  {
591  sal_Int32 length = nodes->getLength();
592  for (sal_Int32 i = 0; i < length; i++)
593  listRet.push_back(nodes->item(i)->getNodeValue());
594  }
595  return listRet;
596  }
597  catch ( const css::deployment::DeploymentException& )
598  {
599  throw;
600  }
601  catch(const css::uno::Exception &)
602  {
603  Any exc( ::cppu::getCaughtException() );
604  throw css::deployment::DeploymentException(
605  "Extension Manager: failed to read data entry in backend db: " +
606  m_urlDb, nullptr, exc);
607  }
608 }
609 
610 
613  OUString const & url):BackendDb(xContext, url)
614 {
615 }
616 
617 void RegisteredDb::addEntry(OUString const & url)
618 {
619  try{
620  if (!activateEntry(url))
621  {
622  const OUString sNameSpace = getDbNSName();
623  const OUString sPrefix = getNSPrefix();
624  const OUString sEntry = getKeyElementName();
625 
626  Reference<css::xml::dom::XDocument> doc = getDocument();
627  Reference<css::xml::dom::XNode> root = doc->getFirstChild();
628 
629 #if OSL_DEBUG_LEVEL > 0
630  //There must not be yet an entry with the same url
631  OUString sExpression(
632  sPrefix + ":" + sEntry + "[@url = \"" + url + "\"]");
633  Reference<css::xml::dom::XNode> _extensionNode =
634  getXPathAPI()->selectSingleNode(root, sExpression);
635  OSL_ASSERT(! _extensionNode.is());
636 #endif
637  Reference<css::xml::dom::XElement> helpElement(
638  doc->createElementNS(sNameSpace, sPrefix + ":" + sEntry));
639 
640  helpElement->setAttribute("url", url);
641 
642  Reference<css::xml::dom::XNode> helpNode(
643  helpElement, UNO_QUERY_THROW);
644  root->appendChild(helpNode);
645 
646  save();
647  }
648  }
649  catch(const css::uno::Exception &)
650  {
651  Any exc( ::cppu::getCaughtException() );
652  throw css::deployment::DeploymentException(
653  "Extension Manager: failed to write data entry in backend db: " +
654  m_urlDb, nullptr, exc);
655  }
656 }
657 
658 } // namespace
659 
660 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void writeVectorOfPair(std::vector< std::pair< OUString, OUString > > const &vecPairs, OUString const &sVectorTagName, OUString const &sPairTagName, OUString const &sFirstTagName, OUString const &sSecondTagName, css::uno::Reference< css::xml::dom::XNode > const &xParent)
css::uno::Reference< css::xml::dom::XDocument > const & getDocument()
std::vector< sal_uInt8 > bytes
void removeEntry(OUString const &url)
std::deque< OUString > readList(css::uno::Reference< css::xml::dom::XNode > const &parent, OUString const &sListTagName, OUString const &sMemberTagName)
css::uno::Reference< css::xml::dom::XDocument > m_doc
css::uno::Reference< css::deployment::XPackageRegistry > create(css::uno::Reference< css::deployment::XPackageRegistry > const &xRootRegistry, OUString const &context, OUString const &cachePath, css::uno::Reference< css::uno::XComponentContext > const &xComponentContext)
css::uno::Reference< css::xml::dom::XNode > writeKeyElement(OUString const &url)
The key elements have a url attribute and are always children of the root element.
Any SAL_CALL getCaughtException()
length
css::uno::Reference< css::xml::dom::XNode > getKeyElement(OUString const &url)
css::uno::Reference< css::xml::xpath::XXPathAPI > m_xpathApi
virtual OUString getKeyElementName()=0
OUString sPrefix
err
Reference< io::XInputStream > createInputStream(std::vector< sal_Int8 > const &rInData)
std::vector< std::pair< OUString, OUString > > readVectorOfPair(css::uno::Reference< css::xml::dom::XNode > const &parent, OUString const &sListTagName, OUString const &sPairTagName, OUString const &sFirstTagName, OUString const &sSecondTagName)
BackendDb(BackendDb const &)=delete
int i
void removeElement(OUString const &sXPathExpression)
virtual OUString getDbNSName()=0
bool hasActiveEntry(OUString const &url)
void writeSimpleElement(OUString const &sElementName, OUString const &value, css::uno::Reference< css::xml::dom::XNode > const &xParent)
void addEntry(OUString const &url)
OUString expandUnoRcUrl(OUString const &url)
Definition: dp_misc.cxx:329
static uno::Reference< css::uno::XComponentContext > xContext
Definition: init.cxx:2087
css::uno::Reference< css::io::XInputStream > openStream()
const css::uno::Reference< css::uno::XComponentContext > m_xContext
std::vector< OUString > getOneChildFromAllEntries(OUString const &sElementName)
void revokeEntry(OUString const &url)
RegisteredDb(css::uno::Reference< css::uno::XComponentContext > const &xContext, OUString const &url)
virtual OUString getNSPrefix()=0
css::uno::Reference< css::xml::xpath::XXPathAPI > const & getXPathAPI()
Reference< io::XOutputStream > createOutputStream(std::vector< sal_Int8 > *pOutData)
void SAL_CALL first(const css::awt::SpinEvent &rEvent) override
OUString readSimpleElement(OUString const &sElementName, css::uno::Reference< css::xml::dom::XNode > const &xParent)
virtual OUString getRootElementName()=0
void writeStream(const css::uno::Reference< css::io::XInputStream > &rStream, bool bReplaceExisting)
bool activateEntry(OUString const &url)
uno::Reference< uno::XComponentContext > m_xContext
void writeSimpleList(std::deque< OUString > const &list, OUString const &sListTagName, OUString const &sMemberTagName, css::uno::Reference< css::xml::dom::XNode > const &xParent)