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