Novell is now a part of Micro Focus

I am implementing a JDBC DirXML driver for...

Articles and Tips: qna

01 Apr 2003


Q.

I am implementing a JDBC DirXML driver for an Oracle database. I only need a publisher channel that, based on Oracle's view fields:

  • Changes, adds, or removes Group Membership and Security Equals attributes

  • Disables or enables a NetMail mailbox

  • Moves User objects

The create and placement rules were implemented as style sheets. The event transformation schema mapping, and matching rules are implemented and working. Everything seems to be perfect, but I just discovered that the application that handles Oracle data (a VB application) does not do any "update" events. It will do "deletes" and "inserts."

Everything changes in this new environment. If a row is updated in Oracle, it is actually deleted and inserted. The event transformation style sheet does not work anymore, because is has an <xsl:template match=modify>. I've already tried to modify the Create style sheet to handle this, but I know now that this stylesheet does not handle "modify" requests. I know that if the DirXML engine takes the add event for an existing object, it turns the event to "modify," but I have to handle it (such as group membership) before the data is entered into eDirectory and I don't know how.

I've already tried to create a stylesheet that is processed after the matching rule, but the error "Operation vetoed by create rule" is displayed in the trace (level 3). This stylesheet and the create style- sheet implements add events and I think they are killing each other.

Is there a way to change an "add" event into a modify and move event, or is there a way to do something like the following:

"If the user already exists in eDirectory, do a modify. If not, do the add placed on the create stylesheet?"

A.

Yes, it sounds like you have an add-to-modify/ modify-to-add situation. Regarding your question:

"Is there a way to change an "add" event into a "modify" and "move" event?"

the answer is yes. The job is done by simply outputting a different document when one is received. As far as finding out if the object already is there or not, this can be done using queries. To change an event to another, type:

<xsl:template match="add"/>
	<modify>
		<xsl:apply-templates="@*|node()"/>
	</modify>
</xsl:template>

That will simply change the event. Of course you'll have more/different code than this, but that's the gist of it. For information on how to set up <query> docs, see the NDS.dtd and the DirXML documentation. You may need to manually handle some events.

* Originally published in Novell AppNotes


Disclaimer

The origin of this information may be internal or external to Novell. While Novell makes all reasonable efforts to verify this information, Novell does not make explicit or implied claims to its validity.

© Copyright Micro Focus or one of its affiliates