CapicuaGenGaspar 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +11 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +4 -0
  5. data/CODE_OF_CONDUCT.md +49 -0
  6. data/CapicuaGenGaspar.gemspec +60 -0
  7. data/Gemfile +4 -0
  8. data/Gemfile.lock +33 -0
  9. data/LICENSE +165 -0
  10. data/README.md +41 -0
  11. data/Rakefile +6 -0
  12. data/bin/console +14 -0
  13. data/bin/setup +8 -0
  14. data/lib/CapicuaGenGaspar/Business/CSSqlEntitityInterface/Source/cs_sql_entity_interface_feature.rb +96 -0
  15. data/lib/CapicuaGenGaspar/Business/CSSqlEntitityInterface/Template/table_interface.erb +49 -0
  16. data/lib/CapicuaGenGaspar/Business/CSSqlEntity/Source/cs_sql_entity_feature.rb +103 -0
  17. data/lib/CapicuaGenGaspar/Business/CSSqlEntity/Template/table_entity.erb +51 -0
  18. data/lib/CapicuaGenGaspar/CodeTransformer/CSHeaderFooter/Source/cs_header_footer_feature.rb +148 -0
  19. data/lib/CapicuaGenGaspar/CodeTransformer/CSHeaderFooter/Template/footer.erb +37 -0
  20. data/lib/CapicuaGenGaspar/CodeTransformer/CSHeaderFooter/Template/header.erb +43 -0
  21. data/lib/CapicuaGenGaspar/CodeTransformer/CodeMaidCleaner/Bin/EnvDTE.dll +0 -0
  22. data/lib/CapicuaGenGaspar/CodeTransformer/CodeMaidCleaner/Bin/EnvDTE80.dll +0 -0
  23. data/lib/CapicuaGenGaspar/CodeTransformer/CodeMaidCleaner/Bin/RunCodeMaidCleaner.exe +0 -0
  24. data/lib/CapicuaGenGaspar/CodeTransformer/CodeMaidCleaner/Bin/RunCodeMaidCleaner.exe.config +52 -0
  25. data/lib/CapicuaGenGaspar/CodeTransformer/CodeMaidCleaner/Bin/stdole.dll +0 -0
  26. data/lib/CapicuaGenGaspar/CodeTransformer/CodeMaidCleaner/Source/code_maid_cleaner_feature.rb +162 -0
  27. data/lib/CapicuaGenGaspar/DataAccess/CSConnectionProvider/Source/cs_db_connection_provider_feature.rb +90 -0
  28. data/lib/CapicuaGenGaspar/DataAccess/CSSqlDataAccess/Source/cs_sql_data_access_feature.rb +106 -0
  29. data/lib/CapicuaGenGaspar/DataAccess/CSSqlDataAccess/Template/data_access.erb +154 -0
  30. data/lib/CapicuaGenGaspar/DataAccess/CSSqlDataAccess/Template/data_access_exception.erb +36 -0
  31. data/lib/CapicuaGenGaspar/DataAccess/CSSqlDataAccess/Template/data_access_table.erb +298 -0
  32. data/lib/CapicuaGenGaspar/Entities/CSEntity/Source/entity_field_schema.rb +100 -0
  33. data/lib/CapicuaGenGaspar/GUI/CSAboutWindowsForm/Source/cs_about_windows_form_feature.rb +85 -0
  34. data/lib/CapicuaGenGaspar/GUI/CSAboutWindowsForm/Template/AboutForm.designer.erb +211 -0
  35. data/lib/CapicuaGenGaspar/GUI/CSAboutWindowsForm/Template/AboutForm.erb +127 -0
  36. data/lib/CapicuaGenGaspar/GUI/CSAboutWindowsForm/Template/AboutForm.resx.erb +535 -0
  37. data/lib/CapicuaGenGaspar/GUI/CSCatalogWindowsForm/Source/cs_catalog_windows_form_feature.rb +146 -0
  38. data/lib/CapicuaGenGaspar/GUI/CSCatalogWindowsForm/Template/CatalogForm.Designer.erb +363 -0
  39. data/lib/CapicuaGenGaspar/GUI/CSCatalogWindowsForm/Template/CatalogForm.erb +320 -0
  40. data/lib/CapicuaGenGaspar/GUI/CSCatalogWindowsForm/Template/CatalogForm.resx.erb +2407 -0
  41. data/lib/CapicuaGenGaspar/GUI/CSCatalogWindowsForm/Template/CatalogState.erb +51 -0
  42. data/lib/CapicuaGenGaspar/GUI/CSMDIWindowsForm/Source/cs_mdi_windows_form_feature.rb +93 -0
  43. data/lib/CapicuaGenGaspar/GUI/CSMDIWindowsForm/Template/MainForm.Designer.erb +316 -0
  44. data/lib/CapicuaGenGaspar/GUI/CSMDIWindowsForm/Template/MainForm.erb +161 -0
  45. data/lib/CapicuaGenGaspar/GUI/CSMDIWindowsForm/Template/MainForm.resx.erb +2504 -0
  46. data/lib/CapicuaGenGaspar/GUI/CSMDIWindowsForm/Template/MsgboxConsts.erb +31 -0
  47. data/lib/CapicuaGenGaspar/GUI/CSSplashWindowsForm/Source/cs_splash_windows_feature.rb +87 -0
  48. data/lib/CapicuaGenGaspar/GUI/CSSplashWindowsForm/Template/SplashForm.designer.erb +141 -0
  49. data/lib/CapicuaGenGaspar/GUI/CSSplashWindowsForm/Template/SplashForm.erb +160 -0
  50. data/lib/CapicuaGenGaspar/GUI/CSSplashWindowsForm/Template/SplashForm.resx.erb +535 -0
  51. data/lib/CapicuaGenGaspar/Mixins/about_mixin.rb +55 -0
  52. data/lib/CapicuaGenGaspar/Mixins/catalog_mixin.rb +65 -0
  53. data/lib/CapicuaGenGaspar/Mixins/cs_app_config_mixin.rb +41 -0
  54. data/lib/CapicuaGenGaspar/Mixins/cs_db_connection_provider_mixin.rb +67 -0
  55. data/lib/CapicuaGenGaspar/Mixins/cs_namespace_mixin.rb +53 -0
  56. data/lib/CapicuaGenGaspar/Mixins/entity_interface_mixin.rb +57 -0
  57. data/lib/CapicuaGenGaspar/Mixins/entity_mixin.rb +58 -0
  58. data/lib/CapicuaGenGaspar/Mixins/entity_sql_table_mixin.rb +58 -0
  59. data/lib/CapicuaGenGaspar/Mixins/main_form_mixin.rb +55 -0
  60. data/lib/CapicuaGenGaspar/Mixins/splash_mixin.rb +54 -0
  61. data/lib/CapicuaGenGaspar/Proyect/CSProyect/Source/cs_proyect_feature.rb +140 -0
  62. data/lib/CapicuaGenGaspar/Proyect/CSProyectRESTFul/Source/cs_proyect_rest_ful_feature.rb +82 -0
  63. data/lib/CapicuaGenGaspar/Proyect/CSProyectRESTFul/Template/AssemblyInfo.erb +59 -0
  64. data/lib/CapicuaGenGaspar/Proyect/CSProyectRESTFul/Template/ExcepcionControlada.erb +38 -0
  65. data/lib/CapicuaGenGaspar/Proyect/CSProyectRESTFul/Template/Proyect.erb +114 -0
  66. data/lib/CapicuaGenGaspar/Proyect/CSProyectRESTFul/Template/Soluction.erb +54 -0
  67. data/lib/CapicuaGenGaspar/Proyect/CSProyectRESTFul/Template/Web.erb +66 -0
  68. data/lib/CapicuaGenGaspar/Proyect/CSProyectWindowsForm/Source/cs_proyect_windows_form_feature.rb +85 -0
  69. data/lib/CapicuaGenGaspar/Proyect/CSProyectWindowsForm/Template/App.erb +32 -0
  70. data/lib/CapicuaGenGaspar/Proyect/CSProyectWindowsForm/Template/AssemblyInfo.erb +59 -0
  71. data/lib/CapicuaGenGaspar/Proyect/CSProyectWindowsForm/Template/ControlExcepciones.erb +49 -0
  72. data/lib/CapicuaGenGaspar/Proyect/CSProyectWindowsForm/Template/ExcepcionControlada.erb +40 -0
  73. data/lib/CapicuaGenGaspar/Proyect/CSProyectWindowsForm/Template/Program.erb +46 -0
  74. data/lib/CapicuaGenGaspar/Proyect/CSProyectWindowsForm/Template/Proyect.erb +138 -0
  75. data/lib/CapicuaGenGaspar/Proyect/CSProyectWindowsForm/Template/Soluction.erb +55 -0
  76. data/lib/CapicuaGenGaspar/Tools/message_helper.rb +43 -0
  77. data/lib/CapicuaGenGaspar/WCFService/CSRESTFulCatalog/Source/cs_rest_ful_catalog_feature.rb +176 -0
  78. data/lib/CapicuaGenGaspar/WCFService/CSRESTFulCatalog/Template/CatalogState.erb +51 -0
  79. data/lib/CapicuaGenGaspar/WCFService/CSRESTFulCatalog/Template/Catalogs.erb +58 -0
  80. data/lib/CapicuaGenGaspar/WCFService/CSRESTFulCatalog/Template/Catalogs.svc.erb +24 -0
  81. data/lib/CapicuaGenGaspar/WCFService/CSRESTFulCatalog/Template/ICatalogs.erb +58 -0
  82. data/lib/CapicuaGenGaspar/gaspar.rb +44 -0
  83. data/lib/CapicuaGenGaspar/version.rb +3 -0
  84. metadata +216 -0
@@ -0,0 +1,40 @@
1
+ <%
2
+ #encoding: UTF-8
3
+
4
+ =begin
5
+
6
+ CapicuaGen
7
+
8
+ CapicuaGen es un software que ayuda a la creación automática de
9
+ sistemas empresariales a través de la definición y ensamblado de
10
+ diversos generadores de características.
11
+
12
+ El proyecto fue iniciado por José Luis Bautista Martin, el 6 de enero
13
+ del 2016.
14
+
15
+ Puede modificar y distribuir este software, según le plazca, y usarlo
16
+ para cualquier fin ya sea comercial, personal, educativo, o de cualquier
17
+ índole, siempre y cuando incluya este mensaje, y se permita acceso el
18
+ código fuente.
19
+
20
+ Este software es código libre, y se licencia bajo LGPL.
21
+
22
+ Para más información consultar http://www.gnu.org/licenses/lgpl.html
23
+ =end
24
+ %>using System;
25
+ using System.Windows.Forms;
26
+
27
+
28
+ namespace <%=generation_attributes[:namespace]%>
29
+ {
30
+ /// <summary>
31
+ /// Excepcion controlada
32
+ /// </summary>
33
+ abstract partial class ExcepcionControlada : Exception
34
+ {
35
+ public ExcepcionControlada(string mensaje)
36
+ : base(mensaje)
37
+ {
38
+ }
39
+ }
40
+ }
@@ -0,0 +1,46 @@
1
+ <%
2
+ #encoding: UTF-8
3
+
4
+ =begin
5
+
6
+ CapicuaGen
7
+
8
+ CapicuaGen es un software que ayuda a la creación automática de
9
+ sistemas empresariales a través de la definición y ensamblado de
10
+ diversos generadores de características.
11
+
12
+ El proyecto fue iniciado por José Luis Bautista Martin, el 6 de enero
13
+ del 2016.
14
+
15
+ Puede modificar y distribuir este software, según le plazca, y usarlo
16
+ para cualquier fin ya sea comercial, personal, educativo, o de cualquier
17
+ índole, siempre y cuando incluya este mensaje, y se permita acceso el
18
+ código fuente.
19
+
20
+ Este software es código libre, y se licencia bajo LGPL.
21
+
22
+ Para más información consultar http://www.gnu.org/licenses/lgpl.html
23
+ =end
24
+ %>using System;
25
+ using System.Windows.Forms;
26
+
27
+
28
+ namespace <%=generation_attributes[:namespace]%>
29
+ {
30
+ static class Program
31
+ {
32
+ /// <summary>
33
+ /// Punto de entrada de la aplicación
34
+ /// </summary>
35
+ [STAThread]
36
+ private static void Main()
37
+ {
38
+ Application.EnableVisualStyles();
39
+ Application.SetCompatibleTextRenderingDefault(false);
40
+ <%if get_splash_class_name%>//Muestro Splash Screen
41
+ Application.Run(new <%=get_splash_class_full_name%>());
42
+ <%end%>//Muestro la pantalla principal
43
+ Application.Run(new <%=get_main_form_class_full_name%>());
44
+ }
45
+ }
46
+ }
@@ -0,0 +1,138 @@
1
+ <%
2
+ #encoding: UTF-8
3
+
4
+ =begin
5
+
6
+ CapicuaGen
7
+
8
+ CapicuaGen es un software que ayuda a la creación automática de
9
+ sistemas empresariales a través de la definición y ensamblado de
10
+ diversos generadores de características.
11
+
12
+ El proyecto fue iniciado por José Luis Bautista Martin, el 6 de enero
13
+ del 2016.
14
+
15
+ Puede modificar y distribuir este software, según le plazca, y usarlo
16
+ para cualquier fin ya sea comercial, personal, educativo, o de cualquier
17
+ índole, siempre y cuando incluya este mensaje, y se permita acceso el
18
+ código fuente.
19
+
20
+ Este software es código libre, y se licencia bajo LGPL.
21
+
22
+ Para más información consultar http://www.gnu.org/licenses/lgpl.html
23
+ =end
24
+ %><?xml version="1.0" encoding="utf-8"?>
25
+ <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
26
+ <PropertyGroup>
27
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
28
+ <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
29
+ <ProductVersion>8.0.30703</ProductVersion>
30
+ <SchemaVersion>2.0</SchemaVersion>
31
+ <ProjectGuid>{<%=self.generation_attributes[:project_guid]%>}</ProjectGuid>
32
+ <OutputType>WinExe</OutputType>
33
+ <AppDesignerFolder>Properties</AppDesignerFolder>
34
+ <RootNamespace><%=generation_attributes[:namespace]%></RootNamespace>
35
+ <AssemblyName><%=generation_attributes[:namespace]%></AssemblyName>
36
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
37
+ <TargetFrameworkProfile>
38
+ </TargetFrameworkProfile>
39
+ <FileAlignment>512</FileAlignment>
40
+ <PublishUrl>publish\</PublishUrl>
41
+ <Install>true</Install>
42
+ <InstallFrom>Disk</InstallFrom>
43
+ <UpdateEnabled>false</UpdateEnabled>
44
+ <UpdateMode>Foreground</UpdateMode>
45
+ <UpdateInterval>7</UpdateInterval>
46
+ <UpdateIntervalUnits>Days</UpdateIntervalUnits>
47
+ <UpdatePeriodically>false</UpdatePeriodically>
48
+ <UpdateRequired>false</UpdateRequired>
49
+ <MapFileExtensions>true</MapFileExtensions>
50
+ <ApplicationRevision>0</ApplicationRevision>
51
+ <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
52
+ <IsWebBootstrapper>false</IsWebBootstrapper>
53
+ <UseApplicationTrust>false</UseApplicationTrust>
54
+ <BootstrapperEnabled>true</BootstrapperEnabled>
55
+ </PropertyGroup>
56
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
57
+ <PlatformTarget>x86</PlatformTarget>
58
+ <DebugSymbols>true</DebugSymbols>
59
+ <DebugType>full</DebugType>
60
+ <Optimize>false</Optimize>
61
+ <OutputPath>bin\Debug\</OutputPath>
62
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
63
+ <ErrorReport>prompt</ErrorReport>
64
+ <WarningLevel>4</WarningLevel>
65
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
66
+ </PropertyGroup>
67
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
68
+ <PlatformTarget>x86</PlatformTarget>
69
+ <DebugType>pdbonly</DebugType>
70
+ <Optimize>true</Optimize>
71
+ <OutputPath>bin\Release\</OutputPath>
72
+ <DefineConstants>TRACE</DefineConstants>
73
+ <ErrorReport>prompt</ErrorReport>
74
+ <WarningLevel>4</WarningLevel>
75
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
76
+ </PropertyGroup>
77
+ <ItemGroup>
78
+ <Reference Include="System" />
79
+ <Reference Include="System.configuration" />
80
+ <Reference Include="System.Core" />
81
+ <Reference Include="System.Xml.Linq" />
82
+ <Reference Include="System.Data.DataSetExtensions" />
83
+ <Reference Include="Microsoft.CSharp" />
84
+ <Reference Include="System.Data" />
85
+ <Reference Include="System.Deployment" />
86
+ <Reference Include="System.Drawing" />
87
+ <Reference Include="System.Windows.Forms" />
88
+ <Reference Include="System.Xml" />
89
+ </ItemGroup>
90
+ <ItemGroup>
91
+ <%=get_proyect_files()
92
+ %> </ItemGroup>
93
+ <ItemGroup>
94
+ <BootstrapperPackage Include=".NETFramework,Version=v4.0">
95
+ <Visible>False</Visible>
96
+ <ProductName>Microsoft .NET Framework 4 %28x86 y x64%29</ProductName>
97
+ <Install>true</Install>
98
+ </BootstrapperPackage>
99
+ <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
100
+ <Visible>False</Visible>
101
+ <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
102
+ <Install>false</Install>
103
+ </BootstrapperPackage>
104
+ <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
105
+ <Visible>False</Visible>
106
+ <ProductName>.NET Framework 3.5 SP1</ProductName>
107
+ <Install>false</Install>
108
+ </BootstrapperPackage>
109
+ <BootstrapperPackage Include="Microsoft.SQL.Server.Compact.3.5">
110
+ <Visible>False</Visible>
111
+ <ProductName>SQL Server Compact 3.5 SP2</ProductName>
112
+ <Install>true</Install>
113
+ </BootstrapperPackage>
114
+ <BootstrapperPackage Include="Microsoft.Sql.Server.Express.10.0">
115
+ <Visible>False</Visible>
116
+ <ProductName>SQL Server 2008 Express Edition</ProductName>
117
+ <Install>true</Install>
118
+ </BootstrapperPackage>
119
+ <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
120
+ <Visible>False</Visible>
121
+ <ProductName>Windows Installer 3.1</ProductName>
122
+ <Install>true</Install>
123
+ </BootstrapperPackage>
124
+ <BootstrapperPackage Include="Microsoft.Windows.Installer.4.5">
125
+ <Visible>False</Visible>
126
+ <ProductName>Windows Installer 4.5</ProductName>
127
+ <Install>true</Install>
128
+ </BootstrapperPackage>
129
+ </ItemGroup>
130
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
131
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
132
+ Other similar extension points exist, see Microsoft.Common.targets.
133
+ <Target Name="BeforeBuild">
134
+ </Target>
135
+ <Target Name="AfterBuild">
136
+ </Target>
137
+ -->
138
+ </Project>
@@ -0,0 +1,55 @@
1
+ <%
2
+ #encoding: UTF-8
3
+
4
+ =begin
5
+
6
+ CapicuaGen
7
+
8
+ CapicuaGen es un software que ayuda a la creación automática de
9
+ sistemas empresariales a través de la definición y ensamblado de
10
+ diversos generadores de características.
11
+
12
+ El proyecto fue iniciado por José Luis Bautista Martin, el 6 de enero
13
+ del 2016.
14
+
15
+ Puede modificar y distribuir este software, según le plazca, y usarlo
16
+ para cualquier fin ya sea comercial, personal, educativo, o de cualquier
17
+ índole, siempre y cuando incluya este mensaje, y se permita acceso el
18
+ código fuente.
19
+
20
+ Este software es código libre, y se licencia bajo LGPL.
21
+
22
+ Para más información consultar http://www.gnu.org/licenses/lgpl.html
23
+ =end
24
+ %>Microsoft Visual Studio Solution File, Format Version 12.00
25
+ # Visual Studio 14
26
+ VisualStudioVersion = 14.0.24720.0
27
+ MinimumVisualStudioVersion = 10.0.40219.1
28
+ <%
29
+ generator.get_features_in_targets_by_type(:proyect).each do |f|
30
+ f.get_relative_out_files(:directory_base => File.dirname(out_file), :types => :proyect).each do |p|
31
+ %>Project("<%=self.generation_attributes[:project_guid]%>") = "<%=self.generation_attributes[:namespace]%>", "<%=p%>", "<%=self.generation_attributes[:project_guid]%>"
32
+ <% end
33
+ end
34
+ %>EndProject
35
+ Global
36
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
37
+ Debug|Any CPU = Debug|Any CPU
38
+ Debug|x86 = Debug|x86
39
+ Release|Any CPU = Release|Any CPU
40
+ Release|x86 = Release|x86
41
+ EndGlobalSection
42
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
43
+ {4BAEBBDC-C7FA-4841-AAC4-958E89B6AB81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
44
+ {4BAEBBDC-C7FA-4841-AAC4-958E89B6AB81}.Debug|Any CPU.Build.0 = Debug|Any CPU
45
+ {4BAEBBDC-C7FA-4841-AAC4-958E89B6AB81}.Debug|x86.ActiveCfg = Debug|x86
46
+ {4BAEBBDC-C7FA-4841-AAC4-958E89B6AB81}.Debug|x86.Build.0 = Debug|x86
47
+ {4BAEBBDC-C7FA-4841-AAC4-958E89B6AB81}.Release|Any CPU.ActiveCfg = Release|Any CPU
48
+ {4BAEBBDC-C7FA-4841-AAC4-958E89B6AB81}.Release|Any CPU.Build.0 = Release|Any CPU
49
+ {4BAEBBDC-C7FA-4841-AAC4-958E89B6AB81}.Release|x86.ActiveCfg = Release|x86
50
+ {4BAEBBDC-C7FA-4841-AAC4-958E89B6AB81}.Release|x86.Build.0 = Release|x86
51
+ EndGlobalSection
52
+ GlobalSection(SolutionProperties) = preSolution
53
+ HideSolutionNode = FALSE
54
+ EndGlobalSection
55
+ EndGlobal
@@ -0,0 +1,43 @@
1
+ =begin
2
+
3
+ CapicuaGen
4
+
5
+ CapicuaGen es un software que ayuda a la creación automática de
6
+ sistemas empresariales a través de la definición y ensamblado de
7
+ diversos generadores de características.
8
+
9
+ El proyecto fue iniciado por José Luis Bautista Martin, el 6 de enero
10
+ del 2016.
11
+
12
+ Puede modificar y distribuir este software, según le plazca, y usarlo
13
+ para cualquier fin ya sea comercial, personal, educativo, o de cualquier
14
+ índole, siempre y cuando incluya este mensaje, y se permita acceso el
15
+ código fuente.
16
+
17
+ Este software es código libre, y se licencia bajo LGPL.
18
+
19
+ Para más información consultar http://www.gnu.org/licenses/lgpl.html
20
+ =end
21
+
22
+ # Agrega opciones de refleccion a las clases que lo implementan
23
+ module CapicuaGen
24
+
25
+ # Modifica la clase MessageHelper para agregar informacion relativa
26
+ # a los mensajes generados por GASPAR
27
+ class MessageHelper
28
+
29
+ public
30
+
31
+
32
+ # Indica que un archivo fue limpiado (por CodeMaid)
33
+ def puts_code_clean(out_file)
34
+ result= ''
35
+ result= "* -> '#{out_file}': Limpiado"
36
+ puts_message result
37
+ end
38
+
39
+
40
+ end
41
+
42
+
43
+ end
@@ -0,0 +1,176 @@
1
+ =begin
2
+
3
+ CapicuaGen
4
+
5
+ CapicuaGen es un software que ayuda a la creación automática de
6
+ sistemas empresariales a través de la definición y ensamblado de
7
+ diversos generadores de características.
8
+
9
+ El proyecto fue iniciado por José Luis Bautista Martin, el 6 de enero
10
+ del 2016.
11
+
12
+ Puede modificar y distribuir este software, según le plazca, y usarlo
13
+ para cualquier fin ya sea comercial, personal, educativo, o de cualquier
14
+ índole, siempre y cuando incluya este mensaje, y se permita acceso el
15
+ código fuente.
16
+
17
+ Este software es código libre, y se licencia bajo LGPL.
18
+
19
+ Para más información consultar http://www.gnu.org/licenses/lgpl.html
20
+ =end
21
+
22
+ require 'active_support/core_ext/object/blank'
23
+
24
+
25
+ require 'CapicuaGen/Mixins/attributes_mixin'
26
+ require_relative '../../../Mixins/cs_namespace_mixin'
27
+ require_relative '../../../Mixins/entity_interface_mixin'
28
+ require_relative '../../../Mixins/entity_mixin'
29
+ require_relative '../../../Mixins/entity_sql_table_mixin'
30
+
31
+
32
+ module CapicuaGen::Gaspar
33
+ # Caracteristica generadora para acceso a catalogos de RestFUL
34
+ # creados a traves de entidades de negocio
35
+ class CSRESTFULCatalogFeature < CapicuaGen::TemplateFeature
36
+ include CapicuaGen
37
+ include CapicuaGen::Gaspar
38
+ include CapicuaGen::Melchior
39
+
40
+ public
41
+
42
+ # Inicializa la caracteristica
43
+ def initialize(values= {})
44
+ super(values)
45
+
46
+ # Configuro los tipos si estos no han sido configurados previamente
47
+ self.types= [:catalog] if self.types.blank?
48
+
49
+ # Configuro los templates
50
+ set_template("catalogState", Template.new(:file => 'CatalogState.erb'))
51
+ set_template('catalogs', Template.new(:file => 'Catalogs.erb'))
52
+ set_template('catalogs.svc', Template.new(:file => 'Catalogs.svc.erb'))
53
+ set_template('icatalogs', Template.new(:file => 'ICatalogs.erb'))
54
+
55
+
56
+ end
57
+
58
+ # Configura los objetivos de las platillas (despues de establecer el generador)
59
+ def configure_template_targets
60
+
61
+ # Configuro los templates
62
+ set_template_target('catalogState', TemplateTarget.new(:out_file => "CatalogState.cs", :types => :proyect_file))
63
+ set_template_target('catalogs', TemplateTarget.new(:out_file => "Catalogs.svc.cs", :types => :proyect_file, :class_name => 'Catalogs'))
64
+ set_template_target('catalogs.svc', TemplateTarget.new(:out_file => "Catalogs.svc", :types => :proyect_file, :class_name => 'Catalogs'))
65
+ set_template_target('icatalogs', TemplateTarget.new(:out_file => "ICatalogs.cs", :types => :proyect_file, :class_name => 'ICatalogs'))
66
+
67
+
68
+ end
69
+
70
+ # Resetea los atributos personalizados de la caracteristica (antes de establecer el generador)
71
+ def reset_attributes
72
+ self.generation_attributes[:out_dir] = nil
73
+ self.generation_attributes[:namespace]= nil
74
+ end
75
+
76
+ # Configura los atributos personalizados de la caracteristica (antes de establecer el generador)
77
+ def configure_attributes()
78
+ self.generation_attributes[:out_dir] = "#{self.generation_attributes[:out_dir]}/#{self.generation_attributes[:namespace]}/Services" unless self.generation_attributes.has_in_self?(:out_dir)
79
+ self.generation_attributes[:namespace]= "#{self.generation_attributes[:namespace]}.Services" unless self.generation_attributes.has_in_self?(:namespace)
80
+ end
81
+
82
+ # Obtiene el nombre de un catalogo asociado a una entidad
83
+ def get_entity_catalog_name(entity_name)
84
+ return "#{entity_name}Catalog"
85
+ end
86
+
87
+ # Obtiene el nombre completo de un catalogo asociado a una entidad
88
+ def get_entity_catalog_full_name (entity_name)
89
+ return "#{self.generation_attributes[:namespace]}.#{get_entity_catalog_name(entity_name)}"
90
+ end
91
+
92
+
93
+ # Obtiene el nombre completo de todos los catalogos asociados a una entidad
94
+ def get_entity_catalogs_full_name
95
+ # Busco las caracteristicas que contiene entidades de SQL para una table
96
+ get_tables do |e|
97
+ yield get_entity_catalog_full_name e.name
98
+ end
99
+ end
100
+
101
+ # Obtiene el nombre de todos los catalogos asociados a una entidad
102
+ def get_entity_catalogs_name
103
+ # Busco las caracteristicas que contiene entidades de SQL para una table
104
+ get_tables do |e|
105
+ yield get_entity_catalog_name e.name
106
+ end
107
+ end
108
+
109
+ # Devuelve una entidad en base al nombre de su catalogo
110
+ def get_entity_by_catalog_name(catalog_name)
111
+ # Busco las caracteristicas que contiene entidades de SQL para una table
112
+ get_tables do |e|
113
+ if catalog_name==get_entity_catalog_name(e.name)
114
+ return e
115
+ end
116
+ end
117
+ return nil
118
+ end
119
+
120
+ # Genera la caracteristica
121
+ def generate
122
+ super()
123
+ generate_configuration
124
+ end
125
+
126
+ # Genera las configuraciones necesarias dentro del archivo web.config
127
+ def generate_configuration
128
+
129
+ web_config_file= get_app_config_file
130
+
131
+ return unless web_config_file
132
+
133
+ # Ruta para conseguir el archivo app.config
134
+
135
+ xml = Nokogiri::XML(File.read(web_config_file))
136
+
137
+ # Recupero el nodo
138
+ xpath = "system.serviceModel/services/service[@name= '#{self.generation_attributes[:namespace]}.Catalogs']"
139
+ node = XMLHelper.get_node_from_xml_document(xml, xpath)
140
+
141
+ # Configuro el nodo
142
+ node['name'] = "#{self.generation_attributes[:namespace]}.Catalogs"
143
+
144
+ # Recupero el nodo
145
+ xpath = "#{xpath}/endpoint"
146
+ node = XMLHelper.get_node_from_xml_document(xml, xpath)
147
+
148
+ #Configuro el nodo
149
+ node['binding'] = "webHttpBinding"
150
+ node['contract'] = "#{self.generation_attributes[:namespace]}.ICatalogs"
151
+ node['behaviorConfiguration']= "web"
152
+
153
+
154
+ # Recupero el nodo
155
+ xpath = "system.serviceModel/behaviors/endpointBehaviors/behavior[@name= 'web']"
156
+ path = "system.serviceModel/behaviors/endpointBehaviors/behavior"
157
+ node = XMLHelper.get_node_from_xml_document(xml, xpath)
158
+
159
+ # Configuro el nodo
160
+ node['name'] = "web"
161
+
162
+ xpath = "system.serviceModel/behaviors/endpointBehaviors/behavior/webHttp"
163
+ path = "system.serviceModel/behaviors/endpointBehaviors/behavior/webHttp"
164
+ node = XMLHelper.get_node_from_xml_document(xml, xpath)
165
+
166
+ # Formateo el texto
167
+ formatted_xml= XMLHelper.format(xml.to_xml)
168
+
169
+ # Guardo el resultado
170
+ File.write(web_config_file, formatted_xml)
171
+
172
+ end
173
+
174
+ end
175
+
176
+ end
@@ -0,0 +1,51 @@
1
+ <%
2
+ #encoding: UTF-8
3
+
4
+ =begin
5
+
6
+ CapicuaGen
7
+
8
+ CapicuaGen es un software que ayuda a la creación automática de
9
+ sistemas empresariales a través de la definición y ensamblado de
10
+ diversos generadores de características.
11
+
12
+ El proyecto fue iniciado por José Luis Bautista Martin, el 6 de enero
13
+ del 2016.
14
+
15
+ Puede modificar y distribuir este software, según le plazca, y usarlo
16
+ para cualquier fin ya sea comercial, personal, educativo, o de cualquier
17
+ índole, siempre y cuando incluya este mensaje, y se permita acceso el
18
+ código fuente.
19
+
20
+ Este software es código libre, y se licencia bajo LGPL.
21
+
22
+ Para más información consultar http://www.gnu.org/licenses/lgpl.html
23
+ =end
24
+ %>using System;
25
+ using System.Collections.Generic;
26
+ using System.Linq;
27
+ using System.Text;
28
+
29
+ namespace <%=generation_attributes[:namespace]%>
30
+ {
31
+ /// <summary>
32
+ /// Representan los posibles estados de un catalago
33
+ /// </summary>
34
+ internal enum EstadosCatalogo
35
+ {
36
+ /// <summary>
37
+ /// El catalogo esta en modo vista
38
+ /// </summary>
39
+ Vista = 0,
40
+
41
+ /// <summary>
42
+ /// El catalogo este creando un nuevo registro
43
+ /// </summary>
44
+ Nuevo = 1,
45
+
46
+ /// <summary>
47
+ /// El catalogo esta en edición
48
+ /// </summary>
49
+ Edicion = 2
50
+ }
51
+ }
@@ -0,0 +1,58 @@
1
+ <%
2
+ #encoding: UTF-8
3
+
4
+ =begin
5
+
6
+ CapicuaGen
7
+
8
+ CapicuaGen es un software que ayuda a la creación automática de
9
+ sistemas empresariales a través de la definición y ensamblado de
10
+ diversos generadores de características.
11
+
12
+ El proyecto fue iniciado por José Luis Bautista Martin, el 6 de enero
13
+ del 2016.
14
+
15
+ Puede modificar y distribuir este software, según le plazca, y usarlo
16
+ para cualquier fin ya sea comercial, personal, educativo, o de cualquier
17
+ índole, siempre y cuando incluya este mensaje, y se permita acceso el
18
+ código fuente.
19
+
20
+ Este software es código libre, y se licencia bajo LGPL.
21
+
22
+ Para más información consultar http://www.gnu.org/licenses/lgpl.html
23
+ =end
24
+ %>using System;
25
+ using System.Collections.Generic;
26
+ using System.Linq;
27
+ using System.Runtime.Serialization;
28
+ using System.ServiceModel;
29
+ using System.ServiceModel.Web;
30
+ using System.Text;
31
+
32
+ <%=get_namespaces_text(:business_interfaces)
33
+ %><%=get_namespaces_text(:business_entities)
34
+ %><%=get_namespaces_text(:data_access)
35
+ %>
36
+
37
+
38
+ namespace <%=generation_attributes[:namespace]%>
39
+ {
40
+ /// <summary>
41
+ /// Catalogs
42
+ /// </summary>
43
+ public class <%=template_target.class_name%> : I<%=template_target.class_name%>
44
+ {
45
+
46
+ <%get_tables do |catalog|%>
47
+ /// <summary>
48
+ /// Gets the <%=catalog.name%>.
49
+ /// </summary>
50
+ /// <returns></returns>
51
+ public <%=catalog.name%>[] Get<%=catalog.name%>()
52
+ {
53
+ <%=get_entity_data_access_full_name(catalog.name)%><<%=get_entity_name(catalog.name)%>> accesoDatos<%=catalog.name%>=new <%=get_entity_data_access_full_name(catalog.name)%><<%=get_entity_name(catalog.name)%>>();
54
+ return accesoDatos<%=catalog.name%>.Listar().ToArray();
55
+ }
56
+ <%end%>
57
+ }
58
+ }
@@ -0,0 +1,24 @@
1
+ <%
2
+ #encoding: UTF-8
3
+
4
+ =begin
5
+
6
+ CapicuaGen
7
+
8
+ CapicuaGen es un software que ayuda a la creación automática de
9
+ sistemas empresariales a través de la definición y ensamblado de
10
+ diversos generadores de características.
11
+
12
+ El proyecto fue iniciado por José Luis Bautista Martin, el 6 de enero
13
+ del 2016.
14
+
15
+ Puede modificar y distribuir este software, según le plazca, y usarlo
16
+ para cualquier fin ya sea comercial, personal, educativo, o de cualquier
17
+ índole, siempre y cuando incluya este mensaje, y se permita acceso el
18
+ código fuente.
19
+
20
+ Este software es código libre, y se licencia bajo LGPL.
21
+
22
+ Para más información consultar http://www.gnu.org/licenses/lgpl.html
23
+ =end
24
+ %><%%@ServiceHost Language="C#" Debug="true" Service="<%=generation_attributes[:namespace]%>.<%=template_target.class_name%>" CodeBehind="<%=template_target.class_name%>.svc.cs"%>