NpsArticle indicates article object.
| String |
id Article’s unique identification. Readonly |
| String |
title article’s title |
| String |
url URL path. Setting external link for custom datasource is not supported. |
| NpsTopic |
topic Master topic |
| NpsTopic[] |
slavetopics Slave topics' list. Readonly |
| NpsAttach[] |
attaches attachment list. Readonly |
| int |
state article’s status. Readonly 0: draft. 1: submitted while verifying. 2: verified while publishing. 3: published. |
| boolean |
bPublished To verify the article was published or not. Readonly |
| Date |
createdate date of creation. Readonly |
| Date |
publishdate date of publishing. Readonly |
| String |
subtitle subtitle. Custom Datasource NOT supported. |
| String |
abtitle abtitle. Custom Datasource NOT supported. |
| String |
keyword tags. Custom Datasource NOT supported. |
| String |
source source. Custom Datasource NOT supported. |
| String |
author author. Custom Datasource NOT supported. |
| int |
importance 重要度:0普通 1重要 2非常重要。可读写。不支持自定义数据源 |
| int |
validdays valid days. Custom Datasource NOT supported. =0 means valid forever |
| double |
score score. Custom Datasource NOT supported. |
| boolean |
isExternalLink Test if it is an external link. Readonly |
| String |
sourceid The id of article copied from. Custom Datasource NOT supported. |
|
new(NpsTopic topic,String title) Constructor. |
|
| void |
AddResource(NpsResource resource) Attach resource to this article. Custom Datasource NOT supported. |
| boolean |
IsPublished() whether it is already published or not. “true”: yes “false”: no |
| boolean |
HasField(String name) whether it contains field or not. “true”: yes “false”: no |
| Object |
GetFieldValue(String name) return to the field value designated by “name” Text content will return “string” object while others will return relevant digital type, character string type and date type according to database’s definition. |
| String |
GetFieldValueFormatted(String name,String format) Format and return the field value designated by “name” according to the requirement of “format”. |
| String |
GetFieldValueLimitted(String name,int wordcount) return to the front “wordcount” value among field values designated by “name”. Digits will not be truncated. “wordcount<=0”: it will return to the whole field value. |
| void |
SetCustomField(String name,String value) AddCustomField(String name,String value) Set customized field value. If not exist, then create a new one. |
| NpsAttach[] |
GetAttaches(String suffix,int max) return to the front “max” attachment of suffix-designated attachments. The format of “suffix” can be designated as ".jpg *.bmp", and separated by “;”, “|”, space or TAB. "*.*" indicates it will return all attachments. “max<=0”: indicates it will return to all attachments which can meet requirement. |
| NpsAttach |
GetAttach(int i) return to the attachment of number “i”. |
| NpsAttach |
GetAttachById(String id) return to the attachment whose “id” is designated. |
| NpsArticle |
CopyToTopic(NpsTopic topic) CopyTo(NpsTopic topic) copy article to designated topic of “topic” and return to the copied article. It is not available for self-defined datasource. |
| void |
AddSlaveTopic(NpsTopic topic) Add a slave topic. |
| void |
Save() save articles. Custom Datasource NOT supported. |
| void |
UpdateContent(String content) update content |
| void |
UpdateContentByFile(NpsFile file) update conent by file |
| void |
Submit() Submit this article to approve. Custom Datasource NOT supported. |
| void |
Build() publish article,but topic pages template not built. |
| void |
BuildAllTopics() Build all related topics' page template. |
| void |
Cancel(boolean bResetPublishdate) cancel article. If bResetPublishdate is true, then empty the publish date field value. |
| void |
Delete() delete article |
| void |
Index(int mode) Submit/Remove index to Solr.mode=0 means to add or update;mode=1 means to remove index from solr. ATTENTION:Before indexing to solr,you must set SOLR's url in nps.conf and check the "Building a full-text index for the web" option on for this site. Method such as Build(),Cancel(),Delete() will submit/remove fulltext index to solr automatically. |
| void |
Clear() delete all temporary files. |