Kaydet (Commit) 8aad9509 authored tarafından Ivo Hinkelmann's avatar Ivo Hinkelmann

INTEGRATION: CWS jl49 (1.4.8); FILE MERGED

2006/11/16 14:20:51 sb 1.4.8.3: #i70481# Moved extracting information from XML description element to DescriptionInfoset.
2006/11/15 14:50:49 sb 1.4.8.2: #i70481# ExtensionDescription ctor throws DeploymentException instead of arbitrary Exception.
2006/11/06 16:23:12 sb 1.4.8.1: #i70481# Check for Update button and context menu entry.
üst 78f74e04
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* *
* $RCSfile: dp_description.cxx,v $ * $RCSfile: dp_description.cxx,v $
* *
* $Revision: 1.4 $ * $Revision: 1.5 $
* *
* last change: $Author: kz $ $Date: 2006-10-04 16:55:32 $ * last change: $Author: ihi $ $Date: 2006-12-20 14:30:26 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
...@@ -38,9 +38,10 @@ ...@@ -38,9 +38,10 @@
#include "dp_description.hxx" #include "dp_description.hxx"
#include "cppuhelper/exc_hlp.hxx"
#include "ucbhelper/content.hxx" #include "ucbhelper/content.hxx"
#include "com/sun/star/deployment/DeploymentException.hpp"
#include "com/sun/star/xml/dom/XDocumentBuilder.hpp" #include "com/sun/star/xml/dom/XDocumentBuilder.hpp"
#include "com/sun/star/xml/xpath/XXPathAPI.hpp"
#include "com/sun/star/uno/XComponentContext.hpp" #include "com/sun/star/uno/XComponentContext.hpp"
#include "com/sun/star/ucb/CommandFailedException.hpp" #include "com/sun/star/ucb/CommandFailedException.hpp"
#include "com/sun/star/ucb/InteractiveAugmentedIOException.hpp" #include "com/sun/star/ucb/InteractiveAugmentedIOException.hpp"
...@@ -63,6 +64,7 @@ ExtensionDescription::ExtensionDescription( ...@@ -63,6 +64,7 @@ ExtensionDescription::ExtensionDescription(
const ::rtl::OUString& installDir, const ::rtl::OUString& installDir,
const cssu::Reference< css::ucb::XCommandEnvironment >& xCmdEnv) const cssu::Reference< css::ucb::XCommandEnvironment >& xCmdEnv)
{ {
try {
m_sExtensionRootUrl = installDir; m_sExtensionRootUrl = installDir;
//may throw ::com::sun::star::ucb::ContentCreationException //may throw ::com::sun::star::ucb::ContentCreationException
//If there is no description.xml then ucb will start an interaction which //If there is no description.xml then ucb will start an interaction which
...@@ -120,12 +122,8 @@ ExtensionDescription::ExtensionDescription( ...@@ -120,12 +122,8 @@ ExtensionDescription::ExtensionDescription(
throw cssu::Exception( throw cssu::Exception(
sDescriptionUri + OUSTR(" contains no root element."), 0); sDescriptionUri + OUSTR(" contains no root element."), 0);
} }
m_xRoot = xRoot; m_xRoot = cssu::Reference<css::xml::dom::XNode>(
if ( ! m_xRoot->getTagName().equals(OUSTR("description"))) xRoot, cssu::UNO_QUERY_THROW);
{
throw cssu::Exception(
sDescriptionUri + OUSTR(" does not contain the root element <description>."), 0);
}
::rtl::OUString nsDescription = xRoot->getNamespaceURI(); ::rtl::OUString nsDescription = xRoot->getNamespaceURI();
//check if this namespace is supported //check if this namespace is supported
...@@ -133,16 +131,17 @@ ExtensionDescription::ExtensionDescription( ...@@ -133,16 +131,17 @@ ExtensionDescription::ExtensionDescription(
{ {
throw cssu::Exception(sDescriptionUri + OUSTR(" contains a root element with an unsupported namespace. "), 0); throw cssu::Exception(sDescriptionUri + OUSTR(" contains a root element with an unsupported namespace. "), 0);
} }
} catch (css::uno::RuntimeException &) {
throw;
cssu::Reference<css::xml::xpath::XXPathAPI> xxPathAPI( } catch (css::deployment::DeploymentException &) {
xContext->getServiceManager()->createInstanceWithContext( throw;
OUSTR("com.sun.star.xml.xpath.XPathAPI"), } catch (css::uno::Exception & e) {
xContext), cssu::UNO_QUERY); css::uno::Any a(cppu::getCaughtException());
throw css::deployment::DeploymentException(
if (!xxPathAPI.is()) (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DeploymentException: "))
throw css::uno::Exception(OUSTR(" Could not create service com.sun.star.xml.xpath.XPathAPI."), 0); + e.Message),
m_xXPath = xxPathAPI; css::uno::Reference< css::uno::XInterface >(), a);
}
} }
ExtensionDescription::~ExtensionDescription() ExtensionDescription::~ExtensionDescription()
......
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