idempiere-plugin-development

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

iDempiere Plugin Development (OSGi)

iDempiere 插件开发(OSGi)

Objetivo

目标

Implementar cambios en iDempiere con un plugin desacoplado y mantenible:
  • bundle OSGi + build Tycho/Maven consistente,
  • extension points correctos,
  • instalacion reproducible (feature/p2 o mecanismo del proyecto).
通过松耦合且可维护的插件在iDempiere中实现变更:
  • 一致的OSGi bundle + Tycho/Maven构建,
  • 正确的扩展点,
  • 可复现的安装(feature/p2或项目自带机制)。

Antes de tocar codigo

编码前准备

  1. Confirmar el tipo de extension
    • Proceso/Report, Callout, ModelValidator, EventHandler, Form/ZUL, REST/OSGi service, etc.
  2. Confirmar restriccion clave
    • Evitar cambios en core (salvo necesidad justificada y aprobada).
  3. Confirmar alcance de DB
    • Si hay cambios de diccionario/DB, coordinar con
      $idempiere-db-migration
      .
  1. 确认扩展类型
    • 流程/报表、Callout、ModelValidator、EventHandler、Form/ZUL、REST/OSGi服务等。
  2. 确认关键限制
    • 避免修改核心代码(除非有合理且已获批的需求)。
  3. 确认数据库范围
    • 若涉及数据字典/数据库变更,需与
      $idempiere-db-migration
      协作。

Puntos de extension (referencia rapida)

扩展点快速参考

  • Proceso / Reporte: implementar clase (ej:
    SvrProcess
    ) y registrar en
    AD_Process
    (Classname) + menu/role donde aplique.
  • Callout: implementar callout y referenciarlo desde la columna/campo correspondiente (evitar logica pesada y efectos colaterales).
  • ModelValidator: implementar validador y registrarlo como servicio OSGi (preferir patrones ya usados en el repo).
  • Event handler: suscribirse a eventos OSGi/iDempiere segun el mecanismo del proyecto (copiar un handler existente como base).
  • Form / ZUL: empaquetar recursos (ZUL/CSS) en el plugin y registrar el acceso (menu/forma) segun convencion del repo.
  • 流程/报表:实现类(例如:
    SvrProcess
    )并在
    AD_Process
    (Classname)中注册,同时关联对应的菜单/角色。
  • Callout:实现callout并在对应列/字段中引用(避免复杂逻辑和副作用)。
  • ModelValidator:实现验证器并将其注册为OSGi服务(优先采用仓库中已使用的模式)。
  • 事件处理器:根据项目机制订阅OSGi/iDempiere事件(以现有处理器为基础进行复制)。
  • 表单/ZUL:将资源(ZUL/CSS)打包到插件中,并按照仓库约定注册访问路径(菜单/表单)。

Workflow recomendado

推荐工作流

  1. Ubicar el parent/releng del repo
    • Detectar donde se agregan modulos (parent
      pom.xml
      ,
      releng
      ,
      features
      ,
      update-site
      ).
  2. Crear/ajustar el bundle
    • Nombre y paquetes sin colisiones (evitar split packages).
    • Export/Import packages segun necesidad (no exportar por default).
    • Preferir Declarative Services (DS) cuando aplique.
  3. Implementar la extension
    • Registrar lo necesario (plugin.xml, DS, o configuracion en AD_* segun el caso).
    • Mantener codigo testeable y sin dependencias innecesarias.
  4. Integrar al empaquetado
    • Agregar a feature/update-site si el repo lo usa.
    • Versionar y anotar cambios (semver cuando corresponda).
  5. Verificar runtime
    • Confirmar que el bundle queda ACTIVE.
    • Probar el flujo funcional end-to-end en UI.
  1. 定位仓库的parent/releng
    • 确定模块添加位置(parent
      pom.xml
      releng
      features
      update-site
      )。
  2. 创建/调整bundle
    • 名称和包避免冲突(避免拆分包)。
    • 根据需要导出/导入包(默认不导出)。
    • 适用时优先使用声明式服务(DS)。
  3. 实现扩展
    • 完成必要的注册(plugin.xml、DS或根据情况在AD_*中配置)。
    • 保持代码可测试且无不必要的依赖。
  4. 集成到打包流程
    • 若仓库使用特性/更新站点,将其添加进去。
    • 版本化并记录变更(适用时采用语义化版本)。
  5. 验证运行时
    • 确认bundle处于ACTIVE状态。
    • 在UI中进行端到端的功能流程测试。

Checklist rapido

快速检查清单

  • No se toco core (o esta justificado).
  • Bundle compila y resuelve dependencias en OSGi.
  • Extension registrada y ejecuta en runtime.
  • Instrucciones de instalacion/upgrade documentadas.
  • 未修改核心代码(或已合理说明)。
  • Bundle可编译且在OSGi中能解析依赖。
  • 扩展已注册并能在运行时执行。
  • 已记录安装/升级说明。