33
PRIMAVERA v7.50 Integration Manual Integration Manual of External Applications in the PRIMAVERA Administrator Version 1.2 August 2010

PLT 7.00 - Manual de Integração

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: PLT 7.00 - Manual de Integração

PRIMAVERA v7.50

Integration

Manual Integration Manual of External Applications in the PRIMAVERA Administrator

Version 1.2

August 2010

Page 2: PLT 7.00 - Manual de Integração

Integration Manual of External Applications in the PRIMAVERA Administrator

PRIMAVERA Business Software Solutions | Integration Manual v7.50 1

Contents 1. Introduction .......................................................................................................................... 3

2. Nomenclature ........................................................................................................................ 4

2. 1. Abbreviation of the Application .......................................................................................... 4

2. 2. Logical and Physical Name of Components .......................................................................... 5

3. Necessary Components ........................................................................................................... 7

3. 1. Description of Components ............................................................................................... 7

3. 2. Names of Components ..................................................................................................... 7

3. 3. References ..................................................................................................................... 7

3. 4. Binary Compatibility......................................................................................................... 7

4. Windows Registry and Setups .................................................................................................. 8

4. 1. SGE750 – Executive......................................................................................................... 8

4. 2. SGP750 – Professional ..................................................................................................... 8

4. 3. Registration of the Application ........................................................................................... 9

5. Audit .................................................................................................................................. 11

5. 1. Necessary Classes ......................................................................................................... 11

5. 2. cls<Apl>ApplicationOperations ........................................................................................ 11

5. 3. cls<Apl>LogOperations .................................................................................................. 13

5. 4. cls<Apl>DataBases ....................................................................................................... 14

5. 5. Notes ........................................................................................................................... 15

5. 5. 1. Definition of the Hierarchy of Operations ................................................................... 15

5. 5. 2. Applications without Operations ................................................................................ 15

5. 5. 3. Parameters of Methods ............................................................................................ 16

5. 5. 6. Applications without Integrated Databases ................................................................. 17

5. 5. 7. Executable File in the Menu System or Utilities ........................................................... 17

6. Forms ................................................................................................................................. 18

6. 1. Necessary Classes ......................................................................................................... 18

6. 2. cls<Apl>Images ............................................................................................................ 18

6. 3. cls<Apl>Parametrizacoes ............................................................................................... 18

6. 4. cls<Apl>Servicos .......................................................................................................... 20

6. 5. Notes ........................................................................................................................... 21

6. 5. 1. Applications without Parameters or Services .............................................................. 21

6. 5. 2. Parameters of Methods ............................................................................................ 21

7. Platform Features ................................................................................................................. 24

7. 1. Licensing ...................................................................................................................... 24

7. 2. Creation of Companies ................................................................................................... 24

7. 3. Parameters by Application .............................................................................................. 24

7. 4. Parameters by Company ................................................................................................ 24

7. 5. Services / Utilities by Company ....................................................................................... 24

7. 6. Permissions .................................................................................................................. 24

7. 7. Dynamic Permissions ..................................................................................................... 25

7. 8. Log .............................................................................................................................. 25

7. 9. Executable Files in the Menu System................................................................................ 26

Page 3: PLT 7.00 - Manual de Integração

Integration Manual of External Applications in the PRIMAVERA Administrator

PRIMAVERA Business Software Solutions | Integration Manual v7.50 2

7. 10. External Databases ...................................................................................................... 27

8. Prototype ............................................................................................................................ 28

8. 1. Applications .................................................................................................................. 28

8. 2. Companies ................................................................................................................... 29

8. 3. Parameters and Services ............................................................................................... 29

8. 4. Permissions .................................................................................................................. 30

8. 5. Log .............................................................................................................................. 31

8. 6. Executable Files in the Menu System or Utilities ................................................................ 32

8. 7. External Databases in the Administrator ........................................................................... 32

Page 4: PLT 7.00 - Manual de Integração

Integration Manual of External Applications in the PRIMAVERA Administrator

PRIMAVERA Business Software Solutions | Integration Manual v7.50 3

1. Introduction This manual documents the integration of external applicatios - developed by PRIMAVERA partners - in

the PRIMAVERA v7.50 solution (Executive or Professional), namely, in the Administrator, within the

scope of the PRIMAVERA Gold project (Certified Solutions).

In this version of the PRIMAVERA Platform there are no different levels of integration - for example,

applications integrated in the Administrator (ADM) without support for parameters or permissions. This

means that each application must implement all the norms for the integration to be carried out.

In general terms, the application to be integrated must observe norms at different levels:

• Components - set of components that obey a specific nomenclature and provide a defined set of

necessary features for the application to be considered in the Administrator;

• Registry - set of entries in the Windows Registry necessary for the ADM to be able to locate the

components;

• Classes, Properties and Methods - minimum necessary features for the ADM to be able to

recognise the application.

The examples presented throughout the manual correspond to a real implementation of a simple

prototype that exemplifies the necessary implementations.

All the norms presented apply, in the same way, to integrations carried out at the level of the

Executive or Professional version. Any exception to this principle is also documented in this manual.

Page 5: PLT 7.00 - Manual de Integração

2. Nomenclature

PRIMAVERA Business Software Solutions | Integration Manual v7.50 4

2. Nomenclature The integration of applications must obey a set of nomenclature norms - of the application and of the

components provided . These norms are presented below:

2. 1. Abbreviation of the Application All the applications to be integrated in the Administrator must have a defined abbreviation that must be

part of the name of its components.

This abbreviation must consist of 3 alphanumeric characters (examples: XPR, XGO, etc.).

The following abbreviations are reserved for existing PRIMAVERA modules:

Opening Module

ADM Administrator

ANL Analytics

ANW Analytics Service

ATP Technical Assistances

AUC AutoUpdate Client

AUP AutoUpdate

AWS Windows Services

CBI Customer Business Intelligence

CBL Accounting

COP Construction and Public Works

CNO Unorganized Accounting

CRM CRM

CTP Primavera Company Templates ("Base Company Configurations")

DBM Data Base Management

DFP Fiscal and Official Declarations

EAP Equipment and Assets

ERP ERP PRIMAVERA

EXP EXPRESS

FIL Branches

FIN Financial Add-in

Page 6: PLT 7.00 - Manual de Integração

2. Nomenclature

PRIMAVERA Business Software Solutions | Integration Manual v7.50 5

GAB Offices

GBI Business Intelligence Manager

GCP Logistics and Treasury (L&T)

GPP Process Management

GPR Production

GPS Personnel Management

HYP Hyperion

IMO Fixed Asset

PBI Business Intelligence

PDA PDA

PDS PRIMAVERA DataSync (PRIMAVERA Maintenance integrator)

PEP Enterprise Portals

PFR Fiscal Reporting

PLT Platform

PMS Mobile Sales

PRM Report Migrator

PSP Standard Portals

PSR School Reporting

PWS Windows Scheduler

RHP Human Resources

RTL Fashion Retail

STI Integrated setup

STP Smart Tags

TTE Electronic Transactions

2. 2. Logical and Physical Name of Components In the definition of the logical and physical name of the necessary components for integration, the

following good practices are recommended (not compulsory):

• Include the abbreviation of the application in the logical and physical name of the component

(ex.: GppAudit750.dll);

Page 7: PLT 7.00 - Manual de Integração

2. Nomenclature

PRIMAVERA Business Software Solutions | Integration Manual v7.50 6

• Include the application version in the logical and physical name of the component (ex.:

GppAudit750.dll) so as to permit the coexistence of several versions of the application in the

same machine.

Page 8: PLT 7.00 - Manual de Integração

3. Necessary Components

PRIMAVERA Business Software Solutions | Integration Manual v7.50 7

3. Necessary Components

3. 1. Description of Components For the ADM to consider a certain application it has to provide the follow components - in the form of

ActiveX DLLs:

Component Description

Audit Lists the categories of the application data (integration of the Navigator), the

operations for which permissions can be defined in the ADM and the databases

supported by the application.

Forms Publishes and provides the application parameterisations and utilities to be provided in

the application.

3. 2. Names of Components Both components must observe the recommendations presented in 2. 2. However, it is possible to

attribute the logical and physical names you want, provided the "Audit" and "Forms" entries of the

Registry (see 4. 3.) are correctly filled in with the logical name of the components.

The PRIMAVERA recommendation would result in the following logical and physical names of the

components:

• PrtAudit750 – PrtAudit750.dll;

• PrtForms750 – PrtForms750.dll.

3. 3. References In addition, it will be necessary for each project corresponding to the mentioned components, in order

to provide the necessary objects, to implement the references listed below.

Component References

AplAudit Microsoft ActiveX Data Objects 2.8 Library

PRIMAVERA StdBE 7.50 – StdBE750.dll

PRIMAVERA StdClasses 7.50 – StdClasses750.dll

AplForms PRIMAVERA StdBE 7.50 – StdBE750.dll

PRIMAVERA StdClasses 7.50 – StdClasses750.dll

3. 4. Binary Compatibility It is recommended that both integration components be developed guaranteeing binary compatibility

between versions.

Page 9: PLT 7.00 - Manual de Integração

4. Windows Registry and Setups

PRIMAVERA Business Software Solutions | Integration Manual v7.50 8

4. Windows Registry and Setups For an Administrator to be able to recognise and register an application it is necessary to include a set

of entries in the Windows Registry. Those entries depend on the product.

4. 1. SGE750 – Executive The definitions of all PRIMAVERA Executive version modules are provided in the Windows Registry in

the key HKEY_LOCAL_MACHINE\SOFTWARE\PRIMAVERA\SGE750.

This key will include the entries corresponding to each PRIMAVERA instance available in the installation

in question. Each of these instances will consist of a node under the entry SGE750 (the default instance

will always exist):

Under the node corresponding to each instance, there must be an entry for each installed module:

4. 2. SGP750 – Professional In the case of the Professional version the same norm described in the previous point is applied but the

main key will be HKEY_LOCAL_MACHINE\SOFTWARE\PRIMAVERA\SGP750:

Page 10: PLT 7.00 - Manual de Integração

4. Windows Registry and Setups

PRIMAVERA Business Software Solutions | Integration Manual v7.50 9

4. 3. Registration of the Application To register an application the following entries need to be defined in the registry:

Key Entry Description

<APL> Audit Logical name of the Audit component.

<APL> Forms Logical name of the Forms component.

<APL> 3rdParty TRUE.

<APL> Nome Name of the application.

<APL> PercursoApl Physical location of the application’s executable file.

<APL> PercursoDados Data directory.

<APL> PercursoDadosComuns Common data directory.

<APL> PercursoMapas Map directory.

<APL> Versao Application version.

<APL> Exec Physical name of the application's executable file (without

directory or .EXE extension).

ADM\Apls <APL> Opening of the application.

All entries must exist and be filled in with valid values.

As an example, if the application to be integrated had the abbreviation PRT, it would be necessary to

include the following entries in the Registry:

Page 11: PLT 7.00 - Manual de Integração

4. Windows Registry and Setups

PRIMAVERA Business Software Solutions | Integration Manual v7.50 10

Page 12: PLT 7.00 - Manual de Integração

5. Audit

PRIMAVERA Business Software Solutions | Integration Manual v7.50 11

5. Audit

5. 1. Necessary Classes The AplAudit component must implement the following classes to be recognised by the PRIMAVERA

Administrator.

Class Description

cls<Apl> OperacoesAplicacao This class lists all the permissions that can be parameterised by the

user.

cls<Apl> OperacoesLog This class lists all the log entities available.

cls<Apl> BasesDados This class lists the databases supported by the application (not

compulsory).

The class must be defined with the following generic properties:

• DataBindingBehaviour – 0 (vbNone);

• DataSourceBehaviour – 0 (vbNone);

• Instancing – 5 (MultiUse);

• MTSTransactionMode – 0 (NotAnMTSObject);

• Persistable – 0 (NotPersistable).

5. 2. cls<Apl>ApplicationOperations The class cls<Apl>ApplicationOperations defines the fixed and/or dynamic operations provided by the

application and for which the user can define permissions dependent on the profiles defined in the

Administrator. This class must:

• Implement the clsAplAudit interface (defined in StdClasses750);

• Provide the following methods:

Method Description

ArvOperacoes Hierarchical structure of the fixed operations (not dependent on the

database/company in question) for which the user can define permissions.

PermissoesDinamicas Hierarchical structure of the dynamic operations (not dependent on the

database/company in question) for which the user can define permissions.

The class code must be similar to the following example:

Option Explicit

Implements clsAplAudit

Private Property Get clsAplAudit_ArvOperacoes(objParametros As clsParamOpsAplicacao) As

clsArvoreOperacoes

Dim objOps As clsArvoreOperacoes

Dim objOp As clsOperacaoApl

On Error GoTo Erro

Set objOps = New clsArvoreOperacoes

'File Menu

Set objOp = objOps.Add("mnuFicheiros", "Files", 0, "")

Set objOp = objOps.Add("mnuFicheirosOp1", "Operation 1", 0, "mnuFicheiros")

Page 13: PLT 7.00 - Manual de Integração

5. Audit

PRIMAVERA Business Software Solutions | Integration Manual v7.50 12

Set objOp = objOps.Add("mnuFicheirosOp2", "Operation 2", 0, "mnuFicheiros")

Set objOp = objOps.Add("mnuFicheirosOp3", "Operation 3", 0, "mnuFicheiros")

'Documents Menu

Set objOp = objOps.Add("mnuDocumentos", "Documents", 0, "")

Set objOp = objOps.Add("mnuDocumentosOp1", "Documents 1", 0, "mnuDocumentos")

Set objOp = objOps.Add("mnuDocumentosOp2", "Documents 2", 0, "mnuDocumentos")

Set objOp = objOps.Add("mnuDocumentosOp3", "Documents 3", 0, "mnuDocumentos")

'Exploration Menu

Set objOp = objOps.Add("mnuExploracao", "Exploration", 0, "")

Set objOp = objOps.Add("mnuExploracaoOp1", "Exploration 1", 0, "mnuExploracao")

Set objOp = objOps.Add("mnuExploracaoOp2", "Exploration 2", 0, "mnuExploracao")

Set objOp = objOps.Add("mnuExploracaoOp3", "Exploration 3", 0, "mnuExploracao")

'Exploration Sub menu 1

Set objOp = objOps.Add("mnuExploracaoOp31", "Exploration 31", 0,

"mnuExploracaoOp3")

Set objOp = objOps.Add("mnuExploracaoOp32", "Exploration 32", 0,

"mnuExploracaoOp3")

Set objOp = objOps.Add("mnuExploracaoOp33", "Exploration 33", 0,

"mnuExploracaoOp3")

'Result

Set clsAplAudit_ArvOperacoes = objOps

Set objOp = Nothing

Set objOps = Nothing

Exit Property

Erro:

Set objOp = Nothing

Set objOps = Nothing

Err.Raise Err.Number, Err.Source, Err.Description

End Property

Private Property Get clsAplAudit_PermissoesDinamicas(objParametros As

clsParamOpsAplicacao) As clsPermissoesVar

Dim objVars As clsPermissoesVar

Dim objVar As clsPermissaoVar

Dim objRs As ADODB.Recordset

Dim strSQL As String

Dim strId As String

Dim strEntidade As String

Dim strEmpresa As String

Dim strAtributo As String

Dim strDescricao As String

On Error GoTo Erro

Set objVars = New clsPermissoesVar

'Documents

strSQL = "SELECT Documento, Descricao FROM DocumentosVenda ORDER BY Documento,

Descricao"

Set objRs = objParametros.Conexao.Execute(strSQL)

While (Not objRs.EOF)

strId = "Sale Documents "

strEntidade = strId

strEmpresa = objParametros.Empresa

Page 14: PLT 7.00 - Manual de Integração

5. Audit

PRIMAVERA Business Software Solutions | Integration Manual v7.50 13

strAtributo = "" & objRs("Document")

strDescricao = "" & objRs("Description")

Set objVar = objVars.Add(strId, strEntidade, strAtributo, strDescricao,

strEmpresa)

objVar.OperacoesPossiveis.Add "CRIAR", "Create"

objVar.OperacoesPossiveis.Add "MODIFICAR", "Edit"

objVar.OperacoesPossiveis.Add "ANULAR", "Delete"

objVar.OperacoesPossiveis.Add "VISUALIZAR", "View"

objRs.MoveNext

Wend

objRs.Close

Set objRs = Nothing

Set clsAplAudit_PermissoesDinamicas = objVars

Set objVar = Nothing

Set objVars = Nothing

Exit Property

Erro:

If (Not objRs Is Nothing) Then objRs.Close: Set objRs = Nothing

Set objVar = Nothing

Set objVars = Nothing

Err.Raise Err.Number, Err.Source, Err.Description

End Property

5. 3. cls<Apl>LogOperations The class cls<Apl>LogOperations defines the log entities defined by the application. This class must:

• Implement the clsAplLogOperations interface (defined in StdClasses750);

• Provide the following methods:

Method Description

DaOperacoesLog Collection of log entities and respective keys.

The class code must be similar to the following example:

Option Explicit

Implements clsAplOperacoesLog

Private Property Get clsAplOperacoesLog_DaOperacoesLog(objParametros As clsParamOpsLog)

As clsOperacoesLog

Dim objOpLog As clsOperacoesLog

On Error GoTo Erro

Set objOpLog = New clsOperacoesLog

With objOpLog

.Add "Clientes", "Clientes", "Cliente", vbString, 10

.Add LOG_Funcionarios, "Funcionários", "Funcionário", vbString, 10

.Add LOG_Parametros, "Parâmetros"

.Add LOG_Seccoes, "Secções de Venda", "Secção", vbString, 2

End With

Set clsAplOperacoesLog_DaOperacoesLog = objOpLog

Set objOpLog = Nothing

Page 15: PLT 7.00 - Manual de Integração

5. Audit

PRIMAVERA Business Software Solutions | Integration Manual v7.50 14

Exit Property

Erro:

Set objOpLog = Nothing

Err.Raise Err.Number, Err.Source, Err.Description

End Property

5. 4. cls<Apl>DataBases The class cls<Apl>BasesDados defines the databases supported by the application and existing on the

server.

It is an optional class that allows the provision of the following PRIMAVERA Administrator operations on

the application's databases:

• Maintenance Plans;

• Backups;

• Backups Restore;

• Database Reorganisation;

• Database Compacting;

• Database Properties;

• Inside Files.

This class must:

• Implement the clsAplDataBases interface (defined in StdClasses750);

• Provide the following methods:

Method Description

DaBasesDados Collection of supported databases.

The class code must be similar to the following example:

Option Explicit

Implements clsAplBasesDados

Private Property Get clsAplBasesDados_DaBasesDados(objParametros As clsParamBaseDados)

As clsBasesDados

Dim objListaBDs As clsBasesDados

On Error GoTo Erro

Set objListaBDs = New clsBasesDados

With objListaBDs

.Add "PRTBD01", "Base de Dados Protótipo 001"

.Add "PRTBD02", "Base de Dados Protótipo 002"

.Add "PRTBD03", "Base de Dados Protótipo 003"

End With

Set clsAplBasesDados_DaBasesDados = objListaBDs

Set objListaBDs = Nothing

Exit Property

Erro:

Set objListaBDs = Nothing

Err.Raise Err.Number, "_clsPrtBasesDados.DaBasesDados", Err.Description

End Property

Page 16: PLT 7.00 - Manual de Integração

5. Audit

PRIMAVERA Business Software Solutions | Integration Manual v7.50 15

5. 5. Notes

5. 5. 1. Definition of the Hierarchy of Operations

The hierarchy of fixed operations can have as many levels as necessary. This hierarchy is defined by

the last parameter of the Ops.Add method.

Example:

'Exploration Menu

Set objOp = objOps.Add("mnuExploracao", "Exploration", 0, "")

Set objOp = objOps.Add("mnuExploracaoOp1", "Exploration 1", 0, "mnuExploracao")

Set objOp = objOps.Add("mnuExploracaoOp2", "Exploration 2", 0, "mnuExploracao")

Set objOp = objOps.Add("mnuExploracaoOp3", "Exploration 3", 0, "mnuExploracao")

'Exploration Sub menu 1

Set objOp = objOps.Add("mnuExploracaoOp31", "Exploration 31", 0, "mnuExploracaoOp3")

Set objOp = objOps.Add("mnuExploracaoOp32", "Exploration 32", 0, "mnuExploracaoOp3")

Set objOp = objOps.Add("mnuExploracaoOp33", "Exploration 33", 0, "mnuExploracaoOp3")

In the case of dynamic permissions, the hierarchy is limited to 3 levels (Entity / Attribute /

Permission):

strSQL = "SELECT Documento, Descricao FROM DocumentosVenda ORDER BY Documento,

Descricao"

Set objRs = objParametros.Conexao.Execute(strSQL)

While (Not objRs.EOF)

strId = "Documentos Venda"

strEntidade = strId

strEmpresa = objParametros.Empresa

strAtributo = "" & objRs("Documento")

strDescricao = "" & objRs("Descricao")

Set objVar = objVars.Add(strId, strEntidade, strAtributo, strDescricao, strEmpresa)

objVar.OperacoesPossiveis.Add "Criar"

objVar.OperacoesPossiveis.Add "Modificar"

objVar.OperacoesPossiveis.Add "Anular"

objVar.OperacoesPossiveis.Add "Visualizar"

objRs.MoveNext

Wend

objRs.Close

Set objRs = Nothing

5. 5. 2. Applications without Operations

If you want to integrate an application without the need to provide operations (fixed or dynamic) for

permissions, the ArvOperacoes methods must be defined as follows.

Option Explicit

Implements clsAplAudit

Private Property Get clsAplAudit_ArvOperacoes(objParametros As clsParamOpsAplicacao) As

clsArvoreOperacoes

Dim objOps As clsArvoreOperacoes

On Error GoTo Erro

Set objOps = New clsArvoreOperacoes

Page 17: PLT 7.00 - Manual de Integração

5. Audit

PRIMAVERA Business Software Solutions | Integration Manual v7.50 16

Set clsAplAudit_ArvOperacoes = objOps

Set objOp = Nothing

Set objOps = Nothing

Exit Property

Erro:

Set objOp = Nothing

Set objOps = Nothing

Err.Raise Err.Number, Err.Source, Err.Description

End Property

Private Property Get clsAplAudit_PermissoesDinamicas(objParametros As

clsParamOpsAplicacao) As clsPermissoesVar

Dim objVars As clsPermissoesVar

On Error GoTo Erro

Set objVars = New clsPermissoesVar

Set clsAplAudit_PermissoesDinamicas = objVars

Set objVars = Nothing

Exit Property

Erro:

Set objVars = Nothing

Err.Raise Err.Number, Err.Source, Err.Description

End Property

5. 5. 3. Parameters of Methods

clsAplAudit_ArvOperacoes

Parameter Description

objParametros This object includes all the main parameters of the method:

AbvtApl – opening of the application.

Categories - collection of information categories (*).

Connection - connection for the database of the active company (*).

Culture - language of the active user.

DefaultCulture - default language of the installation.

Company - active company (*).

Instance - PRIMAVERA instance.

License - PRIMAVERA license.

RegisteredOfficeLocation - location of the active company’s registered office.

ActiveModule - internal use.

Password – password of the current user.

PlatformType - type of platform.

User – identifier of the active user.

The fields identified with (*) are initialised in the clsAplAudit_PermissoesDinamicas method.

clsAplAudit_PermissoesDinamicas

Parameter Description

Page 18: PLT 7.00 - Manual de Integração

5. Audit

PRIMAVERA Business Software Solutions | Integration Manual v7.50 17

objParametros See previous point.

clsAplAudit_DaOperacoesLog

Parameter Description

objParametros This object includes all the main parameters of the method:

Culture - language of the active user;

DefaultCulture - default language of the installation;

License - PRIMAVERA license;

Location - internal use;

ActiveModule - internal use;

PlatformType - type of platform.

clsAplAudit_DaBasesDados

Parameter Description

objParametros This object includes all the main parameters of the method:

Culture - language of the active user;

DefaultCulture - default language of the installation;

License - PRIMAVERA license;

PlatformType - type of platform.

5. 5. 6. Applications without Integrated Databases

The integration of the application's databases in the Administrator is not compulsory.

If you do not wish to implement this feature, the Audit of the appliction need simply not implement the

cls<Apl>DataBases class.

5. 5. 7. Executable File in the Menu System or Utilities

This feature is automatically provided by the Platform. For this, the executable file defined by the entry

"EXEC" in the application's Registry must exist physically in the folder defined by the entry

"PERCURSOAPL".

Page 19: PLT 7.00 - Manual de Integração

6. Forms

PRIMAVERA Business Software Solutions | Integration Manual v7.50 18

6. Forms

6. 1. Necessary Classes The AplForms component must implement the following classes.

Class Description

cls<Apl>Images This class returns the icon associated to the application.

cls<Apl> Parametrizacoes This class lists and implements all the parameterisation forms provided by

the application.

cls<Apl>Servicos This class lists and implements all the service/utility forms provided by the

application.

Each class must be defined with the following generic properties:

• DataBindingBehaviour – 0 (vbNone);

• DataSourceBehaviour – 0 (vbNone);

• Instancing – 5 (MultiUse);

• MTSTransactionMode – 0 (NotAnMTSObject);

• Persistable – 0 (NotPersistable).

6. 2. cls<Apl>Images The class code cls<Apl>Images (clsPrtImages) must:

• Implement the clsAplImages interface (defined in StdClasses750);

• Provide the clsAplImages_Icon property.

Option Explicit

Implements clsAplImages

'Interface Implementation

Private Property Get clsAplImages_Icon(TipoPlataforma As EnumTipoPlataforma) As

stdPicture

Set clsAplImages_Icon = LoadResPicture("PRTICON", vbResIcon)

End Property

6. 3. cls<Apl>Parametrizacoes The cls<Apl>Parametrizacoes class defines and provides the Administrator with the parameterisation

forms of the application. It must:

• Implement the clsAplParametrizacoes interface (defined in StdClasses750);

• Provide the following methods:

Method Description

AtribuiUtilizador Invoked by the Administrator immediately before the initialisation of the

class to allow saving the properties of the active user.

Inicializa Invoked by the Administrator to allow the initialisation of the class.

Page 20: PLT 7.00 - Manual de Integração

6. Forms

PRIMAVERA Business Software Solutions | Integration Manual v7.50 19

Lista Invoked by the Administrator to obtain the list of parameterisations

published by the application.

Mostra Invoked by the Administrator whenever the user selects one of the

published parameterisations.

The class code must be similar to the following example:

Option Explicit

Implements clsAplParametrizacoes

'Private Variables

Private m_strUtilizador As String

Private m_strPassword As String

'Interface Implementation

Private Sub clsAplParametrizacoes_AtribuiUtilizador(strUtilizador As String,

strPassword As String)

m_strUtilizador = strUtilizador

m_strPassword = strPassword

End Sub

Private Sub clsAplParametrizacoes_Inicializa(enuTipoPlataforma As EnumTipoPlataforma,

strEmpresa As String, strInstalacao As String, objLic As clsLicenca)

End Sub

Private Sub clsAplParametrizacoes_Lista(objParametros As clsParamAplParams, strLista()

As String, colLoc As Collection)

ReDim strLista(3)

strLista(1) = "Parâmetros 1"

strLista(2) = "Parâmetros 2"

strLista(3) = "Parâmetros 3"

End Sub

Private Sub clsAplParametrizacoes_Mostra(intIndex As Integer, intModoOperacao As

Integer, objOwnerForm As Object)

On Error GoTo Erro

Select Case intIndex

Case 1 '1 Parameters

Set frmParam1.Owner = objOwnerForm

frmParam1.Show vbModeless, objOwnerForm

Case 2 '2 Parameters

Set frmParam2.Owner = objOwnerForm

frmParam2.Show vbModeless, objOwnerForm

Case 3 '3 Parameters

Set frmParam3.Owner = objOwnerForm

frmParam3.Show vbModeless, objOwnerForm

End Select

objOwnerForm.ActivaInterface True

Exit Sub

Erro:

objOwnerForm.ActivaInterface True

Err.Raise Err.Number, Err.Source, Err.Description

End Sub

Page 21: PLT 7.00 - Manual de Integração

6. Forms

PRIMAVERA Business Software Solutions | Integration Manual v7.50 20

6. 4. cls<Apl>Servicos The cls<Apl>Servicos class defines and provides the Administrator with the service/utility forms of the

application. It must:

• Implement the clsAplServicos interface (defined in StdClasses750);

• Provide the following methods:

Method Description

AtribuiUtilizador Invoked by the Administrator immediately before the initialisation of the

class to allow saving the properties of the active user.

Inicializa Invoked by the Administrator to allow the initialisation of the class.

Lista Invoked by the Administrator to obtain the list of services published by the

application.

Executa Invoked by the Administrator whenever the user selects one of the

published services.

The class code must be similar to the following example:

Option Explicit

Implements clsAplServicos

'Private Variables

Private m_strUtilizador As String

Private m_strPassword As String

'Interface Implementation

Public Sub clsAplServicos_AtribuiUtilizador(strUtilizador As String, strPassword As

String)

m_strUtilizador = strUtilizador

m_strPassword = strPassword

End Sub

Private Sub clsAplServicos_Inicializa(enuTipoPlataforma As EnumTipoPlataforma,

strEmpresa As String, strInstalacao As String, objLic As clsLicenca)

End Sub

Public Sub clsAplServicos_Lista(objParametros As clsParamAplServicos, strLista() As

String, colLoc As Collection)

ReDim strLista(3)

strLista(1) = "Serviço 1"

strLista(2) = "Serviço 2"

strLista(3) = "Serviço 3"

End Sub

Public Sub clsAplServicos_Executa(intIndex As Integer)

On Error GoTo Erro

Select Case intIndex

Case 1 '1 Services

frmServ1.Show vbModal

Case 2 '2 Services

frmServ2.Show vbModal

Case 3 '3 Services

frmServ3.Show vbModal

End Select

Page 22: PLT 7.00 - Manual de Integração

6. Forms

PRIMAVERA Business Software Solutions | Integration Manual v7.50 21

Exit Sub

Erro:

Err.Raise Err.Number, Err.Source, Err.Description

End Sub

6. 5. Notes

6. 5. 1. Applications without Parameters or Services

It is also possible to register an application in the PRIMAVERA solution without it providing any

parameterisation and/or service.

The following examples demonstrate the definition of the clsAplParametrizacoes_Lista and

clsAplServicos_Lista methods so as to register an application without parameterisations or services.

Private Sub clsAplParametrizacoes_Lista(objParametros As clsParamAplParams, strLista()

As String, colLoc As Collection)

'This method may return the list of parametrization forms

'avaiable by the application

'If doesn’t exist any, the array may be resized to 0.

ReDim sLista(0)

End Sub

Public Sub clsAplServicos_Lista(objParametros As clsParamAplServicos, strLista() As

String, colLoc As Collection)

'This method may return the list of services forms

'avaiable by the application

'If doesn’t exist any, the array may be resized to 0.

ReDim sLista(0)

End Sub

In this case, the application will be presented to the ADM without parameters and/or services.

6. 5. 2. Parameters of Methods

clsAplParametrizacoes_AtribuiUtilizador

Parameter Description

strUser Identifier of the active user.

strPassword Active user password.

clsAplParametrizacoes_Inicializa

Parameter Description

enuPlatformType Type of platform.

strCompany Code of the selected company.

strInstallation Active PRIMAVERA instance.

Page 23: PLT 7.00 - Manual de Integração

6. Forms

PRIMAVERA Business Software Solutions | Integration Manual v7.50 22

objLic Definition of the application's PRIMAVERA license.

clsAplParametrizacoes_Lista

Parameter Description

objParameters This object includes all the main parameters of the method:

Culture - language of the active user;

DefaultCulture - default language of the installation;

License - PRIMAVERA license;

Location - internal use;

PlatformType - type of platform.

strLista() Array with the list of parameterisations available.

colLoc Internal use.

clsAplParametrizacoes_Mostra

Parameter Description

intIndex Index of the parameterisation selected by the user.

intOperationMode Mode of operation (obsolete).

objOwnerForm Handler for the main window of the Administrator.

clsAplServicos_AtribuiUtilizador

Parameter Description

strUser Identifier of the active user.

strPassword Active user password.

clsAplServicos_Inicializa

Parameter Description

enuPlatformType Type of platform.

strCompany Code of the selected company.

strInstallation Active PRIMAVERA instance.

objLic Definition of the application's PRIMAVERA license.

clsAplServicos_Lista

Parameter Description

objParameters This object includes all the main parameters of the method:

Page 24: PLT 7.00 - Manual de Integração

6. Forms

PRIMAVERA Business Software Solutions | Integration Manual v7.50 23

Culture - language of the active user;

DefaultCulture - default language of the installation;

License - PRIMAVERA license;

Location - internal use;

PlatformType - type of platform.

strLista() Array with the list of services provided.

colLoc Internal use.

clsAplServicos_Executa

Parameter Description

intIndex Index of the service selected by the user.

Page 25: PLT 7.00 - Manual de Integração

7. Platform Features

PRIMAVERA Business Software Solutions | Integration Manual v7.50 24

7. Platform Features

7. 1. Licensing The licensing of external applications in the PRIMAVERA Administrator is not supported (the external

application is not listed in the licensing form of the Administrator).

All the licensing features of the application must be implemented in an autonomous tool.

7. 2. Creation of Companies The creation of companies in the PRIMAVERA system is carried out entirely by the Administrator,

registering all the modules selected by the user for each company.

7. 3. Parameters by Application Similarly to what happens with PRIMAVERA modules, parameterisations by module are not supported.

All the parameterisations provided in the Administrator must be dependent on the company.

7. 4. Parameters by Company Each application can register in the Administrator as many parameterisations by company as necesary.

This definition must be carried out from the Forms component according to point 6.3.

7. 5. Services / Utilities by Company Each application can register in the Administrator as many services/utilities by company as necessary.

This definition must be carried out from the Forms component according to point 6.4.

7. 6. Permissions The definition of the permissions available by application must be carried out according to point 5.2.

To check if a certain user has access to a specific option, the PRIMAVERA Administrator engine must be

used as follows:

Private Sub Form_Load()

Dim objCriador As clsCriaMotorAdm

Dim objMotorADMLE As clsAdmMotor

On Error GoTo Erro

Set objCriador = New clsCriaMotorAdm

Set objMotorADMLE = objCriador.CriaMotorADM(tpEmpresarial)

If (objMotorADMLE.Utilizadores.PodeExecutarOperacao("Hugo.Ribeiro", "DEMO", "PRT",

"mnuFicheirosOp1")) Then

MsgBox "The user has access to the operation."

Else

MsgBox "The user does NOT have access to the operation."

End If

Set objMotorADMLE = Nothing

Set objCriador = Nothing

Page 26: PLT 7.00 - Manual de Integração

7. Platform Features

PRIMAVERA Business Software Solutions | Integration Manual v7.50 25

Exit Sub

Erro:

'Ignore all the errors

End Sub

The value of the "Operation" parameter must coincide with the definition carried out in the Audit.

7. 7. Dynamic Permissions The definition of the dynamic permissions available by application must be carried out according to

point 5.2.

To check if a certain user has access to a specific option, the PRIMAVERA Administrator engine must be

used as follows:

Private Sub Form_Load()

Dim objCriador As clsCriaMotorAdm

Dim objMotorADMLE As clsAdmMotor

On Error GoTo Erro

Set objCriador = New clsCriaMotorAdm

Set objMotorADMLE = objCriador.CriaMotorADM(tpEmpresarial)

If (objMotorADMLE.Utilizadores.PodeAcederAtributo("Hugo.Ribeiro", "DEMO", "PRT",

"Documentos Venda", "FA", "Criar")) Then

MsgBox "The user has access to the operation."

Else

MsgBox "The user does NOT have access to the creation of invoices."

End If

Set objMotorADMLE = Nothing

Set objCriador = Nothing

Exit Sub

Erro:

'Ignore all the errors

End Sub

The value of the "Entity", "Attribute" and "Operation" parameters must coincide with the definition

carried out in the Audit.

7. 8. Log The configuration of the log entities of each application depends on the definitions carried out in the

respective Audit (5.2).

While executing the application it is possible to introduce log records by using the features of the

PRIMAVERA Platform, as follows:

Private Const LOG_Clientes = "Clientes"

Private Const PWD_PLAT = "MCJSOO672HSDL233JBNMOOW223OTIWE"

Private Sub Form_Load()

Dim objPlat As StdDS

Dim objTrs As StdBETransaccao

Dim objConn As ADODB.Connection

On Error GoTo Erro

Page 27: PLT 7.00 - Manual de Integração

7. Platform Features

PRIMAVERA Business Software Solutions | Integration Manual v7.50 26

Set objTrs = New StdBETransaccao

Set objPlat = New StdDS

Set objConn = objPlat.AbrePlatEmpresa("PLAT250", "PRT", "DEMO", "Hugo.Ribeiro",

objTrs, tpEmpresarial, PWD_PLAT)

objPlat.Log.ActualizaLinha LOG_Clientes, toInserir, "Inserção de cliente.", "XPTO"

objPlat.FechaPlatEmpresa

Set objPlat = Nothing

Set objTrs = Nothing

Exit Sub

Erro:

'Ignore all the errors

End Sub

NOTES:

To implement this code the following references are necessary:

“PRIMAVERA StdDS 7.50”

“PRIMAVERA StdBE 7.50”

“Microsoft ActiveX Data Objects 2.8 Library”;

In the objPlat.Log class only the UpdateLine method must be used. The remaining methods presuppose

the structure of the components of the PRIMAVERA modules and will not function correctly.

No other classes or StdDS component methods must be used. PRIMAVERA does not provide support for

this component.

7. 9. Executable Files in the Menu System The Platform provides a mechanism that allows the external application to be integrated in the

"System" menu.

To implement this mechanism it is necessary that the application:

• Provide the "EXEC" key in the Windows Registry.

The definition of this key must correspond to the name of the application's executable file (without

directory or extension).

The integration mechanism will include an entry in the menu for the application.

The executable file opened via that command will be determined using the values of the entries:

• AplPath;

• Exec.

as follows:

• Executável = <PercursoApl> & <Exec> & “.EXE”.

If, in the previous example, the values of these entries were:

• PercursoApl = “C:\Program Files\Empresa\”;

• Exec = “PrtApl”.

The executable file opened would be “C:\Program Files\Empresa\PrtApl.exe”.

If the executable file does not exist physically on disc, the entry in the menu will not be created.

Page 28: PLT 7.00 - Manual de Integração

7. Platform Features

PRIMAVERA Business Software Solutions | Integration Manual v7.50 27

7. 10. External Databases This feature allows integrating the databases of the external application in the Administrator to provide

the following operations on those databases:

• Maintenance Plans;

• Backups;

• Backups Restore;

• Database Reorganisation;

• Database Compacting;

• Database Properties;

• Inside Files.

For this purpose, the Audit of the application needs to simply implement the cls<Apl> BasesDados

class and list, using the DaBasesDados method, all of the application's databases.

Page 29: PLT 7.00 - Manual de Integração

Index

PRIMAVERA Business Software Solutions | Integration Manual v7.50 28

8. Prototype The following images demonstrate the integration of the prototype discussed in the previous chapters

of the Administrator.

8. 1. Applications

Page 30: PLT 7.00 - Manual de Integração

Index

PRIMAVERA Business Software Solutions | Integration Manual v7.50 29

8. 2. Companies

8. 3. Parameters and Services

Page 31: PLT 7.00 - Manual de Integração

Index

PRIMAVERA Business Software Solutions | Integration Manual v7.50 30

8. 4. Permissions

Page 32: PLT 7.00 - Manual de Integração

Index

PRIMAVERA Business Software Solutions | Integration Manual v7.50 31

8. 5. Log

Page 33: PLT 7.00 - Manual de Integração

Index

PRIMAVERA Business Software Solutions | Integration Manual v7.50 32

8. 6. Executable Files in the Menu System or Utilities

8. 7. External Databases in the Administrator