1*d1766043SAndrew Rist/**************************************************************
2cdf0e10cSrcweir *
3*d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*d1766043SAndrew Rist * or more contributor license agreements.  See the NOTICE file
5*d1766043SAndrew Rist * distributed with this work for additional information
6*d1766043SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7*d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*d1766043SAndrew Rist * "License"); you may not use this file except in compliance
9*d1766043SAndrew Rist * with the License.  You may obtain a copy of the License at
10*d1766043SAndrew Rist *
11*d1766043SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12*d1766043SAndrew Rist *
13*d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*d1766043SAndrew Rist * software distributed under the License is distributed on an
15*d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*d1766043SAndrew Rist * KIND, either express or implied.  See the License for the
17*d1766043SAndrew Rist * specific language governing permissions and limitations
18*d1766043SAndrew Rist * under the License.
19*d1766043SAndrew Rist *
20*d1766043SAndrew Rist *************************************************************/
21*d1766043SAndrew Rist
22*d1766043SAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir#if ! defined INCLUDED_com_sun_star_deployment_XPackageManager_idl
25cdf0e10cSrcweir#define INCLUDED_com_sun_star_deployment_XPackageManager_idl
26cdf0e10cSrcweir
27cdf0e10cSrcweir#include <com/sun/star/lang/XComponent.idl>
28cdf0e10cSrcweir#include <com/sun/star/task/XAbortChannel.idl>
29cdf0e10cSrcweir#include <com/sun/star/util/XModifyBroadcaster.idl>
30cdf0e10cSrcweir#include <com/sun/star/deployment/XPackage.idl>
31cdf0e10cSrcweir#include <com/sun/star/deployment/XPackageTypeInfo.idl>
32cdf0e10cSrcweir#include <com/sun/star/ucb/XCommandEnvironment.idl>
33cdf0e10cSrcweir#include <com/sun/star/deployment/DeploymentException.idl>
34cdf0e10cSrcweir#include <com/sun/star/container/NoSuchElementException.idl>
35cdf0e10cSrcweir#include <com/sun/star/lang/IllegalArgumentException.idl>
36cdf0e10cSrcweir#include <com/sun/star/beans/NamedValue.idl>
37cdf0e10cSrcweir
38cdf0e10cSrcweir
39cdf0e10cSrcweirmodule com { module sun { module star { module deployment {
40cdf0e10cSrcweir
41cdf0e10cSrcweir/** The <type>XPackageManager</type> interface is used to add or remove
42cdf0e10cSrcweir    packages to a specific repository. This interface represents a particular
43cdf0e10cSrcweir    repository.
44cdf0e10cSrcweir    Packages are deployable files, e.g. scripts or UNO components.
45cdf0e10cSrcweir    <p>
46cdf0e10cSrcweir    Adding an UNO package means that a copy of the package is stored
47cdf0e10cSrcweir    in the repository.
48cdf0e10cSrcweir    </p>
49cdf0e10cSrcweir    <p>
50cdf0e10cSrcweir    Removing an UNO package means that the previously added package is
51cdf0e10cSrcweir    removed from the repository.
52cdf0e10cSrcweir    </p>
53cdf0e10cSrcweir    <p>
54cdf0e10cSrcweir    All interface methods do neither register nor revoke an extension.
55cdf0e10cSrcweir    This happens exclusively by <type>XExtensionManager</type>.
56cdf0e10cSrcweir    </p>
57cdf0e10cSrcweir    <p>
58cdf0e10cSrcweir    Objects of this interface are created using the
59cdf0e10cSrcweir    <type>XPackageManagerFactory</type> service resp. the singleton
60cdf0e10cSrcweir    <code>
61cdf0e10cSrcweir    /singletons/com.sun.star.deployment.thePackageManagerFactory
62cdf0e10cSrcweir    </code>.
63cdf0e10cSrcweir    </p>
64cdf0e10cSrcweir
65cdf0e10cSrcweir    @see thePackageManagerFactory
66cdf0e10cSrcweir    @since OOo 2.0
67cdf0e10cSrcweir    @deprecated
68cdf0e10cSrcweir         Use <type>XExtensionManager</type>.
69cdf0e10cSrcweir*/
70cdf0e10cSrcweirinterface XPackageManager
71cdf0e10cSrcweir{
72cdf0e10cSrcweir    /** interface to notify disposing
73cdf0e10cSrcweir     */
74cdf0e10cSrcweir    interface com::sun::star::lang::XComponent;
75cdf0e10cSrcweir
76cdf0e10cSrcweir    /** interface to notify changes of the set of deployed packages of
77cdf0e10cSrcweir        this manager
78cdf0e10cSrcweir    */
79cdf0e10cSrcweir    interface com::sun::star::util::XModifyBroadcaster;
80cdf0e10cSrcweir
81cdf0e10cSrcweir    /** returns the underlying deployment context, that is,
82cdf0e10cSrcweir        the name of the repository..
83cdf0e10cSrcweir
84cdf0e10cSrcweir        @return
85cdf0e10cSrcweir                underlying deployment context
86cdf0e10cSrcweir    */
87cdf0e10cSrcweir    string getContext();
88cdf0e10cSrcweir
89cdf0e10cSrcweir    /** gets the supported <type>XPackageTypeInfo</type>s.
90cdf0e10cSrcweir
91cdf0e10cSrcweir        @return
92cdf0e10cSrcweir                supported <type>XPackageTypeInfo</type>s.
93cdf0e10cSrcweir    */
94cdf0e10cSrcweir    sequence<XPackageTypeInfo> getSupportedPackageTypes();
95cdf0e10cSrcweir
96cdf0e10cSrcweir    /** creates a command channel to be used to asynchronously abort a command.
97cdf0e10cSrcweir
98cdf0e10cSrcweir        @return
99cdf0e10cSrcweir                abort channel
100cdf0e10cSrcweir    */
101cdf0e10cSrcweir    com::sun::star::task::XAbortChannel createAbortChannel();
102cdf0e10cSrcweir
103cdf0e10cSrcweir    /** adds an UNO package.
104cdf0e10cSrcweir
105cdf0e10cSrcweir        The properties argument is currently only used to suppress the license information
106cdf0e10cSrcweir        for shared extensions.
107cdf0e10cSrcweir
108cdf0e10cSrcweir
109cdf0e10cSrcweir        @param url
110cdf0e10cSrcweir               package URL, must be UCB conform
111cdf0e10cSrcweir        @param properties
112cdf0e10cSrcweir               additional properties, for example, that the license is to be
113cdf0e10cSrcweir               suppressed (if supported by the extension)
114cdf0e10cSrcweir        @param mediaType
115cdf0e10cSrcweir               media-type of package, empty string if to be detected
116cdf0e10cSrcweir        @param xAbortChannel
117cdf0e10cSrcweir               abort channel to asynchronously abort the adding process,
118cdf0e10cSrcweir               or null
119cdf0e10cSrcweir        @param xCmdEnv
120cdf0e10cSrcweir               command environment for error and progress handling
121cdf0e10cSrcweir        @return
122cdf0e10cSrcweir               <type>XPackage</type> handle
123cdf0e10cSrcweir    */
124cdf0e10cSrcweir    XPackage addPackage( [in] string url,
125cdf0e10cSrcweir                         [in] sequence<com::sun::star::beans::NamedValue> properties,
126cdf0e10cSrcweir                         [in] string mediaType,
127cdf0e10cSrcweir                         [in] com::sun::star::task::XAbortChannel xAbortChannel,
128cdf0e10cSrcweir                         [in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
129cdf0e10cSrcweir        raises (DeploymentException,
130cdf0e10cSrcweir                com::sun::star::ucb::CommandFailedException,
131cdf0e10cSrcweir                com::sun::star::ucb::CommandAbortedException,
132cdf0e10cSrcweir                com::sun::star::lang::IllegalArgumentException);
133cdf0e10cSrcweir
134cdf0e10cSrcweir    /** adds an extension.
135cdf0e10cSrcweir
136cdf0e10cSrcweir        This copies the extension. If it was from the same repository,
137cdf0e10cSrcweir        which is represented by this XPackageManager insterface, then
138cdf0e10cSrcweir        nothing happens.
139cdf0e10cSrcweir
140cdf0e10cSrcweir        @param extension
141cdf0e10cSrcweir
142cdf0e10cSrcweir        @param xAbortChannel
143cdf0e10cSrcweir               abort channel to asynchronously abort the adding process,
144cdf0e10cSrcweir               or null
145cdf0e10cSrcweir        @param xCmdEnv
146cdf0e10cSrcweir               command environment for error and progress handling
147cdf0e10cSrcweir        @return
148cdf0e10cSrcweir               <type>XPackage</type> handle
149cdf0e10cSrcweir    */
150cdf0e10cSrcweir    XPackage importExtension( [in] XPackage extension,
151cdf0e10cSrcweir                         [in] com::sun::star::task::XAbortChannel xAbortChannel,
152cdf0e10cSrcweir                         [in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
153cdf0e10cSrcweir        raises (DeploymentException,
154cdf0e10cSrcweir                com::sun::star::ucb::CommandFailedException,
155cdf0e10cSrcweir                com::sun::star::ucb::CommandAbortedException,
156cdf0e10cSrcweir                com::sun::star::lang::IllegalArgumentException);
157cdf0e10cSrcweir
158cdf0e10cSrcweir    /** removes an UNO package.
159cdf0e10cSrcweir
160cdf0e10cSrcweir        @param identifier
161cdf0e10cSrcweir               package identifier
162cdf0e10cSrcweir        @param fileName
163cdf0e10cSrcweir               package file name
164cdf0e10cSrcweir        @param xAbortChannel
165cdf0e10cSrcweir               abort channel to asynchronously abort the removing process,
166cdf0e10cSrcweir               or null
167cdf0e10cSrcweir        @param xCmdEnv
168cdf0e10cSrcweir               command environment for error and progress handling
169cdf0e10cSrcweir    */
170cdf0e10cSrcweir    void removePackage( [in] string identifier,
171cdf0e10cSrcweir                        [in] string fileName,
172cdf0e10cSrcweir                        [in] com::sun::star::task::XAbortChannel xAbortChannel,
173cdf0e10cSrcweir                        [in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
174cdf0e10cSrcweir        raises (DeploymentException,
175cdf0e10cSrcweir                com::sun::star::ucb::CommandFailedException,
176cdf0e10cSrcweir                com::sun::star::ucb::CommandAbortedException,
177cdf0e10cSrcweir                com::sun::star::lang::IllegalArgumentException);
178cdf0e10cSrcweir
179cdf0e10cSrcweir    /** gets a deployed package.
180cdf0e10cSrcweir
181cdf0e10cSrcweir        @param identifier
182cdf0e10cSrcweir               package identifier
183cdf0e10cSrcweir        @param fileName
184cdf0e10cSrcweir               package file name
185cdf0e10cSrcweir        @param xCmdEnv
186cdf0e10cSrcweir               command environment for error and progress handling
187cdf0e10cSrcweir        @return
188cdf0e10cSrcweir               <type>XPackage</type> handle
189cdf0e10cSrcweir    */
190cdf0e10cSrcweir    XPackage getDeployedPackage(
191cdf0e10cSrcweir        [in] string identifier,
192cdf0e10cSrcweir        [in] string fileName,
193cdf0e10cSrcweir        [in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
194cdf0e10cSrcweir        raises (DeploymentException,
195cdf0e10cSrcweir                com::sun::star::ucb::CommandFailedException,
196cdf0e10cSrcweir                com::sun::star::lang::IllegalArgumentException);
197cdf0e10cSrcweir
198cdf0e10cSrcweir    /** gets all currently deployed packages.
199cdf0e10cSrcweir
200cdf0e10cSrcweir        @param xAbortChannel
201cdf0e10cSrcweir               abort channel to asynchronously abort the removing process,
202cdf0e10cSrcweir               or null
203cdf0e10cSrcweir        @param xCmdEnv
204cdf0e10cSrcweir               command environment for error and progress handling
205cdf0e10cSrcweir        @return
206cdf0e10cSrcweir                all currently deployed packages
207cdf0e10cSrcweir    */
208cdf0e10cSrcweir    sequence<XPackage> getDeployedPackages(
209cdf0e10cSrcweir        [in] com::sun::star::task::XAbortChannel xAbortChannel,
210cdf0e10cSrcweir        [in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
211cdf0e10cSrcweir        raises (DeploymentException,
212cdf0e10cSrcweir                com::sun::star::ucb::CommandFailedException,
213cdf0e10cSrcweir                com::sun::star::ucb::CommandAbortedException,
214cdf0e10cSrcweir                com::sun::star::lang::IllegalArgumentException);
215cdf0e10cSrcweir
216cdf0e10cSrcweir    /** Expert feature: erases the underlying registry cache and reinstalls
217cdf0e10cSrcweir        all previously added packages.  Please keep in mind that all
218cdf0e10cSrcweir        registration status get lost.
219cdf0e10cSrcweir        <p>
220cdf0e10cSrcweir        Please use this in case of suspected cache inconsistencies only.
221cdf0e10cSrcweir        </p>
222cdf0e10cSrcweir
223cdf0e10cSrcweir        @param xAbortChannel
224cdf0e10cSrcweir               abort channel to asynchronously abort the adding process
225cdf0e10cSrcweir        @param xCmdEnv
226cdf0e10cSrcweir               command environment for error and progress handling
227cdf0e10cSrcweir    */
228cdf0e10cSrcweir    void reinstallDeployedPackages(
229cdf0e10cSrcweir        [in] com::sun::star::task::XAbortChannel xAbortChannel,
230cdf0e10cSrcweir        [in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
231cdf0e10cSrcweir        raises (DeploymentException,
232cdf0e10cSrcweir                com::sun::star::ucb::CommandFailedException,
233cdf0e10cSrcweir                com::sun::star::ucb::CommandAbortedException,
234cdf0e10cSrcweir                com::sun::star::lang::IllegalArgumentException);
235cdf0e10cSrcweir
236cdf0e10cSrcweir    /** indicates that this implementation cannot be used for tasks
237cdf0e10cSrcweir        which require write access to the location where the extensions
238cdf0e10cSrcweir        are installed.
239cdf0e10cSrcweir        <p>
240cdf0e10cSrcweir        Normally one would call a method and handle the exception
241cdf0e10cSrcweir        if writing failed. However, a GUI interface may need to know beforehand
242cdf0e10cSrcweir        if writing is allowed. For example, the Extension Manager dialog
243cdf0e10cSrcweir        needs to enable / disable the Add button depending if the user has
244cdf0e10cSrcweir        write permission. Only the XPackageManager implementation knows the
245cdf0e10cSrcweir        location of the installed extensions. Therefore it is not possible
246cdf0e10cSrcweir        to check &quot;externally&quot; for write permission.
247cdf0e10cSrcweir        </p>
248cdf0e10cSrcweir    */
249cdf0e10cSrcweir    boolean isReadOnly();
250cdf0e10cSrcweir
251cdf0e10cSrcweir    /** synchronizes the extension database with the contents of the extensions
252cdf0e10cSrcweir       folder.
253cdf0e10cSrcweir
254cdf0e10cSrcweir       Added extensions will be added to the database and removed extensions
255cdf0e10cSrcweir       will be removed from the database.
256cdf0e10cSrcweir
257cdf0e10cSrcweir       @param xAddedExtension
258cdf0e10cSrcweir            new extensions which may need to be registered.
259cdf0e10cSrcweir
260cdf0e10cSrcweir       @param
261cdf0e10cSrcweir            removed extensions which must be revoked
262cdf0e10cSrcweir       @return
263cdf0e10cSrcweir            If true - then at least one extension was removed or added. Otherwise
264cdf0e10cSrcweir            nothing was chaned.
265cdf0e10cSrcweir    */
266cdf0e10cSrcweir    boolean synchronize([in] com::sun::star::task::XAbortChannel xAbortChannel,
267cdf0e10cSrcweir                     [in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
268cdf0e10cSrcweir        raises (DeploymentException,
269cdf0e10cSrcweir                com::sun::star::ucb::CommandFailedException,
270cdf0e10cSrcweir                com::sun::star::ucb::CommandAbortedException);
271cdf0e10cSrcweir
272cdf0e10cSrcweir
273cdf0e10cSrcweir    /** returns all extensions which are currently not in use
274cdf0e10cSrcweir        because the user did not accept the license.
275cdf0e10cSrcweir
276cdf0e10cSrcweir        The function will not return any object for the user repository, because
277cdf0e10cSrcweir        a user extension will not be kept in the user repository if its license
278cdf0e10cSrcweir        is declined. Only extensions which are registered at start-up of OOo,
279cdf0e10cSrcweir        that is, shared and bundled extensions, can be returned.
280cdf0e10cSrcweir
281cdf0e10cSrcweir        Extensions which allow the license to be suppressed, that is, it does not
282cdf0e10cSrcweir        need to be displayed, and which are installed with the corresponding option,
283cdf0e10cSrcweir        are also not returned.
284cdf0e10cSrcweir    */
285cdf0e10cSrcweir    sequence<XPackage> getExtensionsWithUnacceptedLicenses(
286cdf0e10cSrcweir        [in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
287cdf0e10cSrcweir        raises (DeploymentException);
288cdf0e10cSrcweir
289cdf0e10cSrcweir    /** checks if the extension can be used.
290cdf0e10cSrcweir
291cdf0e10cSrcweir        The extension must be managed by this package manager, that is, it must
292cdf0e10cSrcweir        be recorded in its database.  The package manager calls
293cdf0e10cSrcweir        XPackage::checkPrerequisites and updates its data base with the
294cdf0e10cSrcweir        result. The result, which is from <type>Prerequisites</type> will be
295cdf0e10cSrcweir        returned.
296cdf0e10cSrcweir     */
297cdf0e10cSrcweir    long checkPrerequisites(
298cdf0e10cSrcweir        [in] XPackage extension,
299cdf0e10cSrcweir        [in] com::sun::star::task::XAbortChannel xAbortChannel,
300cdf0e10cSrcweir        [in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
301cdf0e10cSrcweir        raises (DeploymentException,
302cdf0e10cSrcweir                com::sun::star::ucb::CommandFailedException,
303cdf0e10cSrcweir                com::sun::star::ucb::CommandAbortedException,
304cdf0e10cSrcweir                com::sun::star::lang::IllegalArgumentException);
305cdf0e10cSrcweir
306cdf0e10cSrcweir};
307cdf0e10cSrcweir
308cdf0e10cSrcweir}; }; }; };
309cdf0e10cSrcweir
310cdf0e10cSrcweir#endif
311