外部系统到Dolibarr的接口: Difference between revisions

Jump to navigation Jump to search
no edit summary
m (Adding interlang links (links to translated versions of this page in other languages) triggered by origin English page "Interfaces_from_foreign_systems_toward_Dolibarr" update.)
No edit summary
Line 1: Line 1:
<!-- BEGIN interlang links -->
{{TemplateDocDevZh}}
<!-- Do NOT edit this section
有三种方法允许外部应用程序将数据插入 Dolibarr(有关允许Dolibarr将数据插入外部系统的方法,请参阅  [[Interfaces Dolibarr toward foreign systems]] 页面。
    Links below are automatically managed by PolyglotBot
    You can edit links on the English source page : Interfaces_from_foreign_systems_toward_Dolibarr -->
[[en:Interfaces_from_foreign_systems_toward_Dolibarr]]
[[fr:Interfaces_Exterieur_vers_Dolibarr]]
[[es:Interfaces_del_Exterior_hacia_Dolibarr]]
<!-- END interlang links -->


{{TemplateDocDevZh}}
要从外部作用于Dolibarr,有三种可能的技术:
There are 3 methods to allow an external application to insert data into Dolibarr (For information on the other direction and allow Dolibarr to insert datas into external systems, see page [[Interfaces Dolibarr toward foreign systems]]).


To act on Dolibarr from external system, there is 3 possible solutions:


=将数据直接插入数据库=
此解决方案需要知道物理模型和字段的允许值。这是有风险的,如果Dolibarr的数据库设计发生变化,则必须重写。


= Insert data directly into database =
'''优点:''' 可以用任何语言实现。
This solution requires knowledge of the physical model and the allowed values of the fields. It is risky and should be rewritten if modified format based Dolibarr.


'''Advantages:''' Can be made in any language.
'''缺点:''' 强烈建议不要使用这种技术。在对Dolibarr进行版本升级后,该方法可能不再起作用,需要重写。此外,使用此方法将绕过业务验证规则,从而产生数据损坏的风险。该方法还需要了解 Dolibarr 数据库。


'''Disadvantage:''' This technique is highly discouraged. At the first upgrade of Dolibarr version, this method will not work and will need to be rewritten. Moreover, using this method, you override the business rules validations, which creates a risk of corrupting data. This method also needs to know the basis Dolibarr.
=使用 PHP 类=
可以使用Dolibarr的业务对象(xxx.class.php文件)。每个文件都提供了一个类,其中包含以下方法:


= Using PHP classes =
*检索实体(fetch 方法)
It is possible to use business objects Dolibarr (xxx.class.php files). Each of these files provides a class of methods for:
*插入实体到数据库中(create或insert方法)
* reading of an entity (the fetch method)
*更新实体(update 方法)
* insertion into database of an entity (the create method or insert)
*删除实体(delete 方法),如果适用于对象
* updating an entity (the update method)
*特定于被操纵实体的其他各种方法。
* deletion of an entity (the delete method) if applicable to the object
* various other methods specific to the entity manipulated.


This technique is better than first one.
这种技术比前一种技术更可取。


'''Advantages:''' It offers the advantage of passing through layers of data validation business. The interface code should normally not be rewritten when upgrading version Dolibarr.
'''优点:''' 它提供了使用数据业务验证层的优势。如果Dolibarr版本升级,通常不需要重写接口代码。


'''Disadvantages:''' It is usable in PHP only. Your code must be stored on the same server as the Dolibarr files.
'''缺点:''' 它只能在PHP语言中使用。您的代码必须与Dolibarr文件位于同一台服务器上。


See page [[Business Objects]].
请参阅 [[业务对象]] 页面。


= Web services =
=Web services=
See [[Module Web Services REST|Module Web Services API REST]] and [[Module Web Services|Module Web Services API SOAP]].
See [[Module Web Services REST|Module Web Services API REST]] and [[Module Web Services|Module Web Services API SOAP]].


The REST APIs are those used by the Automation tools nocode platforms.
The REST APIs are those used by the Automation tools nocode platforms.


= See also =
=See also=
* [[Hooks system]]
 
* [[Triggers]]
*[[Hooks system]]
* [[Interfaces Dolibarr toward foreign systems]]
*[[Triggers]]
*[[Interfaces Dolibarr toward foreign systems]]
714

edits

Navigation menu