Other Programming and Scripting Languages

     

To help you quickly develop applications for NDS and NetWare without having to fully understand the underlying complexity, Novell Developer Support has several tools available. For example, you can build successful network-ready applications and utilities by using your favorite rapid application development (RAD) Windows programming tool, such as Visual Basic.

Visual Basic Libraries for Novell Services gives programmers full access to all the low-level NetWare APIs that have traditionally been available only to C programmers. The libraries are provided in the form of a single text file and a set of helper functions in a .BAS file. The text file ( NETWARE.BAS ) contains declarations for most of the NetWare APIs. (The libraries are for the 32-bit Novell Client DLLs and do not support the old 16-bit library.) All the constants, types, and function declarations are in NETWARE.BAS to make it easier to include them in a project. The following is a Visual Basic code snippet that illustrates how to remove an attribute value whose syntax type is SYN_CI_STRING :

 Private objName As String Private attrName As String Private objType As Integer Private Sub RemoveValueFromAttribute(objName As String,                                         attrName As String,                                         attrValue As String) Dim inBuf As Long Dim byteName(127) As Byte     retCode = NWDSAllocBuf(DEFAULT_MESSAGE_LEN, inBuf)     If retCode Then         MsgBox "NWDSAllocBug returned E=" + Str(retCode),                 vbCritical         Exit Sub     End If     retCode = NWDSInitBuf(contextHandle, DSV_MODIFY_ENTRY,                             inBuf)     If retCode Then         MsgBox "NWDSInitBuf returned E=" + Str(retCode),                 vbCritical         GoTo exit1     End If    'defined in NETWARE.BAS     Call StringToByteArray(byteName, attrValue + Chr(0))     retCode = NWDSPutChangeAndVal(contextHandle, inBuf,                                     DS_REMOVE_VALUE,                                     attrName + Chr(0),                                     SYN_CI_STRING,                                     VarPtr(byteName(0)))     retCode = NWDSModifyObject(contextHandle,                                  objName + Chr(0),                                  -1, 0, inBuf) exit1:     retCode = NWDSFreeBuf(inBuf) End Sub 

Alternately, you can use ActiveX Controls for Novell Services, which supports full access to NDS, as well as administration capabilities for NetWare servers, print queues, and volumes . All this functionality is packaged so it can be used quickly and easily in a Windows visual builder and other development tools, such as Visual Basic, Delphi (see Figure 10.1), PowerBuilder, Active Server Pages for Internet Information Server (IIS), Windows Scripting Host, and the Internet Explorer Web browser. ActiveX Controls for Novell Services contains controls that are divided into the following three categories:

  • Novell Directory Access Protocol (NDAP; that is, NCP-based) controls:

    • Application Administration ( NWAppA )

    • Browser ( NWBrowse )

    • Directory ( NWDir )

    • Directory Administration ( NWDirA )

    • Directory Authenticator ( NWDirAuth )

    • Directory Query ( NWDirQ )

    • NDPS Printer Administration ( NWDPPrtA )

    • NDS Corporate Edition Domain ( NDSDomain )

    • Network Selector ( NWSelect )

    • SecretStore ( NWSecStr )

    • Server Administration ( NWSrvA )

    • Session Management ( NWSess )

    • User Group ( NWUsrGrp )

    • Volume Administration ( NWVolA )

  • LDAP controls (to access NDS/eDirectory or any LDAP-complaint directory via LDAP):

    • Internet Directory ( NWIDir )

    • Internet Directory Authenticator ( NWIDirAuth )

    • Internet Directory Entries ( NWIDirE )

    • Internet Directory Query ( NWIDirQ )

    • Internet Directory Schema ( NWIDirS )

  • Socket controls (to develop applications that communicate by using either TCP or SPX protocols):

    • Client and Server Socket ( NWCliSkt and NWSvrSkt )

    • Peer Socket ( NWPrSkt )

Figure 10.1. A Novell sample Delphi application.
graphics/10fig01.gif

TIP

After installing the core components for ActiveX Controls for Novell Services, you need to also install the necessary LDAP /NDAP/Socket component to get the necessary controls. These controls use the .DLL extension and not the .OCX extension that you expect for ActiveX controls.


NOTE

Although ActiveX Controls for Novell Services provides broad coverage of the most popular features of the NetWare C APIs, the controls do not wrap 100% of the available API set.

If you are a Delphi developer, you can use Delphi Libraries for Novell Services, which includes the DCU and PAS files needed to call the NetWare APIs from Delphi, instead of using ActiveX Controls for Novell Services.


Java fans will be glad to know that Novell has classes for Java and Java Naming and Directory Interface (JNDI) providers, as well as JavaBeans, available to use. Java applications can access NDS through the JNDI APIs, with or without Novell client software installed. If you're more comfortable with scripting languages, such as VBScript, you'll be happy to hear that Novell has support for them, too. For example, using the Novell Script for NetWare (NSN), which is a VBScript-compatible language for script automation and Web development on the Netscape FastTrack Server for NetWare platform, you can use Novell Script's prebuilt components to access NetWare and integrate eDirectory, Oracle, Microsoft Access, MySQL, and Pervasive (previously Btrieve) databases into your Web applications.

NOTE

You install and configure Novell Script for NetWare when you install a NetWare 5.1 or later server. You can find the latest at http://developer.novell.com/ndk/nscript.htm.


More traditional Web page designers can use Perl 5 for NetWare with the Apache Web Server for NetWare or the NetWare Enterprise Web Server. Perl 5 support enables you to enhance and continue your investment in Perl scripts and Perl applications. At the time of this writing, Perl 5 for NetWare is at Perl 5.8 and provides system administration and common gateway interface (CGI) scripting functionality. You can use the Perl_LDAP modules to access NDS/eDirectory. However, the standard Perl_LDAP modules available from Comprehensive Perl Archive Network (CPAN; www.cpan.org) do not support eDirectory-specific extensions such as those related to partition operations. However, the version from Novell, which can be found at http://developer.novell.com/ndk/perl5.htm, includes a set of functions for performing extended operations (such as ChangeReplicaType ) on eDirectory.

With the release of NetWare 6.5, Novell introduced PHP scripting support (used in conjunction with Apache Web Server) to NetWare 6.x servers. (PHP is a recursive acronym for PHP: Hypertext Preprocesser.) PHP for NetWare is based on open -source PHP (www.php.net). On NetWare, PHP supports standard extensions and extensions for LDAP, XML, and MySQL. It also has a UCS extension (PHP2UCS) that can be used to access various Novell services, such as eDirectory, file I/O, server management, and volume administration. Through UCS, PHP can use UCX components, JavaBeans and classes, and remote ActiveX controls.

NOTE

For information on how to set up a NetWare 6 server to take advantage of Apache, MySQL, and PHP/Perl scripting ” generally referred to as AMP ”see the white paper about NetWare AMP at http://developer.novell.com/ndk/whitepapers/namp.htm.




Novell's Guide to Troubleshooting eDirectory
Novells Guide to Troubleshooting eDirectory
ISBN: 0789731460
EAN: 2147483647
Year: 2003
Pages: 173

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net