4D v16.3Project method properties |
||
|
4D v16.3
Project method properties
Project method properties
After creating a project method, you can rename it and modify its properties. Project method properties mainly concern their access and security conditions (access by users, integrated servers or services) as well as their execution mode. The other types of methods do not have specific properties. Their properties are related to those of the objects to which they are attached. To modify the properties of a project method:
Note: A batch setting function can be used to modify a property for all or part of the database project methods in a single operation (see Batch setting for method attributes). You can change the name of a project method in the "Name" area of the Method properties window or in the Explorer. The new name must comply with 4D naming rules (see Identifiers in the 4D Language Reference manual). If a method with the same name already exists, 4D displays a message saying that the method name has already been used. If necessary, 4D resorts the list of methods again. Warning: Changing the name of a method already used in the database can invalidate any methods or formulas that use the old method name and runs the risk of disrupting application functioning. You can rename the method manually but it is strongly recommended to use the renaming function for project methods, described in Renaming. With this function, you can automatically update the name wherever the method is called throughout the Design environment. With 4D Server, the method name is changed on the server when you finish editing it. If more than one user is modifying the method name at the same time, the final method name will be the name specified by the last user to finish editing it. You may want to specify a method owner so that only certain users can change the method’s name Note: Database methods cannot be renamed. The same goes for triggers, form methods, and object methods, which are bound to objects and take their names from the object concerned. You can control how project methods are used and/or called in different contexts using attributes. Note that you can set attributes for an entire selection of project methods using the Explorer (see following section). If you do not want users to be able to run a project method using the Method... command of the Run menu, you can make it Invisible by checking this option. An invisible method does not appear in the method execution dialog box (see From the Execute Method dialog box). When you make a project method invisible, it is still available to database programmers. It remains listed on the Current form table of the Explorer and in the list of routines in the Method editor. This attribute is used within the framework of components. When it is checked, it indicates that the method will be available to components when the application is used as the host database. On the other hand, when the application is used as a component, the method will be available to the host databases. For more information about components, refer to the Developing and installing 4D components chapter. This attribute is only taken into account for a 4D application in client/server mode. When this option is checked, the project method is always executed on the server, regardless of how it is called. For more information about this option, refer to Execute on Server attribute in the 4D Server Reference Manual. This option allows you to declare the method eligible for execution in preemptive mode. By default, 4D executes all the project methods of your applications in cooperative mode. If you want to benefit from the preemptive mode feature, you must explicitly declare all the methods that you want to be started in preemptive mode. The compiler will then check that these methods are actually thread-safe. Note: Execution in preemptive mode is only available in 64-bit versions of 4D in compiled mode. For more information, refer to the Preemptive 4D processes section. The following options are provided:
Availability attributes specify the external services which are allowed to explicitly call the method. This attribute lets you publish the current method as a Web Service accessible via SOAP requests. For more information, refer to the Publication and use of Web Services chapter. When this option is checked, the Published in WSDL option is enabled. In the Explorer, project methods that are offered as a Web Service are given a specific icon . Note: You cannot publish a method as a Web service if its name includes characters that do not comply with XML nomenclature (e.g. containing spaces). If the method name is not in keeping with this, 4D does not assign the property. This attribute is only available when the "Web Service" attribute is checked. It lets you include the current method in the WSDL of the 4D application. For more information about this, refer to Generation of the WSDL. In the Explorer, project methods that are offered as a Web Service and published in WSDL are given a specific icon . This option is used to reinforce 4D Web server security: when it is not checked, the project method cannot be executed via an HTTP request containing the special 4DACTION URL used for calling 4D methods (as well as the former 4DMETHOD URL), nor the special 4DSCRIPT, 4DTEXT and 4DHTML tags (as well as the former 4DVAR and 4DHTMLVAR tags). For more information, refer to URLs and Form Actions and 4D HTML Tags in the 4D Language Reference manual. In the Explorer, project methods with this attribute are given a specific icon . For security reasons, this option is unchecked by default. Each method that can be executed using the special Web URL or tags must be indicated individually. When it is checked, this option allows the project method to be executed by the SQL engine of 4D. By default, it is not selected, which means that, unless explicitly authorized, 4D project methods are protected and cannot be called by the SQL engine of 4D. This property applies to all internal and external SQL queries — executed via the ODBC driver, SQL code inserted between the Begin SQL/End SQL tags or the QUERY BY SQL command. Notes:
For more information, refer to 4D SQL engine implementation in the 4D SQL manual. This option configures the availability and scope of action for the method as part of a 4D Mobile link with a Wakanda server. For more information about this option, refer to Configuring the 4D Database in the 4D Mobile manual. You can control access to methods by setting Access and Owner privileges for groups of users. For information about creating a password access system with users and groups, refer to the Users and groups chapter.
Users who are assigned to both groups can use or modify the method without restriction. Using the "Attributes for methods" dialog box, you can modify an attribute (Invisible, Offered as a Web Service, etc.) for all or part of the database project methods in a single operation. This feature is especially useful for modifying the attributes of a large number of project methods. It can also be used during development to apply common attributes to groups of similar methods quickly. For batch setting of method attributes:
|
PROPERTIES
Product: 4D
HISTORY
Modified: 4D v15 R5 ARTICLE USAGE
4D Design Reference ( 4D v16) |