Technics:Abo-System: Difference between revisions

From CoPlanner 10
Jump to navigationJump to search
Created page with '==Prerequisites== The following components from the Feature Pack for SQL Server 2005 (even if a new version of SQL Server is used) must be installed on the CoPlanner server using…'
 
No edit summary
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
==Prerequisites==
==Prerequisites==
The following components from the Feature Pack for SQL Server 2005 (even if a new version of SQL Server is used) must be installed on the CoPlanner server using the proper architecture (x86 resp. x86):
The following components from the Feature Pack for SQL Server 2005 (even if a new version of SQL Server is used) must be installed on the [[Technics:CoPlanner-Server|CoPlanner Server]] using the proper architecture (x86 resp. x86):


:*Microsoft SQL Server Native Client
:*Microsoft SQL Server Native Client
:*Microsoft SQL Server 2005 Management Objects Collection  (XMO)
:*Microsoft SQL Server 2005 Management Objects Collection  (XMO)


As far as possible the component language should meet the SQL Server language. For executing abonnements the '''xp_cmdshell'''-feature must be enabled.
As far as possible the component language should meet the SQL Server language.  
 
The '''xp_cmdshell'''-feature must be enabled for executing [[Enterprise_Edition:Subscription_Manager|subscriptions]]
 
The account of the process spawned by '''xp_cmdshell''' must be in the Report-Builder (or higher) role on the report server.
The account of the process spawned by '''xp_cmdshell''' must be in the Report-Builder (or higher) role on the report server.
The stored procedure '''dbo.ExecReportAbo''' must be customized. In the default configuration at least the PowerUser‘s password must be set.
 
You have to provide a '''ClientConfig.xml'''-configuration file for the Abo-Executor.
The "SQL Server-Agent (MSSQLSERVER) must be started.
 
You have to provide a '''[[Technics:CoPlanner_Win-Client#ClientConfig.xml|ClientConfig.xml]]'''-configuration file for the Abo-Executor.
 
In the default configuration at least the [[Framework:Developer_mode#PowerUser|PowerUser's]] password must be set.


{| {{Bausteindesign1}}
{| {{Bausteindesign1}}
|-
|-
| <span style="color: darkblue;">'''Hint'''</span> &nbsp;Das Abo-System ist nur für Berichte geeignet, die mit der CoPlanner Reporting Services Integration auf reine CoPlanner-Daten zugreifen. Der Zugriff über den Matrixbuilder auf Olap-Würfel wird aus technischen Gründen nicht unterstützt, da das Abo-System üblicherweise mit einem Serviceaccount ausgeführt wird und der Olap-Zugriff nur mit SSPI möglich ist.
| <span style="color: darkblue;">'''Hint'''</span> &nbsp;The abo-system is suited only for reports, which access CoPlanner data with CoPlanner Reporting Services Integration. The access to OLAP-cubes is not supported via Matrixbuilder, because the abo-system runs with a service account usually and the OLAP access is only available with SSPI.
|}
|}


Line 18: Line 25:
{| {{Bausteindesign1}}
{| {{Bausteindesign1}}
|-
|-
| <span style="color: darkblue;">'''Hinweis'''</span> &nbsp;Bei der Verwendung des Abo-Systems ist auf die Anmeldeinformationen für die Datenquelle zu achten. Die volle Funktionalität (Berechtigungen für die Benutzer) ist nur dann gegeben, wenn für die Anmeldeinformationen der Modus Zur Eingabe der ''Anmeldeinformationen auffordern'' eingestellt ist. Bei ''Windows Authentifizierung'' wird das Abonnement immer im Kontext von ''xp_cmdshell'' ausgeführt.
| <span style="color: darkblue;">'''Hint'''</span> &nbsp;For using the abo-system you have to pay attention to the login information of the data source. The full functionality is available only, if the mode ''request login information'' is selected. In case of windows authentication the [[Enterprise_Edition:Subscription_Manager|subscriptions]] run in the context of ''xp_cmdshell''.
|}
|}
==AboExecutor.exe.config==
In the file "AboExecutor.exe.config" in the folder "\server\AboExecutor" you configure the e-mail.
The following points have to be adopted:
:*maxAttachmentSizeInKB: The maximum attachment size in kB. If 0 or not available, then unlimited.
:*mailSettings: [[Technics:E-Mail Settings|e-mail settings]]
==AboExecutor.exe.config==
In the file "AboExecutor.exe.config" in the directory "\server\AboExecutor" you find the configuration for the Email dispatch.
<font color="#0000ff"><?</font><font color="#3a3aff">xml </font><font color="#ff0000">version</font><font color="black">=</font><font color="#000000">"</font><font color="#803aff">1.0</font><font  color="#000000">"</font> <font color="#ff0000">encoding</font><font color="#0000ff">=</font><font color="#000000">"</font><font color="#803aff">utf-16</font><font color="#000000">"</font> <font color="#ff0000">standalone</font><font color="#0000ff">=</font><font color="#000000">"</font><font color="#803aff">yes</font><font color="#000000">"</font><font color="#0000ff">?></font>
<font color="#0000ff"><</font><font color="#3a3aff">configuration</font><font color="#0000ff">></font>
<font color="#0000ff">  <</font><font color="#3a3aff">appSettings</font><font color="#0000ff">></font>
<font color="#0000ff">  <</font><font color="#3a3aff">add </font><font color="#ff0000">key</font><font color="#0000ff">=</font><font color="803aff">"abo" </font><font color="ff0000">value</font><font color="black">=</font><font color="803aff">"633964077278817699"</font><font color="#0000ff">/></font>
<font color="#0000ff">  <</font><font color="#3a3aff">add </font><font color="#ff0000">key</font><font color="#0000ff">=</font><font color="803aff">"user" </font><font color="ff0000">value</font><font color="black">=</font><font color="803aff">"PowerUser"</font><font color="#0000ff">/></font>
<font color="#0000ff">  <</font><font color="#3a3aff">add </font><font color="#ff0000">key</font><font color="#0000ff">=</font><font color="803aff">"pass" </font><font color="ff0000">value</font><font color="black">=</font><font color="803aff">"UserPasswort"</font><font color="#0000ff">/></font>
<font color="#0000ff">  <</font><font color="#3a3aff">add </font><font color="#ff0000">key</font><font color="#0000ff">=</font><font color="803aff">"maxAttachmentSizeInKB"</font><font color="ff0000">value</font><font color="black">=</font><font color="803aff">"1000"</font><font color="#0000ff">/></font>
    <font color="#0000ff"><</font><font color="#3a3aff">/appSettings</font><font color="#0000ff">></font>
<font color="#0000ff">  <</font><font color="#3a3aff">system.net</font><font color="#0000ff">></font>
<font color="#0000ff">  <</font><font color="#3a3aff">mailSettings</font><font color="#0000ff">></font>
<font color="#0000ff">      <</font><font color="#3a3aff">smtp </font><font color="#ff0000">deliveryMethod</font><font color="#0000ff">=</font><font color="#000000">"</font><font color="#803aff">Network</font><font color="#000000">"</font> <font color="#ff0000">from</font><font color="#0000ff">=</font><font color="#000000">"</font><font color="#803aff">aboexecutor@coplanner.com</font><font color="#000000">"</font><font color="#0000ff">></font>
<font color="#0000ff">        <</font><font color="#3a3aff">network</font>
<font color="#ff0000">            host</font><font color="#0000ff">=</font><font color="#000000">"</font><font color="#803aff">psad001.graz.coplanner.com</font><font color="#000000">"</font>
<font color="#ff0000">            port</font><font color="#0000ff">=</font><font color="#000000">"</font><font color="#803aff">25</font><font color="#000000">"</font>
<font color="#ff0000">            defaultCredentials</font><font color="#0000ff">=</font><font color="#000000">"</font><font color="#803aff">true</font><font color="#000000">"</font>
<font color="#0000ff">            /></font>
<font color="#0000ff">      </</font><font color="#3a3aff">smtp</font><font color="#0000ff">></font>
<font color="#0000ff">  </</font><font color="#3a3aff">mailSettings</font><font color="#0000ff">></font>
<font color="#0000ff"> </</font><font color="#3a3aff">system.net</font><font color="#0000ff">></font>
<font color="#0000ff"></</font><font color="#3a3aff">configuration</font><font color="#0000ff">></font>
The '''abo'''-attribute can be ignored, because it will be set by the job for the subscription.
Valid entries for the '''user'''-attribute are PowerUser, Partner or Hersteller.
At the '''pass'''-attribute you have to enter the users password.
'''MaxAttachmentSize IKB''': The maximum attachment size for e-mail delivery in kB when "0" or not existing, then unlimited.
The '''Delivery Method'''-attribute specifies the delivery method for emails. Valid values are "network", "pickupDirectoryFromIis" and "specifiedPickupDirectory".
The '''from'''-attribute specifies the sender address for emails.
The '''specifiedPickupDirectory'''-attribute specifies the directory in which the applications e-mail messages will be stored for later processing with the SMTP server. In the example, "c:\temp\pickup" as the e-mail pickup directory.
The '''network'''-attribute configures the network options for an external SMTP server.


==Architecture (Customizing)==
==Architecture (Customizing)==


For each abonnement defined in the CoPlanner client the CoPlanner server will create a SQL Server Agent job. Each job consists of a single T-SQL step which is executing the stored procedure '''dbo.ExecReportAbo''' passing the abonnement’s '''COPSYS_ID''' as parameter.
For each [[Enterprise_Edition:Subscription_Manager|subscription]] defined in the CoPlanner client the [[Technics:CoPlanner-Server|CoPlanner Server]] will create a SQL Server Agent job. Each job consists of a single T-SQL step which is executing the stored procedure ''dbo.ExecReportAbo'' passing the [[Enterprise_Edition:Subscription_Manager|subscription]]’s ''COPSYS_ID'' as parameter.


The job will be executed according to the schedule, but can be also started manually in the CoPlanner client
The job will be executed according to the schedule, but can be also started manually in the CoPlanner client
Line 29: Line 90:
===dbo.ExecReportAbo===
===dbo.ExecReportAbo===


This stored procedure will be called by the SQL Server Agent job. This – and only this – procedure may be ajdusted as needed. '''dbo.ExecReportAbo’s''' tasks are:
This stored procedure will be called by the SQL Server Agent job. This – and only this – procedure may be ajdusted as needed. ''dbo.ExecReportAbo’s'' tasks are:




:*Determine the Abo-Executor’s path
:*Determine the Abo-Executor’s path
In the default configuration the Abo-Excutor AboExecutor.exe is located in the AboExecutor directory in the CoPlanner server directory.
In the default configuration the Abo-Excutor AboExecutor.exe is located in the AboExecutor directory in the [[Technics:CoPlanner-Server|CoPlanner Server]] directory.


:*Determine the path to the configuration file ClientConfig.xml
:*Determine the path to the configuration file [[Technics:CoPlanner_Win-Client#ClientConfig.xml|ClientConfig.xml]]
In the default configuration the configuration file is located in the Abo-Executor-directory.
In the default configuration the configuration file is located in the Abo-Executor-directory.


:*Set the username and password the Abo-Excutor will use for connecting tot he CoPlanenr server
:*Set the username and password the Abo-Excutor will use for connecting tot he CoPlanenr server
In the default configuration the PowerUser with an empty password will be used. The Abo-Executor is working with the accounts PowerUser, Partner and Hersteller only.
In the default configuration the [[Framework:Developer_mode#PowerUser|PowerUser]] with an empty password will be used. The Abo-Executor is working with the accounts [[Framework:Developer_mode#PowerUser|PowerUser]], [[Framework:Developer_mode#Partner|partner]] and [[Framework:Developer_mode#Manufacturer|manufacturer]] only.


:*Set additional Abo-Executor parameters
:*Set additional Abo-Executor parameters
Line 45: Line 106:




The stored procedure '''dbo.ExecReportAboInternal''' will be called using these values and the abonnement’s id as parameter.
The stored procedure ''dbo.ExecReportAboInternal'' will be called using these values and the [[Enterprise_Edition:Subscription_Manager|subscription]]’s id as parameter.


===dbo.ExecReportAboInternal===
===dbo.ExecReportAboInternal===
This stored procedure must not be customized. It will be overwritten by future CopVersion scripts. This stored procedure builds the Abo-Executor’s command line, executes it using '''xp_cmdshell''' and writes to the log tables.  
This stored procedure must not be customized. It will be overwritten by future CopVersion scripts. This stored procedure builds the Abo-Executor’s command line, executes it using ''xp_cmdshell'' and writes to the log tables.  


===Logging===
===Logging===
Each abonnement execution (started automatically or manually) will be logged in the following tables:  
Each [[Enterprise_Edition:Subscription_Manager|subscription]] execution (started automatically or manually) will be logged in the following tables:  


:*''dbo.tb_ExecReportAboLog''
:*''dbo.tb_ExecReportAboLog''
:*''dbo.tb_ExecReportAboLogMsg''
:*''dbo.tb_ExecReportAboLogMsg''


mit protokolliert. Die Tabellen enthalten für jedes Abonnement das Ergebnis der letzten Ausführung.
These tables contain the result of the latest execution for each [[Enterprise_Edition:Subscription_Manager|subscription]].


{| style=cellspacing="1" cellpadding="5" border="1" width={{{breite|100%}}}
{| class="wikitable" width="100%"
|-
|- {{Tabellentitel}}  
|width="200pt" style=background-color:#f6f6f6 |'''''Spalte'''''  
|width="200pt" |Column  
|style=background-color:#f6f6f6 |'''''Beschreibung'''''
|Description
|-
|-
|AboId
|AboId
|ID des Abonnements
|[[Enterprise_Edition:Subscription_Manager|Subscription]] ID
|-
|-
|AboName
|AboName
|Name des Abonnements
|[[Enterprise_Edition:Subscription_Manager|Subscription]] name
|-
|-
|ExecTime
|ExecTime
|Zeitpunkt der Ausführung (bzw. wann wurde der Log-Datensatz erstellt)
|Last [[Enterprise_Edition:Subscription_Manager|subscription]] execution
|}
|}




{| style=cellspacing="1" cellpadding="5" border="1" width={{{breite|100%}}}
{| class="wikitable" width="100%"
|-
|- {{Tabellentitel}}  
|width="200pt" style=background-color:#f6f6f6 |'''''Spalte'''''  
|width="200pt" |Column  
|style=background-color:#f6f6f6 |'''''Beschreibung'''''
|Description
|-
|-
|AboId
|AboId
|ID des Abonnements
|[[Enterprise_Edition:Subscription_Manager|Subscription]] ID
|-
|-
|LineNr
|LineNr
|Zeilennummer der Ausgabe
|Line number
|-
|-
|MsgTyp
|MsgTyp
|Typ der Zeile (siehe weiter unten)
|Line type (see below)
|-
|-
|MsgLine
|MsgLine
|Text der Zeile
|Line text
|}
|}


Mit dem Spalte ''MsgTyp'' werden die einzelnen Zeilen klassifiziert:
The ''MsgTyp'' column is used for categorizing the table’s records:
 
:*Empty Type


:*Kein Typ
Lines without type are for information only. At present also exceptions are inserted without type into the log table because it is difficult to detect these lines automatically.
Zeilen ohne Typ sind reine Informationszeilen. Auch Exceptions werden ohne Typ in die Log-Tabelle eingefügt, da sich diese Zeilen nicht leicht automatisch erkennen lassen.


:*WRN
:*WRN
Warnmeldungen, die vom Berichtsserver beim Rendern der Berichte ausgegeben werden.
Warning messages which are generated by the report server on rendering the reports.


:*ERR
:*ERR
Fehlermeldungen, die vom Berichtsserver beim Rendern der Berichte ausgegeben werden.
Error messages which are generated by the report server on rendering the reports.


:*VAR
:*VAR
Das sind spezielle, vom Abo-Executor erstellt Zeilen, über die in weiteren Abfragen oder in Berichten Informationen abgerufen werden können. Die Spalte MsgLine hat in diesen Zeilen immer den Aufbau
These are special lines which can be used for retrieving information in queries or reports. For this type of lines the MsgLine-column always looks like


''Variable'':=''Wert''
''variable:=value''


Derzeit ist nur die Variable AboName definiert, die den Namen des Abonnements liefert.
At present the only defined variable is AboName which returns the [[Enterprise_Edition:Subscription_Manager|subscription]]’s name.




__NOEDITSECTION__


[[Category:Technics|Abo-System]]
[[de:Technik:Abo-System]]
[[de:Technik:Abo-System]]

Latest revision as of 10:28, 23 October 2015

Prerequisites

The following components from the Feature Pack for SQL Server 2005 (even if a new version of SQL Server is used) must be installed on the CoPlanner Server using the proper architecture (x86 resp. x86):

  • Microsoft SQL Server Native Client
  • Microsoft SQL Server 2005 Management Objects Collection (XMO)

As far as possible the component language should meet the SQL Server language.

The xp_cmdshell-feature must be enabled for executing subscriptions

The account of the process spawned by xp_cmdshell must be in the Report-Builder (or higher) role on the report server.

The "SQL Server-Agent (MSSQLSERVER) must be started.

You have to provide a ClientConfig.xml-configuration file for the Abo-Executor.

In the default configuration at least the PowerUser's password must be set.

Hint  The abo-system is suited only for reports, which access CoPlanner data with CoPlanner Reporting Services Integration. The access to OLAP-cubes is not supported via Matrixbuilder, because the abo-system runs with a service account usually and the OLAP access is only available with SSPI.


Hint  For using the abo-system you have to pay attention to the login information of the data source. The full functionality is available only, if the mode request login information is selected. In case of windows authentication the subscriptions run in the context of xp_cmdshell.

AboExecutor.exe.config

In the file "AboExecutor.exe.config" in the folder "\server\AboExecutor" you configure the e-mail. The following points have to be adopted:

  • maxAttachmentSizeInKB: The maximum attachment size in kB. If 0 or not available, then unlimited.
  • mailSettings: e-mail settings

AboExecutor.exe.config

In the file "AboExecutor.exe.config" in the directory "\server\AboExecutor" you find the configuration for the Email dispatch.


<?xml version="1.0" encoding="utf-16" standalone="yes"?>
<configuration>
   <appSettings>
   <add key="abo" value="633964077278817699"/>
   <add key="user" value="PowerUser"/> 
   <add key="pass" value="UserPasswort"/> 
   <add key="maxAttachmentSizeInKB"value="1000"/>
   </appSettings>

   <system.net>
   <mailSettings>
      <smtp deliveryMethod="Network" from="aboexecutor@coplanner.com">
         <network
            host="psad001.graz.coplanner.com"
            port="25"
            defaultCredentials="true"
            />
      </smtp>
   </mailSettings>
 </system.net>

</configuration>


The abo-attribute can be ignored, because it will be set by the job for the subscription.

Valid entries for the user-attribute are PowerUser, Partner or Hersteller.

At the pass-attribute you have to enter the users password.

MaxAttachmentSize IKB: The maximum attachment size for e-mail delivery in kB when "0" or not existing, then unlimited.

The Delivery Method-attribute specifies the delivery method for emails. Valid values are "network", "pickupDirectoryFromIis" and "specifiedPickupDirectory".


The from-attribute specifies the sender address for emails.


The specifiedPickupDirectory-attribute specifies the directory in which the applications e-mail messages will be stored for later processing with the SMTP server. In the example, "c:\temp\pickup" as the e-mail pickup directory.

The network-attribute configures the network options for an external SMTP server.


Architecture (Customizing)

For each subscription defined in the CoPlanner client the CoPlanner Server will create a SQL Server Agent job. Each job consists of a single T-SQL step which is executing the stored procedure dbo.ExecReportAbo passing the subscription’s COPSYS_ID as parameter.

The job will be executed according to the schedule, but can be also started manually in the CoPlanner client

dbo.ExecReportAbo

This stored procedure will be called by the SQL Server Agent job. This – and only this – procedure may be ajdusted as needed. dbo.ExecReportAbo’s tasks are:


  • Determine the Abo-Executor’s path

In the default configuration the Abo-Excutor AboExecutor.exe is located in the AboExecutor directory in the CoPlanner Server directory.

In the default configuration the configuration file is located in the Abo-Executor-directory.

  • Set the username and password the Abo-Excutor will use for connecting tot he CoPlanenr server

In the default configuration the PowerUser with an empty password will be used. The Abo-Executor is working with the accounts PowerUser, partner and manufacturer only.

  • Set additional Abo-Executor parameters

In the default configuration no additional parameters are used.


The stored procedure dbo.ExecReportAboInternal will be called using these values and the subscription’s id as parameter.

dbo.ExecReportAboInternal

This stored procedure must not be customized. It will be overwritten by future CopVersion scripts. This stored procedure builds the Abo-Executor’s command line, executes it using xp_cmdshell and writes to the log tables.

Logging

Each subscription execution (started automatically or manually) will be logged in the following tables:

  • dbo.tb_ExecReportAboLog
  • dbo.tb_ExecReportAboLogMsg

These tables contain the result of the latest execution for each subscription.

Column Description
AboId Subscription ID
AboName Subscription name
ExecTime Last subscription execution


Column Description
AboId Subscription ID
LineNr Line number
MsgTyp Line type (see below)
MsgLine Line text

The MsgTyp column is used for categorizing the table’s records:

  • Empty Type

Lines without type are for information only. At present also exceptions are inserted without type into the log table because it is difficult to detect these lines automatically.

  • WRN

Warning messages which are generated by the report server on rendering the reports.

  • ERR

Error messages which are generated by the report server on rendering the reports.

  • VAR

These are special lines which can be used for retrieving information in queries or reports. For this type of lines the MsgLine-column always looks like

variable:=value

At present the only defined variable is AboName which returns the subscription’s name.