|
|
The ODMA ProviderPrefaceThe ODMA Content Provider (OCP) implements a Content Provider for the Universal Content Broker (UCB). It provides access to a document structure stored in a Document Management System (DMS). OCP ContentThe OCP Content provides two types of content; the document and the Root Folder.
![]() OCP Folders implement the interface XContentCreator. OCP Root Folder supports the command „insert“. That's why the OCP Root Folder can create new OCP Streams. To create a new OCP Streams:
URL Scheme for OCP ContentsEach OCP content has an identifier corresponding to the following scheme: vnd.sun.star.odma:/<name> where <name> is the DocumentID given by the DMS. Examples: vnd.sun.star.odma:/ ( The URL of the OCP Root Folder ) vnd.sun.star.odma:/ a document id given by the DMS vnd.sun.star.odma:/::ODMA\DMS_ID\DM_SPECIFIC_INFO AppendixThe following table gives an overview of the different OCP contents.
More information about ODMA can be found at www.infonuovo.com/odma/ To enable ODMA the following basic macro has to executed to insert the settings needed in the Configuration. EM ***** BASIC ***** ' Option Explicit Sub RegisterUcpOdma Dim aConfigProvider As Object Dim aConfiguration As Object Dim aFilters as Object Dim aNewNode as Object Dim nResponse as Integer Dim bAddNode as Boolean ' access the global configuration provider aConfigProvider = createUnoService( "com.sun.star.configuration.ConfigurationProvider" ) ' create an access object for TypeDetection module Dim aParams(0) As new com.sun.star.beans.PropertyValue aParams(0).Name = "nodepath" aParams(0).Value = "/org.openoffice.ucb.Configuration" aConfiguration = aConfigProvider.createInstanceWithArguments( _ "com.sun.star.configuration.ConfigurationUpdateAccess", _ aParams() ) ' open the set node for the types aContentProviders = aConfiguration.getByName( "ContentProviders" ) aContentProvidersDataPrimaryKeys = aContentProviders.getByName( "Local" ) aSecondaryKeys = aContentProvidersDataPrimaryKeys.getByName( "SecondaryKeys" ) aContentProvidersDataSecondaryKeys = aSecondaryKeys.getByName( "Office" ) aProviderData = aContentProvidersDataSecondaryKeys.getByName( "ProviderData" ) ' existence check bAddNode = TRUE dim xx() as string xx() = aProviderData.getElementNames for i=LBOUND(xx) to UBOUND(xx) aContentProviderData = aProviderData.getByName( xx(i) ) if ( aContentProviderData.ServiceName = "com.sun.star.ucb.OdmaContentProvider" ) Then nResponse = MsgBox( "The type is already present in the configuration! Overwrite?", 4 ) if ( 6 = nResponse ) Then aProviderData.removeByName( xx(i) ) Else bAddNode = FALSE End If End If next i if ( bAddNode ) Then ' create a new node for the new type aContentProviderData = aProviderData.createInstance( ) ' fill this new type node aContentProviderData.ServiceName = "com.sun.star.ucb.OdmaContentProvider" aContentProviderData.URLTemplate = "vnd.sun.star.odma" ' insert this new type aProviderData.insertByName( "Provider" + (UBOUND(xx) - LBOUND(xx) + 2), aContentProviderData ) End If ' commit the changes done aConfiguration.commitChanges( ) ' register the component implementing the filter ' RegisterFilterComponent( ) End Sub Sub RegisterFilterComponent Dim oRegistry as Object Dim oImplReg as Object oRegistry = createUnoService( "com.sun.star.registry.SimpleRegistry" ) oImplReg = createUnoService( "com.sun.star.registry.ImplementationRegistration" ) if ( IsNull( oRegistry ) Or IsNull( oImplReg ) ) Then MsgBox "could not create the components necessary for registering the component!" Exit Sub End If On Local Error Resume Next oRegistry.open( "applicat.rdb", FALSE, FALSE ) if ( Not oRegistry.IsValid() ) Then MsgBox "could not open the registry!" Exit Sub End If On Local Error Goto 0 oImplReg.registerImplementation( "com.sun.star.loader.SharedLibrary", "ucpodma1.dll", oRegistry ) End Sub |



