-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
José Torres
committed
Nov 13, 2017
1 parent
27b5b73
commit c529045
Showing
52 changed files
with
80,050 additions
and
171 deletions.
There are no files selected for viewing
Binary file not shown.
54 changes: 31 additions & 23 deletions
54
IngeniBridge.Programs/IngeniBridge.GenerateFullInventory/App.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,56 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<configSections> | ||
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/> | ||
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" /> | ||
</configSections> | ||
<startup> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" /> | ||
</startup> | ||
<log4net> | ||
<appender name="LogFileAppender" type="log4net.Appender.RollingFileAppender"> | ||
<appendToFile value="true"/> | ||
<file value="IngeniBridge.GenerateFullInventory.log"/> | ||
<rollingStyle value="Size"/> | ||
<maxSizeRollBackups value="10"/> | ||
<maximumFileSize value="5MB"/> | ||
<staticLogFileName value="true"/> | ||
<appendToFile value="true" /> | ||
<file value="IngeniBridge.GenerateFullInventory.log" /> | ||
<rollingStyle value="Size" /> | ||
<maxSizeRollBackups value="10" /> | ||
<maximumFileSize value="5MB" /> | ||
<staticLogFileName value="true" /> | ||
<layout type="log4net.Layout.PatternLayout"> | ||
<param name="ConversionPattern" value="%d;[%t];%-5p;%c;%m%n"/> | ||
<param name="ConversionPattern" value="%d;[%t];%-5p;%c;%m%n" /> | ||
</layout> | ||
</appender> | ||
<appender name="LogFileErrorAppender" type="log4net.Appender.RollingFileAppender"> | ||
<appendToFile value="true"/> | ||
<file value="IngeniBridge.GenerateFullInventory.ERR.log"/> | ||
<rollingStyle value="Size"/> | ||
<maxSizeRollBackups value="10"/> | ||
<maximumFileSize value="5MB"/> | ||
<staticLogFileName value="true"/> | ||
<appendToFile value="true" /> | ||
<file value="IngeniBridge.GenerateFullInventory.ERR.log" /> | ||
<rollingStyle value="Size" /> | ||
<maxSizeRollBackups value="10" /> | ||
<maximumFileSize value="5MB" /> | ||
<staticLogFileName value="true" /> | ||
<layout type="log4net.Layout.PatternLayout"> | ||
<param name="ConversionPattern" value="%d;[%t];%-5p;%c;%m%n"/> | ||
<param name="ConversionPattern" value="%d;[%t];%-5p;%c;%m%n" /> | ||
</layout> | ||
<filter type="log4net.Filter.LevelRangeFilter"> | ||
<levelMin value="ERROR"/> | ||
<levelMax value="FATAL"/> | ||
<levelMin value="ERROR" /> | ||
<levelMax value="FATAL" /> | ||
</filter> | ||
</appender> | ||
<appender name="Console" type="log4net.Appender.ConsoleAppender"> | ||
<layout type="log4net.Layout.PatternLayout"> | ||
<conversionPattern value="%date %-5level: %message%newline"/> | ||
<conversionPattern value="%date %-5level: %message%newline" /> | ||
</layout> | ||
</appender> | ||
<root> | ||
<level value="INFO"/> | ||
<appender-ref ref="LogFileAppender"/> | ||
<appender-ref ref="LogFileErrorAppender"/> | ||
<appender-ref ref="Console"/> | ||
<level value="INFO" /> | ||
<appender-ref ref="LogFileAppender" /> | ||
<appender-ref ref="LogFileErrorAppender" /> | ||
<appender-ref ref="Console" /> | ||
</root> | ||
</log4net> | ||
<runtime> | ||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> | ||
<dependentAssembly> | ||
<assemblyIdentity name="EPPlus" publicKeyToken="ea159fdaa78159a1" culture="neutral" /> | ||
<bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0" /> | ||
</dependentAssembly> | ||
</assemblyBinding> | ||
</runtime> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+0 Bytes
(100%)
IngeniBridge.Programs/IngeniBridge.GenerateFullInventory/bin/Release/EPPlus.dll
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...ams/IngeniBridge.GenerateFullInventory/bin/Release/IngeniBridge.GenerateFullInventory.exe
Binary file not shown.
54 changes: 31 additions & 23 deletions
54
...eniBridge.GenerateFullInventory/bin/Release/IngeniBridge.GenerateFullInventory.exe.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,56 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<configSections> | ||
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/> | ||
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" /> | ||
</configSections> | ||
<startup> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" /> | ||
</startup> | ||
<log4net> | ||
<appender name="LogFileAppender" type="log4net.Appender.RollingFileAppender"> | ||
<appendToFile value="true"/> | ||
<file value="IngeniBridge.GenerateFullInventory.log"/> | ||
<rollingStyle value="Size"/> | ||
<maxSizeRollBackups value="10"/> | ||
<maximumFileSize value="5MB"/> | ||
<staticLogFileName value="true"/> | ||
<appendToFile value="true" /> | ||
<file value="IngeniBridge.GenerateFullInventory.log" /> | ||
<rollingStyle value="Size" /> | ||
<maxSizeRollBackups value="10" /> | ||
<maximumFileSize value="5MB" /> | ||
<staticLogFileName value="true" /> | ||
<layout type="log4net.Layout.PatternLayout"> | ||
<param name="ConversionPattern" value="%d;[%t];%-5p;%c;%m%n"/> | ||
<param name="ConversionPattern" value="%d;[%t];%-5p;%c;%m%n" /> | ||
</layout> | ||
</appender> | ||
<appender name="LogFileErrorAppender" type="log4net.Appender.RollingFileAppender"> | ||
<appendToFile value="true"/> | ||
<file value="IngeniBridge.GenerateFullInventory.ERR.log"/> | ||
<rollingStyle value="Size"/> | ||
<maxSizeRollBackups value="10"/> | ||
<maximumFileSize value="5MB"/> | ||
<staticLogFileName value="true"/> | ||
<appendToFile value="true" /> | ||
<file value="IngeniBridge.GenerateFullInventory.ERR.log" /> | ||
<rollingStyle value="Size" /> | ||
<maxSizeRollBackups value="10" /> | ||
<maximumFileSize value="5MB" /> | ||
<staticLogFileName value="true" /> | ||
<layout type="log4net.Layout.PatternLayout"> | ||
<param name="ConversionPattern" value="%d;[%t];%-5p;%c;%m%n"/> | ||
<param name="ConversionPattern" value="%d;[%t];%-5p;%c;%m%n" /> | ||
</layout> | ||
<filter type="log4net.Filter.LevelRangeFilter"> | ||
<levelMin value="ERROR"/> | ||
<levelMax value="FATAL"/> | ||
<levelMin value="ERROR" /> | ||
<levelMax value="FATAL" /> | ||
</filter> | ||
</appender> | ||
<appender name="Console" type="log4net.Appender.ConsoleAppender"> | ||
<layout type="log4net.Layout.PatternLayout"> | ||
<conversionPattern value="%date %-5level: %message%newline"/> | ||
<conversionPattern value="%date %-5level: %message%newline" /> | ||
</layout> | ||
</appender> | ||
<root> | ||
<level value="INFO"/> | ||
<appender-ref ref="LogFileAppender"/> | ||
<appender-ref ref="LogFileErrorAppender"/> | ||
<appender-ref ref="Console"/> | ||
<level value="INFO" /> | ||
<appender-ref ref="LogFileAppender" /> | ||
<appender-ref ref="LogFileErrorAppender" /> | ||
<appender-ref ref="Console" /> | ||
</root> | ||
</log4net> | ||
<runtime> | ||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> | ||
<dependentAssembly> | ||
<assemblyIdentity name="EPPlus" publicKeyToken="ea159fdaa78159a1" culture="neutral" /> | ||
<bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0" /> | ||
</dependentAssembly> | ||
</assemblyBinding> | ||
</runtime> | ||
</configuration> |
Binary file modified
BIN
+0 Bytes
(100%)
...ams/IngeniBridge.GenerateFullInventory/bin/Release/IngeniBridge.GenerateFullInventory.pdb
Binary file not shown.
2 changes: 1 addition & 1 deletion
2
IngeniBridge.Programs/IngeniBridge.GenerateFullInventory/packages.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
IngeniBridge.Programs/IngeniBridge.IBDatabaseParser/App.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<configuration> | ||
<startup> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" /> | ||
</startup> | ||
</configuration> |
9 changes: 9 additions & 0 deletions
9
IngeniBridge.Programs/IngeniBridge.IBDatabaseParser/CommandLineOptions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using CommandLine; | ||
namespace IngeniBridge.IBDatabaseParser | ||
{ | ||
internal class CommandLineOptions | ||
{ | ||
[Option ( 'm', "IngeniBridgeDBFile", Required = true, HelpText = "IngeniBridge DB file")] | ||
public string INgeniBridgeDBFile { get; set; } | ||
} | ||
} |
87 changes: 87 additions & 0 deletions
87
IngeniBridge.Programs/IngeniBridge.IBDatabaseParser/IngeniBridge.IBDatabaseParser.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{260CFB42-5402-4AA0-8A30-E38C73CFD19C}</ProjectGuid> | ||
<OutputType>Exe</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>IngeniBridge.IBDatabaseParser</RootNamespace> | ||
<AssemblyName>IngeniBridge.IBDatabaseParser</AssemblyName> | ||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<PlatformTarget>AnyCPU</PlatformTarget> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<PlatformTarget>AnyCPU</PlatformTarget> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="CommandLine, Version=2.0.0.0, Culture=neutral, PublicKeyToken=de6f01bd326f8c32, processorArchitecture=MSIL"> | ||
<HintPath>..\packages\CommandLineParser20.2.0.0.0\lib\net40\CommandLine.dll</HintPath> | ||
<Private>True</Private> | ||
</Reference> | ||
<Reference Include="EPPlus, Version=4.1.1.0, Culture=neutral, PublicKeyToken=ea159fdaa78159a1, processorArchitecture=MSIL"> | ||
<HintPath>..\packages\EPPlus.4.1.1\lib\net40\EPPlus.dll</HintPath> | ||
<Private>True</Private> | ||
</Reference> | ||
<Reference Include="IngeniBridge.Core, Version=1.0.25.0, Culture=neutral, processorArchitecture=MSIL"> | ||
<HintPath>..\packages\IngeniBridge.Core.1.0.25\lib\net452\IngeniBridge.Core.dll</HintPath> | ||
<Private>True</Private> | ||
</Reference> | ||
<Reference Include="JT.TechCases.Threading, Version=1.0.10.0, Culture=neutral, processorArchitecture=MSIL"> | ||
<HintPath>..\packages\JT.TechCases.Threading.1.0.10\lib\net452\JT.TechCases.Threading.dll</HintPath> | ||
<Private>True</Private> | ||
</Reference> | ||
<Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> | ||
<HintPath>..\packages\log4net.2.0.8\lib\net45-full\log4net.dll</HintPath> | ||
<Private>True</Private> | ||
</Reference> | ||
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> | ||
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath> | ||
<Private>True</Private> | ||
</Reference> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Xml.Linq" /> | ||
<Reference Include="System.Data.DataSetExtensions" /> | ||
<Reference Include="Microsoft.CSharp" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Net.Http" /> | ||
<Reference Include="System.Xml" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="CommandLineOptions.cs" /> | ||
<Compile Include="Program.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="App.config" /> | ||
<None Include="LaunchOnMyCompanyDb.cmd" /> | ||
<None Include="packages.config" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. | ||
Other similar extension points exist, see Microsoft.Common.targets. | ||
<Target Name="BeforeBuild"> | ||
</Target> | ||
<Target Name="AfterBuild"> | ||
</Target> | ||
--> | ||
</Project> |
3 changes: 3 additions & 0 deletions
3
IngeniBridge.Programs/IngeniBridge.IBDatabaseParser/LaunchOnMyCompanyDb.cmd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
rem dont forget to rename ibdb file in the command line | ||
bin\Release\IngeniBridge.IBDatabaseParser --IngeniBridgeDBFile=..\..\IngeniBridge.Sample.MyCompany\IngeniBridge.Samples.MyCompany\MasterAssetMyCompany_2017_09_18.ibdb | ||
pause |
72 changes: 72 additions & 0 deletions
72
IngeniBridge.Programs/IngeniBridge.IBDatabaseParser/Program.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
using CommandLine; | ||
using IngeniBridge.Core.Diags; | ||
using IngeniBridge.Core.Iterator; | ||
using IngeniBridge.Core.MetaHelper; | ||
using IngeniBridge.Core.StagingData; | ||
using log4net; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.Linq; | ||
using System.Reflection; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace IngeniBridge.IBDatabaseParser | ||
{ | ||
class Program | ||
{ | ||
private static readonly ILog log = LogManager.GetLogger ( System.Reflection.MethodBase.GetCurrentMethod ().DeclaringType ); | ||
static int Main ( string [] args ) | ||
{ | ||
int ret = 0; | ||
log4net.Config.XmlConfigurator.Configure (); | ||
ParserResult<CommandLineOptions> result = CommandLine.Parser.Default.ParseArguments<CommandLineOptions> ( args ); | ||
if ( result.Errors.Any () ) | ||
{ | ||
ret = 1; | ||
return ( ret ); | ||
} | ||
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo ( Assembly.GetEntryAssembly ().Location ); | ||
log.Info ( fvi.ProductName + " v" + fvi.FileVersion + " -- " + fvi.LegalCopyright ); | ||
log.Info ( "INgeniBridgeDBFile => " + result.Value.INgeniBridgeDBFile ); | ||
try | ||
{ | ||
Core.StagingData.Serializer ser = new Core.StagingData.Serializer (); | ||
Console.WriteLine ( "Deserialzing IB database => " + result.Value.INgeniBridgeDBFile ); | ||
DataModelVersion dmv = ser.DeserializeTree ( result.Value.INgeniBridgeDBFile ); | ||
MetaHelper helper = new MetaHelper ( ser.DataModelAssembly ); | ||
log.Info ( "DataModel Name => " + dmv.Name ); | ||
log.Info ( "DataModel Date => " + dmv.Generated.ToString () ); | ||
log.Info ( "DataModel Version Major => " + dmv.Major.ToString () ); | ||
log.Info ( "DataModel Version Minor => " + dmv.Minor.ToString () ); | ||
log.Info ( "DataModel Version Build => " + dmv.Build.ToString () ); | ||
TreeChecker tc = new TreeChecker ( helper ); | ||
Console.WriteLine ( "Verifying the tree..." ); | ||
tc.CheckTree ( ser.Frame, false, message => log.Error ( message ) ); | ||
new Core.Iterator.NodesHelper ( helper ).IterateTree ( ser.Frame.TreeRoot, ( inode ) => | ||
{ | ||
Console.WriteLine ( "Tree pos => " + inode.FlatPath ); | ||
Console.WriteLine ( "\tObject => " + inode.vemdNode.EntityType.Name + " - " + helper.RetrieveCodeValue ( inode.Node ) + " - " + helper.RetrieveLabelValue ( inode.Node ) ); | ||
helper.RetrieveCodeValue ( inode.Node ); | ||
EntityMetaDescription mdv = helper.GetMetaDataFromType ( inode.GetType () ); | ||
new MetaHelper ( ser.DataModelAssembly ).ParseAttributes ( inode.Node, ( attribute, val ) => | ||
{ | ||
Console.WriteLine ( "\t\tAttribute => " + attribute.AttributeType.Name + " - " + val.ToString () ); | ||
return ( true ); | ||
}, true, true ); | ||
return ( true ); | ||
} ); | ||
log.Info ( "Terminated OK." ); | ||
} | ||
catch ( Exception ex ) | ||
{ | ||
log.Error ( ex ); | ||
Console.WriteLine ( ex.Message ); | ||
log.Error ( "Terminated FAILED." ); | ||
ret = 1; | ||
} | ||
return ( ret ); | ||
} | ||
} | ||
} |
Oops, something went wrong.