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>
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>
46#include <unotools/tempfile.hxx>
47#include <optional>
48#include <utility>
49
50using namespace ::dp_misc;
51using namespace ::com::sun::star;
52using namespace ::com::sun::star::uno;
53using namespace ::com::sun::star::ucb;
54
55namespace dp_registry::backend {
56
57
59{
60}
61
62
63void PackageRegistryBackend::disposing( lang::EventObject const & event )
64{
65 Reference<deployment::XPackage> xPackage(
66 event.Source, UNO_QUERY_THROW );
67 OUString url( xPackage->getURL() );
68 ::osl::MutexGuard guard( m_aMutex );
69 if ( m_bound.erase( url ) != 1 )
70 {
71 SAL_WARN("desktop.deployment", "erase(" << url << ") != 1");
72 }
73}
74
75
77 Sequence<Any> const & args,
78 Reference<XComponentContext> const & xContext )
81 m_eContext( Context::Unknown )
82{
83 assert(xContext.is());
84 std::optional<OUString> cachePath;
85 std::optional<bool> readOnly;
86 comphelper::unwrapArgs( args, m_context, cachePath, readOnly );
87 if (cachePath)
88 m_cachePath = *cachePath;
89
90 if ( m_context == "user" )
92 else if ( m_context == "shared" )
94 else if ( m_context == "bundled" )
96 else if ( m_context == "tmp" )
98 else if (m_context.matchIgnoreAsciiCase("vnd.sun.star.tdoc:/"))
100 else
102}
103
104
106{
107 ::osl::MutexGuard guard( m_aMutex );
108 if (rBHelper.bInDispose || rBHelper.bDisposed) {
109 throw lang::DisposedException(
110 "PackageRegistryBackend instance has already been disposed!",
111 static_cast<OWeakObject *>(this) );
112 }
113}
114
115
117{
118 try {
119 for (auto const& elem : m_bound)
120 elem.second->removeEventListener(this);
121 m_bound.clear();
122 m_xComponentContext.clear();
123 WeakComponentImplHelperBase::disposing();
124 }
125 catch (const RuntimeException &) {
126 throw;
127 }
128 catch (const Exception &) {
129 Any exc( ::cppu::getCaughtException() );
130 throw lang::WrappedTargetRuntimeException(
131 "caught unexpected exception while disposing!",
132 static_cast<OWeakObject *>(this), exc );
133 }
134}
135
136// XPackageRegistry
137
138Reference<deployment::XPackage> PackageRegistryBackend::bindPackage(
139 OUString const & url, OUString const & mediaType, sal_Bool bRemoved,
140 OUString const & identifier, Reference<XCommandEnvironment> const & xCmdEnv )
141{
142 ::osl::ResettableMutexGuard guard( m_aMutex );
143 check();
144
145 t_string2ref::const_iterator const iFind( m_bound.find( url ) );
146 if (iFind != m_bound.end())
147 {
148 Reference<deployment::XPackage> xPackage( iFind->second );
149 if (xPackage.is())
150 {
151 if (!mediaType.isEmpty() &&
152 mediaType != xPackage->getPackageType()->getMediaType())
153 throw lang::IllegalArgumentException
154 ("XPackageRegistry::bindPackage: media type does not match",
155 static_cast<OWeakObject*>(this), 1);
156 if (xPackage->isRemoved() != bRemoved)
157 throw deployment::InvalidRemovedParameterException(
158 "XPackageRegistry::bindPackage: bRemoved parameter does not match",
159 static_cast<OWeakObject*>(this), xPackage->isRemoved(), xPackage);
160 return xPackage;
161 }
162 }
163
164 guard.clear();
165
166 Reference<deployment::XPackage> xNewPackage;
167 try {
168 xNewPackage = bindPackage_( url, mediaType, bRemoved,
169 identifier, xCmdEnv );
170 }
171 catch (const RuntimeException &) {
172 throw;
173 }
174 catch (const CommandFailedException &) {
175 throw;
176 }
177 catch (const deployment::DeploymentException &) {
178 throw;
179 }
180 catch (const Exception &) {
181 Any exc( ::cppu::getCaughtException() );
182 throw deployment::DeploymentException(
183 "Error binding package: " + url,
184 static_cast<OWeakObject *>(this), exc );
185 }
186
187 guard.reset();
188
189 std::pair< t_string2ref::iterator, bool > insertion(
190 m_bound.emplace( url, xNewPackage ) );
191 if (insertion.second)
192 { // first insertion
194 Reference<XInterface>(insertion.first->second) != xNewPackage,
195 "desktop.deployment", "mismatch");
196 }
197 else
198 { // found existing entry
199 Reference<deployment::XPackage> xPackage( insertion.first->second );
200 if (xPackage.is())
201 return xPackage;
202 insertion.first->second = xNewPackage;
203 }
204
205 guard.clear();
206 xNewPackage->addEventListener( this ); // listen for disposing events
207 return xNewPackage;
208}
209
211 Reference<ucb::XCommandEnvironment> const & xCmdEnv)
212{
213 const OUString sDataFolder = makeURL(getCachePath(), OUString());
214 //make sure the folder exist
215 ucbhelper::Content dataContent;
216 ::dp_misc::create_folder(&dataContent, sDataFolder, xCmdEnv);
217
218 const OUString url = ::utl::CreateTempURL(&sDataFolder, true);
219 return sDataFolder + url.subView(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 {
231 erase_path( folderUrl, Reference<XCommandEnvironment>(),
232 false /* no throw: ignore errors */ );
233
234 if (folderUrl.endsWith("_"))
235 {
236 const OUString tempFile = folderUrl.copy(0, folderUrl.getLength() - 1);
237 erase_path( tempFile, Reference<XCommandEnvironment>(),
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 url,
301 OUString aName,
302 OUString displayName,
303 Reference<deployment::XPackageTypeInfo> const & xPackageType,
304 bool bRemoved,
305 OUString identifier)
307 m_myBackend(std::move( myBackend )),
308 m_url(std::move( url )),
309 m_name(std::move( aName )),
310 m_displayName(std::move( displayName )),
311 m_xPackageType( xPackageType ),
312 m_bRemoved(bRemoved),
313 m_identifier(std::move(identifier))
314{
315 if (m_bRemoved)
316 {
317 //We use the last segment of the URL
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
336void Package::check() const
337{
338 ::osl::MutexGuard guard( m_aMutex );
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
402Reference<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
435Sequence< Reference<deployment::XPackage> > Package::getBundle(
436 Reference<task::XAbortChannel> const &,
437 Reference<XCommandEnvironment> const & )
438{
439 return Sequence< Reference<deployment::XPackage> >();
440}
441
442
444{
445 return m_name;
446}
447
448beans::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
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
503css::beans::StringPair Package::getPublisherInfo()
504{
505 if (m_bRemoved)
506 throw deployment::ExtensionRemovedException();
507 css::beans::StringPair aEmptyPair;
508 return aEmptyPair;
509}
510
511
513{
514 if (m_bRemoved)
515 throw deployment::ExtensionRemovedException();
516
518 return aEmpty;
519}
520
521
522Reference<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(
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 return;
558
559 const Sequence< Reference<XInterface> > elements(
560 container->getElements() );
561 lang::EventObject evt( static_cast<OWeakObject *>(this) );
562 for ( const Reference<XInterface>& x : elements )
563 {
564 Reference<util::XModifyListener> xListener( x, UNO_QUERY );
565 if (xListener.is())
566 xListener->modified( evt );
567 }
568}
569
570// XPackage
571
572beans::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( m_aMutex );
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( m_aMutex );
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 & e) {
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() + ": " + exc.getValueType().getTypeName() + " \"" + e.Message
667 + "\"",
668 static_cast<OWeakObject *>(this), exc );
669 }
670 }
671 catch (...) {
672 if (action)
673 fireModified();
674 throw;
675 }
676 if (action)
677 fireModified();
678}
679
680
682 sal_Bool startup,
683 Reference<task::XAbortChannel> const & xAbortChannel,
684 Reference<XCommandEnvironment> const & xCmdEnv )
685{
686 if (m_bRemoved)
687 throw deployment::ExtensionRemovedException();
688 processPackage_impl( true /* register */, startup, xAbortChannel, xCmdEnv );
689}
690
691
693 sal_Bool startup,
694 Reference<task::XAbortChannel> const & xAbortChannel,
695 Reference<XCommandEnvironment> const & xCmdEnv )
696{
697 processPackage_impl( false /* revoke */, startup, xAbortChannel, xCmdEnv );
698
699}
700
702{
703 PackageRegistryBackend * pBackend = m_myBackend.get();
704 if (nullptr == pBackend)
705 {
706 //May throw a DisposedException
707 check();
708 //We should never get here...
709 throw RuntimeException(
710 "Failed to get the BackendImpl",
711 static_cast<OWeakObject*>(const_cast<Package *>(this)));
712 }
713 return pBackend;
714}
715
717{
719 return backEnd->getContext();
720}
721
722beans::Optional< OUString > Package::getRegistrationDataURL()
723{
724 if (m_bRemoved)
725 throw deployment::ExtensionRemovedException();
726 return beans::Optional<OUString>();
727}
728
730{
731 return m_bRemoved;
732}
733
735{
736}
737
738// XPackageTypeInfo
739
741{
742 return m_mediaType;
743}
744
745
747{
748 return getShortDescription();
749}
750
751
753{
754 return m_shortDescr;
755}
756
758{
759 return m_fileFilter;
760}
761
762Any Package::TypeInfo::getIcon( sal_Bool /*highContrast*/, sal_Bool /*smallIcon*/ )
763{
764 return Any();
765}
766
767}
768
769/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
mutable::osl::Mutex m_aMutex
css::uno::Sequence< css::uno::Reference< css::uno::XInterface > > SAL_CALL getElements() const
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:138
OUString createFolder(css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv)
Definition: dp_backend.cxx:210
virtual void SAL_CALL disposing() override
Definition: dp_backend.cxx:116
static void deleteTempFolder(OUString const &folderUrl)
Definition: dp_backend.cxx:226
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
void deleteUnusedFolders(std::vector< OUString > const &usedFolders)
Definition: dp_backend.cxx:247
enum dp_registry::backend::PackageRegistryBackend::Context m_eContext
PackageRegistryBackend(css::uno::Sequence< css::uno::Any > const &args, css::uno::Reference< css::uno::XComponentContext > const &xContext)
Definition: dp_backend.cxx:76
css::uno::Reference< css::uno::XComponentContext > m_xComponentContext
Definition: dp_backend.h:211
virtual OUString SAL_CALL getDescription() override
Definition: dp_backend.cxx:746
virtual css::uno::Any SAL_CALL getIcon(sal_Bool highContrast, sal_Bool smallIcon) override
Definition: dp_backend.cxx:762
virtual OUString SAL_CALL getShortDescription() override
Definition: dp_backend.cxx:752
virtual OUString SAL_CALL getMediaType() override
Definition: dp_backend.cxx:740
virtual OUString SAL_CALL getFileFilter() override
Definition: dp_backend.cxx:757
virtual OUString SAL_CALL getLicenseText() override
Definition: dp_backend.cxx:487
virtual OUString SAL_CALL getName() override
Definition: dp_backend.cxx:443
virtual void SAL_CALL removeEventListener(css::uno::Reference< css::lang::XEventListener > const &xListener) override
Definition: dp_backend.cxx:365
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
void checkAborted(::rtl::Reference< ::dp_misc::AbortChannel > const &abortChannel)
Definition: dp_backend.cxx:391
const css::uno::Reference< css::deployment::XPackageTypeInfo > m_xPackageType
Definition: dp_backend.h:61
virtual void SAL_CALL addModifyListener(css::uno::Reference< css::util::XModifyListener > const &xListener) override
Definition: dp_backend.cxx:375
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
virtual OUString SAL_CALL getURL() override
Definition: dp_backend.cxx:465
virtual OUString SAL_CALL getDescription() override
Definition: dp_backend.cxx:479
virtual OUString SAL_CALL getRepositoryName() override
Definition: dp_backend.cxx:716
virtual void SAL_CALL removeModifyListener(css::uno::Reference< css::util::XModifyListener > const &xListener) override
Definition: dp_backend.cxx:383
virtual ::sal_Bool SAL_CALL checkDependencies(const css::uno::Reference< css::ucb::XCommandEnvironment > &xCmdEnv) override
Definition: dp_backend.cxx:426
virtual sal_Bool SAL_CALL isBundle() override
Definition: dp_backend.cxx:409
PackageRegistryBackend * getMyBackend() const
Definition: dp_backend.cxx:701
::rtl::Reference< PackageRegistryBackend > m_myBackend
Definition: dp_backend.h:57
virtual ~Package() override
Definition: dp_backend.cxx:294
virtual void SAL_CALL dispose() override
Definition: dp_backend.cxx:348
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:681
virtual OUString SAL_CALL getDisplayName() override
Definition: dp_backend.cxx:471
virtual css::uno::Reference< css::graphic::XGraphic > SAL_CALL getIcon(sal_Bool bHighContrast) override
Definition: dp_backend.cxx:512
virtual css::beans::Optional< OUString > SAL_CALL getRegistrationDataURL() override
Definition: dp_backend.cxx:722
virtual css::beans::Optional< OUString > SAL_CALL getIdentifier() override
Definition: dp_backend.cxx:448
virtual void SAL_CALL addEventListener(css::uno::Reference< css::lang::XEventListener > const &xListener) override
Definition: dp_backend.cxx:356
virtual css::beans::StringPair SAL_CALL getPublisherInfo() override
Definition: dp_backend.cxx:503
Package(::rtl::Reference< PackageRegistryBackend > myBackend, OUString url, OUString name, OUString displayName, css::uno::Reference< css::deployment::XPackageTypeInfo > const &xPackageType, bool bRemoved, OUString identifier)
Definition: dp_backend.cxx:299
virtual OUString SAL_CALL getVersion() override
Definition: dp_backend.cxx:457
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
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 disposing() override
Definition: dp_backend.cxx:329
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
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
virtual css::uno::Reference< css::deployment::XPackageTypeInfo > SAL_CALL getPackageType() override
Definition: dp_backend.cxx:522
virtual css::uno::Sequence< OUString > SAL_CALL getUpdateInformationURLs() override
Definition: dp_backend.cxx:495
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::Reference< css::task::XAbortChannel > SAL_CALL createAbortChannel() override
Definition: dp_backend.cxx:402
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:692
virtual sal_Bool SAL_CALL isRemoved() override
Definition: dp_backend.cxx:729
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
#define TOOLS_WARN_EXCEPTION(area, stream)
Reference< XComponentContext > const m_xComponentContext
OUString DpResId(TranslateId aId)
Definition: dp_misc.cxx:555
float x
std::mutex m_aMutex
const char * name
static uno::Reference< css::uno::XComponentContext > xContext
Definition: init.cxx:2516
OUString aName
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
OUString m_name
@ Exception
void unwrapArgs(const css::uno::Sequence< css::uno::Any > &seq, Args &... args)
Reference< XComponentContext > getComponentContext(Reference< XMultiServiceFactory > const &factory)
OUString getString(const Any &_rAny)
Any SAL_CALL getCaughtException()
OUString makeURL(std::u16string_view baseURL, OUString const &relPath_)
appends a relative path to a url.
Definition: dp_misc.cxx:251
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)
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool erase_path(OUString const &url, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv, bool throw_exc=true)
OUString makeURLAppendSysPathSegment(std::u16string_view baseURL, OUString const &segment)
appends a relative path to a url.
Definition: dp_misc.cxx:281
::cppu::WeakComponentImplHelper< css::deployment::XPackage > t_PackageBase
Definition: dp_backend.h:44
::cppu::WeakComponentImplHelper< css::lang::XEventListener, css::deployment::XPackageRegistry, css::lang::XServiceInfo > t_BackendBase
Definition: dp_backend.h:192
Unknown
index
action
args
OUString m_url
::boost::spirit::classic::rule< ScannerT > identifier
JCOPY_OPTION option
unsigned char sal_Bool