Import into the project a classifier presented as xml text.


iret = ac_request("classification", "Classification_Import", strinf sXMLsource, int iclassifpolicy, int ipropertypolicy);


Here:

sXMLsource - classifier source text in xml encoding,

iclassifpolicy - how to deal with conflicts during classifier loading:

0 - merge with existing classification,

1 - replace,

2 - skip.

ipropertypolicy - how to deal with conflicts while loading parameters for a classification:

0 - merge,

1 - skip.


Example:

Get the text of the classifier from a file from the site and load it into the project.


int do_iButtonloadClassificator()

{

       string sclassifname = "Classificator KSI- Objects";


       int iStringDescr;

       object("create", "ts_string", iStringDescr);

       int iret = ts_string(iStringDescr, "ReadFromURL", "http://www.labpp.ru/TSDownload/KSI/" + sclassifname + ".txt");

       object("read_simple_value", iStringDescr);

       string sXMLsource = ac_getstrvalue();


       if (iret == 0)

       {

               coutvar << sXMLsource;

               iret = ac_request("classification", "Classification_Import", sXMLsource, 1, 0);

               if (iret == 0)

               {

                       tsalert(-3, "Information", "Classificator loading finished", sclassifname);

               }

       }

       object("delete", iStringDescr);

       refresh_classificators_list_for_loaded();

}