LibreOffice Module desktop (master)  1
dp_backend.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 <sal/config.h>
21 
22 #include <cassert>
23 
24 #include <dp_backend.h>
25 #include <dp_ucb.h>
26 #include <rtl/ustring.hxx>
27 #include <rtl/uri.hxx>
28 #include <rtl/bootstrap.hxx>
29 #include <sal/log.hxx>
30 #include <osl/file.hxx>
31 #include <cppuhelper/exc_hlp.hxx>
33 #include <ucbhelper/content.hxx>
34 #include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
35 #include <com/sun/star/deployment/DeploymentException.hpp>
36 #include <com/sun/star/deployment/ExtensionRemovedException.hpp>
37 #include <com/sun/star/deployment/InvalidRemovedParameterException.hpp>
38 #include <com/sun/star/deployment/thePackageManagerFactory.hpp>
39 #include <com/sun/star/ucb/ContentCreationException.hpp>
40 #include <com/sun/star/ucb/CommandAbortedException.hpp>
41 #include <com/sun/star/ucb/CommandFailedException.hpp>
42 #include <com/sun/star/ucb/InteractiveAugmentedIOException.hpp>
43 #include <com/sun/star/ucb/IOErrorCode.hpp>
44 #include <com/sun/star/beans/StringPair.hpp>
45 #include <com/sun/star/sdbc/XResultSet.hpp>
46 #include <com/sun/star/sdbc/XRow.hpp>
47 #include <unotools/tempfile.hxx>
48 #include <boost/optional.hpp>
49 
50 using namespace ::dp_misc;
51 using namespace ::com::sun::star;
52 using namespace ::com::sun::star::uno;
53 using namespace ::com::sun::star::ucb;
54 
55 namespace dp_registry {
56 namespace backend {
57 
58 
60 {
61 }
62 
63 
64 void PackageRegistryBackend::disposing( lang::EventObject const & event )
65 {
66  Reference<deployment::XPackage> xPackage(
67  event.Source, UNO_QUERY_THROW );
68  OUString url( xPackage->getURL() );
69  ::osl::MutexGuard guard( getMutex() );
70  if ( m_bound.erase( url ) != 1 )
71  {
72  SAL_WARN("desktop.deployment", "erase(" << url << ") != 1");
73  }
74 }
75 
76 
78  Sequence<Any> const & args,
80  : t_BackendBase( getMutex() ),
81  m_xComponentContext( xContext ),
82  m_eContext( Context::Unknown )
83 {
84  assert(xContext.is());
85  boost::optional<OUString> cachePath;
86  boost::optional<bool> readOnly;
87  comphelper::unwrapArgs( args, m_context, cachePath, readOnly );
88  if (cachePath)
89  m_cachePath = *cachePath;
90 
91  if ( m_context == "user" )
93  else if ( m_context == "shared" )
95  else if ( m_context == "bundled" )
97  else if ( m_context == "tmp" )
99  else if (m_context.matchIgnoreAsciiCase("vnd.sun.star.tdoc:/"))
101  else
103 }
104 
105 
107 {
108  ::osl::MutexGuard guard( getMutex() );
109  if (rBHelper.bInDispose || rBHelper.bDisposed) {
110  throw lang::DisposedException(
111  "PackageRegistryBackend instance has already been disposed!",
112  static_cast<OWeakObject *>(this) );
113  }
114 }
115 
116 
118 {
119  try {
120  for (auto const& elem : m_bound)
121  elem.second->removeEventListener(this);
122  m_bound.clear();
123  m_xComponentContext.clear();
124  WeakComponentImplHelperBase::disposing();
125  }
126  catch (const RuntimeException &) {
127  throw;
128  }
129  catch (const Exception &) {
130  Any exc( ::cppu::getCaughtException() );
131  throw lang::WrappedTargetRuntimeException(
132  "caught unexpected exception while disposing!",
133  static_cast<OWeakObject *>(this), exc );
134  }
135 }
136 
137 // XPackageRegistry
138 
139 Reference<deployment::XPackage> PackageRegistryBackend::bindPackage(
140  OUString const & url, OUString const & mediaType, sal_Bool bRemoved,
141  OUString const & identifier, Reference<XCommandEnvironment> const & xCmdEnv )
142 {
143  ::osl::ResettableMutexGuard guard( getMutex() );
144  check();
145 
146  t_string2ref::const_iterator const iFind( m_bound.find( url ) );
147  if (iFind != m_bound.end())
148  {
149  Reference<deployment::XPackage> xPackage( iFind->second );
150  if (xPackage.is())
151  {
152  if (!mediaType.isEmpty() &&
153  mediaType != xPackage->getPackageType()->getMediaType())
154  throw lang::IllegalArgumentException
155  ("XPackageRegistry::bindPackage: media type does not match",
156  static_cast<OWeakObject*>(this), 1);
157  if (xPackage->isRemoved() != bRemoved)
158  throw deployment::InvalidRemovedParameterException(
159  "XPackageRegistry::bindPackage: bRemoved parameter does not match",
160  static_cast<OWeakObject*>(this), xPackage->isRemoved(), xPackage);
161  return xPackage;
162  }
163  }
164 
165  guard.clear();
166 
167  Reference<deployment::XPackage> xNewPackage;
168  try {
169  xNewPackage = bindPackage_( url, mediaType, bRemoved,
170  identifier, xCmdEnv );
171  }
172  catch (const RuntimeException &) {
173  throw;
174  }
175  catch (const CommandFailedException &) {
176  throw;
177  }
178  catch (const deployment::DeploymentException &) {
179  throw;
180  }
181  catch (const Exception &) {
182  Any exc( ::cppu::getCaughtException() );
183  throw deployment::DeploymentException(
184  "Error binding package: " + url,
185  static_cast<OWeakObject *>(this), exc );
186  }
187 
188  guard.reset();
189 
190  std::pair< t_string2ref::iterator, bool > insertion(
191  m_bound.emplace( url, xNewPackage ) );
192  if (insertion.second)
193  { // first insertion
194  SAL_WARN_IF(
195  Reference<XInterface>(insertion.first->second) != xNewPackage,
196  "desktop.deployment", "mismatch");
197  }
198  else
199  { // found existing entry
200  Reference<deployment::XPackage> xPackage( insertion.first->second );
201  if (xPackage.is())
202  return xPackage;
203  insertion.first->second = xNewPackage;
204  }
205 
206  guard.clear();
207  xNewPackage->addEventListener( this ); // listen for disposing events
208  return xNewPackage;
209 }
210 
212  Reference<ucb::XCommandEnvironment> const & xCmdEnv)
213 {
214  const OUString sDataFolder = makeURL(getCachePath(), OUString());
215  //make sure the folder exist
216  ucbhelper::Content dataContent;
217  ::dp_misc::create_folder(&dataContent, sDataFolder, xCmdEnv);
218 
219  const OUString baseDir(sDataFolder);
220  ::utl::TempFile aTemp(&baseDir, true);
221  const OUString& url = aTemp.GetURL();
222  return sDataFolder + url.copy(url.lastIndexOf('/'));
223 }
224 
225 //folderURL can have the extension .tmp or .tmp_
226 //Before OOo 3.4 the created a tmp file with osl_createTempFile and
227 //then created a Folder with a same name and a trailing '_'
228 //If the folderURL has no '_' then there is no corresponding tmp file.
230  OUString const & folderUrl)
231 {
232  if (!folderUrl.isEmpty())
233  {
235  false /* no throw: ignore errors */ );
236 
237  if (folderUrl.endsWith("_"))
238  {
239  const OUString tempFile = folderUrl.copy(0, folderUrl.getLength() - 1);
241  false /* no throw: ignore errors */ );
242  }
243  }
244 }
245 
246 //usedFolders can contain folder names which have the extension .tmp or .tmp_
247 //Before OOo 3.4 we created a tmp file with osl_createTempFile and
248 //then created a Folder with a same name and a trailing '_'
249 //If the folderURL has no '_' then there is no corresponding tmp file.
251  std::vector< OUString> const & usedFolders)
252 {
253  try
254  {
255  const OUString sDataFolder = makeURL(getCachePath(), OUString());
256  ::ucbhelper::Content tempFolder(
257  sDataFolder, Reference<ucb::XCommandEnvironment>(), m_xComponentContext);
258 
259  Reference<sdbc::XResultSet> xResultSet(
260  StrTitle::createCursor( tempFolder, ::ucbhelper::INCLUDE_FOLDERS_ONLY ) );
261 
262  // get all temp directories:
263  std::vector<OUString> tempEntries;
264 
265  while (xResultSet->next())
266  {
267  OUString title(
268  Reference<sdbc::XRow>(
269  xResultSet, UNO_QUERY_THROW )->getString(
270  1 /* Title */ ) );
271 
272  if (title.endsWith(".tmp"))
273  tempEntries.push_back(
274  makeURLAppendSysPathSegment(sDataFolder, title));
275  }
276 
277  for (OUString & tempEntrie : tempEntries)
278  {
279  if (std::find( usedFolders.begin(), usedFolders.end(), tempEntrie ) ==
280  usedFolders.end())
281  {
282  deleteTempFolder(tempEntrie);
283  }
284  }
285  }
286  catch (const ucb::InteractiveAugmentedIOException& e)
287  {
288  //In case the folder containing all the data folder does not
289  //exist yet, we ignore the exception
290  if (e.Code != ucb::IOErrorCode_NOT_EXISTING)
291  throw;
292  }
293 
294 }
295 
296 
298 {
299 }
300 
301 
303  OUString const & url,
304  OUString const & rName,
305  OUString const & displayName,
306  Reference<deployment::XPackageTypeInfo> const & xPackageType,
307  bool bRemoved,
308  OUString const & identifier)
309  : t_PackageBase( getMutex() ),
310  m_myBackend( myBackend ),
311  m_url( url ),
312  m_name( rName ),
313  m_displayName( displayName ),
314  m_xPackageType( xPackageType ),
315  m_bRemoved(bRemoved),
316  m_identifier(identifier)
317 {
318  if (m_bRemoved)
319  {
320  //We use the last segment of the URL
321  SAL_WARN_IF(
322  !m_name.isEmpty(), "desktop.deployment", "non-empty m_name");
323  OUString name = m_url;
324  rtl::Bootstrap::expandMacros(name);
325  sal_Int32 index = name.lastIndexOf('/');
326  if (index != -1 && index < name.getLength())
327  m_name = name.copy(index + 1);
328  }
329 }
330 
331 
333 {
334  m_myBackend.clear();
335  WeakComponentImplHelperBase::disposing();
336 }
337 
338 
339 void Package::check() const
340 {
341  ::osl::MutexGuard guard( getMutex() );
342  if (rBHelper.bInDispose || rBHelper.bDisposed) {
343  throw lang::DisposedException(
344  "Package instance has already been disposed!",
345  static_cast<OWeakObject *>(const_cast<Package *>(this)));
346  }
347 }
348 
349 // XComponent
350 
352 {
353  //Do not call check here. We must not throw an exception here if the object
354  //is being disposed or is already disposed. See com.sun.star.lang.XComponent
355  WeakComponentImplHelperBase::dispose();
356 }
357 
358 
360  Reference<lang::XEventListener> const & xListener )
361 {
362  //Do not call check here. We must not throw an exception here if the object
363  //is being disposed or is already disposed. See com.sun.star.lang.XComponent
364  WeakComponentImplHelperBase::addEventListener( xListener );
365 }
366 
367 
369  Reference<lang::XEventListener> const & xListener )
370 {
371  //Do not call check here. We must not throw an exception here if the object
372  //is being disposed or is already disposed. See com.sun.star.lang.XComponent
373  WeakComponentImplHelperBase::removeEventListener( xListener );
374 }
375 
376 // XModifyBroadcaster
377 
379  Reference<util::XModifyListener> const & xListener )
380 {
381  check();
382  rBHelper.addListener( cppu::UnoType<decltype(xListener)>::get(), xListener );
383 }
384 
385 
387  Reference<util::XModifyListener> const & xListener )
388 {
389  check();
390  rBHelper.removeListener( cppu::UnoType<decltype(xListener)>::get(), xListener );
391 }
392 
393 
395  ::rtl::Reference<AbortChannel> const & abortChannel )
396 {
397  if (abortChannel.is() && abortChannel->isAborted()) {
398  throw CommandAbortedException(
399  "abort!", static_cast<OWeakObject *>(this) );
400  }
401 }
402 
403 // XPackage
404 
405 Reference<task::XAbortChannel> Package::createAbortChannel()
406 {
407  check();
408  return new AbortChannel;
409 }
410 
411 
413 {
414  return false; // default
415 }
416 
417 
419  const css::uno::Reference< css::task::XAbortChannel >&,
420  const css::uno::Reference< css::ucb::XCommandEnvironment >&,
421  sal_Bool)
422 {
423  if (m_bRemoved)
424  throw deployment::ExtensionRemovedException();
425  return 0;
426 }
427 
428 
430  const css::uno::Reference< css::ucb::XCommandEnvironment >& )
431 {
432  if (m_bRemoved)
433  throw deployment::ExtensionRemovedException();
434  return true;
435 }
436 
437 
438 Sequence< Reference<deployment::XPackage> > Package::getBundle(
439  Reference<task::XAbortChannel> const &,
441 {
442  return Sequence< Reference<deployment::XPackage> >();
443 }
444 
445 
447 {
448  return m_name;
449 }
450 
451 beans::Optional<OUString> Package::getIdentifier()
452 {
453  if (m_bRemoved)
454  return beans::Optional<OUString>(true, m_identifier);
455 
456  return beans::Optional<OUString>();
457 }
458 
459 
461 {
462  if (m_bRemoved)
463  throw deployment::ExtensionRemovedException();
464  return OUString();
465 }
466 
467 
468 OUString Package::getURL()
469 {
470  return m_url;
471 }
472 
473 
475 {
476  if (m_bRemoved)
477  throw deployment::ExtensionRemovedException();
478  return m_displayName;
479 }
480 
481 
483 {
484  if (m_bRemoved)
485  throw deployment::ExtensionRemovedException();
486  return OUString();
487 }
488 
489 
491 {
492  if (m_bRemoved)
493  throw deployment::ExtensionRemovedException();
494  return OUString();
495 }
496 
497 
499 {
500  if (m_bRemoved)
501  throw deployment::ExtensionRemovedException();
502  return Sequence<OUString>();
503 }
504 
505 
506 css::beans::StringPair Package::getPublisherInfo()
507 {
508  if (m_bRemoved)
509  throw deployment::ExtensionRemovedException();
510  css::beans::StringPair aEmptyPair;
511  return aEmptyPair;
512 }
513 
514 
515 uno::Reference< css::graphic::XGraphic > Package::getIcon( sal_Bool /*bHighContrast*/ )
516 {
517  if (m_bRemoved)
518  throw deployment::ExtensionRemovedException();
519 
520  uno::Reference< css::graphic::XGraphic > aEmpty;
521  return aEmpty;
522 }
523 
524 
525 Reference<deployment::XPackageTypeInfo> Package::getPackageType()
526 {
527  return m_xPackageType;
528 }
529 
531  OUString const & destFolderURL, OUString const & newTitle,
532  sal_Int32 nameClashAction, Reference<XCommandEnvironment> const & xCmdEnv )
533 {
534  if (m_bRemoved)
535  throw deployment::ExtensionRemovedException();
536 
537  ::ucbhelper::Content destFolder( destFolderURL, xCmdEnv, getMyBackend()->getComponentContext() );
538  ::ucbhelper::Content sourceContent( getURL(), xCmdEnv, getMyBackend()->getComponentContext() );
539  bool bOk=true;
540  try
541  {
542  destFolder.transferContent(
543  sourceContent, ::ucbhelper::InsertOperation::Copy,
544  newTitle, nameClashAction);
545  }
546  catch (const css::ucb::ContentCreationException&)
547  {
548  bOk = false;
549  }
550 
551  if (!bOk)
552  throw RuntimeException( "UCB transferContent() failed!", nullptr );
553 }
554 
556 {
557  ::cppu::OInterfaceContainerHelper * container = rBHelper.getContainer(
559  if (container != nullptr) {
560  Sequence< Reference<XInterface> > elements(
561  container->getElements() );
562  lang::EventObject evt( static_cast<OWeakObject *>(this) );
563  for ( sal_Int32 pos = 0; pos < elements.getLength(); ++pos )
564  {
565  Reference<util::XModifyListener> xListener(
566  elements[ pos ], UNO_QUERY );
567  if (xListener.is())
568  xListener->modified( evt );
569  }
570  }
571 }
572 
573 // XPackage
574 
575 beans::Optional< beans::Ambiguous<sal_Bool> > Package::isRegistered(
576  Reference<task::XAbortChannel> const & xAbortChannel,
577  Reference<XCommandEnvironment> const & xCmdEnv )
578 {
579  try {
580  ::osl::ResettableMutexGuard guard( getMutex() );
581  return isRegistered_( guard,
582  AbortChannel::get(xAbortChannel),
583  xCmdEnv );
584  }
585  catch (const RuntimeException &) {
586  throw;
587  }
588  catch (const CommandFailedException &) {
589  throw;
590  }
591  catch (const CommandAbortedException &) {
592  throw;
593  }
594  catch (const deployment::DeploymentException &) {
595  throw;
596  }
597  catch (const Exception & e) {
598  Any exc( ::cppu::getCaughtException() );
599  throw deployment::DeploymentException(
600  "unexpected " + exc.getValueTypeName() + ": " + e.Message,
601  static_cast<OWeakObject *>(this), exc );
602  }
603 }
604 
605 
607  bool doRegisterPackage,
608  bool startup,
609  Reference<task::XAbortChannel> const & xAbortChannel,
610  Reference<XCommandEnvironment> const & xCmdEnv )
611 {
612  check();
613  bool action = false;
614 
615  try {
616  try {
617  ::osl::ResettableMutexGuard guard( getMutex() );
618  beans::Optional< beans::Ambiguous<sal_Bool> > option(
619  isRegistered_( guard, AbortChannel::get(xAbortChannel),
620  xCmdEnv ) );
621  action = (option.IsPresent &&
622  (option.Value.IsAmbiguous ||
623  (doRegisterPackage ? !option.Value.Value
624  : option.Value.Value)));
625  if (action) {
626 
627  OUString displayName = isRemoved() ? getName() : getDisplayName();
628  ProgressLevel progress(
629  xCmdEnv,
630  (doRegisterPackage
633  + displayName );
634  processPackage_( guard,
635  doRegisterPackage,
636  startup,
637  AbortChannel::get(xAbortChannel),
638  xCmdEnv );
639  }
640  }
641  catch (lang::IllegalArgumentException &) {
643  throw deployment::DeploymentException(
644  ((doRegisterPackage
645  ? DpResId(RID_STR_ERROR_WHILE_REGISTERING)
646  : DpResId(RID_STR_ERROR_WHILE_REVOKING))
647  + getDisplayName()),
648  static_cast< OWeakObject * >(this), e);
649  }
650  catch (const RuntimeException &e) {
651  SAL_WARN("desktop.deployment", "unexpected " << e);
652  throw;
653  }
654  catch (const CommandFailedException &) {
655  throw;
656  }
657  catch (const CommandAbortedException &) {
658  throw;
659  }
660  catch (const deployment::DeploymentException &) {
661  throw;
662  }
663  catch (const Exception &) {
664  Any exc( ::cppu::getCaughtException() );
665  throw deployment::DeploymentException(
666  (doRegisterPackage
667  ? DpResId(RID_STR_ERROR_WHILE_REGISTERING)
668  : DpResId(RID_STR_ERROR_WHILE_REVOKING))
669  + getDisplayName(), static_cast<OWeakObject *>(this), exc );
670  }
671  }
672  catch (...) {
673  if (action)
674  fireModified();
675  throw;
676  }
677  if (action)
678  fireModified();
679 }
680 
681 
683  sal_Bool startup,
684  Reference<task::XAbortChannel> const & xAbortChannel,
685  Reference<XCommandEnvironment> const & xCmdEnv )
686 {
687  if (m_bRemoved)
688  throw deployment::ExtensionRemovedException();
689  processPackage_impl( true /* register */, startup, xAbortChannel, xCmdEnv );
690 }
691 
692 
694  sal_Bool startup,
695  Reference<task::XAbortChannel> const & xAbortChannel,
696  Reference<XCommandEnvironment> const & xCmdEnv )
697 {
698  processPackage_impl( false /* revoke */, startup, xAbortChannel, xCmdEnv );
699 
700 }
701 
703 {
704  PackageRegistryBackend * pBackend = m_myBackend.get();
705  if (nullptr == pBackend)
706  {
707  //May throw a DisposedException
708  check();
709  //We should never get here...
710  throw RuntimeException(
711  "Failed to get the BackendImpl",
712  static_cast<OWeakObject*>(const_cast<Package *>(this)));
713  }
714  return pBackend;
715 }
716 
718 {
719  PackageRegistryBackend * backEnd = getMyBackend();
720  return backEnd->getContext();
721 }
722 
723 beans::Optional< OUString > Package::getRegistrationDataURL()
724 {
725  if (m_bRemoved)
726  throw deployment::ExtensionRemovedException();
727  return beans::Optional<OUString>();
728 }
729 
731 {
732  return m_bRemoved;
733 }
734 
736 {
737 }
738 
739 // XPackageTypeInfo
740 
742 {
743  return m_mediaType;
744 }
745 
746 
748 {
749  return getShortDescription();
750 }
751 
752 
754 {
755  return m_shortDescr;
756 }
757 
759 {
760  return m_fileFilter;
761 }
762 
763 Any Package::TypeInfo::getIcon( sal_Bool /*highContrast*/, sal_Bool /*smallIcon*/ )
764 {
765  return Any();
766 }
767 
768 }
769 }
770 
771 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual css::uno::Reference< css::deployment::XPackage > SAL_CALL bindPackage(OUString const &url, OUString const &mediaType, sal_Bool bRemoved, OUString const &identifier, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv) override
Definition: dp_backend.cxx:139
void processPackage_impl(bool registerPackage, bool startup, css::uno::Reference< css::task::XAbortChannel > const &xAbortChannel, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv)
Definition: dp_backend.cxx:606
::osl::Mutex & getMutex() const
Definition: dp_misc.h:45
virtual css::beans::Optional< css::beans::Ambiguous< sal_Bool > > isRegistered_(::osl::ResettableMutexGuard &guard,::rtl::Reference< ::dp_misc::AbortChannel > const &abortChannel, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv)=0
virtual OUString SAL_CALL getFileFilter() override
Definition: dp_backend.cxx:758
void checkAborted(::rtl::Reference< ::dp_misc::AbortChannel > const &abortChannel)
Definition: dp_backend.cxx:394
PackageRegistryBackend * getMyBackend() const
Definition: dp_backend.cxx:702
virtual void SAL_CALL disposing() override
Definition: dp_backend.cxx:117
enum dp_registry::backend::PackageRegistryBackend::Context m_eContext
const OUString m_identifier
Definition: dp_backend.h:68
virtual css::uno::Sequence< css::uno::Reference< css::deployment::XPackage > > SAL_CALL getBundle(css::uno::Reference< css::task::XAbortChannel > const &xAbortChannel, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv) override
Definition: dp_backend.cxx:438
virtual void SAL_CALL removeEventListener(css::uno::Reference< css::lang::XEventListener > const &xListener) override
Definition: dp_backend.cxx:368
virtual void SAL_CALL addEventListener(css::uno::Reference< css::lang::XEventListener > const &xListener) override
Definition: dp_backend.cxx:359
virtual ::sal_Int32 SAL_CALL checkPrerequisites(const css::uno::Reference< css::task::XAbortChannel > &xAbortChannel, const css::uno::Reference< css::ucb::XCommandEnvironment > &xCmdEnv, sal_Bool noLicenseChecking) override
Definition: dp_backend.cxx:418
virtual css::uno::Sequence< OUString > SAL_CALL getUpdateInformationURLs() override
Definition: dp_backend.cxx:498
virtual OUString SAL_CALL getRepositoryName() override
Definition: dp_backend.cxx:717
OUString makeURL(OUString const &baseURL, OUString const &relPath_)
appends a relative path to a url.
Definition: dp_misc.cxx:266
OUString makeURLAppendSysPathSegment(OUString const &baseURL, OUString const &segment)
appends a relative path to a url.
Definition: dp_misc.cxx:296
::cppu::WeakComponentImplHelper< css::lang::XEventListener, css::deployment::XPackageRegistry > t_BackendBase
Definition: dp_backend.h:196
Package(::rtl::Reference< PackageRegistryBackend > const &myBackend, OUString const &url, OUString const &name, OUString const &displayName, css::uno::Reference< css::deployment::XPackageTypeInfo > const &xPackageType, bool bRemoved, OUString const &identifier)
void deleteUnusedFolders(std::vector< OUString > const &usedFolders)
Definition: dp_backend.cxx:250
virtual void SAL_CALL registerPackage(sal_Bool startup, css::uno::Reference< css::task::XAbortChannel > const &xAbortChannel, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv) override
Definition: dp_backend.cxx:682
Unknown
virtual OUString SAL_CALL getDescription() override
Definition: dp_backend.cxx:747
JCOPY_OPTION option
virtual css::uno::Reference< css::deployment::XPackage > bindPackage_(OUString const &url, OUString const &mediaType, bool bRemoved, OUString const &identifier, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv)=0
Any SAL_CALL getCaughtException()
virtual void SAL_CALL dispose() override
Definition: dp_backend.cxx:351
virtual sal_Bool SAL_CALL isRemoved() override
Definition: dp_backend.cxx:730
OUString createFolder(css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv)
Definition: dp_backend.cxx:211
virtual OUString SAL_CALL getMediaType() override
Definition: dp_backend.cxx:741
::cppu::WeakComponentImplHelper< css::deployment::XPackage > t_PackageBase
Definition: dp_backend.h:48
virtual OUString SAL_CALL getName() override
Definition: dp_backend.cxx:446
const css::uno::Reference< css::deployment::XPackageTypeInfo > m_xPackageType
Definition: dp_backend.h:65
virtual void processPackage_(::osl::ResettableMutexGuard &guard, bool registerPackage, bool startup,::rtl::Reference< ::dp_misc::AbortChannel > const &abortChannel, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv)=0
virtual sal_Bool SAL_CALL isBundle() override
Definition: dp_backend.cxx:412
OUString const & getCachePath() const
Definition: dp_backend.h:267
OUString const & GetURL() const
PackageRegistryBackend(css::uno::Sequence< css::uno::Any > const &args, css::uno::Reference< css::uno::XComponentContext > const &xContext)
Definition: dp_backend.cxx:77
virtual void SAL_CALL exportTo(OUString const &destFolderURL, OUString const &newTitle, sal_Int32 nameClashAction, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv) override
Definition: dp_backend.cxx:530
unsigned char sal_Bool
css::uno::Reference< css::uno::XComponentContext > m_xComponentContext
Definition: dp_backend.h:215
OString const name
virtual OUString SAL_CALL getShortDescription() override
Definition: dp_backend.cxx:753
tuple index
virtual void SAL_CALL revokePackage(sal_Bool startup, css::uno::Reference< css::task::XAbortChannel > const &xAbortChannel, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv) override
Definition: dp_backend.cxx:693
Reference< XComponentContext > getComponentContext(Reference< XMultiServiceFactory > const &factory)
virtual css::uno::Any SAL_CALL getIcon(sal_Bool highContrast, sal_Bool smallIcon) override
Definition: dp_backend.cxx:763
virtual void SAL_CALL removeModifyListener(css::uno::Reference< css::util::XModifyListener > const &xListener) override
Definition: dp_backend.cxx:386
virtual css::uno::Reference< css::task::XAbortChannel > SAL_CALL createAbortChannel() override
Definition: dp_backend.cxx:405
virtual css::beans::Optional< OUString > SAL_CALL getRegistrationDataURL() override
Definition: dp_backend.cxx:723
static uno::Reference< css::uno::XComponentContext > xContext
Definition: init.cxx:1604
virtual ::sal_Bool SAL_CALL checkDependencies(const css::uno::Reference< css::ucb::XCommandEnvironment > &xCmdEnv) override
Definition: dp_backend.cxx:429
virtual OUString SAL_CALL getVersion() override
Definition: dp_backend.cxx:460
virtual css::beans::StringPair SAL_CALL getPublisherInfo() override
Definition: dp_backend.cxx:506
#define SAL_WARN_IF(condition, area, stream)
static void deleteTempFolder(OUString const &folderUrl)
Definition: dp_backend.cxx:229
virtual void SAL_CALL addModifyListener(css::uno::Reference< css::util::XModifyListener > const &xListener) override
Definition: dp_backend.cxx:378
virtual css::beans::Optional< css::beans::Ambiguous< sal_Bool > > SAL_CALL isRegistered(css::uno::Reference< css::task::XAbortChannel > const &xAbortChannel, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv) override
Definition: dp_backend.cxx:575
void transferContent(const Content &rSourceContent, InsertOperation eOperation, const OUString &rTitle, const sal_Int32 nNameClashAction, const OUString &rMimeType=OUString(), bool bMajorVersion=false, const OUString &rCommentVersion=OUString(), OUString *pResultURL=nullptr, const OUString &rDocumentId=OUString()) const
void unwrapArgs(const css::uno::Sequence< css::uno::Any > &seq, Args &...args)
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool erase_path(OUString const &url, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv, bool throw_exc=true)
const OUString & getContext() const
Definition: dp_backend.h:270
virtual OUString SAL_CALL getLicenseText() override
Definition: dp_backend.cxx:490
virtual OUString SAL_CALL getURL() override
Definition: dp_backend.cxx:468
virtual void SAL_CALL disposing() override
Definition: dp_backend.cxx:332
OUString DpResId(const char *pId)
Definition: dp_shared.hxx:38
#define SAL_WARN(area, stream)
virtual OUString SAL_CALL getDisplayName() override
Definition: dp_backend.cxx:474
OUString getString(const Any &_rAny)
css::uno::Sequence< css::uno::Reference< css::uno::XInterface > > SAL_CALL getElements() const
virtual ~Package() override
Definition: dp_backend.cxx:297
::rtl::Reference< PackageRegistryBackend > m_myBackend
Definition: dp_backend.h:61
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool create_folder(::ucbhelper::Content *ucb_content, OUString const &url, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv, bool throw_exc=true)
virtual css::uno::Reference< css::deployment::XPackageTypeInfo > SAL_CALL getPackageType() override
Definition: dp_backend.cxx:525
virtual css::beans::Optional< OUString > SAL_CALL getIdentifier() override
Definition: dp_backend.cxx:451
virtual OUString SAL_CALL getDescription() override
Definition: dp_backend.cxx:482
::osl::Mutex & getMutex()
virtual css::uno::Reference< css::graphic::XGraphic > SAL_CALL getIcon(sal_Bool bHighContrast) override
Definition: dp_backend.cxx:515