Kaydet (Commit) 7f64aa4d authored tarafından Jens-Heiner Rechtien's avatar Jens-Heiner Rechtien

CWS-TOOLING: integrate CWS jl161

...@@ -31,6 +31,8 @@ ...@@ -31,6 +31,8 @@
#include "com/sun/star/deployment/VersionException.hpp" #include "com/sun/star/deployment/VersionException.hpp"
#include "com/sun/star/deployment/LicenseException.hpp" #include "com/sun/star/deployment/LicenseException.hpp"
#include "com/sun/star/deployment/InstallException.hpp" #include "com/sun/star/deployment/InstallException.hpp"
#include "com/sun/star/deployment/DependencyException.hpp"
#include "com/sun/star/deployment/PlatformException.hpp"
#include "com/sun/star/task/XInteractionApprove.hpp" #include "com/sun/star/task/XInteractionApprove.hpp"
#include "com/sun/star/task/XInteractionAbort.hpp" #include "com/sun/star/task/XInteractionAbort.hpp"
#include "com/sun/star/task/XInteractionHandler.hpp" #include "com/sun/star/task/XInteractionHandler.hpp"
...@@ -250,7 +252,43 @@ void NoLicenseCommandEnv::handle( ...@@ -250,7 +252,43 @@ void NoLicenseCommandEnv::handle(
handle_(approve, abort, xRequest); handle_(approve, abort, xRequest);
} }
// SilentCheckPrerequisitesCommandEnv::SilentCheckPrerequisitesCommandEnv(
// css::uno::Reference< css::task::XInteractionHandler> const & handler):
// BaseCommandEnv(handler)
// {
// }
SilentCheckPrerequisitesCommandEnv::SilentCheckPrerequisitesCommandEnv()
{
}
void SilentCheckPrerequisitesCommandEnv::handle(
Reference< task::XInteractionRequest> const & xRequest )
throw (uno::RuntimeException)
{
uno::Any request( xRequest->getRequest() );
OSL_ASSERT( request.getValueTypeClass() == uno::TypeClass_EXCEPTION );
deployment::LicenseException licExc;
deployment::PlatformException platformExc;
deployment::DependencyException depExc;
bool approve = false;
bool abort = false;
if (request >>= licExc)
{
approve = true;
handle_(approve, abort, xRequest);
}
else if ((request >>= platformExc)
|| (request >>= depExc))
{
m_Exception = request;
}
else
{
m_UnknownException = request;
}
}
// NoExceptionCommandEnv::NoExceptionCommandEnv( // NoExceptionCommandEnv::NoExceptionCommandEnv(
// css::uno::Reference< css::task::XInteractionHandler> const & handler, // css::uno::Reference< css::task::XInteractionHandler> const & handler,
// css::uno::Type const & type): // css::uno::Type const & type):
......
...@@ -135,6 +135,29 @@ public: ...@@ -135,6 +135,29 @@ public:
}; };
/* For use in XExtensionManager::addExtension in the call to
XPackage::checkPrerequisites
It prevents all user interactions. The license is always accepted.
It remembers if there was a platform or a dependency exception in
the member m_bException. if there was any other exception then m_bUnknownException
is set.
*/
class SilentCheckPrerequisitesCommandEnv : public BaseCommandEnv
{
public:
SilentCheckPrerequisitesCommandEnv();
// XInteractionHandler
virtual void SAL_CALL handle(
css::uno::Reference<css::task::XInteractionRequest > const & xRequest )
throw (css::uno::RuntimeException);
// Set to true if a PlatformException or a DependencyException were handled.
css::uno::Any m_Exception;
// Set to true if an unknown exception was handled.
css::uno::Any m_UnknownException;
};
// class NoExceptionCommandEnv : public BaseCommandEnv // class NoExceptionCommandEnv : public BaseCommandEnv
// { // {
// css::uno::Type m_type; // css::uno::Type m_type;
......
...@@ -235,6 +235,8 @@ private: ...@@ -235,6 +235,8 @@ private:
css::uno::Reference<css::deployment::XPackageManager> m_bundledRepository; css::uno::Reference<css::deployment::XPackageManager> m_bundledRepository;
css::uno::Reference<css::deployment::XPackageManager> m_tmpRepository; css::uno::Reference<css::deployment::XPackageManager> m_tmpRepository;
//only to be used within addExtension
::osl::Mutex m_addMutex;
/* contains the names of all repositories (except tmp) in order of there /* contains the names of all repositories (except tmp) in order of there
priority. That is, the first element is "user" follod by "shared" and priority. That is, the first element is "user" follod by "shared" and
then "bundled" then "bundled"
...@@ -296,6 +298,21 @@ private: ...@@ -296,6 +298,21 @@ private:
css::uno::Reference<css::deployment::XPackageManager> css::uno::Reference<css::deployment::XPackageManager>
getPackageManager(::rtl::OUString const & repository) getPackageManager(::rtl::OUString const & repository)
throw (css::lang::IllegalArgumentException); throw (css::lang::IllegalArgumentException);
bool doChecksForAddExtension(
css::uno::Reference<css::deployment::XPackageManager> const & xPackageMgr,
css::uno::Sequence<css::beans::NamedValue> const & properties,
css::uno::Reference<css::deployment::XPackage> const & xTmpExtension,
css::uno::Reference<css::task::XAbortChannel> const & xAbortChannel,
css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv,
css::uno::Reference<css::deployment::XPackage> & out_existingExtension )
throw (css::deployment::DeploymentException,
css::ucb::CommandFailedException,
css::ucb::CommandAbortedException,
css::lang::IllegalArgumentException,
css::uno::RuntimeException);
}; };
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment