WebFioriAPI ReferenceLearnDownloadContributeLearn{{result.parent_page}} > {{result.title}}{{result.title}}Classes{{result.class_name}}{{result.summary}}Methods{{result.name}}{{result.summary}}

namespace \webfiori\framework

abstract class ExtendedWebServicesManager

Class Methods Summary

public function __construct(string$version)Creates new instance of 'API'.public function actionNotImpl()Sends a response message to indicate that an action is not implemented.public function actionNotSupported()Sends a response message to indicate that an action is not supported by the API.public function contentTypeNotSupported(unkown_type$cType )Sends a response message to indicate that request content type is not supported by the API.public function createLangDir(string$dir)Creates a sub array to define language variables.public function databaseErr(JsonI|Json|DB|string$info)Sends a response message to indicate that a database error has occur.public function get(string$dir)Returns the value of a language variable.public function getAuthorizationHeader()Returns an associative array that contains HTTP authorization header content.public function getTranslation()Returns the language instance which is linked with the API instance.public function invParams()Sends a response message to indicate that a request parameter(s) have invalid values.public function missingParams()Sends a response message to indicate that a request parameter or parameters are missing.public function notAuth()Sends a response message to indicate that a user is not authorized to do an API call.public function registerServices(string$pathToScan)Auto-register services tables which exist on a specific directory.public function requestMethodNotAllowed()Sends a response message to indicate that request method is not supported.public function setLangVars(string$dir, array$arr)Sets multiple language variables.

Class Methods Details

public function __construct(string$version)Creates new instance of 'API'.

Parameters:

  • string $version initial API version. Default is '1.0.0'.
public function actionNotImpl()
Sends a response message to indicate that an action is not implemented. This method will send back a JSON string in the following format:

{
  "message":"Action not implemented.",
  "type":"error",
}

In addition to the message, The response will sent HTTP code 404 - Not Found. Note that the content of the field "message" might differ. It depends on the language. If no language is selected or language is not supported, The language that will be used is the language that was set as default language in the class 'SiteConfig'.
public function actionNotSupported()
Sends a response message to indicate that an action is not supported by the API. This method will send back a JSON string in the following format:

{
  "message":"Action not supported",
  "type":"error"
}

In addition to the message, The response will sent HTTP code 404 - Not Found. Note that the content of the field "message" might differ. It depends on the language. If no language is selected or language is not supported, The language that will be used is the language that was set as default language in the class 'SiteConfig'.
public function contentTypeNotSupported(unkown_type$cType )
Sends a response message to indicate that request content type is not supported by the API. This method will send back a JSON string in the following format:

{
  "message":"Content type not supported.",
  "type":"error",
  "request-content-type":"content_type"
}

In addition to the message, The response will sent HTTP code 404 - Not Found. Note that the content of the field "message" might differ. It depends on the language. If no language is selected or language is not supported, The language that will be used is the language that was set as default language in the class 'SiteConfig'.

Parameters:

  • unkown_type $cType
public function createLangDir(string$dir)Creates a sub array to define language variables. An example: if the given string is 'general', an array with key name 'general' will be created. Another example is if the given string is 'pages/login', two arrays will be created. The top one will have the key value 'pages' and another one inside the pages array with key value 'login'.

Parameters:

  • string $dir A string that looks like a directory.
public function databaseErr(JsonI|Json|DB|string$info)
Sends a response message to indicate that a database error has occur. This method will send back a JSON string in the following format:

{
  "message":"a_message",
  "type":"error",
  "err-info":OTHER_DATA
}

In here, 'OTHER_DATA' can be a basic string. Also, The response will sent HTTP code 404 - Not Found.

Parameters:

  • JsonI|Json|DB|string $info An object of type JsonI or Json that describe the error in more details. Also it can be a simple string. Also, this parameter can be a database instance that contains database error information. Note that the content of the field "message" might differ. It depends on the language. If no language is selected or language is not supported, The language that will be used is the language that was set as default language in the class 'SiteConfig'.
public function get(string$dir)Returns the value of a language variable.

Parameters:

  • string $dir A directory to the language variable (such as 'pages/login/login-label').
Returns: string|arrayIf the given directory represents a label, the method will return its value. If it represents an array, the array will be returned. If nothing was found, the returned value will be the passed value to the method.
public function getAuthorizationHeader()
Returns an associative array that contains HTTP authorization header content. The generated associative array will have two indices:
  • type: Type of authorization (e.g. basic, bearer )
  • credentials: Depending on authorization type, this field will have different values.
Note that if no authorization header is sent, The two indices will be empty.
Returns: arrayAn associative array.
public function getTranslation()Returns the language instance which is linked with the API instance. Returns: Languagean instance of the class 'Language'.public function invParams()
Sends a response message to indicate that a request parameter(s) have invalid values. This method will send back a JSON string in the following format:

{
  "message":"The following parameter(s) has invalid values: 'param_1', 'param_2', 'param_n'",
  "type":"error"
}

In addition to the message, The response will sent HTTP code 404 - Not Found. Note that the content of the field "message" might differ. It depends on the language. If no language is selected or language is not supported, The language that will be used is the language that was set as default language in the class 'SiteConfig'.
public function missingParams()
Sends a response message to indicate that a request parameter or parameters are missing. This method will send back a JSON string in the following format:

{
  "message":"The following required parameter(s) where missing from the request body: 'param_1', 'param_2', 'param_n'",
  "type":"error",
}

In addition to the message, The response will sent HTTP code 404 - Not Found. Note that the content of the field "message" might differ. It depends on the language. If no language is selected or language is not supported, The language that will be used is the language that was set as default language in the class 'SiteConfig'.
public function notAuth()
Sends a response message to indicate that a user is not authorized to do an API call. This method will send back a JSON string in the following format:

{
  "message":"Not authorized",
  "type":"error"
}

In addition to the message, The response will sent HTTP code 401 - Not Authorized. Note that the content of the field "message" might differ. It depends on the language. If no language is selected or language is not supported, The language that will be used is the language that was set as default language in the class 'SiteConfig'.
public function registerServices(string$pathToScan)Auto-register services tables which exist on a specific directory. Note that the statement 'return __NAMESPACE__' should be included at the end of service class for auto-register to work. If the statement does not exist, the method will assume that the path is the namespace of each class. Also, the classes which represents web services must be suffixed with the word 'Service' in order to register them (e.g. RegisterUserService).

Parameters:

  • string $pathToScan A path which is relative to application source code folder. For example, if application folder name is 'my-app' and the web services are in the folder 'my-app/apis/user, then the value of the argument must be 'apis/user'.
public function requestMethodNotAllowed()
Sends a response message to indicate that request method is not supported. This method will send back a JSON string in the following format:

{
  "message":"Method Not Allowed.",
  "type":"error",
}

In addition to the message, The response will sent HTTP code 405 - Method Not Allowed. Note that the content of the field "message" might differ. It depends on the language. If no language is selected or language is not supported, The language that will be used is the language that was set as default language in the class 'SiteConfig'.
public function setLangVars(string$dir, array$arr)Sets multiple language variables.

Parameters:

  • string $dir A string that looks like a directory.
  • array $arr An associative array. The key will act as the variable and the value of the key will act as the variable value.
mdi-menuAll Classesmdi-chevron-leftAnchorBrCodeSnippetHTMLDocHTMLListHTMLNodeHTMLTableHeadNodeInputJsCodeLabelListItemOrderedListParagraphRadioGroupTableCellTableRowUnorderedListInvalidNodeNameExceptionTemplateNotFoundExceptionCaseConverterJsonJsonConverterJsonIJsonTypesPropertyAPIFilterAbstractWebServiceManagerInfoServiceParamTypesRequestRequestParameterResponseUriWebServicesManagerAccessAutoLoaderConfigConfigControllerDBEAbstractWebServiceExtendedWebServicesManagerFileLoggerPrivilegePrivilegesGroupThemeThemeLoaderUploadFileUploaderUserUtilWebFioriAppLanguageErrorBoxHTTPCodeViewMessageBoxServerErrViewStarterPageWebPageDatabaseSessionStorageDefaultSessionStorageMSSQLSessionDataTableMSSQLSessionsTableMySQLSessionDataTableMySQLSessionsTableSessionSessionOperationsSessionStorageSessionsManagerRouterRouterUriAbstractMiddlewareMiddlewareManagerEmailMessageSMTPAccountSMTPServerClassLoaderExceptionFileExceptionInitializationExceptionInvalidCRONExprExceptionMissingLangExceptionNoSuchThemeExceptionRoutingExceptionSMTPExceptionSessionExceptionUIExceptionAbstractJobCronCronEmailCronJobJobArgumentCronLoginViewCronTasksViewCronViewCronLoginServiceCronLogoutServiceCronServicesManagerForceCronExecutionServiceGetJobsServiceCLICLICommandInputStreamOutputStreamStdInStdOutClassWriterLangClassWriterQueryClassWriterServiceHolderThemeClassWriterWebServiceWriterCreateCLIClassHelperCreateCronJobCreateMiddlewareCreateTableCreateTableObjCreateThemeHelperCreateWebServiceAddCommandCreateCommandCronCommandHelpCommandListCronCommandListRoutesCommandListThemesCommandRunSQLQueryCommandSettingsCommandTestRouteCommandUpdateSettingsCommandUpdateTableCommandVersionCommandAbstractQueryColumnColumnFactoryConditionConnectionConnectionInfoDatabaseDatabaseExceptionDateTimeValidatorEntityMapperExpressionForeignKeyJoinTableResultSetSelectExpressionTableWhereExpressionMySQLColumnMySQLConnectionMySQLQueryMySQLTableMSSQLColumnMSSQLConnectionMSSQLQueryMSSQLTableAbstractCollectionComparableLinkedListNodeQueueStack
Powered By: WebFiori Framework, Vue and VuetifyAll Rights Reserved © 2018 - 2024