Skip to content

Commit

Permalink
PG-1250
Browse files Browse the repository at this point in the history
- removed 'ConnectToErpServerWithMessageBox' function and usages in Vault and Inventor as the connection will be handled by the newly introduced pG 'Sample.ConnectToPowerGateServer' script
  • Loading branch information
lustricker committed Oct 24, 2022
1 parent 6a458a4 commit aa5282c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 18 deletions.
2 changes: 0 additions & 2 deletions Files/DataStandard/CAD.Custom/addins/powerGateMain.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,6 @@ function InitializeWindow
{
Import-Module "C:\ProgramData\coolOrange\powerGate\Modules\Initialize.psm1" -Global
Initialize-CoolOrange
Disconnect-ERP
ConnectToErpServerWithMessageBox

$erpServices = Get-ERPServices -Available
if (-not $erpServices -or $erpServices.Count -le 0) {
Expand Down
4 changes: 1 addition & 3 deletions Files/DataStandard/Vault.Custom/addinVault/Default.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function OnTabContextChanged {
$global:ErrorActionPreference = "Stop"
$xamlFile = [System.IO.Path]::GetFileName($VaultContext.UserControl.XamlFile)
OnTabContextChanged_powerGate -xamlFile $xamlFile
OnTabContextChanged_powerGate -xamlFile $xamlFile
if ($VaultContext.SelectedObject.TypeId.SelectionContext -eq "FileMaster" -and $xamlFile -eq "CAD BOM.xaml") {
$fileMasterId = $vaultContext.SelectedObject.Id
$file = $vault.DocumentService.GetLatestFileByMasterId($fileMasterId)
Expand All @@ -23,9 +23,7 @@ function OnLogOn {

Import-Module "C:\ProgramData\coolOrange\powerGate\Modules\Initialize.psm1" -Global
Initialize-CoolOrange
Disconnect-ERP
Open-VaultConnection
ConnectToErpServerWithMessageBox
$logPath = Join-Path $env:LOCALAPPDATA "coolOrange\Projects\VDS_Vault-powerGate.log"
Set-LogFilePath -Path $logPath
}
Expand Down
14 changes: 1 addition & 13 deletions Files/powerGate/Modules/Communication.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,7 @@ function CreateUrlFromPGServerName {
return $powerGateServerErpPluginUrl;

}
function ConnectToErpServerWithMessageBox {
Log -Begin
$powerGateServerErpPluginUrl = CreateUrlFromPGServerName
if (-not $powerGateServerErpPluginUrl){
$null = ShowMessageBox -Message "The current connected VAULT $($vaultConnection.Vault) is not mapped in the configuration for any ERP.`nChange the configuration and restart vault!" -Icon Error
}
else {
Write-Host "Connecting with URL: $powerGateServerErpPluginUrl"
$connected = Connect-ERP -Service $PowerGateServerErpPluginUrl
Write-Host "Connected: $connected"
}
Log -End
}

# Use this function in Jobs
function ConnectToConfiguredErpServer {
Log -Begin
Expand Down

0 comments on commit aa5282c

Please sign in to comment.