$CLASSNAME$
	CODBDEPOSITORY
$SUMMARY$
	The essence this CODB class is storehouse of stored objects - objects
	whouse structure descript into dictionary.
$LANG_RU$
	  CODB  -  ,     .
$ABOUT$
	The essence this CODB class is storehouse of stored objects - objects
	whouse structure descript into dictionary.
$LANG_RU$
	  CODB  -  ,     .
$SYNTAX$
	coDepositioryNew(<sDictID>, <sUser>, <sPasswd>) --> CODBDEPOSITORY object
	coDepository:New(<sDictID>, <sUser>, <sPasswd>)  --> CODBDEPOSITORY object
$ATTRIBUTES$
	<ClassName> 	CODBDEPOSITORY
	<Error>		String, the error description what araised within running last operation.
$LANG_RU$
	<ClassName> 	CODBDEPOSITORY
	<Error>		String,  ,     .

$METHODNAME$
	New()
$SUMMARY$
	Initiation new CODBDEPOSITORY object.
$LANG_RU$
	   CODBDEPOSITORY.
$SYNTAX$
	New(<sDepID>, <sUser>, <sPasswd>) --> CODBDEPOSITORY object
$ARGUMENTS$
	<sDepID>	Stirng, the depository identifier
	<sUser>		String, the user name
	<sPasswd>       String, the password to access
$LANG_RU$
	<sDepID>	Stirng,  
	<sUser>		String,  
	<sPasswd>       String,  
$RETURNS$
	Method returns new CODBDEPOSITORY object.
$LANG_RU$
	    CODBDEPOSITORY.
$DESCRIPTION$
	New() inits new CODBDEPOSITORY object and returns it.

	If object <sDepID> already exist, New() openes and returns this
	ddepository.
$LANG_RU$
	New()    CODBDEPOSITORY  .

	  <sDepID>  , New()   
	 .
$ENDMETHOD$

$METHODNAME$
	Create()
$SUMMARY$
	Create empty depository.
$LANG_RU$
	  .
$SYNTAX$
	Create() 	--> TRUE || FALSE
$ARGUMENTS$
$RETURNS$
	Returns TRUE if new empty depository created.
$LANG_RU$
	 TRUE     .
$DESCRIPTION$
	Create() returns TRUE if new empty depository created.
	Usualy, this method do not needy to direct invitation. It's call automaticaly
	when new depository appending to CODBDICTIONARY.

	<::Error> contain error descriptions if araised.
$LANG_RU$
	Create()  TRUE     .
	,      ,   
	     CODBDICTIONARY.

	<::Error>   ,   .
$ENDMETHOD$

$METHODNAME$
	Open()
$SUMMARY$
	Open all necessary files.
$LANG_RU$
	   .
$SYNTAX$
	Open() 	--> TRUE || FALSE
$ARGUMENTS$
$RETURNS$
	Returns TRUE if files opened.
$LANG_RU$
	 TRUE   .
$DESCRIPTION$
	Open() openes all necessary files or openes connection with SQL server.

	<::Error> contain error descriptions if araised.
$LANG_RU$
	Open()         
	 SQL .

	<::Error>   ,   .
$ENDMETHOD$


$METHODNAME$
	Close()
$SUMMARY$
	Close opened files.
$LANG_RU$
	  .
$SYNTAX$
	Close() 	--> TRUE || FALSE
$ARGUMENTS$
$RETURNS$
	Returns TRUE if files closed.
$LANG_RU$
	 TRUE   .
$DESCRIPTION$
	Close() is close files or connection with SQL server.
$LANG_RU$
	Open()         
	 SQL .
$ENDMETHOD$

$METHODNAME$
	Append()
$SUMMARY$
	Append object to storehouse.
$LANG_RU$
	   .
$SYNTAX$
	Append(<oData>, <sClassID>) 	--> <sDataID>
$ARGUMENTS$
	<oData> 	Object, new object to keeping
	<sClassID>	String, class identifier

$LANG_RU$
	<oData> 	Object,    .
	<sClassID>	String,  
$RETURNS$
	Returns <sDataID> - identifier registered object.
$LANG_RU$
	 <sDataID> -   .
$DESCRIPTION$
	Append() appends new object <oData> to storehouse as object of
	class <sClassID> and returns objects identifier <sDataID>.

	<::Error> contain error descriptions if araised.
$LANG_RU$
	Append()    <oData>     
	<sClassID>    
	 <sDataID>.

	<::Error>   ,   .
$ENDMETHOD$

$METHODNAME$
	Update()
$SUMMARY$
	Update object into storehouse.
$LANG_RU$
	   .
$SYNTAX$
	Update(<oData>) 	--> TRUE || FALSE
$ARGUMENTS$
	<oData> 	Object, object to updating
$LANG_RU$
	<oData> 	Object,   
$RETURNS$
	Returns TRUE if object updated.
$LANG_RU$
	 TRUE   .
$DESCRIPTION$
	Update() updates object <oData> into storehouse. If depositoy have not
	object with identifier <oData:ID>, Update() returns FALSE.

	<::Error> contain error descriptions if araised.
$LANG_RU$
	Update()   <oData>  .    
	   <oData:ID>, Update()  FALSE.

	<::Error>   ,   .
$ENDMETHOD$

$METHODNAME$
	Delete()
$SUMMARY$
	Delete object from storehouse.
$LANG_RU$
	   .
$SYNTAX$
	Delete(<sDataID>) 	--> TRUE || FALSE
$ARGUMENTS$
	<sDataID> 	String, the objects identifier

$LANG_RU$
	<sDataID> 	String,  
$RETURNS$
	Returns TRUE if object was deleted.
$LANG_RU$
	 TRUE    .
$DESCRIPTION$
	Delete() deletes object with identifier <sDataID> from depository.

	<::Error> contain error descriptions if araised.
$LANG_RU$
	Delete()     <sDataID>  .

	<::Error>   ,   .
$ENDMETHOD$


$METHODNAME$
	GetValue()
$SUMMARY$
	Get object from storehouse.
$LANG_RU$
	   .
$SYNTAX$
	GetValue(<sDataID>) 	--> <oData>
$ARGUMENTS$
	<sDataID> 	String, the objects identifier

$LANG_RU$
	<sDataID> 	String,  
$RETURNS$
	Returns object <oData> with identifier <sDataID>.
$LANG_RU$
	  <oData>   <sDataID>.
$DESCRIPTION$
	GetValue() gets form depository and returns object <oData> with
	identifier <sDataID>.

	<::Error> contain error descriptions if araised.
$LANG_RU$
	GetValue()       <oData> 
	 <sDataID>.

	<::Error>   ,   .
$ENDMETHOD$


$METHODNAME$
	CheckBody()
$SUMMARY$
	Checks object a valid class.
$LANG_RU$
	     .
$SYNTAX$
	CheckBody(<oData>, <sClassID>) 	--> <oData>
$ARGUMENTS$
	<oData> 	Object, object to check
	<sClassID>	String, class identifier

$LANG_RU$
	<oData> 	Object,   .
	<sClassID>	String,  
$RETURNS$
	Returns object <oData>.
$LANG_RU$
	  <oData>.
$DESCRIPTION$
	CheckBody() checks object <oData> a valid class <sClassID>.
	If object is a valid, CheckBody() fills <oData> properties the default values
	 if necessary.

	<::Error> contain error descriptions if araised.
$LANG_RU$
	CheckBody()   <oData>     <sClassID>
	     <oData>   .

	<::Error>   ,   .
$ENDMETHOD$

$METHODNAME$
	PadrBody()
$SUMMARY$
	Makes data representation.
$LANG_RU$
	    .
$SYNTAX$
	PadrBody(<oData>, <sClassID>) 	--> <oData>
$ARGUMENTS$
	<oData> 	Object, source object
	<sClassID>	String, class identifier

$LANG_RU$
	<oData> 	Object,  
	<sClassID>	String,  
$RETURNS$
	Returns object <oData>.
$LANG_RU$
	  <oData>.
$DESCRIPTION$
	PadrBody() makes data representation for <oData> to class <sClassID>.

	<::Error> contain error descriptions if araised.
$LANG_RU$
	PadrBody()   <oData>    <sClassID>.

	<::Error>   ,   .
$ENDMETHOD$

$METHODNAME$
	Select()
$SUMMARY$
	Returns identifier list of selected objects.
$LANG_RU$
	    .
$SYNTAX$
	Select(<sClassID>[, <nOrder>][, <sName>][, <sWhere>]) 	--> <aIdent>
$ARGUMENTS$
	<sClassID>	String, class identifier
	<nOrder>	Numeric, the index number
	<sName>		String, value <Name> attribute to search
	<sWhere>	String, the searching condition
$LANG_RU$
	<sClassID>	String,  
	<nOrder>	Numeric, the index number
	<sName>		String,   <Name>
	<sWhere>	String,  
$RETURNS$
	Returns <aIdent> array of object identifier what equal searching condition.
$LANG_RU$
	 <aIdent>   ,   .
$DESCRIPTION$
	Select() returns for class <sClassID> identifier list <aIdent> selected objects in order <nOrder>
	whose attribute <Name> == <sName> and attributes equal <sWhere>.

	<::Error> contain error descriptions if araised.
$LANG_RU$
	Select()    ,   <sClassID>   <nOrder>,
	   <Name>   <sName>   
	  <sWhere>.

	<::Error>   ,   .
$ENDMETHOD$

$METHODNAME$
	IdList()
$SUMMARY$
	Returns object of class IDLIST.
$LANG_RU$
	   IDLIST.
$SYNTAX$
	IdList(<sClassID>[, <nOrder>][, <sName>][, <sWhere>]) 	--> <oIDList>
$ARGUMENTS$
	<sClassID>	String, class identifier
	<nOrder>	Numeric, the index number
	<sName>		String, value <Name> attribute to search
	<sWhere>	String, the searching condition
$LANG_RU$
	<sClassID>	String,  
	<nOrder>	Numeric, the index number
	<sName>		String,   <Name>
	<sWhere>	String,  
$RETURNS$
	Returns <oIDList> - object of class IDLIST.
$LANG_RU$
	 <oIDList> -   IDLIST.
$DESCRIPTION$
	IdList() returns <oIDList> - object of class <link linkend="classCODBIDLIST">CODBIDLIST</link>.
$LANG_RU$
	IdList()  <oIDList> -   <link linkend="classCODBIDLIST">IDLIST</link>.
$ENDMETHOD$

$METHODNAME$
	Id4PrimaryKey()
$SUMMARY$
	Returns object identifier.
$LANG_RU$
	  .
$SYNTAX$
	Id4PrimaryKey(<sClassName>, <sKeyName>, <KeyValue>) 	--> <sDataID>
$ARGUMENTS$
	<sClassName>	String, class name
	<sKeyName>	String, the properties name
	<KeyValue> 	the value of properties
$LANG_RU$
	<sClassName>	String,  
	<sKeyName>	String,  
	<KeyValue> 	 
$RETURNS$
	Returns <sDataID> - identifier of founded object.
$LANG_RU$
	 <sDataID> -   .
$DESCRIPTION$
	Id4ProperyKey() returns <sDataID> - identifier of founded object
	whouse properties with name <sKeyName> is equal <KeyValue>.
$LANG_RU$
	Id4ProperyKey()  <sDataID> -   ,
	     <sKeyName>  <KeyValue>.
$ENDMETHOD$



$EXAMPLES$
* open first depository from MY001
oDep:=coDepository():new("MY00101")
oDep:open()
oDict:=oDep:dictionary()
* get currency metadata
currBody:=oDict:classBodyByName("currency")
if empty(currBody)
   ? "Class 'currency' not found in dictionary"
   quit
endif
*this data may be load from txt or dbf source file
data:={;
	{"USD","USA dollar"},;
	{"UUU","UUU dollar"},;
	{"RUR","Russian rubl"},;
	{"RUA","Ukraina rubl :)"};
      }
* add currency objects
for i=1 to len(data)
	obj:=map()
	obj:code := data[i][1]
	obj:name := data[i][2]
	obj_id := oDep:id4primaryKey("currency","code",obj:code)
	if empty(obj_id)
		oDep:append(obj,currBody:id)
	else
		/* object exist in depository */
		obj:id := obj_id
		oDep:update(obj)
	endif
	if !empty(oDep:error)
		? "Error:",oDep:error
	else
		? "currency object '"+obj:code+"' added to depository"
	endif
next
? "To depository added ",len(data)," objects"
c_list:=oDep:select(currBody:id,,,'code="U"')
? "Select currency objects with code='U':",c_list
c_list:=oDep:select(currBody:id)
? "Select all currency objects:",c_list
? "Loading objects body:"
for i=1 to len(c_list)
	obj:=oDep:getValue(c_list[i])
	? "code=",obj:code, "name=",obj:name
next

$PLATFORMS$
   No dependies of platform.
$SEEALSO$
	CODBLIST
$AUTHOR$
ITK
$LASTDATE$




