The global variable of "session","out","user" can be directly applied."source" can be used in trigger.
The prototype of "session" variable is "NpsSession", which records current context.
The prototype of "out" variable is "NpsLog", logs will be written into "nps.log" global files.
The prototype of "user" variable is "NpsUser"
"source" is the source of event.For articles,it's prototype is NpsArticle.
| Class | Direction |
|---|---|
| NpsSession | Record current context, which can be quoted through the global variable of “session”. |
| NpsUser | User Object |
| NpsSite | Website object, which can be acquired through NpsSession’s “GetSite()” serial methods. |
| NpsTopic | Topic Object |
| NpsArticle | Article Object |
| NpsAttach | Attachment Object |
| NpsResource | Resource Object |
| NpsArticleCollection | Article collection. It will return to the result set by calling NpsSite’s “GetAllArticles()” and “Search()”. |
| NpsResourceCollection | Resource collection,It will return the result set by calling NpsSite's GetResourcesByType() and GetResourcesByTopic() |
| NpsPreparedStatement | Database PreparedStatement object, which can be acquired through the “PreparedStatement()” of NpsSession. |
| NpsResultSet | Database ResultSet object, which can be acquired by transferring “ExecuteQuery()” of “NpsPreparedStatement” |
| NpsFile | File object, which can be created through javascript’s “new NpsFile(String filename)” |
| NpsLog | Log record object. The system defaulted log object can be acquired by transferring “GetDefaultLog()” of NpsSession. The self-defined file log can be acquired by transferring “CreateLog()” method. |
| NpsSmtp | Sending email via SMTP |
| NpsPop3 | Retrieving email via POP3 |
| NpsFtp | Ftp Tool |
| NpsSitemap | Google Sitemap Implementation |
| NpsRss | RSS Implementation |
| NpsAwstats | Integrate with AWStats |
| NpsFormula | A library for evaluating various mathematical expressions |
| NpsHtmlFetcher | Web Fetch Tool |
| NpsHtmlParser | Html Parser |
| NpsCurrencyConverter | Currency Converter |
| NpsChineseConverter | Chinese Converter |
| NpsIPQuery | IP query tools |
| NpsWebServiceClient | WebService Client |
| NpsExcelFormat | Apply special formatting to Excel cells |
| NpsExcel | Helps to create, read, modify Excel spreadsheet |
| NpsBackup | Dump all datas into Sqlite Database |
| NpsAtomClient | A tool implementing Atom Publishing Protocol |
| Sample Code |
|---|
|
var site = session.GetSite(); var new_log = null; try { new_log = session.CreateLog('d:/a.txt'); //put your code here new_log.Error('write error message to log'); } finally { if(new_log!=null) new_log.Close(); } |