
Welcome to using ngBook

1. What is ngBook?

The ngBook v1.10 is a tool to develop dynamic homepage, with a focus on
education purpose. With ngBook, you can easily develop homepages through 
that teachers can edit their course materials and students can read 
these course materials, submit exercise and assignments.

2. Features of ngBook:

Lecture notes: Composing course materials or other materials such as 
homepage of a company.

Glossary: Terms in lecture notes, multimedia, and library can 
automatically link to the glossary.

Multimedia: A multimedia database for all developers to share information.

Library: Not a professional one, but good enough for a small organization 
to setup a web-based library to store personal collections.

Multi language support: There are samples (library edit) which support 
two languages at the same time.

3. Installation

System requirements:
Windows NT (or Windows 95/98 )+ IIS4 (including MS Transaction server and SMTP server)

Warning: Your system may be need to reboot during the installation.

(1) To save space, the VB 6.0 runtime is not included. Please download and copy 
    VB 6.0 runtime files into your system if your system doesn't have it. 
    The files include:
	ASYCFILT.DLL
	COMCAT.DLL
	MSVBVM60.DLL
	MTXAS.DLL
	OLEAUT32.DLL
	OLEPRO32.DLL
	STDOLE2.TLB
	VB6STKIT.DLL

(2) Download and unzip file "ngBook.zip" then run "Setup.exe". It will install 
    ngBook system files into your system.

(3) Install sample pages: 

   a. Create a folder called ngBook in c:\inetpub\wwwroot\. Unzip file 
      "ngBookDES.zip" which is included in ngBook.zip into that folder.

   b. Move file "ngBook.mdb" in directory "C:\inetpub\wwwroot\ngBook\" to 
      "C:\inetpub\database". Create an ODBC connection for this database with 
      DSN (Data source name) called "ngBook" by running ODBC in the 
      "Control Panel". It should be a system DSN. For more information, please 
      read the on-line help of ODBC.

   c. Move file "ngBookVar.asi" to "C:\inetpub\scripts\". Open this file using 
      Notepad.exe and check whether the setting is ok for your system. You need 
      to change the settings if your DSN is not ngBook or your web directory is 
      not "C:\inetpub\wwwroot\".

      Note: leave file "ngBookSysVar.asi" in ngBook directory.

   d. Run Netscape or Internet Explorer and load "http://localhost/ngBook/". 
      The default user ID is "ngbook" and the password is "ngbook".

4. Uninstall:

(1). Stop IIS 4 service.

(2). Run un-install from "Add/Remove Program" in "Control Panel".

(3). Remove ODBC connection for all concerned database.

(4). Start IIS 4 and related service again.

5. Known problems:

(1). When you install ngBook, some systems will prompt you that it should 
install new version of some system files. Just click "Yes" to install it 
and then reboot the system.

(2). During the installation, it may prompted that mtxas.dll is in-use. 
Just ignore it and continue to install.

(3). In some systems, install program can not register ngBook.dll. In this 
case, you need to register it manually by typing these commands at DOS prompt:

\winnt\system32\regsvr32   \program files\ngbook\ngbook.dll
\winnt\system32\regsvr32   \winnt\system32\mtxas.dll

If you got the following error message in Netscape or Internet Explorer:
	Server object error 'ASP 0177 : 800401f3' 
	Server.CreateObject Failed 
	/Scripts/ngBookVar.asi, line 4 
	Invalid class string
That means the ngBook.dll is not registered.


6. File list

ngBook.dl_	ngBook
FILE_ID.DIZ	Brief descriptions
Readme.txt	Read me file (this file)
ngBookDES.zip	Sample file
ST5UNST.EX_
Setup.Lst
setup1.ex_
SETUP.EXE	Setup program

7. Related software

1. The ngBook Builder is used to convert database ngBook web page into plain 
html files which can be used in CD-ROM system. Please visit 
http://www.bigfoot.com/~huangng for detail.

2. The ngBook convertor is used to automatically convert .tif file into .jpg 
file after uploaded or create a thumbnail from uploaded .gif, .jpg, or .tif 
file. This will save time for the conversion and have thumbnail in same size. 
Please visit http://www.bigfoot.com/~huangng for detail.

8. Technical supports

Technical supports are available only through Web page: 
http://www.bigfoot.com/~huangng. The author will answer user's questions and 
put new stuff there.

9. Contact address

This version of ngBook is freeware. You can use it freely. You can distribute 
the software freely as is. No individual technical supports are available. 
However, the author would like to have an opportunity to cooperate with any 
interest company or organization to improve or fully use this software.

Homepage: http://www.bigfoot.com/~huangng, http://members.xoom.com/huangng/ngBook.htm
e_mail:  huangng@bigfoot.com, huangng@email.com
Post address:
---------------------------------------------
   Mr. Huang Neng Geng via Ni Zheng

        Rm. 403, No. 202
        Shuixiu Xincun, Wuxi,
        Jiangsu, 214071 China
---------------------------------------------

==========================================================================
Appendix 1:
==========================================================================
The ngBook uses ngBook.mdb. All tables and queries with name beginning of "ng" 
should not be changed (both the name and the data definition).

System tables:
ngAuthBook: defines the book's properties.
ngAuthGroup: defines the group of users
ngAuthLog: a log table to record users activities
ngAuthUser: defines user's properties
ngCodeDef: defines select items used in drop down menu
ngCodeType: used by CodeDef table
ngSystemMsg: defines system message used in the page.

User-defined tables:
There is a templete for user-defined tables. Just copy the structure of table 
templete and templete_ when you want to create your table. If you don't use 
assignment or exercise functions, you can only copy templete table. Otherwise 
you have to copy templete_ table because it is used to store the the student 
answers. The name is the same but plus "_".

Pre-defined tables:
There are three pre-defined tables. The data structure are the same as templete 
except ngLibrary and ngLibrary_. The table name and structure also should not be 
changed. 
ngGlossary: All glossary definition should in this table.
ngMedia: All shareable media should in this table.
ngLibrary: specially designed for library management. It supports three languages.


==========================================================================
Appendix 2:
==========================================================================
The ngBook is an ActiveX component. This appendix is for ASP programmers only.

The ngBook has four objects:
Sysvar: used to initialize the system and setup system parameters.
Book: used to manipulate books and pages.
Folder: used to access system resources, mainly folders.
AspFile: used by Folder object.

==========================================================================
Book: Object
==========================================================================
Properties:
=====================================
Property GetBookCode()
	return the code of current book
Property GetBookID()
	return the ID of current book
Property GetBookOwnerID()
	return the owner ID of current book
Property GetErrorMsg()
	return the error message code if there is an error
		"" if there is no error
Property GetGlossaryOriginalTerm() As String
	return original term if jump to other glossary
		"" if no jump
Property GetPageLevel()
	return the page level of current page
Property GetPageNo()
	return the page number in current level of current page
Property GetPageNoTotal()
	return the total page number in current level of current page
Property GetPageOwnerID()
	return the owner ID of current page
Property GetPageType()
	return the page type ID of current page
		Page type:
		Normal = 0
		NormalUserOwned = 1
		Discussion = 2
		DiscussionReply = 3
		Bulletin = 4
		BulletinMessage = 5
		Quiz = 6
		Exercise = 7
		Assignment = 8
		ClassDiscussion = 9
		SubmitAnonymous = 10  ' so any one can submit but can not edit
		CheckedAssignment = 11
Property HasError()
	return true if there is at least one error
		false if there is no error
Property hasSubPage()
	return true if current page has sub page(s)
	return false if current page has no sub page
Property ID() As Variant
	return the ID of current page
Property IsAdmin() As Boolean
	return true if current user is an administrator (major group=99)
Property IsAuthor() As Boolean
	return true if current user is an author (book's owner or belong to the author)
Property IsEditor() As Boolean
	return true if current user is an editor (belong to the editor)
Property IsReaderOnly() As Boolean
	return true if current user is not an author neither an editor
Property thePage() As Object
	return the RecordSet object of current page


=====================================
Methods:
=====================================
Function eMailPassword(strUserID) As String
	send an email to the user specified by the strUserID
	return email address of the user if success
		"false" if error (no user ID or no email address)


Sub BookDescription()
	write description of current book
Sub BookRemark()
	write remark of current book
Sub BookTitle()
	write title of current book
Sub ClosePage(Optional strFoot As Boolean = True)
	close all opened book and page
Sub EditBook()
	edit a book's property
Sub EditPage()
	edit current page
Sub EditUser()
	edit an user's property
Sub FilesList()
	list files uploaded
Sub FilesUpload(Optional strAddMsg = "")
	upload files
		add an "add new page" button if strAddMsg not empty
Sub GlossaryTerm(Optional intLanguage As Integer = 1)
	write glossary term
Sub GoNext(strTitle)
	create a go next link
Sub GoPrevious(strTitle)
	create a go previous link
Sub GoRefresh(strTitle)
	create a refresh link
Sub GoTop(strTitle)
	create a go top link
Sub GoUp(strTitle)
	create a go up link
Sub ListBooks(Optional strMark As String = "")
	list books in a specified table
Sub ListContents(Optional intShowThumbNail As Integer = 0, _
		Optional intLevel As Integer = 0, _
		Optional blnIsEdit As Boolean = False, _
		Optional blnHideSelfLink As Boolean = True)
	create a table of content of one level
		intShowThumbNail 	= 0 text only
					= 1 thumbnail only
					= 2 both text and thumbnail
		intLevel		= -1 parent level
					= 0 current level
					= 1 sub level
		blnIsEdit		= true list all pages
					= false list only finished and not expired pages
		blnHideSelfLink	= true current page has no link
					= false current page has link
Sub ListContentsLevel(Optional intShowThumbNail As Integer = 0, _
	Optional intPageLevel As Long = 0, _
	Optional blnIsEdit As Boolean = False)
	create a table of content of three levels at most
		intShowThumbNail 	= 0 text only
					= 1 thumbnail only
					= 2 both text and thumbnail
		intPageLevel		= n defines the topmost level
		blnIsEdit		= true list all pages
					= false list only finished and not expired pages
Sub ListCourses(TableName, _
		Optional IsEditOnly As Boolean = False, _
		Optional strImgName = "mark_book.gif")
	list all available courses of a table
		TableName	defines the table in which the courses to be list
		IsEditOnly	= true list all courses
				= false list only finished courses
		strImgName	defines image showed before the course name
Sub ListGroups(Optional strMark As String = "")
	list groups
Sub ListMenu()
	list all available menu for current user
Sub ListTables(Optional strMark As String = "")
	list table names
Sub ListUsers(Optional strMark As String = "")
	list users
Sub OpenBook()
	open the book of current page
Sub OpenGlossary(ByVal strID)
	open glossary specified by the strID number
Sub OpenPage(strTableName As String, Optional DefaultID As String = "0")
	open the page specified by the table name and ID (ID is usually in querystring)
Sub PageInfo()
	list page's information
Sub PageTitle(Optional language As Integer = 1)
	write page title
Sub ParentTitle()
	write parent page's title
Sub ReOpenPage(ByVal ID As String)
	open the page once again
Sub ReOpenSubPage()
	Open the sub page of current page.
		Go to the first if there are more than one sub page
Sub ShowGlossary(Optional intLanguage As Integer = 1)
	display glossary's explanation
Sub ShowPage()
	display current page's content or related forms (add, edit, glossary update forms)
Sub UpdatePage()
	responsible for update (add, update, cut, paste etc..)


==========================================================================
SysVar: Object
==========================================================================
Properties:
=====================================
Property AnonymousAccessLevel() As Integer
	any user can access book which dbGroup <= AnonymousAccessLevel
	default = 50
	read-write
Property AuthSiteID() As String
	default = "1"
	read-write
Property BookAuthorization() As String
	default = "read,admin" for administrator
	        = "" for others
	usually set by call Openbook method
	read-write
Property CheckDuplicateTitle() As Boolean
	default = false
	read-write
Property DefaultTextAreaWidth(ByVal vData As Integer)
	default = 45
	write
Property DSNName() As String
	usually set by call init method
	read-write
Property DSNPassword() As String
	usually set by call init method
	read-write
Property DSNUserID() As String
	usually set by call init method
	read-write
Property FirstLanguage() As String
	default = "e"
		can be "e" or "n" only
	read-write
Property FormatAuth() As String
	usually set by call Openbook method
	read-write
Property FormatEdit() As String
	usually set by call Openbook method
	read-write
Property FormatProperty() As String
	usually set by call Openbook method
	read-write
Property FormatRead_e() As String
	usually set by call Openbook method
	read-write
Property FormatRead_n() As String
	usually set by call Openbook method
	read-write
Property FormatReadAll_e() As String
	usually set by call Openbook method
	read-write
Property FormatReadAll_n() As String
	usually set by call Openbook method
	read-write
Property FromEmail() As String
	set the from email when email password to an user
	default = ""
	read-write
Property GlossaryBook() As String
	usually set by call Openbook method
	read-write
Property ID() As Variant
	return the ID of current page, same as book.ID
	read-only
Property Indent() As String
	set the prefix string when indent is needed
	default = " "
	read-write
Property LANLoginOnly() As Boolean
	use NT users account information for login process
	default = false
	read-write
Property LogLevel() As Integer
	set which events will be logged in the log table
	default = 4
	read-write
Property MaintenanceMsg(vData As String)
	set a message to be display in user's browser. Usually it is a warning message
	default = ""
	write-only
Property NoDuplicateTitle() As Boolean
	default = false
	read-write
Property NoEmptyTitle() As Boolean
	default = false
	read-write
Property ODBCErrorMsg(vData As String)
	inform users that the ODBC can not be openned.
	if it is an URL, redirect to that page
	default = ""
	write-only
Property PageLevelMax() As Integer
	usually set by call Openbook method
	read-write
Property PageLevelMin() As Integer
	usually set by call Openbook method
	read-write
Property ParentFrameFile() As String
	read-write
Property pBookDir() As String
	read-only
Property pImageDir() As String
	read-only
Property pMediaDir() As String
	read-only
Property pScriptDir() As String
	read-only
Property RegisteKey(vData As String)
	if it is a valid key, there will no ngBook footer at each page
	write-only
Property ReplyLevel() As Integer
	the max reply level for discussion page
	read-write
Property SecondLanguage() As String
	can be "e","n", or user defined (the table should be redesigned accordingly)
	default = ""
	read-write
Property SessionTime() As Integer
	set the time in minutes a session will be end
	default = 180
	read-write
Property ShowMark() As Boolean
	define whether to show mark in the talbe of contents 
		(book.listconents and book.listcontentlevel)
	default = true
	read-write
Property TableName() As String
	usually set by call OpenPage method
	read-write
Property TargetFile() As String
	if not empty, Link to this file 
		for listcontents, listcontentlevel, listmenu
	read-write
Property TargetFileParam() As String
	if not empty, user it as querystring 
		for listcontents, listcontentlevel, listmenu
	read-write
Property TargetFrame() As String
	if not empty, user it as default frame 
		for listcontents, listcontentlevel, listmenu
	read-write
Property ThisURL() As String
	automatically set, the URL of current web page
	read-only
Property ThisURLFull() As String
	automatically set, the URL with querystring of current web page
	read-only
Property UploadMaxK() As Integer
	the max size (k) of a file that can be uploaded
	default = 1024 
	read-write
Property vBookDir() As String
	the vritual path of ngBook
	read-write
Property Verion() As String
	return the current verions of ngBook
	read-only
Property vImageDir() As String
	the virtual path of image files
	read-write
Property vMediaDir() As String
	the virtual path of media files for upload
	Warning: make sure that this path is read-only
		do not give executive or script running right to it.
		otherwise a user may be able to upload an executable file and run it.
	read-write
Property vScriptDir() As String
	the virtual path of script files
	read-write

=====================================
Methods:
=====================================
Function EncodePassword(PWord)
Function GetMajorGroupID()
Function GetMinorGroupIDs()
Function GetSystemMsg(ByVal mName As String, Optional intLanguage As Byte = 1)
Function GetUserID()
Function GetUserName(Optional intLanguage As Integer = 1)
Function hasLogin()
Function UserID2UserName(strUserID As String, Optional intLanguage As Integer = 1)

Sub Init(strDSNName, _
	Optional strDSNUserID As String = "", _
	Optional strDSNPassword As String = "", _
	Optional SystemMsgTable As String = "")
Sub ListFormVariables()
Sub ListQueryString()
Sub ListServerVariables()
Sub Login(Optional SubmitOnly As Boolean = False)
Sub Logout()
Sub SetSystemMsg(ByVal mName As String, _
	ByVal mValue, _
	Optional mIsUpdate As Boolean = True)


==========================================================================
Folder: Object
==========================================================================
Properties:
=====================================
Property Count() As Long
	the number of files found
Property Item(vntIndexKey As Variant) As AspFile
	An object that contains file's information

=====================================
Methods:
=====================================
Method CopyFile(sOldFile As String, sNewFile As String)
	return 0 if success
Method DelDir(sDir)
	return 0 if success
Method DelFile(sFileName As String)
	return 0 if success
Method MakeDir(sDir As String)
	return 0 if success
Method ListFile(sFilePath As String, sFileName As String, 
		Optional iSort As Integer)
	Return collections of AspFile
Method ReNameFile(sOldName As String, sNewName As String)
	return 0 if success
Method RunApplication(AppName)
	run a given application on the server


==========================================================================
AspFile: Object, Collection
==========================================================================
Properties:
=====================================
FilePath As String
	Path of the file
FileName As String
	Name of the file
FileDate As Date
	Date of the file
FileSize As Long
	Size of the file
==========================================================================

	- The end -
