Reference of IAdminWebPlugin
Description of IAdminWebPlugin. IAdminWebPlugin is in Plugin V4.1 and above.
In plug-in, developers can use internal API of adminWeb.
IPTTPlugin4
IVideoPlugin3
IPublicGWPlugin
PTTUser
| customerId | Company ID. Normally it is always 1. |
| nDBID | The user's ID in TB_User |
| strID | The user's login ID |
| strPlainPassword | The user's login password. default it is empty. |
| strName | The user's name |
| strEmail | The user's email address if the user has it |
| strPhoneNumber | The user's phone number if the user has it. |
| Description | Login user's information |
ICallback
In plug-in, a developer can use internal API of IAdminWebPlugin server.
getDBConnection
| Connection getDBConnection() |
| Return | java.sql.Connection |
| Description | Get DB connection from DB connection pool in server. |
| Common library version | 4.1.x |
sendEmail
| void sendEmail(String toEmailID, String title, String content) |
| toEmailID | receiver's email ID. |
| title | email title. |
| content | email content. |
| Description | send email to a user. An operator must set up email in setup of adminWeb |
| Common library version | 4.1.x |
writeLog
| void writeLog(String message) |
| message | log message |
| Description | Write log in Tomcat log |
| Common library version | 4.1.x |
writeErrorLog
| void writeErrorLog(String message) |
| message | log message |
| Description | Write error log in Tomcat log |
| Common library version | 4.1.x |
OnInitialized
| void OnInitialized() |
| Description | Notify initialized to adminWeb. |
| Common library version | 4.1.x |
IAdminWebPlugin
getInterfaceVersion
| int getInterfaceVersion() |
| Return | most be retured INTERFACE_VERSION |
| Description | Notify plug-in's INTERFACE version |
| Common library version | 4.1.x |
getType
| int getType() |
| Return | most be retured TYPE_GENERAL_PLUGIN |
| Description | Notify plug-in's type |
| Common library version | 4.1.x |
initialize
| boolean initialize(String arg) |
| Return | result of initialize |
| Description | initialize plug-in |
| Common library version | 4.1.x |
autheticate
| String autheticate(PTTUser user, String hashedPassword, boolean passwordVerified, String device, String os, String app, String peerIp, String token |
| user | current seesion's user information |
| hashedPassword | user input password by sha512 |
| passwordVerified | user input password is verified |
| device | user's device |
| os | user's OS |
| app | user's App information |
| peerIp | user's IP |
| token |
AuthToken: user input token+[','+other auth token], ex) "1234" or "1234,01012341234"
"retry": have to send 2FA(Two-Factor Authentication) token again. (Please note ProPTT2 app don't support it yet)
|
| Response |
"success": authetication success
"failure": authetication failure
"required": a 2FA(Two-Factor Authentication) key is required
"sessionKey": generated one time session key.
|
| Description | check user's authetication |
| Common library version | 4.1.x |
OnError
| void OnError(int errCode, String jsonParams) |
| errCode | error code. not defined |
| jsonParams | extended parameters |
| Description | fired error |
| Common library version | 4.1.x |
OnExtenedEvent
| void OnExtenedEvent(String cmdName, String jsonParams) |
| cmdName | commend name. not defined |
| jsonParams | extended parameters |
| Description | Fired an extended event |
| Common library version | 4.1.x |