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