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