summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorTor Lillqvist <tlillqvist@novell.com>2010-08-25 22:28:03 +0200
committerJan Holesovsky <kendy@suse.cz>2010-08-26 13:08:23 +0200
commit7b7494785bd8e13a80150869cfe31ab744967cd2 (patch)
treef4e4cc5185c441310b0629a644a86fcc506ee62f /ucb
parent6c3eff7ee952ad4da79082b52a2eaf288a6a262b (diff)
novell-win32-odma.diff: ODMA dialog implementation.
i#6885, i#32741
Diffstat (limited to 'ucb')
-rw-r--r--ucb/prj/build.lst1
-rw-r--r--ucb/prj/d.lst5
-rw-r--r--ucb/source/ucp/odma/makefile.mk11
-rw-r--r--ucb/source/ucp/odma/odma_content.cxx100
-rw-r--r--ucb/source/ucp/odma/odma_content.hxx2
-rw-r--r--ucb/source/ucp/odma/odma_contentprops.hxx1
-rw-r--r--ucb/source/ucp/odma/odma_datasupplier.cxx3
-rw-r--r--ucb/source/ucp/odma/odma_lib.cxx25
-rw-r--r--ucb/source/ucp/odma/odma_lib.hxx76
-rw-r--r--ucb/source/ucp/odma/odma_provider.cxx8
-rw-r--r--ucb/source/ucp/odma/odma_provider.hxx15
-rw-r--r--ucb/source/ucp/odma/odma_services.cxx14
-rw-r--r--ucb/source/ucp/odma/ucpodma.xml2
13 files changed, 121 insertions, 142 deletions
diff --git a/ucb/prj/build.lst b/ucb/prj/build.lst
index dad79213047e..e58d23926b22 100644
--- a/ucb/prj/build.lst
+++ b/ucb/prj/build.lst
@@ -16,3 +16,4 @@ uc ucb\source\ucp\tdoc nmake - all uc_tdoc uc_inc NULL
uc ucb\source\ucp\expand nmake - all uc_expand uc_inc NULL
uc ucb\source\ucp\ext nmake - all uc_ext uc_inc NULL
uc ucb\qa\unoapi nmake - all uc_qa_unoapi NULL
+uc ucb\source\ucp\odma nmake - w uc_odma uc_inc NULL
diff --git a/ucb/prj/d.lst b/ucb/prj/d.lst
index b02c8184a6e9..7b15e5b7fa3b 100644
--- a/ucb/prj/d.lst
+++ b/ucb/prj/d.lst
@@ -23,6 +23,11 @@
..\%__SRC%\lib\ucp*.uno.dylib %_DEST%\lib%_EXT%\ucp*.uno.dylib
..\%__SRC%\misc\ucp*.map %_DEST%\bin%_EXT%\ucp*.map
..\%__SRC%\misc\ucp*.sym %_DEST%\bin%_EXT%\ucp*.sym
+
+..\%__SRC%\slb\odma_lib.lib %_DEST%\lib%_EXT%\odma_lib.lib
+..\source\ucp\odma\odma.h %_DEST%\inc%_EXT%\odma.h
+..\source\ucp\odma\odma_lib.hxx %_DEST%\inc%_EXT%\odma_lib.hxx
+
..\source\ucp\file\ucpfile.xml %_DEST%\xml%_EXT%\ucpfile.xml
..\source\ucp\ftp\ucpftp.xml %_DEST%\xml%_EXT%\ucpftp.xml
..\source\ucp\hierarchy\ucphier.xml %_DEST%\xml%_EXT%\ucphier.xml
diff --git a/ucb/source/ucp/odma/makefile.mk b/ucb/source/ucp/odma/makefile.mk
index 14a7d3d45c3d..643b4fa2788e 100644
--- a/ucb/source/ucp/odma/makefile.mk
+++ b/ucb/source/ucp/odma/makefile.mk
@@ -47,7 +47,7 @@ LIBTARGET=NO
# --- General -----------------------------------------------------
-SLOFILES=\
+SLO1FILES=\
$(SLO)$/odma_lib.obj \
$(SLO)$/odma_services.obj \
$(SLO)$/odma_provider.obj \
@@ -58,7 +58,7 @@ SLOFILES=\
$(SLO)$/odma_contentcaps.obj
LIB1TARGET=$(SLB)$/_$(TARGET).lib
-LIB1OBJFILES=$(SLOFILES)
+LIB1OBJFILES=$(SLO1FILES)
# --- Shared-Library ---------------------------------------------------
@@ -91,6 +91,13 @@ APP2STDLIBS=$(SALLIB) \
DEF2DES=UCB ODMA URL converter
+# --- odma_lib library -----------------------------------------------
+
+SLO3FILES=$(SLO)$/odma_lib.obj
+
+LIB3TARGET=$(SLB)$/odma_lib.lib
+LIB3OBJFILES=$(SLO3FILES)
+
# --- Targets ----------------------------------------------------------
.INCLUDE: target.mk
diff --git a/ucb/source/ucp/odma/odma_content.cxx b/ucb/source/ucp/odma/odma_content.cxx
index ae3c3ede60e7..015706d7aded 100644
--- a/ucb/source/ucp/odma/odma_content.cxx
+++ b/ucb/source/ucp/odma/odma_content.cxx
@@ -471,6 +471,12 @@ uno::Any SAL_CALL Content::execute(
}
else if( ! aCommand.Name.compareToAscii( "transfer" ) )
{
+ // So far I have determined that this command is called when
+ // doing "Save As" to copy an already written backup copy of
+ // the document in the file system into the DMS.
+
+ // Maybe also in other situations.
+
ucb::TransferInfo aTransferInfo;
if( ! ( aCommand.Argument >>= aTransferInfo ) )
{
@@ -486,84 +492,21 @@ uno::Any SAL_CALL Content::execute(
::rtl::Reference<ContentProperties> aProp = m_aProps;
if(aProp->m_bIsFolder)
{
- aProp = getContentProvider()->getContentPropertyWithTitle(aTransferInfo.NewTitle);
+ aProp = getContentProvider()->getContentPropertyWithDocumentId(aTransferInfo.NewTitle);
if(!aProp.is())
aProp = getContentProvider()->getContentPropertyWithSavedAsName(aTransferInfo.NewTitle);
sal_Bool bError = !aProp.is();
- if(bError)
- {
- sal_Char* pExtension = NULL;
- ::rtl::OString sExt;
- sal_Int32 nPos = aTransferInfo.NewTitle.lastIndexOf('.');
- if(nPos != -1)
- {
- sExt = ::rtl::OUStringToOString(aTransferInfo.NewTitle.copy(nPos+1),RTL_TEXTENCODING_ASCII_US);
- if(sExt.equalsIgnoreAsciiCase("txt"))
- pExtension = ODM_FORMAT_TEXT;
- else if(sExt.equalsIgnoreAsciiCase("rtf"))
- pExtension = ODM_FORMAT_RTF;
- else if(sExt.equalsIgnoreAsciiCase("ps"))
- pExtension = ODM_FORMAT_PS;
- else
- pExtension = const_cast<sal_Char*>(sExt.getStr());
- }
- else
- pExtension = ODM_FORMAT_TEXT;
-
- sal_Char* lpszNewDocId = new sal_Char[ODM_DOCID_MAX];
- void *pData = NULL;
- DWORD dwFlags = ODM_SILENT;
- ODMSTATUS odm = NODMSaveAsEx(ContentProvider::getHandle(),
- NULL, // means it is saved the first time
- lpszNewDocId,
- pExtension,
- NULL, // no callback function here
- pData,
- &dwFlags);
-
- // check if we have to call the DMS dialog
- if(odm == ODM_E_USERINT)
- {
- dwFlags = 0;
- odm = NODMSaveAsEx(ContentProvider::getHandle(),
- NULL, // means it is saved the first time
- lpszNewDocId,
- pExtension,
- NULL, // no callback function here
- pData,
- &dwFlags);
- }
- bError = odm != ODM_SUCCESS;
- if(!bError)
- {
- aProp = new ContentProperties();
- aProp->m_sDocumentId = ::rtl::OString(lpszNewDocId);
- aProp->m_sContentType = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODMA_CONTENT_TYPE));
- aProp->m_sSavedAsName = aTransferInfo.NewTitle;
- getContentProvider()->append(aProp);
-
- // now set the title
- WORD nDocInfo = ODM_NAME;
- ::rtl::OUString sFileName = aTransferInfo.NewTitle;
- sal_Int32 nIndex = aTransferInfo.NewTitle.lastIndexOf( sal_Unicode('.') );
- if(nIndex != -1)
- sFileName = aTransferInfo.NewTitle.copy(0,nIndex);
-
- ::rtl::OString sDocInfoValue = ::rtl::OUStringToOString(sFileName,RTL_TEXTENCODING_ASCII_US);
- odm = NODMSetDocInfo( ContentProvider::getHandle(),
- lpszNewDocId,
- nDocInfo,
- const_cast<sal_Char*>(sDocInfoValue.getStr())
- );
- }
- else if ( odm == ODM_E_CANCEL)
- NODMActivate(ContentProvider::getHandle(),
- ODM_DELETE,
- lpszNewDocId);
+ // There used to be code below that called ODMSaveAsEx,
+ // but that was very broken. We have already called
+ // ODMSaveAsEx in the ODMA file picker when selecting the
+ // name for a new document, or the document already exists
+ // in the DMS and we don't need any ODMSaveAsEx. The ODMA
+ // file picker tells odma::ContentProvider about the new
+ // document's DOCID, so the
+ // getContentPropertyWithDocumentId() call above should
+ // succeed.
- delete [] lpszNewDocId;
- }
if(bError)
ucbhelper::cancelCommandExecution(
uno::makeAny( lang::IllegalArgumentException(
@@ -575,12 +518,23 @@ uno::Any SAL_CALL Content::execute(
rtl::OUString sFileURL = ContentProvider::openDoc(aProp);
sal_Int32 nLastIndex = sFileURL.lastIndexOf( sal_Unicode('/') );
+ // Create a new Content object for the "shadow" file
+ // corresponding to the opened document from the DMS.
::ucbhelper::Content aContent(sFileURL.copy(0,nLastIndex),NULL);
// aTransferInfo.NameClash = ucb::NameClash::OVERWRITE;
aTransferInfo.NewTitle = sFileURL.copy( 1 + nLastIndex );
+ // Copy our saved backup copy to the "shadow" file.
aContent.executeCommand(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("transfer")),uno::makeAny(aTransferInfo));
+ // Tell the DMS that the "shadow" file is done and can be
+ // imported.
getContentProvider()->saveDocument(aProp->m_sDocumentId);
}
+ else if ( aCommand.Name.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM( "getCasePreservingURL" ) ) )
+ {
+ rtl::OUString CasePreservingURL = openDoc();
+ aRet <<= CasePreservingURL;
+ }
else
{
//////////////////////////////////////////////////////////////////
diff --git a/ucb/source/ucp/odma/odma_content.hxx b/ucb/source/ucp/odma/odma_content.hxx
index 30422a82e284..724468c2f4c2 100644
--- a/ucb/source/ucp/odma/odma_content.hxx
+++ b/ucb/source/ucp/odma/odma_content.hxx
@@ -59,7 +59,7 @@ namespace odma
// UNO service name for the content.
#define ODMA_CONTENT_SERVICE_NAME \
- "com.sun.star.ucb.OdmaContent"
+ "com.sun.star.ucb.ODMAContent"
//=========================================================================
class ContentProvider;
diff --git a/ucb/source/ucp/odma/odma_contentprops.hxx b/ucb/source/ucp/odma/odma_contentprops.hxx
index 602c1d3d8354..54d1b356dc60 100644
--- a/ucb/source/ucp/odma/odma_contentprops.hxx
+++ b/ucb/source/ucp/odma/odma_contentprops.hxx
@@ -64,6 +64,7 @@ namespace odma
{}
inline ::rtl::OUString getTitle() const { return m_sTitle; }
+ inline ::rtl::OUString getDocumentId() const { return ::rtl::OStringToOUString( m_sDocumentId, RTL_TEXTENCODING_ASCII_US ); }
inline ::rtl::OUString getSavedAsName() const { return m_sSavedAsName; }
};
typedef ::std::binary_function< ::rtl::Reference<ContentProperties>, ::rtl::OUString,bool> TContentPropertiesFunctorBase;
diff --git a/ucb/source/ucp/odma/odma_datasupplier.cxx b/ucb/source/ucp/odma/odma_datasupplier.cxx
index aab2a3d8663c..8702d4dc1af2 100644
--- a/ucb/source/ucp/odma/odma_datasupplier.cxx
+++ b/ucb/source/ucp/odma/odma_datasupplier.cxx
@@ -41,7 +41,6 @@
#include "odma_content.hxx"
#include "odma_contentprops.hxx"
#include "odma_provider.hxx"
-#include "odma_lib.hxx"
using namespace com::sun::star::beans;
using namespace com::sun::star::lang;
@@ -284,7 +283,7 @@ sal_Bool DataSupplier::getResult( sal_uInt32 nIndex )
ODMSTATUS odm = NODMGetDMS(ODMA_ODMA_REGNAME, lpszDMSList);
lpszDMSList[strlen(lpszDMSList)+1] = '\0';
- ::rtl::OString sQuery("SELECT ODM_DOCID, ODM_NAME");
+ ::rtl::OString sQuery("SELECT ODM_DOCID_LATEST, ODM_NAME");
DWORD dwFlags = ODM_SPECIFIC;
odm = NODMQueryExecute(ContentProvider::getHandle(), sQuery,dwFlags, lpszDMSList, pQueryId );
diff --git a/ucb/source/ucp/odma/odma_lib.cxx b/ucb/source/ucp/odma/odma_lib.cxx
index 774bcf5f6323..1f92a66a1cb3 100644
--- a/ucb/source/ucp/odma/odma_lib.cxx
+++ b/ucb/source/ucp/odma/odma_lib.cxx
@@ -32,6 +32,8 @@
//#endif
#include <osl/module.h>
#include <rtl/ustring.hxx>
+#include <tools/prewin.h>
+#include <tools/postwin.h>
#include "odma_lib.hxx"
@@ -70,17 +72,18 @@ namespace odma
sal_Bool LoadFunctions(oslModule _pODMA);
- sal_Bool LoadLibrary()
+ sal_Bool DMSsAvailable()
{
static sal_Bool bLoaded = sal_False;
- static oslModule pODMA = NULL;
+ static sal_Bool bBeenHere = sal_False;
+ oslModule pODMA = NULL;
+
+ if (bBeenHere)
+ return bLoaded;
- if (bLoaded)
- return sal_True;
::rtl::OUString sPath;
#ifdef WIN
sPath = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ODMA.DLL"));
-
#endif
#ifdef WNT
sPath = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ODMA32.DLL"));
@@ -89,11 +92,21 @@ namespace odma
sPath = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("libodma.so"));
#endif
+ bBeenHere = sal_True;
+
pODMA = osl_loadModule( sPath.pData,SAL_LOADMODULE_NOW );
if( !pODMA)
return sal_False;
- return bLoaded = LoadFunctions(pODMA);
+ if (!LoadFunctions(pODMA))
+ return sal_False;
+
+ bLoaded = (NODMGetDMSCount() > 0);
+
+ if (getenv ("NO_ODMA"))
+ bLoaded = sal_False;
+
+ return bLoaded;
}
// -------------------------------------------------------------------------
diff --git a/ucb/source/ucp/odma/odma_lib.hxx b/ucb/source/ucp/odma/odma_lib.hxx
index f4229572dbab..1a19dc15b71a 100644
--- a/ucb/source/ucp/odma/odma_lib.hxx
+++ b/ucb/source/ucp/odma/odma_lib.hxx
@@ -27,19 +27,7 @@
#ifndef ODMA_LIB_HXX
#define ODMA_LIB_HXX
-typedef void *LPVOID;
-typedef char *LPSTR,
- *PSTR;
-typedef const char *LPCSTR;
-typedef unsigned long DWORD;
-typedef unsigned short WORD;
-typedef unsigned short *LPWORD;
-typedef DWORD *LPDWORD;
-
-#define WINAPI __stdcall
-#define FAR
-
-#include "odma.h"
+#include <odma.h>
namespace odma
{
@@ -205,37 +193,37 @@ namespace odma
// now we define some macros
- #define NODMRegisterApp(a,b,c,d,e) (*(pODMRegisterApp))(a,b,c,d,e)
- #define NODMUnRegisterApp(a) (*(pODMUnRegisterApp))(a)
- #define NODMSelectDoc(a,b,c) (*(pODMSelectDoc))(a,b,c)
- #define NODMOpenDoc(a,b,c,d) (*(pODMOpenDoc))(a,b,c,d)
- #define NODMSaveDoc(a,b,c) (*(pODMSaveDoc))(a,b,c)
- #define NODMCloseDoc(a,b,c,d,e,f) (*(pODMCloseDoc))(a,b,c,d,e,f)
- #define NODMNewDoc(a,b,c,d,e) (*(pODMNewDoc))(a,b,c,d,e)
- #define NODMSaveAs(a,b,c,d,e,f) (*(pODMSaveAs))(a,b,c,d,e,f)
- #define NODMActivate(a,b,c) (*(pODMActivate))(a,b,c)
- #define NODMGetDocInfo(a,b,c,d,e) (*(pODMGetDocInfo))(a,b,c,d,e)
- #define NODMSetDocInfo(a,b,c,d) (*(pODMSetDocInfo))(a,b,c,d)
- #define NODMGetDMSInfo(a,b,c,d) (*(pODMGetDMSInfo))(a,b,c,d)
- #define NODMGetDMSCount() (*(pODMGetDMSCount))()
- #define NODMGetDMSList(a,b) (*(pODMGetDMSList))(a,b)
- #define NODMGetDMS(a,b) (*(pODMGetDMS))(a,b)
- #define NODMSetDMS(a,b) (*(pODMSetDMS))(a,b)
- #define NODMQueryExecute(a,b,c,d,e) (*(pODMQueryExecute))(a,b,c,d,e)
- #define NODMQueryGetResults(a,b,c,d,e,f) (*(pODMQueryGetResults))(a,b,c,d,e,f)
- #define NODMQueryClose(a,b) (*(pODMQueryClose))(a,b)
- #define NODMCloseDocEx(a,b,c,d,e,f,g) (*(pODMCloseDocEx))(a,b,c,d,e,f,g)
- #define NODMSaveAsEx(a,b,c,d,e,f,g) (*(pODMSaveAsEx))(a,b,c,d,e,f,g)
- #define NODMSaveDocEx(a,b,c,d) (*(pODMSaveDocEx))(a,b,c,d)
- #define NODMSelectDocEx(a,b,c,d,e,f) (*(pODMSelectDocEx))(a,b,c,d,e,f)
- #define NODMQueryCapability(a,b,c,d,e) (*(pODMQueryCapability))(a,b,c,d,e)
- #define NODMSetDocEvent(a,b,c,d,e,f,g) (*(pODMSetDocEvent))(a,b,c,d,e,f,g)
- #define NODMGetAlternateContent(a,b,c,d,e) (*(pODMGetAlternateContent))(a,b,c,d,e)
- #define NODMSetAlternateContent(a,b,c,d,e) (*(pODMSetAlternateContent))(a,b,c,d,e)
- #define NODMGetDocRelation(a,b,c,d,e,f) (*(pODMGetDocRelation))(a,b,c,d,e,f)
- #define NODMSetDocRelation(a,b,c,d,e,f) (*(pODMSetDocRelation))(a,b,c,d,e,f)
-
- sal_Bool LoadLibrary();
+ #define NODMRegisterApp(a,b,c,d,e) (*(::odma::pODMRegisterApp))(a,b,c,d,e)
+ #define NODMUnRegisterApp(a) (*(::odma::pODMUnRegisterApp))(a)
+ #define NODMSelectDoc(a,b,c) (*(::odma::pODMSelectDoc))(a,b,c)
+ #define NODMOpenDoc(a,b,c,d) (*(::odma::pODMOpenDoc))(a,b,c,d)
+ #define NODMSaveDoc(a,b,c) (*(::odma::pODMSaveDoc))(a,b,c)
+ #define NODMCloseDoc(a,b,c,d,e,f) (*(::odma::pODMCloseDoc))(a,b,c,d,e,f)
+ #define NODMNewDoc(a,b,c,d,e) (*(::odma::pODMNewDoc))(a,b,c,d,e)
+ #define NODMSaveAs(a,b,c,d,e,f) (*(::odma::pODMSaveAs))(a,b,c,d,e,f)
+ #define NODMActivate(a,b,c) (*(::odma::pODMActivate))(a,b,c)
+ #define NODMGetDocInfo(a,b,c,d,e) (*(::odma::pODMGetDocInfo))(a,b,c,d,e)
+ #define NODMSetDocInfo(a,b,c,d) (*(::odma::pODMSetDocInfo))(a,b,c,d)
+ #define NODMGetDMSInfo(a,b,c,d) (*(::odma::pODMGetDMSInfo))(a,b,c,d)
+ #define NODMGetDMSCount() (*(::odma::pODMGetDMSCount))()
+ #define NODMGetDMSList(a,b) (*(::odma::pODMGetDMSList))(a,b)
+ #define NODMGetDMS(a,b) (*(::odma::pODMGetDMS))(a,b)
+ #define NODMSetDMS(a,b) (*(::odma::pODMSetDMS))(a,b)
+ #define NODMQueryExecute(a,b,c,d,e) (*(::odma::pODMQueryExecute))(a,b,c,d,e)
+ #define NODMQueryGetResults(a,b,c,d,e,f) (*(::odma::pODMQueryGetResults))(a,b,c,d,e,f)
+ #define NODMQueryClose(a,b) (*(::odma::pODMQueryClose))(a,b)
+ #define NODMCloseDocEx(a,b,c,d,e,f,g) (*(::odma::pODMCloseDocEx))(a,b,c,d,e,f,g)
+ #define NODMSaveAsEx(a,b,c,d,e,f,g) (*(::odma::pODMSaveAsEx))(a,b,c,d,e,f,g)
+ #define NODMSaveDocEx(a,b,c,d) (*(::odma::pODMSaveDocEx))(a,b,c,d)
+ #define NODMSelectDocEx(a,b,c,d,e,f) (*(::odma::pODMSelectDocEx))(a,b,c,d,e,f)
+ #define NODMQueryCapability(a,b,c,d,e) (*(::odma::pODMQueryCapability))(a,b,c,d,e)
+ #define NODMSetDocEvent(a,b,c,d,e,f,g) (*(::odma::pODMSetDocEvent))(a,b,c,d,e,f,g)
+ #define NODMGetAlternateContent(a,b,c,d,e) (*(::odma::pODMGetAlternateContent))(a,b,c,d,e)
+ #define NODMSetAlternateContent(a,b,c,d,e) (*(::odma::pODMSetAlternateContent))(a,b,c,d,e)
+ #define NODMGetDocRelation(a,b,c,d,e,f) (*(::odma::pODMGetDocRelation))(a,b,c,d,e,f)
+ #define NODMSetDocRelation(a,b,c,d,e,f) (*(::odma::pODMSetDocRelation))(a,b,c,d,e,f)
+
+ sal_Bool DMSsAvailable();
extern TODMRegisterApp pODMRegisterApp;
extern TODMUnRegisterApp pODMUnRegisterApp;
diff --git a/ucb/source/ucp/odma/odma_provider.cxx b/ucb/source/ucp/odma/odma_provider.cxx
index 6c4df4c40b88..5415afb9ec9c 100644
--- a/ucb/source/ucp/odma/odma_provider.cxx
+++ b/ucb/source/ucp/odma/odma_provider.cxx
@@ -434,7 +434,7 @@ void ContentProvider::append(const ::rtl::Reference<ContentProperties>& _rProp)
lpszDMSList[strlen(lpszDMSList)+1] = '\0';
::rtl::OString sTitleText(::rtl::OUStringToOString(_sDocumentName,RTL_TEXTENCODING_ASCII_US));
- ::rtl::OString sQuery("SELECT ODM_DOCID, ODM_NAME WHERE ODM_TITLETEXT = '");
+ ::rtl::OString sQuery("SELECT ODM_DOCID_LATEST, ODM_NAME WHERE ODM_TITLETEXT = '");
sQuery += sTitleText;
sQuery += "'";
@@ -522,6 +522,12 @@ void ContentProvider::append(const ::rtl::Reference<ContentProperties>& _rProp)
return getContentProperty(_sTitle,aFunc);
}
// -----------------------------------------------------------------------------
+::rtl::Reference<ContentProperties> ContentProvider::getContentPropertyWithDocumentId(const ::rtl::OUString& _sDocumentId) const
+{
+ ContentPropertiesMemberFunctor aFunc(::std::mem_fun(&ContentProperties::getDocumentId));
+ return getContentProperty(_sDocumentId,aFunc);
+}
+// -----------------------------------------------------------------------------
::rtl::OUString ContentProvider::openDoc(const ::rtl::Reference<ContentProperties>& _rProp) throw (uno::Exception)
{
OSL_ENSURE(_rProp.is(),"No valid content properties!");
diff --git a/ucb/source/ucp/odma/odma_provider.hxx b/ucb/source/ucp/odma/odma_provider.hxx
index 0e861f59b492..43f8628b8507 100644
--- a/ucb/source/ucp/odma/odma_provider.hxx
+++ b/ucb/source/ucp/odma/odma_provider.hxx
@@ -29,6 +29,8 @@
#define ODMA_PROVIDER_HXX
#include <ucbhelper/providerhelper.hxx>
+#include <tools/prewin.h>
+#include <tools/postwin.h>
#include "odma_lib.hxx"
#include "rtl/ref.hxx"
@@ -43,7 +45,7 @@ namespace odma {
// UNO service name for the provider. This name will be used by the UCB to
// create instances of the provider.
#define ODMA_CONTENT_PROVIDER_SERVICE_NAME \
- "com.sun.star.ucb.OdmaContentProvider"
+ "com.sun.star.ucb.ODMAContentProvider"
// #define ODMA_CONTENT_PROVIDER_SERVICE_NAME_LENGTH 34
// URL scheme. This is the scheme the provider will be able to create
@@ -133,14 +135,21 @@ public:
*/
::rtl::Reference<ContentProperties> queryContentProperty(const ::rtl::OUString& _sDocumentName);
- /** getContentProperty returns the ContentProperties for the first content with that title
+ /** getContentPropertyWithTitle returns the ContentProperties for the first content with that title
@param _sTitle the title of the document
@return the content properties
*/
::rtl::Reference<ContentProperties> getContentPropertyWithTitle(const ::rtl::OUString& _sTitle) const;
- /** getContentProperty returns the ContentProperties for the first content with that SavedAsName
+ /** getContentPropertyWithDocumentId returns the ContentProperties for the first content with that title
+ @param _sTitle the title of the document
+
+ @return the content properties
+ */
+ ::rtl::Reference<ContentProperties> getContentPropertyWithDocumentId(const ::rtl::OUString& _sDocumentId) const;
+
+ /** getContentPropertyWithSavedAsName returns the ContentProperties for the first content with that SavedAsName
@param _sSaveAsName the SavedAsName of the document
@return the content properties
diff --git a/ucb/source/ucp/odma/odma_services.cxx b/ucb/source/ucp/odma/odma_services.cxx
index 3e4639e25806..23886bc9ccdc 100644
--- a/ucb/source/ucp/odma/odma_services.cxx
+++ b/ucb/source/ucp/odma/odma_services.cxx
@@ -32,21 +32,19 @@
#include <com/sun/star/registry/XRegistryKey.hpp>
#include "odma_contentprops.hxx"
#include "odma_provider.hxx"
-#include "odma_lib.hxx"
-using namespace rtl;
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
using namespace com::sun::star::registry;
//=========================================================================
static sal_Bool writeInfo( void * pRegistryKey,
- const OUString & rImplementationName,
- Sequence< OUString > const & rServiceNames )
+ const rtl::OUString & rImplementationName,
+ Sequence< rtl::OUString > const & rServiceNames )
{
- OUString aKeyName( OUString::createFromAscii( "/" ) );
+ rtl::OUString aKeyName( rtl::OUString::createFromAscii( "/" ) );
aKeyName += rImplementationName;
- aKeyName += OUString::createFromAscii( "/UNO/SERVICES" );
+ aKeyName += rtl::OUString::createFromAscii( "/UNO/SERVICES" );
Reference< XRegistryKey > xKey;
try
@@ -119,10 +117,8 @@ extern "C" void * SAL_CALL component_getFactory(
if ( ::odma::ContentProvider::getImplementationName_Static().
compareToAscii( pImplName ) == 0 )
{
- if(::odma::LoadLibrary())
+ if(::odma::DMSsAvailable())
xFactory = ::odma::ContentProvider::createServiceFactory( xSMgr );
- else
- OSL_ASSERT(!"Could not load library!");
}
//////////////////////////////////////////////////////////////////////
diff --git a/ucb/source/ucp/odma/ucpodma.xml b/ucb/source/ucp/odma/ucpodma.xml
index 1ca36334d966..4cfdb67a0a16 100644
--- a/ucb/source/ucp/odma/ucpodma.xml
+++ b/ucb/source/ucp/odma/ucpodma.xml
@@ -11,7 +11,7 @@
Ocke Janssen
</author>
<name>
- com.sun.star.comp.ucb.OdmaContentProvider
+ com.sun.star.comp.ucb.ODMAContentProvider
</name>
<description>
This component implements a Content Provider for the Universal