IFS筆記

一、 Foundation 1定义
Foundation1包括了一系列的编译、开发、管理工具,也就是说,如果想了解 Foundation1就需要了解如下所说明的一系列工具:
 以模块化的系统架构、开发、管理环境和IFS应用程序的Runtime
 一系列的开发工具,标准化的、允许并行、独立的、模块化的开发基础
 依赖于面向对象编程的观念,快速应用程序开发(RAD)环境,使用的技术如下:
 UML(Rational Rose)定义业务逻辑模型
 IFS Design用于快速地创建业务逻辑和数据对象定义
 IFS Developer(Centura)用于快速的创建应用程序使用窗口和操作
 可重复使用的原型定义,允许快速对需求进行处理
 IFS Info Service和Report Builder允许快速的设计报表
 方便的开发、安装管理工具,以及应用程序管理的系统工具
 Windows的窗口开发工具和大量的类库以供使用
 快速的本地化工具,包括对客户端和服务器端的字典生成
 Foundation1的应用程序服务包括如下:
 业务逻辑层支持应用逻辑,直接和Oracle的数据库整合
 消息处理层(IAL)方便外部应用程序对数据的使用要求,同时支持外部工具对数据的处理
 Localization支持本地化
 IFS事件服务器驱动外部应用程序
 方便和其他IFS数据库实例的连接
 在系统层、业务逻辑层、应用数据层对权限进行详细的设置
 支持开发环境的实时调试,对应用程序的处理流程进行跟踪
 基于Centura的开发环境包括如下内容:
 丰富的类库支持快速的创建应用程序窗口,以及其它图形化的程序
 IFS F1的属性设置工具,可以和业务逻辑、应用数据结合,快速的设置基础属性、操作
 实时的支持最终用户的权限设置
 通过IFS Print Server支持快速的前台报表打印和后台报表集中处理
 输出通道支持快速的把数据导出到其它软件中进行处理,例如:Word,Excel或Notepad等
 基于SQL Query的快速报表方便对数据的汇总统计
 控制台显示信息方便对数据流进行跟踪,对错误信息进行调试
 类似Window的操作环境和导航条式的软件操作、方便的保存用户的使用习惯,更有利用户的使用
 IFS事件服务器可以和外部其它工具结合,例如email,net message,SMS或其它所有可以执行的工具
 打印服务器方便集中对报表进行处理,或预先定义不同报表、不同用户的报表处理方向
=================================================================
       centura
=================================================================
SalSendMsg()
SalPostMsg()
SalSendMessageToChildren()
==================================================================
       IFS
==================================================================
一创建MDI Window: mdiFndDem
二利用Function执行下列Code
Message Actions
On PM_UserLoginOk
Call Navigator.Load( TEXT_NAV_FndDem, strNULL, NAVIGATOR_Parent, NAVIGATOR_Root, 'FNDDEM')
Call Navigator.Load( TEXT_NAV_CustomerInvoice, 'frmDemoCustomerAndOrderOnTab',NAVIGATOR_Child,
         'DEMORD.InvoiceNav', 'DEMORD.CustomerAndOrder2')
---函数功能:为浏览器添加菜单
---参数1:TEXT_NAV_FndDem /TEXT_NAV_CustomerInvoice,表示常量,应该设置成浏览器菜单名
   String: TEXT_NAV_CustomerInvoice=    'TEXT_NAV_CustomerInvoice: Customer Info/Invoice'
---参数2:'frmDemoCustomerAndOrderOnTab' 表示窗口名字
      strNULL 表示是一个文件夹
---参数3: NAVIGATOR_Child 表示添加的菜单是一个窗口
      NAVIGATOR_Parent 表示添加的菜单是一个文件夹
---参数4:NAVIGATOR_Root 表示添加的菜单是一个根目录
      'DEMORD.InvoiceNav' 表示添加的菜单是在菜单ID('DEMORD.InvoiceNav')之下
---参数5:'FNDDEM':表示添加的菜单ID
      'DEMORD.CustomerAndOrder2'表示添加的菜单ID
____________________________________________________________________________
  
On PM_ApplicationInit
Call Component.WindowRegister( 'frmDemoCustomerAndOrderOnTab', 'DemoCustomer', 'DEMO_CUSTOMER', FALSE, strNULL)
---函数功能:注册窗口,使其他窗口可以知道这个窗口的存在,就可以调用
---参数1:窗口名称
---参数2:LU名称
---参数3:VIEW名称
---参数4:固定为FALSE
---参数5:固定为strNULL
____________________________________________________________________________
---状态菜单
Menu Item: Invoice
Resource Id: 44062
Keyboard Accelerator: (none)
Status Text:
Menu Settings
---当当前可以做Invoice这个动作时,菜单有效
   Enabled when: SalSendMsg( i_hWndFrame, PM_DataRecordStateEvent, METHOD_Inquire, SalHStringToNumber( 'Invoice' ) )
   Checked when:
Menu Actions
---执行Invoice这个动作
   Call PostMessage ( i_hWndFrame, PM_DataRecordStateEvent, METHOD_Execute,   'Invoice' )
______________________________________________________________________________
我们把应用程序安装的Oracle用户称作 IFS Application Owner,其它的用户调用后台对象必须通过schemaname.tablename的形式进行调用。
为了避免这些,系统提供了两个预定义的方式进行替代:
&AO(如上面所使用的例子)
c_sDbPrefix
_________________________________________________________________________
客户端调用Server端的过程或是函数
Call DbPLSQLBlock(c_hSql,'Demo_Customer_API.Check_Credit(:i_hWndFrma.frmCustomer.dfsCusromerID)
最好使用下列方式
Set sFullNmae = ':i_hWndFrme.'||QualifiedItemNmaeGet(hWndForm)
Set sStmt = sFullName||".nAllowed:=&AO.Customer_Order_Flow_API.Deliver_Line_Allowed__("||sFullNmae ||".colsOrderNo")"
-----调用过程   execute
Call DbPLSQLTransaction( c_hSql, 'Some_API.Update( :id )' )
-----调用函数   select
Call DbPLSQLBlock( c_hSql,
'BEGIN
    Some_API.Get_Description( :id, :desc );
    Some_API_Get_Price( :id, :price);
END;' )
______________________________________________________________________________
-----修改dfdtOrderDate 值后,需要调用下列函数更新用户端显示
Call dfdtOrderDate.EditDataItemSetEdited( )
______________________________________________________________________________
-----这个是做刷新的动作,就是有返回值的时候我们要刷新
Call SalSendClassMessage(PM_DataSourceRefresh,,wParam, lParam )
______________________________________________________________________________
右键菜单
Menu Item: &Modify Price..
Resource Id: 38274
Keyboard Accelerator: (none)
Status Text:
Menu Settings
   Enabled when: SalSendMsg( hWndForm, PM_UserMethod, METHOD_Inquire,   SalHStringToNumber( 'ModifyPrice' ))
   Checked when:
Menu Actions
   Return SalSendMsg( hWndForm, PM_UserMethod, METHOD_Execute,   SalHStringToNumber( 'ModifyPrice' ))
   ! Call SalModalDialog ( dlgDemoModifyPrice, hWndForm, sUserId, sUserName, sUserTypeName, nBorrowedNum)
Menu Item Name:
Function: UserMethod
Description:
Returns
   Boolean:
Parameters
   Number: nWhat
   String: sMethod
Static Variables
Local variables
   Number: nIndex
Actions
   Select Case nWhat
    Case METHOD_Inquire
     If sMethod = 'ModifyPrice'
      Set nIndex = TBL_MinRow
      If SalTblFindNextRow( hWndForm, nIndex, ROW_Selected, 0)
       If SalTblFindNextRow( hWndForm, nIndex, ROW_Selected, 0)
        Return FALSE
       ! Return TRUE
       Return Security.IsMethodAvailable('DEMO_JUN_CO_LINE_API.update_price')
      Return FALSE
      ! Return TRUE
     Else If sMethod= 'Update'
      If SalTblAnyRows(hWndForm,ROW_Selected,0) AND Security.IsViewAvailable('DEMO_JUN_CO_LINE')
       Return TRUE
      Else
       Return FALSE
     Else
      Return FALSE
    Case METHOD_Execute
     If sMethod = 'ModifyPrice'
      Set sOrderNo = colsOrderNo
      Set nLine = colnLine
      Set sCatalogNo =   colsCatalogNo
      Set nQty = colnQty
      Set sUnit = colsUnit
      ! Set nPrice = colnPrice
      Call SalModalDialog ( dlgDemoModifyPrice, hWndForm, sOrderNo, nLine, sCatalogNo, nQty,sUnit)
     Else If sMethod= 'Update'
      Call Update(nWhat)
      Call SalSendClassMessage( PM_DataSourceRefresh, wParam, lParam )
     Else
      Return FALSE
   Return FALSE
______________________________________________________________________________
----- 更新数据源
Call SalSendMsg( tbwJunOrderLine , PM_DataSourceRefresh, METHOD_Execute, 0 )
______________________________________________________________________________
----- 设置默认值
Function: FrameStartupUser
Description:
Returns
   Boolean:
   ! Applications should return FALSE to skip standard window startup logic (such
     as exectuing the "startup behavior" settings), or TRUE to allow standard logic.
Parameters
Static Variables
Local variables
Actions
   Set dfsOrderNo = spOrder
   Set dfnLine = npLine
   Set dfsCatalogNo = spCatalogNo
   Set dfdWantedDeliveryDate = dpDelivery
   Set dfsUnit = spUnit
______________________________________________________________________
-----
Function: UserMethod
Description:
Returns
   Number:
   ! When nWhat = METHOD_Inquire: the return value should be TRUE if the
     method is available (possible to execute), FALSE otherwise.
     When nWhat = METHOD_Execute: the return value should be TRUE if the method
     is completed sucessfully, FALSE otherwise.
Parameters
   Number: nWhat
    ! Standard method parameter
      Standard method parameter. Possible values are METHOD_Inquire, METHOD_Execute, METHOD_GetType
   String: sMethod
    ! Method name
      Name of the method to be executed.
Static Variables
Local variables
   Number: nRow
Actions
   Select Case nWhat
    Case METHOD_Inquire
     If (sMethod = 'Ok' )
      Return TRUE
     If sMethod = 'Cancel'
      Return TRUE
     ! If sMethod = 'List'
      Return SalSendMsg( hWndFocusField, PM_DataItemLov, METHOD_Inquire, 0 )
     Return FALSE
    Case METHOD_Execute
     If (sMethod = 'Ok')
      ! Return SalSendMsg( hWndForm, PM_DataSourceSave, METHOD_Execute, 0 )
      Return Ok( )
     If sMethod = 'Cancel'
      Return SalEndDialog( hWndForm, IDCANCEL )
     ! If sMethod = 'List'
      Call SalSendMsg( hWndFocusField, PM_DataItemLov, METHOD_Execute, 0 )
      Call SalSetFocus( hWndFocusField )
      Return TRUE
     Return FALSE
---
Function: Ok
Description:
Returns
   Boolean:
Parameters
Static Variables
Local variables
Actions
   Call SalWaitCursor ( TRUE )
   ! Set lsStmt = SalNumberToHString (40)
   Set lsStmt = '&AO.DEMO_JUN_CO_LINE_API.Update_Delivery( ' ||
      ':i_hWndFrame.dlgUpdateDelivery.dfsOrderNo, ' ||
      ':i_hWndFrame.dlgUpdateDelivery.dfnLine, ' ||
      ':i_hWndFrame.dlgUpdateDelivery.dfdWantedDeliveryDate)'
   Call DbPLSQLTransaction( c_hSql, lsStmt)
   Call SalWaitCursor ( FALSE )
   Call SalSendMsg( tbwJunOrderLine , PM_DataSourceRefresh, METHOD_Execute, 0 )
   Return SalEndDialog( hWndForm, IDOK )
__________________________________________ 屏蔽新增
窗口变量
Number: nMessage
Number: nRow
Window Handle: hWndCol
屏蔽新增
On PM_DataRecordNew
If wParam = METHOD_Inquire
   If (i_hWndParent.frmChangeInvLocation.dfsState = strNULL)   or (i_hWndParent.frmChangeInvLocation.dfsState = 'Closed') or (i_hWndParent.frmChangeInvLocation.dfsState = 'Cancelled')
    Return FALSE
   Else
    Return SalSendClassMessage(PM_DataRecordNew,wParam,lParam)
Set nMessage = SalSendClassMessage(PM_DataRecordNew, wParam, lParam)
If nMessage AND wParam = METHOD_Execute
   Call SalTblQueryFocus( hWndForm, nRow, hWndCol )
   Call SalTblSetFocusCell ( hWndForm, nRow, colsPartNo, 0, -1 )
   ! Set lsBlanketDate = i_hWndParent.frmPurchaseOrder.dfsBlanketDateDb
   ! Set sDueDateDb = i_hWndParent.frmPurchaseOrder.sDueDateDb
Return nMessage
______________________________________ 消息
----利用检查值有效性更新汇总价格
   On PM_DataItemValidate
   Set colSum = colnQty*colnPrice
   Return VALIDATE_Ok
On PM_DataItemValidate
Call DbPLSQLBlock(c_hSql,'BEGIN
       :i_hWndFrame.frmProductionMove.tblProductionMoveLine.colnOnhand :=
       &AO.INVENTORY_PART_IN_STOCK_API.Get_Inventory_Qty_Onhand       (:i_hWndFrame.frmProductionMove.tblProductionMoveLine.colsContract,
        :i_hWndFrame.frmProductionMove.tblProductionMoveLine.colsPartNo,Null);
       END;')
Call colnOnhand.EditDataItemSetEdited()
Return VALIDATE_Ok
___________________________________________ 更新整个界面数据源
On PM_DataSourceSave
Return SalSendClassMessage( PM_DataSourceRefresh, wParam, lParam )
--没有下拉框
===========================================================================
      PLSQL
===========================================================================
-----添加字段到默认值 Prepare_Insert___
Client_SYS.Set_Item_Value('DEMO_JUN_CUSTOMER_TYPE', 'External', attr_);
-----利用PLSQL刷新客户端值
Client_SYS.Add_To_Attr('ORDER_NO', newrec_.order_no, attr_);
-----状态机
Finite_State_Machine___
-----出错消息框
Error_SYS.Record_General(lu_name_, 'QUOTATION_ERROR: Error while retrieving the next free quotation number. Check coordinator groups');
=============================================================================
      菜单调用水晶报表,参数传递
=============================================================================
InfoService.QuickReportStart(SalNumberToStrX(41,0)||'@CONTRACT='|| hWndForm.frmInventoryPart.dfsContract||'^PART_NO='|| hWndForm.frmInventoryPart.ecmbPartNo.i_sMyValue)
A Definition of Foundation1
Foundation1 is a term that encompasses all aspects of how IFS builds and distributes application software solutions. The meaning of Foundation1 must be understood in the context in which it is used. Foundation1 is:
A system architecture for component based development, deployment, administration, and runtime of IFS Applications.
A set of development tools, standards, and processes to allow parallel independent component development.
A Rapid Application Development (RAD) environment based on Object-Oriented theory and techniques using: The Rational Rose modeling tool with Unified Modeling Language (UML) to define the business problem.
The IFS Design tool for rapid creation of Business Logic and Database object definitions.
The IFS Develop tool for rapid creation of Application Windows Client code.
An iterative approach to development using early prototyping of the application, followed by refinement of requirements and specifications based on the prototype. A set of tools for deployment (installation), and administration of an operational IFS system.
Tools and Class Library for Windows Client development and runtime.
Tools and runtime support for Localization of Client and Server.
A Quality Distribution System (QDS) based on CA CCC/Harvest for Life Cycle management of Source Code, Version Control, and Customer Fittings.
Foundation1 Application Server Software that provides: Business Logic Layer support for Application Logic and interaction with an Oracle Database.
Support for Report creation and archival.
An Information Access Layer (IAL) to present information extracted from data to end users and end user tools.
Localization support for runtime translations.
Support for Application defined 'Events' which may be connected to an 'Action' to interact with the outside world, typically through the IFS Event Server or IFS Connect 2.x.
Connectivity to other IFS instances.
Connectivity and Messaging to non-IFS Applications.
Support for Security to control access to the system, business logic, and application data.
Support during the development cycle for debugging of applications including tracing and debug messaging. Foundation1 Windows Client Software based on Centura Team Developer that provides: A Class Library for rapid creation of MDI Windows, Application Forms and other graphical objects.
A Foundation Properties tool for rapid development of client applications by connecting client objects to business logic and application data.
Runtime Security support to manage end user access.
Support for creation of Standard Reports and foreground printing, or background printing via IFS Print Server.
Output Channel support to allow direction of data in Client Windows objects to other Windows based applications such as Excel, Word, and Notepad.
Quick Reports support for running basic reports based on a predefined SQL query.
Support during the development cycle for debugging of applications. Includes a 'Console' for tracing client interaction with the server as well as full debug functionality for client code.
A look and feel that integrates seamlessly into a Windows environment in terms of navigation and appearance. Foundation1 Event Server Software to provide application access to external actions such as email, net messages, and other utility functions.
Foundation1 Print Server Software to provide background creation and printing of Reports.
A philosophy…a way of thinking…a way of doing things.

你可能感兴趣的:(windows,application,报表,menu,localization,printing)