Administrator Extensibility
Integration with the PRIMAVERA administrator allows applications developed by third parties to be added to the PRIMAVERA administrator and access a set of features made available by the platform, among which security, configuration, database management and the operation log features. To register an external application in the PRIMAVERA administrator, you need to define a set of components that implement an interface, obey specific naming conventions and provide a defined set of features. Only then is the application included in the administrator and in the Registry Entries, allowing the administrator to locate the different components. Below please find the components and corresponding classes required to register an application in the PRIMAVERA administrator: The integration of applications must comply with a set of components and application naming standards. All applications to be integrated in the Administrator must have a defined abbreviation, which must be part of the name of its components. Step 1 - Create the Audit project 1 - After opening Visual Studio, select File > New > Project. 2 - From the tree on the left of the displayed window select the development language (C# or VB); 3 - Select the Class Library (.NET Framework) project type. 4 - Assign a name to the 'EXTAudit100' project, and press OK. Note: The application's abbreviation must always be three characters long, such as 'EXT' 5 - Add the following classes clsOperacoesAplicacao and clsOperacoesLog. 6 - Add a reference to the StdClasses100 assembly. 7 - Next to the class name add clsAplAudit. This step indicates that our class will inherit all methods, properties and attributes from the clsAplAudit class. 8 - Add the following code to the class clsEXTOperacoesAplicacao The clsArvoreOperacoes GetArvOperacoes(clsParamOpsAplicacao objParametros) method is used to grant access permissions to the third application operations. This extensibility mechanism is very useful to validate if options added to Ribbon by the extensibility mechanism have access to operations. The clsPermissoesVar GetPermissoesDinamicas(clsParamOpsAplicacao objParametros) is used to grant dynamic permissions to the application. This type of permissions can be filled in based on an SQL query (ex: types of documents). 9 - Add the following code to the clsExtOperacoesLog class: Step 2 - Create the Forms project 1 - After opening Visual Studio, select File > New > Project. 2 - From the tree on the left of the displayed window select the development language (C# or VB); 3 - Select the Class Library (.NET Framework) project type. 4 - Assign a name to the 'EXTForms100' project, and press OK. Nota: The application abbreviation must always be three characters long, such as 'EXT'. 5 - Add the following classes clsParametrizacoe and clsServicos. 6 - Add references to the Primavera.Platform.Collections, StdClasses100 and StdBE100 assemblies. 7 - Under Toolbox > Containers, select a ' Panel' and drag it into the form. 8 - Add the following code to the clsExtParametrizacoes class: 14 - Add the following code to the clsExtServicos class: Step 3 - Register the application 1 - To register the extensibility application in the administrator you need to add a new entry in the PRIMAVERA folder on the Windows registry with the abbreviation of the application, such as 'EXT'. 2 - Add the following keys to the new entry. 3 - In the 'SGE100DefaultADMApls' folder, create a new entry with the same abbreviation as the application ('EXT'). 4 - Open the Administrator and check the registration of the application. 5 - Access the properties of a company. In the 'Parameters' tab, add the application created, which in this case is 'Extensibility Example'. 6 - Confirm. For more information, see an example of the PRIMAVERA Administrator extensibility technology on GitHub.Necessary components
This abbreviation must consist on 3 alphanumeric characters (examples: ABC, D01, EF2 etc.). Please note that some abbreviations are reserved for PRIMAVERA modules (for example: ADM-Administrator, DBM- Data Base Management, CBL - Accounting, among others).Recording external applications
using StdClasses100;
namespace EXTAudit100
{
public class clsEXTOperacoesAplicacao : clsAplAudit
{
#region private properties
private string Instancia { get; set; }
private string Utilizador { get; set; }
private string PassWord { get; set; }
#endregion
#region _clsAplAudit Members
public clsArvoreOperacoes GetArvOperacoes(clsParamOpsAplicacao objParametros)
{
clsArvoreOperacoes objOps = new clsArvoreOperacoes();
clsOperacaoApl objOp;
objOp = objOps.Add('mnuOperacao', 'Operações', 0, ');
objOp = objOps.Add('mnuOperacao1', 'Operação 1', 0, 'mnuOperacao');
objOp = objOps.Add('mnuOperacao2', 'Operação 2', 0, 'mnuOperacao');
return objOps;
}
public clsPermissoesVar GetPermissoesDinamicas(clsParamOpsAplicacao objParametros)
{
clsPermissoesVar objVars = new clsPermissoesVar();
clsPermissaoVar objVar;
objVar = objVars.Add('Documento', 'Documento', 'FA', 'Fatura Externa.', objParametros.Empresa);
objVar.OperacoesPossiveis.Add('CRIAR', 'Criar');
objVar.OperacoesPossiveis.Add('MODIFICAR', 'Modificar');
objVar.OperacoesPossiveis.Add('ANULAR', 'Anular');
objVar.OperacoesPossiveis.Add('VISUALIZAR', 'Visualizar');
return objVars;
}
#endregion
}
}
using StdClasses100;
namespace EXTAudit100
{
public class clsExtOperacoesLog : clsAplOperacoesLog
{
#region _clsAplOperacoesLog Members
public clsOperacoesLog GetDaOperacoesLog(clsParamOpsLog objParametros)
{
clsOperacoesLog opLog;
return null;
}
#endregion
}
}
using ExtForms100.UI;
using Primavera.Platform.Collections;
using StdBE100;
using StdClasses100;
namespace ExtForms100
{
public class clsExtParametrizacoes : clsAplParametrizacoes
{
private string Utilizador { get; set; }
private string PassWord { get; set; }
#region _clsAplParametrizacoes Members
public void AtribuiUtilizador(string strUtilizador, string strPassword)
{
this.Utilizador = strUtilizador;
this.PassWord = strPassword;
}
public void Inicializa(StdBETipos.EnumTipoPlataforma enuTipoPlataforma, string strEmpresa, string strInstalacao, clsLicenca objLic)
{
}
public void Lista(clsParamAplParams objParametros, ref string[] strLista, PrimaveraOrderedDictionary colLoc)
{
string[] Parametros;
Parametros = new string[2];
Parametros[1] = 'Parametros Gerais';
strLista = Parametros;
}
public bool ModuloDisponivelLocalizacao(StdBETipos.EnumLocalizacaoSede enuLocSede)
{
// Required to be true.
return true;
}
public void Mostra(int intIndex, int intModoOperacao, dynamic objOwnerForm)
{
// Place the code to open the different parameter forms here.
}
public void Termina()
{
}
public void TiposExercicioSuportados(StdBETipos.EnumTipoPlataforma enuTipoPlataforma, ref StdBETipos.EnumTipoExercicio[] enuTiposExercicio)
{
}
#endregion
}
}
using Primavera.Platform.Collections;
using StdBE100;
using StdClasses100;
namespace ExtForms100
{
public class clsExtServicos : clsAplServicos
{
private string Utilizador { get; set; }
private string PassWord { get; set; }
#region _clsAplServicos Members
public void AtribuiUtilizador(string strUtilizador, string strPassword)
{
this.Utilizador = strUtilizador;
this.PassWord = strPassword;
}
public void Executa(int intIndex)
{
// Place code to call the different services here.
}
public void Inicializa(StdBETipos.EnumTipoPlataforma enuTipoPlataforma, string strEmpresa, string strInstalacao, clsLicenca objLic)
{
}
public void Lista(clsParamAplServicos objParametros, ref string[] strLista, PrimaveraOrderedDictionary colLoc)
{
string[] servicos;
servicos = new string[2];
servicos[1] = 'User creation wizard';
strLista = servicos;
}
public void Termina()
{
}
#endregion
}
}
Key Description Audit Logical name of the Audit component. Forms Logical name of the Forms component. 3rdParty Indicates that this is a third party application. The value must be set to 'TRUE'. Name Name of the application PercursoApl Path to the application's executable file PercursoDados Data directory PercursoDadosComuns Directory for common data PercursoMapas Directory for reports Versao Application version Exec Name of the application's executable file (without path or .EXE extension)
login para deixar a sua opinião.