Commit 73c46b4162ffbb5b4ad7208a776cbae8aaf30e58

Authored by totoro
1 parent 8b280927

add js for designer based on the fork of "wwwsqldesigner"

Showing 106 changed files with 10669 additions and 750 deletions   Show diff stats

Too many changes.

To preserve performance only 100 of 106 files are displayed.

model_manager.aproj deleted
1   -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2   - <PropertyGroup>
3   - <ProjectGuid>{89372B21-80FA-4EB8-B17C-072EB55713D6}</ProjectGuid>
4   - <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5   - <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6   - <OutputType>Exe</OutputType>
7   - <RootNamespace>model_manager</RootNamespace>
8   - <AssemblyName>model_manager</AssemblyName>
9   - <StartupObject>src\main.anubis</StartupObject>
10   - <IncludePaths>./%3b./src</IncludePaths>
11   - <MakeUsedFile>False</MakeUsedFile>
12   - <MakeUnusedFile>False</MakeUnusedFile>
13   - <AnubiscVerbosity>False</AnubiscVerbosity>
14   - </PropertyGroup>
15   - <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
16   - <OutputPath>bin\Debug\</OutputPath>
17   - <DebugSymbols>True</DebugSymbols>
18   - <DebugType>Full</DebugType>
19   - <Optimize>False</Optimize>
20   - <CommandLine>-sc</CommandLine>
21   - </PropertyGroup>
22   - <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
23   - <OutputPath>bin\Release\</OutputPath>
24   - <DebugSymbols>False</DebugSymbols>
25   - <DebugType>None</DebugType>
26   - <Optimize>True</Optimize>
27   - </PropertyGroup>
28   - <Import Project="$(AnubisBinPath)\Anubis.Build.targets" />
29   - <ItemGroup>
30   - <Compile Include="calexium_lib\asterisk\ami.anubis" />
31   - <Compile Include="calexium_lib\asterisk\ami_commands.anubis" />
32   - <Compile Include="calexium_lib\asterisk\ami_types.anubis" />
33   - <Compile Include="calexium_lib\CXM_errors.anubis" />
34   - <Compile Include="calexium_lib\CXM_message_constants.anubis" />
35   - <Compile Include="calexium_lib\database\alter_table.anubis" />
36   - <Compile Include="calexium_lib\database\db_types.anubis" />
37   - <Compile Include="calexium_lib\database\db_utils.anubis" />
38   - <Compile Include="calexium_lib\database\migration.anubis" />
39   - <Compile Include="calexium_lib\database\migration_common.anubis" />
40   - <Compile Include="calexium_lib\database\migration_common_sqlite3.anubis" />
41   - <Compile Include="calexium_lib\database\migration_sqlite3.anubis" />
42   - <Compile Include="calexium_lib\database\model\db_model.anubis" />
43   - <Compile Include="calexium_lib\database\settings.anubis" />
44   - <Compile Include="calexium_lib\database\settings_sqlite3.anubis" />
45   - <Compile Include="calexium_lib\database\sqlite_foreign_key.anubis" />
46   - <Compile Include="calexium_lib\database\vtm\view_table_manager.anubis" />
47   - <Compile Include="calexium_lib\database\vtm\view_table_manager_types.anubis" />
48   - <Compile Include="calexium_lib\database\vtm\view_table_renderer.anubis" />
49   - <Compile Include="calexium_lib\database\vtm\view_table_types.anubis" />
50   - <Compile Include="calexium_lib\extensions\json.anubis" />
51   - <Compile Include="calexium_lib\mail\authentication.anubis" />
52   - <Compile Include="calexium_lib\mail\lexers\enhanced_status.anubis" />
53   - <Compile Include="calexium_lib\mail\send_mail.anubis" />
54   - <Compile Include="calexium_lib\mail\send_mail_type.anubis" />
55   - <Compile Include="calexium_lib\mail\smtp_client.anubis" />
56   - <Compile Include="calexium_lib\mail\smtp_server_extensions.anubis" />
57   - <Compile Include="calexium_lib\mail\tools.anubis" />
58   - <Compile Include="calexium_lib\network\socket_pool.anubis" />
59   - <Compile Include="calexium_lib\net_services\CXM_generic_client.anubis" />
60   - <Compile Include="calexium_lib\net_services\CXM_generic_protocol.anubis" />
61   - <Compile Include="calexium_lib\net_services\CXM_net_services.anubis" />
62   - <Compile Include="calexium_lib\net_services_protocols\ftp_client.anubis" />
63   - <Compile Include="calexium_lib\net_services_protocols\logger_service.anubis" />
64   - <Compile Include="calexium_lib\net_services_protocols\pkg_updater_protocol.anubis" />
65   - <Compile Include="calexium_lib\os_tools\freebsd\rc_conf.anubis" />
66   - <Compile Include="calexium_lib\os_tools\linux\config\network_interface_file.anubis" />
67   - <Compile Include="calexium_lib\unit_test\xml_rpc.unit_test.anubis" />
68   - <Compile Include="calexium_lib\web\counter.anubis" />
69   - <Compile Include="calexium_lib\web\CXM_common.anubis" />
70   - <Compile Include="calexium_lib\web\CXM_cookies.anubis" />
71   - <Compile Include="calexium_lib\web\CXM_dojo.anubis" />
72   - <Compile Include="calexium_lib\web\CXM_form.anubis" />
73   - <Compile Include="calexium_lib\web\CXM_generic_form.anubis" />
74   - <Compile Include="calexium_lib\web\CXM_generic_login.anubis" />
75   - <Compile Include="calexium_lib\web\CXM_generic_table.anubis" />
76   - <Compile Include="calexium_lib\web\CXM_html_tooltip.anubis" />
77   - <Compile Include="calexium_lib\web\CXM_https_get.anubis" />
78   - <Compile Include="calexium_lib\web\CXM_http_get.anubis" />
79   - <Compile Include="calexium_lib\web\CXM_http_get_common.anubis" />
80   - <Compile Include="calexium_lib\web\CXM_jquery.anubis" />
81   - <Compile Include="calexium_lib\web\CXM_json.anubis" />
82   - <Compile Include="calexium_lib\web\CXM_making_a_web_site.anubis" />
83   - <Compile Include="calexium_lib\web\CXM_mime.anubis" />
84   - <Compile Include="calexium_lib\web\CXM_multihost_http_server.anubis" />
85   - <Compile Include="calexium_lib\web\CXM_style_tools.anubis" />
86   - <Compile Include="calexium_lib\web\CXM_urllib.anubis" />
87   - <Compile Include="calexium_lib\web\CXM_web_arg_encode.anubis" />
88   - <Compile Include="calexium_lib\web\CXM_web_arg_utils.anubis" />
89   - <Compile Include="calexium_lib\web\CXM_web_dump.anubis" />
90   - <Compile Include="calexium_lib\web\CXM_widgets.anubis" />
91   - <Compile Include="calexium_lib\web\CXM_xml_rpc.anubis" />
92   - <Compile Include="calexium_lib\web\CXM_xml_rpc_parser.anubis" />
93   - <Compile Include="calexium_lib\web\CXM_xml_rpc_types.anubis" />
94   - <Compile Include="calexium_lib\web\jQuery\CXM_jquery_animate.anubis" />
95   - <Compile Include="calexium_lib\web\jQuery\CXM_jquery_button.anubis" />
96   - <Compile Include="calexium_lib\web\jQuery\CXM_jquery_datatable.anubis" />
97   - <Compile Include="calexium_lib\web\jQuery\CXM_jquery_datatable_plugins.anubis" />
98   - <Compile Include="calexium_lib\web\jQuery\CXM_jquery_datatable_server_side.anubis" />
99   - <Compile Include="calexium_lib\web\jQuery\CXM_jquery_datatable_translation.anubis" />
100   - <Compile Include="calexium_lib\web\jQuery\CXM_jquery_datatable_types.anubis" />
101   - <Compile Include="calexium_lib\web\jQuery\CXM_jquery_dialog.anubis" />
102   - <Compile Include="calexium_lib\web\jQuery\CXM_jquery_easing.anubis" />
103   - <Compile Include="calexium_lib\web\jQuery\CXM_jquery_eudock.anubis" />
104   - <Compile Include="calexium_lib\web\jQuery\CXM_jquery_eudock_types.anubis" />
105   - <Compile Include="calexium_lib\web\jQuery\CXM_jquery_icons.anubis" />
106   - <Compile Include="calexium_lib\web\jQuery\CXM_jquery_jqplot.anubis" />
107   - <Compile Include="calexium_lib\web\jQuery\CXM_jquery_tabs.anubis" />
108   - <Compile Include="calexium_lib\web\jQuery\CXM_jquery_tiptip.anubis" />
109   - <Compile Include="calexium_lib\web\jQuery\CXM_jquery_toolbar.anubis" />
110   - <Compile Include="calexium_lib\web\jQuery\CXM_jq_checkbox.anubis" />
111   - <Compile Include="calexium_lib\web\jQuery\CXM_jq_form.anubis" />
112   - <Compile Include="calexium_lib\web\jQuery\CXM_jq_radio.anubis" />
113   - <Compile Include="calexium_lib\web\jQuery\jq_flot.anubis" />
114   - <Compile Include="calexium_lib\web\jQuery\ui-addon\datetimepicker.anubis" />
115   - <Compile Include="calexium_lib\web\js_tools.anubis" />
116   - <Compile Include="calexium_lib\web\widgets\button.anubis" />
117   - <Compile Include="calexium_lib\web\widgets\css_helper.anubis" />
118   - <Compile Include="calexium_lib\web\widgets\dashboard.anubis" />
119   - <Compile Include="calexium_lib\web\widgets\fisheye_menu.anubis" />
120   - <Compile Include="calexium_lib\web\widgets\icons_set.anubis" />
121   - <Compile Include="library\a2a\C\formater.anubis" />
122   - <Compile Include="library\a2a\example.anubis" />
123   - <Compile Include="library\a2a\generic\preformater.anubis" />
124   - <Compile Include="library\charset\charset_decoder.anubis" />
125   - <Compile Include="library\charset\iso2022_jp_decoder.anubis" />
126   - <Compile Include="library\cipher\base64.anubis" />
127   - <Compile Include="library\compile_everything.anubis" />
128   - <Compile Include="library\compil_all.anubis" />
129   - <Compile Include="library\compil_all_beta.anubis" />
130   - <Compile Include="library\converters\_1_7_to_1_8.anubis" />
131   - <Compile Include="library\data_base\alter_table.anubis" />
132   - <Compile Include="library\data_base\db_tools.anubis" />
133   - <Compile Include="library\data_base\db_types.anubis" />
134   - <Compile Include="library\data_base\import_csv.anubis" />
135   - <Compile Include="library\data_base\metaSQL.anubis" />
136   - <Compile Include="library\data_base\metaSQL_example_database.anubis" />
137   - <Compile Include="library\data_base\metaSQL_example_output.anubis" />
138   - <Compile Include="library\data_base\metaSQL_example_queries.anubis" />
139   - <Compile Include="library\data_base\metaSQL_Postgres.anubis" />
140   - <Compile Include="library\data_base\metaSQL_test.anubis" />
141   - <Compile Include="library\data_base\metaSQL_web.anubis" />
142   - <Compile Include="library\data_base\mysql_client.anubis" />
143   - <Compile Include="library\data_base\postgres_client.anubis" />
144   - <Compile Include="library\data_base\postgres_graphic_interface.anubis" />
145   - <Compile Include="library\data_base\read_csv.anubis" />
146   - <Compile Include="library\data_base\read_csv_org.anubis" />
147   - <Compile Include="library\data_base\read_csv_table.anubis" />
148   - <Compile Include="library\data_base\sdbms.anubis" />
149   - <Compile Include="library\data_base\sdbms1.anubis" />
150   - <Compile Include="library\data_base\sdbms3.anubis" />
151   - <Compile Include="library\data_base\sdbms4.anubis" />
152   - <Compile Include="library\data_base\sqlite.anubis" />
153   - <Compile Include="library\data_base\sqlite_foreign_key.anubis" />
154   - <Compile Include="library\data_base\theory.anubis" />
155   - <Compile Include="library\doc_tools\latex.anubis" />
156   - <Compile Include="library\doc_tools\make_doc.anubis" />
157   - <Compile Include="library\doc_tools\maml.anubis" />
158   - <Compile Include="library\doc_tools\maml3.anubis" />
159   - <Compile Include="library\examples\args.anubis" />
160   - <Compile Include="library\examples\conditional_examples.anubis" />
161   - <Compile Include="library\examples\cryptography\md5.anubis" />
162   - <Compile Include="library\examples\cryptography\sha1.anubis" />
163   - <Compile Include="library\examples\fibonacci.anubis" />
164   - <Compile Include="library\examples\file_manager_example.anubis" />
165   - <Compile Include="library\examples\full_ls.anubis" />
166   - <Compile Include="library\examples\graphism\diaporama.anubis" />
167   - <Compile Include="library\examples\graphism\paint.anubis" />
168   - <Compile Include="library\examples\graphism\paint2.anubis" />
169   - <Compile Include="library\examples\graphism\show_image.anubis" />
170   - <Compile Include="library\examples\graphism\try_window.anubis" />
171   - <Compile Include="library\examples\hello.anubis" />
172   - <Compile Include="library\examples\kbd.anubis" />
173   - <Compile Include="library\examples\lexical_analysis\href_extractor.anubis" />
174   - <Compile Include="library\examples\logic\church_integers.anubis" />
175   - <Compile Include="library\examples\logic\peano.anubis" />
176   - <Compile Include="library\examples\ls.anubis" />
177   - <Compile Include="library\examples\mathematics\fact.anubis" />
178   - <Compile Include="library\examples\mathematics\mandelbrot_set.anubis" />
179   - <Compile Include="library\examples\mathematics\mandelbrot_set_old.anubis" />
180   - <Compile Include="library\examples\mathematics\runge_kutta\runge_kutta.anubis" />
181   - <Compile Include="library\examples\mathematics\syracuse.anubis" />
182   - <Compile Include="library\examples\merge_list.anubis" />
183   - <Compile Include="library\examples\mkdir_test.anubis" />
184   - <Compile Include="library\examples\network\client_browser_info.anubis" />
185   - <Compile Include="library\examples\network\client_server.anubis" />
186   - <Compile Include="library\examples\network\minimal_web_site.anubis" />
187   - <Compile Include="library\examples\network\muscle_echo.anubis" />
188   - <Compile Include="library\examples\network\port_scan.anubis" />
189   - <Compile Include="library\examples\network\sntp_client.anubis" />
190   - <Compile Include="library\examples\network\sokoban.anubis" />
191   - <Compile Include="library\examples\network\try_dns.anubis" />
192   - <Compile Include="library\examples\network\udp_client_server.anubis" />
193   - <Compile Include="library\examples\network\upload.anubis" />
194   - <Compile Include="library\examples\playing_with_functions.anubis" />
195   - <Compile Include="library\examples\read_line_example.anubis" />
196   - <Compile Include="library\examples\restart.anubis" />
197   - <Compile Include="library\examples\saturate_example.anubis" />
198   - <Compile Include="library\examples\system\load_adm.anubis" />
199   - <Compile Include="library\examples\test.anubis" />
200   - <Compile Include="library\examples\test_web_site.anubis" />
201   - <Compile Include="library\examples\try_now.anubis" />
202   - <Compile Include="library\examples\try_protect.anubis" />
203   - <Compile Include="library\examples\watt.anubis" />
204   - <Compile Include="library\examples\_99_bottles_of_beer.anubis" />
205   - <Compile Include="library\graphism\charts.anubis" />
206   - <Compile Include="library\graphism\float_int32.anubis" />
207   - <Compile Include="library\graphism\font_tools.anubis" />
208   - <Compile Include="library\graphism\geometrical_figures.anubis" />
209   - <Compile Include="library\graphism\gif.anubis" />
210   - <Compile Include="library\graphism\image_tools.anubis" />
211   - <Compile Include="library\graphism\jpeg.anubis" />
212   - <Compile Include="library\graphism\jpeg_size.anubis" />
213   - <Compile Include="library\graphism\lzw_gif.anubis" />
214   - <Compile Include="library\graphism\png_size.anubis" />
215   - <Compile Include="library\graphism\test_charts.anubis" />
216   - <Compile Include="library\graphism\test_gfigures.anubis" />
217   - <Compile Include="library\install_released_files.anubis" />
218   - <Compile Include="library\lexical_analysis\compile_time_test.anubis" />
219   - <Compile Include="library\lexical_analysis\fast_lexer.anubis" />
220   - <Compile Include="library\lexical_analysis\fast_lexer_2.anubis" />
221   - <Compile Include="library\lexical_analysis\fast_lexer_3.anubis" />
222   - <Compile Include="library\lexical_analysis\fast_lexer_4.anubis" />
223   - <Compile Include="library\lexical_analysis\fast_lexer_example_1.anubis" />
224   - <Compile Include="library\lexical_analysis\fast_lexer_example_2.anubis" />
225   - <Compile Include="library\lexical_analysis\lexer_maker_v2.anubis" />
226   - <Compile Include="library\lexical_analysis\testing_fast_lexer.anubis" />
227   - <Compile Include="library\lexical_analysis\xml.anubis" />
228   - <Compile Include="library\locale\iso3166-1.anubis" />
229   - <Compile Include="library\locale\L3.anubis" />
230   - <Compile Include="library\locale\L3LanguageInfo.anubis" />
231   - <Compile Include="library\mail\send_mail.anubis" />
232   - <Compile Include="library\mail\smtp_server.anubis" />
233   - <Compile Include="library\make_distribution_library.anubis" />
234   - <Compile Include="library\mycompile_everything.anubis" />
235   - <Compile Include="library\network\dns.anubis" />
236   - <Compile Include="library\network\dns_tools.anubis" />
237   - <Compile Include="library\network\remote_files_manager_common.anubis" />
238   - <Compile Include="library\network\sntp.anubis" />
239   - <Compile Include="library\network\tools.anubis" />
240   - <Compile Include="library\official_library.anubis" />
241   - <Compile Include="library\predefined.anubis" />
242   - <Compile Include="library\syntactic_analysis\anubis_output.anubis" />
243   - <Compile Include="library\syntactic_analysis\common.anubis" />
244   - <Compile Include="library\syntactic_analysis\make_automaton.anubis" />
245   - <Compile Include="library\syntactic_analysis\parser_generator.anubis" />
246   - <Compile Include="library\syntactic_analysis\read_grammar.anubis" />
247   - <Compile Include="library\syntactic_analysis\yacc_version.anubis" />
248   - <Compile Include="library\system\bytearray.anubis" />
249   - <Compile Include="library\system\convert.anubis" />
250   - <Compile Include="library\system\data_io.anubis" />
251   - <Compile Include="library\system\datetime.anubis" />
252   - <Compile Include="library\system\files.anubis" />
253   - <Compile Include="library\system\lists.anubis" />
254   - <Compile Include="library\system\logger.anubis" />
255   - <Compile Include="library\system\message_queue.anubis" />
256   - <Compile Include="library\system\message_transceiver.anubis" />
257   - <Compile Include="library\system\muscle.anubis" />
258   - <Compile Include="library\system\parameter\inifile.anubis" />
259   - <Compile Include="library\system\string.anubis" />
260   - <Compile Include="library\system\test_logger.anubis" />
261   - <Compile Include="library\system\types.anubis" />
262   - <Compile Include="library\system_colors\hsl.anubis" />
263   - <Compile Include="library\system_colors\hsv.anubis" />
264   - <Compile Include="library\system_colors\rgb.anubis" />
265   - <Compile Include="library\system_colors\system_colors.anubis" />
266   - <Compile Include="library\system_fonts\draw_font.anubis" />
267   - <Compile Include="library\system_fonts\font_table.anubis" />
268   - <Compile Include="library\test\all_unit_test.anubis" />
269   - <Compile Include="library\test\cp_test.anubis" />
270   - <Compile Include="library\test\execute_capture.anubis" />
271   - <Compile Include="library\test\inifile_test.anubis" />
272   - <Compile Include="library\test\lexical_analysis\fast_lexer.ut.anubis" />
273   - <Compile Include="library\test\lexical_analysis\low_level_fast_lexer_test.anubis" />
274   - <Compile Include="library\test\locale_test.anubis" />
275   - <Compile Include="library\test\Logger_test.anubis" />
276   - <Compile Include="library\test\predefined\ByteArray.ut.anubis" />
277   - <Compile Include="library\test\predefined\date_and_time.unit_test.anubis" />
278   - <Compile Include="library\test\predefined\dbapi.unit_test.anubis" />
279   - <Compile Include="library\test\predefined\decimal_scan.unit_test.anubis" />
280   - <Compile Include="library\test\predefined\fast_lexer.unit_test.anubis" />
281   - <Compile Include="library\test\predefined\file.ut.anubis" />
282   - <Compile Include="library\test\predefined\Int.unit_test.anubis" />
283   - <Compile Include="library\test\predefined\sqlite.obsolete.unit_test.anubis" />
284   - <Compile Include="library\test\predefined\sqlite.unit_test.anubis" />
285   - <Compile Include="library\test\serialize_test.anubis" />
286   - <Compile Include="library\test\sqlite3_test.anubis" />
287   - <Compile Include="library\test\SSLTest.anubis" />
288   - <Compile Include="library\test\system\convert.unit_test.anubis" />
289   - <Compile Include="library\test\system\files.unit_test.anubis" />
290   - <Compile Include="library\test\system\Int.unit_test.anubis" />
291   - <Compile Include="library\test\system\message_queue.unit_test.anubis" />
292   - <Compile Include="library\test\system\message_transceiver.unit_test.anubis" />
293   - <Compile Include="library\test\system\string.unit_test.anubis" />
294   - <Compile Include="library\test\system\wordXX.unit_test.anubis" />
295   - <Compile Include="library\test\TestItem.anubis" />
296   - <Compile Include="library\test\tools\line_reader.ut.anubis" />
297   - <Compile Include="library\test\tools\utf-8.unit_test.anubis" />
298   - <Compile Include="library\test\vm_test.anubis" />
299   - <Compile Include="library\tools\2-4tree.anubis" />
300   - <Compile Include="library\tools\admloader_test.anubis" />
301   - <Compile Include="library\tools\adm_autoreload.anubis" />
302   - <Compile Include="library\tools\adm_autoreload_tools.anubis" />
303   - <Compile Include="library\tools\avltrees.anubis" />
304   - <Compile Include="library\tools\base64.anubis" />
305   - <Compile Include="library\tools\basis.anubis" />
306   - <Compile Include="library\tools\bool.anubis" />
307   - <Compile Include="library\tools\btree1.anubis" />
308   - <Compile Include="library\tools\buffered_connection.anubis" />
309   - <Compile Include="library\tools\bytearray.anubis" />
310   - <Compile Include="library\tools\cmd_line.anubis" />
311   - <Compile Include="library\tools\connections.anubis" />
312   - <Compile Include="library\tools\delegate_writer.anubis" />
313   - <Compile Include="library\tools\dictionaries.anubis" />
314   - <Compile Include="library\tools\dump_file.anubis" />
315   - <Compile Include="library\tools\explore_disk.anubis" />
316   - <Compile Include="library\tools\file_and_dir.anubis" />
317   - <Compile Include="library\tools\findstring.anubis" />
318   - <Compile Include="library\tools\find_and_replace.anubis" />
319   - <Compile Include="library\tools\find_and_replace_simulator.anubis" />
320   - <Compile Include="library\tools\finger_trees.anubis" />
321   - <Compile Include="library\tools\float.anubis" />
322   - <Compile Include="library\tools\function.anubis" />
323   - <Compile Include="library\tools\graphic.anubis" />
324   - <Compile Include="library\tools\graphviz.anubis" />
325   - <Compile Include="library\tools\hashtable.anubis" />
326   - <Compile Include="library\tools\int.anubis" />
327   - <Compile Include="library\tools\ip_address.anubis" />
328   - <Compile Include="library\tools\ISO-8601.anubis" />
329   - <Compile Include="library\tools\iterators.anubis" />
330   - <Compile Include="library\tools\latex.anubis" />
331   - <Compile Include="library\tools\line_reader.anubis" />
332   - <Compile Include="library\tools\list.anubis" />
333   - <Compile Include="library\tools\maml.anubis" />
334   - <Compile Include="library\tools\maybefloat.anubis" />
335   - <Compile Include="library\tools\printable_tree.anubis" />
336   - <Compile Include="library\tools\prompt.anubis" />
337   - <Compile Include="library\tools\random.anubis" />
338   - <Compile Include="library\tools\rationals.anubis" />
339   - <Compile Include="library\tools\read_table.anubis" />
340   - <Compile Include="library\tools\safe_save_retrieve.anubis" />
341   - <Compile Include="library\tools\saturate.anubis" />
342   - <Compile Include="library\tools\schedul_task.anubis" />
343   - <Compile Include="library\tools\sdbms.anubis" />
344   - <Compile Include="library\tools\sdbms1.anubis" />
345   - <Compile Include="library\tools\sdbms2.anubis" />
346   - <Compile Include="library\tools\sorting.anubis" />
347   - <Compile Include="library\tools\streams.anubis" />
348   - <Compile Include="library\tools\string.anubis" />
349   - <Compile Include="library\tools\tables.anubis" />
350   - <Compile Include="library\tools\time.anubis" />
351   - <Compile Include="library\tools\tools.anubis" />
352   - <Compile Include="library\tools\unit_test.anubis" />
353   - <Compile Include="library\tools\useful_types.anubis" />
354   - <Compile Include="library\tools\utf-8.anubis" />
355   - <Compile Include="library\tools\words.anubis" />
356   - <Compile Include="library\version2\diaconescu.anubis" />
357   - <Compile Include="library\vm\vm_dump.anubis" />
358   - <Compile Include="library\vm_test.anubis" />
359   - <Compile Include="library\web\calculatrice.anubis" />
360   - <Compile Include="library\web\common.anubis" />
361   - <Compile Include="library\web\cookies.anubis" />
362   - <Compile Include="library\web\counter.anubis" />
363   - <Compile Include="library\web\default_web_site.anubis" />
364   - <Compile Include="library\web\dynamic_http_server.anubis" />
365   - <Compile Include="library\web\file_manager.anubis" />
366   - <Compile Include="library\web\generic_form.anubis" />
367   - <Compile Include="library\web\generic_login.anubis" />
368   - <Compile Include="library\web\generic_table.anubis" />
369   - <Compile Include="library\web\html.anubis" />
370   - <Compile Include="library\web\https_get.anubis" />
371   - <Compile Include="library\web\http_get.anubis" />
372   - <Compile Include="library\web\http_get_common.anubis" />
373   - <Compile Include="library\web\http_trace.anubis" />
374   - <Compile Include="library\web\kernel.anubis" />
375   - <Compile Include="library\web\making_a_web_site.anubis" />
376   - <Compile Include="library\web\making_forms.anubis" />
377   - <Compile Include="library\web\mime.anubis" />
378   - <Compile Include="library\web\modules.anubis" />
379   - <Compile Include="library\web\multihost_http_server.anubis" />
380   - <Compile Include="library\web\read_html.anubis" />
381   - <Compile Include="library\web\secure_action.anubis" />
382   - <Compile Include="library\web\service_machine.anubis" />
383   - <Compile Include="library\web\site_test.anubis" />
384   - <Compile Include="library\web\sokoban.anubis" />
385   - <Compile Include="library\web\torture_server.anubis" />
386   - <Compile Include="library\web\web_arg_encode.anubis" />
387   - <Compile Include="library\widgets3\5_ht.anubis" />
388   - <Compile Include="library\widgets3\box.anubis" />
389   - <Compile Include="library\widgets3\bubble.anubis" />
390   - <Compile Include="library\widgets3\button.anubis" />
391   - <Compile Include="library\widgets3\characters_example.anubis" />
392   - <Compile Include="library\widgets3\check_box.anubis" />
393   - <Compile Include="library\widgets3\colors.anubis" />
394   - <Compile Include="library\widgets3\desktop.anubis" />
395   - <Compile Include="library\widgets3\desktop_example.anubis" />
396   - <Compile Include="library\widgets3\drag_and_drop.anubis" />
397   - <Compile Include="library\widgets3\generic_editor.anubis" />
398   - <Compile Include="library\widgets3\generic_editor_example.anubis" />
399   - <Compile Include="library\widgets3\host_window.anubis" />
400   - <Compile Include="library\widgets3\hypertext.anubis" />
401   - <Compile Include="library\widgets3\image.anubis" />
402   - <Compile Include="library\widgets3\input.anubis" />
403   - <Compile Include="library\widgets3\map_list.anubis" />
404   - <Compile Include="library\widgets3\menus.anubis" />
405   - <Compile Include="library\widgets3\menu_manager.anubis" />
406   - <Compile Include="library\widgets3\o_essai.anubis" />
407   - <Compile Include="library\widgets3\o_hypertext.anubis" />
408   - <Compile Include="library\widgets3\resizer.anubis" />
409   - <Compile Include="library\widgets3\scrollbar.anubis" />
410   - <Compile Include="library\widgets3\simple_example.anubis" />
411   - <Compile Include="library\widgets3\simple_window.anubis" />
412   - <Compile Include="library\widgets3\space.anubis" />
413   - <Compile Include="library\widgets3\table.anubis" />
414   - <Compile Include="library\widgets3\table_example.anubis" />
415   - <Compile Include="library\widgets3\text.anubis" />
416   - <Compile Include="library\widgets3\tickets_holder.anubis" />
417   - <Compile Include="library\widgets3\tools.anubis" />
418   - <Compile Include="library\widgets3\trace.anubis" />
419   - <Compile Include="library\widgets3\tree_editor.anubis" />
420   - <Compile Include="library\widgets3\tree_editor_test.anubis" />
421   - <Compile Include="library\widgets3\try_ht.anubis" />
422   - <Compile Include="library\widgets3\ubiquity.anubis" />
423   - <Compile Include="library\widgets3\variable.anubis" />
424   - <Compile Include="library\widgets3\widget.anubis" />
425   - <Compile Include="library\widgets3\window.anubis" />
426   - <Compile Include="library\widgets4\background.anubis" />
427   - <Compile Include="library\widgets4\box.anubis" />
428   - <Compile Include="library\widgets4\bubble_manager.anubis" />
429   - <Compile Include="library\widgets4\bubble_manager_test.anubis" />
430   - <Compile Include="library\widgets4\button.anubis" />
431   - <Compile Include="library\widgets4\check_box.anubis" />
432   - <Compile Include="library\widgets4\desktop.anubis" />
433   - <Compile Include="library\widgets4\desktop_example.anubis" />
434   - <Compile Include="library\widgets4\detect_event.anubis" />
435   - <Compile Include="library\widgets4\host_window.anubis" />
436   - <Compile Include="library\widgets4\hypertext.anubis" />
437   - <Compile Include="library\widgets4\hypertext_test.anubis" />
438   - <Compile Include="library\widgets4\image.anubis" />
439   - <Compile Include="library\widgets4\make_tartan_files.anubis" />
440   - <Compile Include="library\widgets4\menus.anubis" />
441   - <Compile Include="library\widgets4\menu_manager.anubis" />
442   - <Compile Include="library\widgets4\menu_manager_test.anubis" />
443   - <Compile Include="library\widgets4\mouse_tracker.anubis" />
444   - <Compile Include="library\widgets4\radio_button.anubis" />
445   - <Compile Include="library\widgets4\radio_buttons_test.anubis" />
446   - <Compile Include="library\widgets4\resizer.anubis" />
447   - <Compile Include="library\widgets4\scrollbar.anubis" />
448   - <Compile Include="library\widgets4\simple_window.anubis" />
449   - <Compile Include="library\widgets4\space.anubis" />
450   - <Compile Include="library\widgets4\table.anubis" />
451   - <Compile Include="library\widgets4\tartan_generator.anubis" />
452   - <Compile Include="library\widgets4\tartan_generator_demo.anubis" />
453   - <Compile Include="library\widgets4\tests.anubis" />
454   - <Compile Include="library\widgets4\text.anubis" />
455   - <Compile Include="library\widgets4\text_input.anubis" />
456   - <Compile Include="library\widgets4\text_input_test.anubis" />
457   - <Compile Include="library\widgets4\ticket_keeper.anubis" />
458   - <Compile Include="library\widgets4\tools.anubis" />
459   - <Compile Include="library\widgets4\trace.anubis" />
460   - <Compile Include="library\widgets4\tree_editor.anubis" />
461   - <Compile Include="library\widgets4\tree_editor_test.anubis" />
462   - <Compile Include="library\widgets4\tree_node.anubis" />
463   - <Compile Include="library\widgets4\variable_widget.anubis" />
464   - <Compile Include="library\widgets4\widget.anubis" />
465   - <Compile Include="library\widgets4\widget_demo.anubis" />
466   - <Compile Include="library\widgets4\widget_test.anubis" />
467   - <Compile Include="library\widgets4\window.anubis" />
468   - <Compile Include="library\widgets4\window_test.anubis" />
469   - <Compile Include="library\xml\basic_xml_parser.anubis" />
470   - <Compile Include="library\xml\xml_parser.apg.anubis" />
471   - <Compile Include="src\generation\files.anubis" />
472   - <Compile Include="src\generation\header.anubis" />
473   - <Compile Include="src\generation\types.anubis" />
474   - <Compile Include="src\main.anubis" />
475   - <Compile Include="src\model.3.0.0.anubis" />
476   - <None Include="calexium_lib\.git" />
477   - <None Include="calexium_lib\.gitignore" />
478   - <None Include="calexium_lib\obj\unit_test.aproj.FileListAbsolute.txt" />
479   - <None Include="calexium_lib\unit_test.aproj" />
480   - <None Include="calexium_lib\unit_test.ide" />
481   - <None Include="calexium_lib\web\js\cxm_jquery_animate.js" />
482   - <None Include="library\cipher\test_quick_base64.a2a" />
483   - <None Include="library\compile_all.inproj" />
484   - <None Include="library\doc_tools\cows.jpg" />
485   - <None Include="library\doc_tools\fNScTnBA4MH-qH_w0pRfArXeeKE8.png" />
486   - <None Include="library\doc_tools\fq22PnfBrYNx2fPr8NQyxy5tdO_A.png" />
487   - <None Include="library\doc_tools\maml3_tutorial.html" />
488   - <None Include="library\doc_tools\maml3_tutorial.maml" />
489   - <None Include="library\doc_tools\maml3_tutorial.maml.html" />
490   - <None Include="library\doc_tools\maml3_tutorial.maml.pdf" />
491   - <None Include="library\doc_tools\maml3_tutorial.pdf" />
492   - <None Include="library\doc_tools\tNScTnBA4MH-qH_w0pRfArXeeKE8.png" />
493   - <None Include="library\examples\determinism.anubis.c" />
494   - <None Include="library\examples\for_loop.anubis.c" />
495   - <None Include="library\examples\graphism\image_samples\cows.jpg" />
496   - <None Include="library\examples\graphism\image_samples\farm.jpg" />
497   - <None Include="library\examples\graphism\image_samples\fingers.jpg" />
498   - <None Include="library\examples\graphism\image_samples\flowers.jpg" />
499   - <None Include="library\examples\graphism\image_samples\mountain.jpg" />
500   - <None Include="library\examples\graphism\image_samples\torrent.jpg" />
501   - <None Include="library\examples\mathematics\runge_kutta\runge_kutta.apg" />
502   - <None Include="library\examples\network\public\bambou.gif" />
503   - <None Include="library\examples\network\public\bleuc.gif" />
504   - <None Include="library\examples\network\public\bleuccloud.gif" />
505   - <None Include="library\examples\network\public\boule.gif" />
506   - <None Include="library\examples\network\public\button_prev.gif" />
507   - <None Include="library\examples\network\public\cloud.gif" />
508   - <None Include="library\examples\network\public\gboule.gif" />
509   - <None Include="library\examples\network\public\gtete.gif" />
510   - <None Include="library\examples\network\public\noir25.gif" />
511   - <None Include="library\examples\network\public\noir25cloud.gif" />
512   - <None Include="library\examples\network\public\tete.gif" />
513   - <None Include="library\examples\OOCounter.anubis.cpp" />
514   - <None Include="library\graphism\image_samples\cows.jpg" />
515   - <None Include="library\graphism\image_samples\farm.jpg" />
516   - <None Include="library\graphism\image_samples\fingers.jpg" />
517   - <None Include="library\graphism\image_samples\flowers.jpg" />
518   - <None Include="library\graphism\image_samples\mountain.jpg" />
519   - <None Include="library\graphism\image_samples\torrent.jpg" />
520   - <None Include="library\install_released_files.bat" />
521   - <None Include="library\install_test.bat" />
522   - <None Include="library\lexical_analysis\lexer_maker_v2_example.lexer" />
523   - <None Include="library\lexical_analysis\test.xml" />
524   - <None Include="library\locale\ISO-639-1 and ISO-639-2.txt" />
525   - <None Include="library\locale\ISO-639-2_values_8bits.txt" />
526   - <None Include="library\syntactic_analysis\anubis_output.anubis.test" />
527   - <None Include="library\syntactic_analysis\calculator_example.apg" />
528   - <None Include="library\syntactic_analysis\README" />
529   - <None Include="library\system_fonts\courier_bold_o_10.sf" />
530   - <None Include="library\system_fonts\courier_bold_o_12.sf" />
531   - <None Include="library\system_fonts\courier_bold_o_14.sf" />
532   - <None Include="library\system_fonts\courier_bold_o_18.sf" />
533   - <None Include="library\system_fonts\courier_bold_o_24.sf" />
534   - <None Include="library\system_fonts\courier_bold_o_8.sf" />
535   - <None Include="library\system_fonts\courier_bold_r_10.sf" />
536   - <None Include="library\system_fonts\courier_bold_r_12.sf" />
537   - <None Include="library\system_fonts\courier_bold_r_14.sf" />
538   - <None Include="library\system_fonts\courier_bold_r_18.sf" />
539   - <None Include="library\system_fonts\courier_bold_r_24.sf" />
540   - <None Include="library\system_fonts\courier_bold_r_8.sf" />
541   - <None Include="library\system_fonts\courier_medium_o_10.sf" />
542   - <None Include="library\system_fonts\courier_medium_o_12.sf" />
543   - <None Include="library\system_fonts\courier_medium_o_14.sf" />
544   - <None Include="library\system_fonts\courier_medium_o_18.sf" />
545   - <None Include="library\system_fonts\courier_medium_o_24.sf" />
546   - <None Include="library\system_fonts\courier_medium_o_8.sf" />
547   - <None Include="library\system_fonts\courier_medium_r_10.sf" />
548   - <None Include="library\system_fonts\courier_medium_r_12.sf" />
549   - <None Include="library\system_fonts\courier_medium_r_14.sf" />
550   - <None Include="library\system_fonts\courier_medium_r_18.sf" />
551   - <None Include="library\system_fonts\courier_medium_r_24.sf" />
552   - <None Include="library\system_fonts\courier_medium_r_8.sf" />
553   - <None Include="library\system_fonts\helvetica_bold_o_10.sf" />
554   - <None Include="library\system_fonts\helvetica_bold_o_12.sf" />
555   - <None Include="library\system_fonts\helvetica_bold_o_14.sf" />
556   - <None Include="library\system_fonts\helvetica_bold_o_18.sf" />
557   - <None Include="library\system_fonts\helvetica_bold_o_24.sf" />
558   - <None Include="library\system_fonts\helvetica_bold_o_8.sf" />
559   - <None Include="library\system_fonts\helvetica_bold_r_10.sf" />
560   - <None Include="library\system_fonts\helvetica_bold_r_12.sf" />
561   - <None Include="library\system_fonts\helvetica_bold_r_14.sf" />
562   - <None Include="library\system_fonts\helvetica_bold_r_18.sf" />
563   - <None Include="library\system_fonts\helvetica_bold_r_24.sf" />
564   - <None Include="library\system_fonts\helvetica_bold_r_8.sf" />
565   - <None Include="library\system_fonts\helvetica_medium_o_10.sf" />
566   - <None Include="library\system_fonts\helvetica_medium_o_12.sf" />
567   - <None Include="library\system_fonts\helvetica_medium_o_14.sf" />
568   - <None Include="library\system_fonts\helvetica_medium_o_18.sf" />
569   - <None Include="library\system_fonts\helvetica_medium_o_24.sf" />
570   - <None Include="library\system_fonts\helvetica_medium_o_8.sf" />
571   - <None Include="library\system_fonts\helvetica_medium_r_10.sf" />
572   - <None Include="library\system_fonts\helvetica_medium_r_12.sf" />
573   - <None Include="library\system_fonts\helvetica_medium_r_14.sf" />
574   - <None Include="library\system_fonts\helvetica_medium_r_18.sf" />
575   - <None Include="library\system_fonts\helvetica_medium_r_24.sf" />
576   - <None Include="library\system_fonts\helvetica_medium_r_8.sf" />
577   - <None Include="library\system_fonts\times_bold_i_10.sf" />
578   - <None Include="library\system_fonts\times_bold_i_12.sf" />
579   - <None Include="library\system_fonts\times_bold_i_14.sf" />
580   - <None Include="library\system_fonts\times_bold_i_18.sf" />
581   - <None Include="library\system_fonts\times_bold_i_24.sf" />
582   - <None Include="library\system_fonts\times_bold_i_8.sf" />
583   - <None Include="library\system_fonts\times_bold_r_10.sf" />
584   - <None Include="library\system_fonts\times_bold_r_12.sf" />
585   - <None Include="library\system_fonts\times_bold_r_14.sf" />
586   - <None Include="library\system_fonts\times_bold_r_18.sf" />
587   - <None Include="library\system_fonts\times_bold_r_24.sf" />
588   - <None Include="library\system_fonts\times_bold_r_8.sf" />
589   - <None Include="library\system_fonts\times_medium_i_10.sf" />
590   - <None Include="library\system_fonts\times_medium_i_12.sf" />
591   - <None Include="library\system_fonts\times_medium_i_14.sf" />
592   - <None Include="library\system_fonts\times_medium_i_18.sf" />
593   - <None Include="library\system_fonts\times_medium_i_24.sf" />
594   - <None Include="library\system_fonts\times_medium_i_8.sf" />
595   - <None Include="library\system_fonts\times_medium_r_10.sf" />
596   - <None Include="library\system_fonts\times_medium_r_12.sf" />
597   - <None Include="library\system_fonts\times_medium_r_14.sf" />
598   - <None Include="library\system_fonts\times_medium_r_18.sf" />
599   - <None Include="library\system_fonts\times_medium_r_24.sf" />
600   - <None Include="library\system_fonts\times_medium_r_8.sf" />
601   - <None Include="library\test\Anubis UnitTest.aproj" />
602   - <None Include="library\test\Anubis UnitTest.ide" />
603   - <None Include="library\test\duplicate_letters.c" />
604   - <None Include="library\tools\maml.anubis.1" />
605   - <None Include="library\tools\safe_save_retrieve.anubis_back" />
606   - <None Include="library\web\spacer.gif" />
607   - <None Include="library\widgets3\alienor.jpg" />
608   - <None Include="library\widgets3\alienor_aquitaine.jpg" />
609   - <None Include="library\widgets3\anubis.jpg" />
610   - <None Include="library\widgets3\flowers.jpg" />
611   - <None Include="library\widgets3\gisant_alienor.jpg" />
612   - <None Include="library\widgets3\gisant_alienor2.jpg" />
613   - <None Include="library\widgets3\henri_2.jpg" />
614   - <None Include="library\widgets3\john_lackland.jpg" />
615   - <None Include="library\widgets3\old_sarum.jpg" />
616   - <None Include="library\widgets3\richard.jpg" />
617   - <None Include="library\widgets4\images\bidon.jpg" />
618   - <None Include="library\widgets4\images\checked.jpg" />
619   - <None Include="library\widgets4\images\cows.jpg" />
620   - <None Include="library\widgets4\images\farm.jpg" />
621   - <None Include="library\widgets4\images\fingers.jpg" />
622   - <None Include="library\widgets4\images\flowers.jpg" />
623   - <None Include="library\widgets4\images\mountain.jpg" />
624   - <None Include="library\widgets4\images\not_checked.jpg" />
625   - <None Include="library\widgets4\images\torrent.jpg" />
626   - <None Include="library\xml\xml_parser.apg" />
627   - </ItemGroup>
628   - <ItemGroup>
629   - <Folder Include="calexium_lib" />
630   - <Folder Include="calexium_lib\asterisk" />
631   - <Folder Include="calexium_lib\database" />
632   - <Folder Include="calexium_lib\database\model" />
633   - <Folder Include="calexium_lib\database\vtm" />
634   - <Folder Include="calexium_lib\extensions" />
635   - <Folder Include="calexium_lib\mail" />
636   - <Folder Include="calexium_lib\mail\lexers" />
637   - <Folder Include="calexium_lib\network" />
638   - <Folder Include="calexium_lib\net_services" />
639   - <Folder Include="calexium_lib\net_services_protocols" />
640   - <Folder Include="calexium_lib\obj" />
641   - <Folder Include="calexium_lib\os_tools" />
642   - <Folder Include="calexium_lib\os_tools\freebsd" />
643   - <Folder Include="calexium_lib\os_tools\linux" />
644   - <Folder Include="calexium_lib\os_tools\linux\config" />
645   - <Folder Include="calexium_lib\unit_test" />
646   - <Folder Include="calexium_lib\web" />
647   - <Folder Include="calexium_lib\web\jQuery" />
648   - <Folder Include="calexium_lib\web\jQuery\ui-addon" />
649   - <Folder Include="calexium_lib\web\js" />
650   - <Folder Include="calexium_lib\web\widgets" />
651   - <Folder Include="library" />
652   - <Folder Include="library\a2a" />
653   - <Folder Include="library\a2a\C" />
654   - <Folder Include="library\a2a\generic" />
655   - <Folder Include="library\charset" />
656   - <Folder Include="library\cipher" />
657   - <Folder Include="library\converters" />
658   - <Folder Include="library\data_base" />
659   - <Folder Include="library\doc_tools" />
660   - <Folder Include="library\examples" />
661   - <Folder Include="library\examples\cryptography" />
662   - <Folder Include="library\examples\graphism" />
663   - <Folder Include="library\examples\graphism\image_samples" />
664   - <Folder Include="library\examples\lexical_analysis" />
665   - <Folder Include="library\examples\logic" />
666   - <Folder Include="library\examples\mathematics" />
667   - <Folder Include="library\examples\mathematics\runge_kutta" />
668   - <Folder Include="library\examples\network" />
669   - <Folder Include="library\examples\network\public" />
670   - <Folder Include="library\examples\system" />
671   - <Folder Include="library\graphism" />
672   - <Folder Include="library\graphism\image_samples" />
673   - <Folder Include="library\lexical_analysis" />
674   - <Folder Include="library\locale" />
675   - <Folder Include="library\mail" />
676   - <Folder Include="library\network" />
677   - <Folder Include="library\syntactic_analysis" />
678   - <Folder Include="library\system" />
679   - <Folder Include="library\system\parameter" />
680   - <Folder Include="library\system_colors" />
681   - <Folder Include="library\system_fonts" />
682   - <Folder Include="library\test" />
683   - <Folder Include="library\test\lexical_analysis" />
684   - <Folder Include="library\test\predefined" />
685   - <Folder Include="library\test\system" />
686   - <Folder Include="library\test\tools" />
687   - <Folder Include="library\tools" />
688   - <Folder Include="library\version2" />
689   - <Folder Include="library\vm" />
690   - <Folder Include="library\web" />
691   - <Folder Include="library\widgets3" />
692   - <Folder Include="library\widgets4" />
693   - <Folder Include="library\widgets4\images" />
694   - <Folder Include="library\xml" />
695   - <Folder Include="src" />
696   - <Folder Include="src\generation" />
697   - <Folder Include="src\types" />
698   - </ItemGroup>
699   -</Project>
700 0 \ No newline at end of file
model_manager.ide deleted
1   -
2   -Microsoft Visual Studio Solution File, Format Version 9.00
3   -# Visual Studio 2005
4   -# SharpDevelop 1.0.12.108
5   -Project("{B6712916-30DE-4a3e-A54C-2A79AC984AEE}") = "model_manager", "model_manager.aproj", "{89372B21-80FA-4EB8-B17C-072EB55713D6}"
6   -EndProject
7   -Global
8   - GlobalSection(SolutionConfigurationPlatforms) = preSolution
9   - Debug|Any CPU = Debug|Any CPU
10   - Release|Any CPU = Release|Any CPU
11   - EndGlobalSection
12   - GlobalSection(ProjectConfigurationPlatforms) = postSolution
13   - {89372B21-80FA-4EB8-B17C-072EB55713D6}.Debug|Any CPU.Build.0 = Debug|Any CPU
14   - {89372B21-80FA-4EB8-B17C-072EB55713D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15   - {89372B21-80FA-4EB8-B17C-072EB55713D6}.Release|Any CPU.Build.0 = Release|Any CPU
16   - {89372B21-80FA-4EB8-B17C-072EB55713D6}.Release|Any CPU.ActiveCfg = Release|Any CPU
17   - EndGlobalSection
18   -EndGlobal
resources/js/hayamiki_designer/README.md 0 → 100644
  1 +WWW SQL Designer allows users to create database designs, which can be saved/loaded and exported to SQL scripts. Various databases and languages are supported. Ability to import existing database design.
  2 +
  3 +[[YouTube video](http://www.youtube.com/watch?v=hCQzJx9AKhU)]
  4 +
  5 +# About
  6 +
  7 +Hi and welcome to WWW SQL Designer! This tool allows you to draw and create database schemas (E-R diagrams) directly in browser, without the need for any external programs (flash). You only need JavaScript enabled.
  8 +The Designer works perfectly in Mozillas (Firefox, Seamonkey), Internet Explorers (6, 7, 8), Safari and Operas. Konqueror works, but the experience is limited.
  9 +
  10 +Many database features are supported, such as keys, foreign key constraints, comments and indexes. You can either save your design (for further loading & modifications), print it or export as SQL script. It is possible to retrieve (import) schema from existing database.
  11 +
  12 +WWW SQL Designer was created by [Ondrej Zara](http://ondras.zarovi.cz/) and is built atop the [oz.js](http://code.google.com/p/oz-js/) JavaScript module. It is distributed under New BSD license.
  13 +
  14 +If you wish to support this project, <a href='https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3340079'><img src='https://www.paypal.com/en_GB/i/btn/btn_donate_LG.gif' alt='Donate at PayPal' title='Donate at PayPal' /></a> at PayPal!
  15 +
  16 +# News
  17 +
  18 +## Moved to GitHub
  19 +
  20 +Google Code is closing down, we are now completely migrated to GitHub.
  21 +
  22 +## Experimental real-time collaboration version
  23 +
  24 +Thanks to Bharat Patil: http://bharat.whiteboard.jit.su/
  25 +
  26 +## New release
  27 +
  28 +Version 2.7 was released on 3.8.2012. This is mainly a bugfix release, although several new features (most notable localStorage support) are present.
  29 +
  30 +## Release
  31 +
  32 +Version 2.6 was released on 22.9.2011. Several new translations (pt\_BR, sv, ar) added; VML removed; new visualization options available (show length and datatype); new DBs and backends; support for touch devices...
  33 +
  34 +## Experimental clone with deletion of saved designs
  35 +
  36 +http://code.google.com/r/charlieyouakim-wwwsqldesigner-deleteadd/
  37 +
  38 +## New optional patch
  39 +
  40 +A new patch, which enable optional display of field details, was submitted by Wilson Oliveira. While this code is not ready yet to be commited into repository, everyone can download it from http://ondras.zarovi.cz/sql/wwwsqldesigner-inline_field_details_patch.zip.
  41 +
  42 +
  43 +## Support for CUBRID
  44 +
  45 +WWW SQL Designer now supports the [CUBRID database](http://www.cubrid.org/): both as a backend (using PHP) as well as datatype definition set.
  46 +
  47 +
  48 +## Release
  49 +
  50 +Version 2.5 was released on 18.6.2010. Many new features were added (hiding of sidebar, colored relation, multi-selection and multi-drag, ...), tons of bugs were fixed.
  51 +
  52 +## Release
  53 +
  54 +Version 2.4 was released on 5.11.2009. Several outstanding issues were fixed and new locales added.
  55 +
  56 +## Release
  57 +
  58 +Version 2.3.3 was released on 28.7.2009. This long-awaited release includes numerous fixes, compatibility improvements, new locales, backends and DB datatypes.
  59 +
  60 +## Release
  61 +
  62 +Version 2.3.2 was released on 8.1.2009. Apart from some traditional bugfixes and locales, a new functionality is introduced - the ability to mark foregin keys between existing table fields!
  63 +
  64 +## Google Code
  65 +
  66 +The project was recently moved to Google Code hosting, which (amongst many other things) introduces Subversion hosting. Enjoy! (The old website, http://ondras.zarovi.cz/sql/, will still exist for some time.)
  67 +
  68 +## 2.0 is here
  69 +
  70 +Good news: A new version of WWW SQL Designer, rewritten from scratch, is now available. I has many new features, including bezier connectors, support for various customizations, localization, options and more.
  71 +
  72 +Bad news: This new version is not backwards compatible with 1.x, so all old localizations and XSLT templates won't work with 2.x. Sorry for inconvenience :/
0 73 \ No newline at end of file
... ...
resources/js/hayamiki_designer/backend/asp-file/Default.aspx 0 → 100644
  1 +<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="backend_asp_file_Default" validateRequest="false" %>
... ...
resources/js/hayamiki_designer/backend/asp-file/Default.aspx.cs 0 → 100644
  1 +using System;
  2 +using System.Collections.Generic;
  3 +using System.Web;
  4 +using System.Web.UI;
  5 +using System.Web.UI.WebControls;
  6 +using System.IO;
  7 +
  8 +public partial class backend_asp_file_Default : System.Web.UI.Page
  9 +{
  10 + protected void Page_Load(object sender, EventArgs e)
  11 + {
  12 + Response.Clear();
  13 +
  14 + string action = Request.Params["action"].ToLower();
  15 +
  16 + if (action.Equals("list"))
  17 + {
  18 + list();
  19 + }
  20 +
  21 + if (action.Equals("load"))
  22 + {
  23 + load();
  24 + }
  25 +
  26 + if (action.Equals("save"))
  27 + {
  28 + save();
  29 + }
  30 +
  31 + Response.End();
  32 + }
  33 +
  34 + private void list()
  35 + {
  36 + string[] filePaths = Directory.GetFiles(Server.MapPath("data"));
  37 + foreach (string filePath in filePaths)
  38 + {
  39 + Response.Write(Path.GetFileName(filePath) + "\n");
  40 + }
  41 + }
  42 +
  43 + private void load()
  44 + {
  45 + string fNaam = "data/" + Request.Params["keyword"].ToLower();
  46 + Response.ContentType = "text/xml";
  47 + if (File.Exists(Server.MapPath(fNaam)))
  48 + {
  49 + Response.WriteFile(Server.MapPath(fNaam));
  50 + }
  51 + else
  52 + {
  53 + Response.StatusCode = 404;
  54 + }
  55 + }
  56 +
  57 + private void save()
  58 + {
  59 + string fNaam = "data/" + Request.Params["keyword"].ToLower();
  60 + FileStream fs = new FileStream(Server.MapPath(fNaam), FileMode.Create);
  61 +
  62 + byte[] buffer = new byte[1024];
  63 + int count;
  64 + while ((count = Request.InputStream.Read(buffer, 0, buffer.Length)) != 0)
  65 + fs.Write(buffer, 0, count);
  66 +
  67 + fs.Close();
  68 +
  69 + }
  70 +}
... ...
resources/js/hayamiki_designer/backend/asp-file/data/default 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8" ?><sql><datatypes db="mysql">
  2 + <group label="Numeric" color="rgb(238,238,170)">
  3 + <type label="Integer" length="0" sql="INTEGER" re="INT" quote=""/>
  4 + <type label="Decimal" length="1" sql="DECIMAL" re="DEC" quote=""/>
  5 + <type label="Single precision" length="0" sql="FLOAT" quote=""/>
  6 + <type label="Double precision" length="0" sql="DOUBLE" re="DOUBLE" quote=""/>
  7 + </group>
  8 +
  9 + <group label="Character" color="rgb(255,200,200)">
  10 + <type label="Char" length="1" sql="CHAR" quote="'"/>
  11 + <type label="Varchar" length="1" sql="VARCHAR" quote="'"/>
  12 + <type label="Text" length="0" sql="MEDIUMTEXT" re="TEXT" quote="'"/>
  13 + <type label="Binary" length="1" sql="BINARY" quote="'"/>
  14 + <type label="Varbinary" length="1" sql="VARBINARY" quote="'"/>
  15 + <type label="BLOB" length="0" sql="BLOB" re="BLOB" quote="'"/>
  16 + </group>
  17 +
  18 + <group label="Date &amp; Time" color="rgb(200,255,200)">
  19 + <type label="Date" length="0" sql="DATE" quote="'"/>
  20 + <type label="Time" length="0" sql="TIME" quote="'"/>
  21 + <type label="Datetime" length="0" sql="DATETIME" quote="'"/>
  22 + <type label="Year" length="0" sql="YEAR" quote=""/>
  23 + <type label="Timestamp" length="0" sql="TIMESTAMP" quote="'"/>
  24 + </group>
  25 +
  26 + <group label="Miscellaneous" color="rgb(200,200,255)">
  27 + <type label="ENUM" length="1" sql="ENUM" quote=""/>
  28 + <type label="SET" length="1" sql="SET" quote=""/>
  29 + </group>
  30 +</datatypes><table x="50" y="50" name="Producer"><row name="id" null="0" autoincrement="1"><datatype>INTEGER</datatype></row><row name="name" null="1" autoincrement="0"><datatype>VARCHAR(100)</datatype><default>NULL</default></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="574" y="66" name="Consumer"><row name="id" null="0" autoincrement="1"><datatype>INTEGER</datatype></row><row name="name" null="1" autoincrement="0"><datatype>VARCHAR(100)</datatype><default>NULL</default></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="195" y="333" name="Product"><row name="id" null="0" autoincrement="1"><datatype>INTEGER</datatype></row><row name="id_Producer" null="0" autoincrement="1"><datatype>INTEGER</datatype><relation table="Producer" row="id" /></row><row name="name" null="1" autoincrement="0"><datatype>VARCHAR(100)</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="383" y="227" name="Garbage"><row name="id" null="0" autoincrement="1"><datatype>INTEGER</datatype></row><row name="id_Product" null="0" autoincrement="1"><datatype>INTEGER</datatype><relation table="Product" row="id" /></row><row name="id_Consumer" null="0" autoincrement="1"><datatype>INTEGER</datatype><relation table="Consumer" row="id" /></row><row name="consumed" null="0" autoincrement="0"><datatype>TIMESTAMP</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table></sql>
0 31 \ No newline at end of file
... ...
resources/js/hayamiki_designer/backend/cf-mysql/database.sql 0 → 100644
  1 +DROP TABLE IF EXISTS `wwwsqldesigner`;
  2 +
  3 +CREATE TABLE `wwwsqldesigner` (
  4 + `keyword` varchar(30) NOT NULL default '',
  5 + `data` mediumtext,
  6 + `dt` timestamp,
  7 + PRIMARY KEY (`keyword`)
  8 +);
... ...
resources/js/hayamiki_designer/backend/cf-mysql/index.cfm 0 → 100644
  1 +<cfsetting requesttimeout="60" enablecfoutputonly="yes">
  2 +
  3 +<cfset db = {
  4 + datasource = "wwwsqldesigner",
  5 + table = "wwwsqldesigner",
  6 +
  7 + info_db = "information_schema",
  8 +
  9 + info_databases_table = "schemata",
  10 + info_database_col = "schema_name",
  11 +
  12 + info_tables_table = "tables",
  13 + info_table_col = "table_name",
  14 +
  15 + info_db_col = "table_schema",
  16 +
  17 + info_columns_table = "columns",
  18 +
  19 + info_column_col = "column_name"
  20 +}>
  21 +
  22 +<cffunction name="getDatabases">
  23 + <cfquery name="local.databases" datasource="#db.datasource#">
  24 + SELECT *
  25 + FROM #db.info_db#.#db.info_databases_table#
  26 + </cfquery>
  27 +
  28 + <cfreturn local.databases>
  29 +</cffunction>
  30 +
  31 +<cffunction name="getTables">
  32 + <cfargument name="database" default="">
  33 +
  34 + <cfquery name="local.tables" datasource="#db.datasource#">
  35 + SELECT *
  36 + FROM #db.info_db#.#db.info_tables_table#
  37 +
  38 + <cfif ARGUMENTS.database NEQ "">
  39 + WHERE #db.info_db_col# = <cfqueryparam cfsqltype="cf_sql_varchar" value="#ARGUMENTS.database#">
  40 + </cfif>
  41 + </cfquery>
  42 +
  43 + <cfreturn local.tables>
  44 +</cffunction>
  45 +
  46 +<cffunction name="getColumns">
  47 + <cfargument name="database">
  48 + <cfargument name="table">
  49 +
  50 + <cfquery name="local.columns" datasource="#db.datasource#">
  51 + SELECT *
  52 + FROM #db.info_db#.#db.info_columns_table#
  53 + WHERE #db.info_db_col# = <cfqueryparam cfsqltype="cf_sql_varchar" value="#ARGUMENTS.database#">
  54 + AND #db.info_table_col# = <cfqueryparam cfsqltype="cf_sql_varchar" value="#ARGUMENTS.table#">
  55 + </cfquery>
  56 +
  57 + <cfreturn local.columns>
  58 +</cffunction>
  59 +
  60 +
  61 +<cffunction name="getForeignKeys">
  62 + <cfargument name="database">
  63 + <cfargument name="table">
  64 + <cfargument name="column">
  65 +
  66 + <cfquery name="local.foreignKeys" datasource="#db.datasource#">
  67 + SELECT REFERENCED_TABLE_NAME AS 'table', REFERENCED_COLUMN_NAME AS 'column'
  68 + FROM #db.info_db#.KEY_COLUMN_USAGE k
  69 + LEFT JOIN #db.info_db#.TABLE_CONSTRAINTS c
  70 + ON k.CONSTRAINT_NAME = c.CONSTRAINT_NAME
  71 + WHERE CONSTRAINT_TYPE = 'FOREIGN KEY'
  72 + AND c.#db.info_db_col# = <cfqueryparam cfsqltype="cf_sql_varchar" value="#ARGUMENTS.database#">
  73 + AND c.#db.info_table_col# = <cfqueryparam cfsqltype="cf_sql_varchar" value="#ARGUMENTS.table#">
  74 + AND k.#db.info_column_col# = <cfqueryparam cfsqltype="cf_sql_varchar" value="#ARGUMENTS.column#">
  75 + </cfquery>
  76 +
  77 + <cfreturn local.foreignKeys>
  78 +</cffunction>
  79 +
  80 +<cffunction name="getKeys">
  81 + <cfargument name="database">
  82 + <cfargument name="table">
  83 +
  84 + <cfquery name="local.keys" datasource="#db.datasource#">
  85 + SELECT *
  86 + FROM #db.info_db#.STATISTICS
  87 + WHERE #db.info_db_col# = <cfqueryparam cfsqltype="cf_sql_varchar" value="#ARGUMENTS.database#">
  88 + AND #db.info_table_col# = <cfqueryparam cfsqltype="cf_sql_varchar" value="#ARGUMENTS.table#">
  89 + ORDER BY SEQ_IN_INDEX ASC
  90 + </cfquery>
  91 +
  92 + <cfreturn local.keys>
  93 +</cffunction>
  94 +
  95 +<cffunction name="list">
  96 + <cfargument name="database" default="">
  97 +
  98 + <cfif ARGUMENTS.database EQ "">
  99 + <cfset local.result = getDatabases()>
  100 +
  101 + <cfreturn valueList(local.result.database_name, chr(10))>
  102 + <cfelse>
  103 + <cfset local.result = getTables(argumentCollection=ARGUMENTS)>
  104 +
  105 + <cfreturn valueList(local.result.table_name, chr(10))>
  106 + </cfif>
  107 +</cffunction>
  108 +
  109 +<cffunction name="isDatabase" returntype="boolean">
  110 + <cfargument name="database">
  111 + <cfset var databases = getDatabases()>
  112 +
  113 + <cfquery dbtype="query" name="local.databaseCheck">
  114 + SELECT * FROM databases
  115 + WHERE #db.info_database_col# = <cfqueryparam value="#ARGUMENTS.database#" cfsqltype="cf_sql_varchar">
  116 + </cfquery>
  117 +
  118 + <cfreturn local.databaseCheck.recordCount>
  119 +</cffunction>
  120 +
  121 +<cffunction name="import" output="false">
  122 + <cfargument name="database" default="information_schema">
  123 +
  124 + <cfset var local = {}>
  125 +
  126 + <cffile action="read" variable="local.datatypes" file="#expandPath("../../db/mysql/datatypes.xml")#">
  127 +
  128 + <cfset local.arr = listToArray(local.datatypes, "#chr(10)##chr(13)#")>
  129 +
  130 + <cfset local.xml = "">
  131 +
  132 + <cfset arrayInsertAt(local.arr, 2, '<sql db="mysql">')>
  133 +
  134 + <cfif !isDatabase(ARGUMENTS.database)>
  135 + <cfthrow message="Invalid database" detail="Databse `#ARGUMENTS.database#` does not exist on this server.">
  136 + </cfif>
  137 +
  138 + <cfset local.tables = getTables(ARGUMENTS.database)>
  139 +
  140 + <cfloop query="local.tables">
  141 + <cfset local.xml &= '<table name="#table_name#">'>
  142 +
  143 + <cfif table_comment NEQ "">
  144 + <cfset local.xml &= '<comment>#htmlEditFormat(table_comment)#</comment>'>
  145 + </cfif>
  146 +
  147 + <cfset local.columns = getColumns(database=ARGUMENTS.database, table=table_name)>
  148 +
  149 + <cfloop query="local.columns">
  150 + <cfif is_nullable EQ "YES">
  151 + <cfset local.null = 1>
  152 + <cfelse>
  153 + <cfset local.null = 0>
  154 + </cfif>
  155 +
  156 + <cfif findNoCase("auto_increment", extra) GT 0>
  157 + <cfset local.ai = 1>
  158 + <cfelse>
  159 + <cfset local.ai = 0>
  160 + </cfif>
  161 +
  162 + <cfset local.def = column_default>
  163 +
  164 + <cfif local.def EQ "NULL">
  165 + <cfset local.def = "">
  166 + </cfif>
  167 +
  168 + <cfset local.xml &= '<row name="#column_name#" null="#local.null#" autoincrement="#local.ai#">'>
  169 + <cfset local.xml &= '<datatype>#ucase(column_type)#</datatype>'>
  170 + <cfset local.xml &= '<default>#local.def#</default>'>
  171 +
  172 + <cfif column_comment NEQ "">
  173 + <cfset local.xml &= '<comment>#htmlEditFormat(column_comment)#</comment>'>
  174 + </cfif>
  175 +
  176 + <cfset local.fk = getForeignKeys(database=ARGUMENTS.database, table=table_name, column=column_name)>
  177 +
  178 + <cfloop query="local.fk">
  179 + <cfset local.xml &= '<relation table="#table#" row="#column#" />'>
  180 + </cfloop>
  181 +
  182 + <cfset local.xml &= '</row>'>
  183 + </cfloop>
  184 +
  185 + <cfset local.keys = getKeys(database=ARGUMENTS.database, table=table_name)>
  186 +
  187 + <cfset local.idx = {}>
  188 +
  189 + <cfloop query="local.keys">
  190 + <cfif structKeyExists(local.idx, index_name)>
  191 + <cfset local.obj = local.idx[index_name]>
  192 + <cfelse>
  193 + <cfset local.t = "INDEX">
  194 +
  195 + <cfif index_type EQ "FULLTEXT">
  196 + <cfset local.t = index_type>
  197 + </cfif>
  198 +
  199 + <cfif NON_UNIQUE EQ 0>
  200 + <cfset local.t = "UNIQUE">
  201 + </cfif>
  202 +
  203 + <cfif index_name EQ "PRIMARY">
  204 + <cfset local.t = "PRIMARY">
  205 + </cfif>
  206 +
  207 + <cfset local.obj = {
  208 + columns=[],
  209 + type=local.t
  210 + }>
  211 +
  212 + </cfif>
  213 +
  214 + <cfset arrayAppend(local.obj["columns"], column_name)>
  215 + <cfset local.idx[index_name] = local.obj>
  216 + </cfloop>
  217 +
  218 + <cfloop collection="#local.idx#" item="local.name">
  219 + <cfset local.obj = local.idx[local.name]>
  220 +
  221 + <cfset local.xml &= '<key name="#local.name#" type="#local.obj["type"]#">'>
  222 +
  223 + <cfloop array="#local.obj["columns"]#" index="local.col">
  224 + <cfset local.xml &= '<part>#local.col#</part>'>
  225 + </cfloop>
  226 +
  227 + <cfset local.xml &= '</key>'>
  228 + </cfloop>
  229 +
  230 + <cfset local.xml &= "</table>">
  231 + </cfloop>
  232 +
  233 + <cfset arrayAppend(arr, xml)>
  234 + <cfset arrayAppend(arr, '</sql>')>
  235 +
  236 + <cfreturn arrayToList(arr, chr(10))>
  237 +</cffunction>
  238 +
  239 +<cfparam name="URL.action" default="">
  240 +<cfset action = URL.action>
  241 +
  242 +<cfswitch expression="#action#">
  243 + <cfcase value="list">
  244 + <cfquery name="result" datasource="#db.datasource#">
  245 + SELECT keyword
  246 + FROM #db.table#
  247 + ORDER BY dt DESC
  248 + </cfquery>
  249 + <cfloop query="result">
  250 + <cfoutput>#keyword##chr(10)#</cfoutput>
  251 + </cfloop>
  252 + </cfcase>
  253 + <cfcase value="save">
  254 + <cfparam name="URL.keyword" default="">
  255 + <cfset keyword = URL.keyword>
  256 +
  257 + <cfset data = GetHttpRequestData().content>
  258 +
  259 + <cfquery name="result" datasource="#db.datasource#">
  260 + SELECT *
  261 + FROM #db.table#
  262 + WHERE keyword = <cfqueryparam value="#keyword#" cfsqltype="cf_sql_varchar">
  263 + </cfquery>
  264 +
  265 + <cfif result.recordCount GT 0>
  266 + <cfquery datasource="#db.datasource#">
  267 + UPDATE #db.table#
  268 + SET data = <cfqueryparam value="#data#" cfsqltype="cf_sql_varchar">
  269 + WHERE keyword = <cfqueryparam value="#keyword#" cfsqltype="cf_sql_varchar">
  270 + </cfquery>
  271 + <cfelse>
  272 + <cfquery datasource="#db.datasource#">
  273 + INSERT INTO #db.table# (keyword, data)
  274 + VALUES (
  275 + <cfqueryparam value="#keyword#" cfsqltype="cf_sql_varchar">,
  276 + <cfqueryparam value="#data#" cfsqltype="cf_sql_varchar">
  277 + )
  278 + </cfquery>
  279 + </cfif>
  280 +
  281 + <cfheader statuscode="201" statustext="Created">
  282 + </cfcase>
  283 + <cfcase value="load">
  284 + <cfparam name="URL.keyword" default="">
  285 + <cfset keyword = URL.keyword>
  286 +
  287 + <cfquery name="result" datasource="#db.datasource#">
  288 + SELECT `data`
  289 + FROM #db.table#
  290 + WHERE keyword = <cfqueryparam value="#keyword#" cfsqltype="cf_sql_varchar">
  291 + </cfquery>
  292 +
  293 + <cfif result.recordCount EQ 0>
  294 + <cfheader statuscode="404" statustext="Not Found">
  295 + <cfdump var="#result#" abort>
  296 + <cfelse>
  297 + <cfheader name="Content-type" value="text/xml">
  298 + <cfoutput>#result.data#</cfoutput>
  299 + </cfif>
  300 + </cfcase>
  301 + <cfcase value="import">
  302 + <cfheader name="Content-type" value="text/xml">
  303 + <cfparam name="URL.database" default="">
  304 + <cfoutput>#import(URL.database)#</cfoutput>
  305 + </cfcase>
  306 + <cfdefaultcase>
  307 + <cfheader statuscode="301" statustext="Not Implemented">
  308 + </cfdefaultcase>
  309 +</cfswitch>
... ...
resources/js/hayamiki_designer/backend/perl-file/index.pl 0 → 100644
  1 +#!d:\perl\bin\perl.exe -wT
  2 +# C.SUDRE - cyril.sudre@edf.fr
  3 +
  4 +use strict;
  5 +use File::Basename;
  6 +use IO::File;
  7 +use CGI;
  8 +
  9 +# Directory for datafile. Take care to untaint current execution dir for CGI while -T if you
  10 +# choose to keep datafile in the same dir than cgi script.
  11 +my $base_dir = (dirname($0) =~ /(.*)/)[0] . "/data/";
  12 +
  13 +my $query = new CGI;
  14 +my $action = $query->url_param('action') || '';
  15 +
  16 +# List available files to load
  17 +if($action eq "list") {
  18 + print $query->header('text/plain');
  19 + my @files = glob($base_dir . "*");
  20 + for (@files) {
  21 + print(basename($_) . "\n");
  22 + }
  23 +}
  24 +
  25 +# Save generated XML to file
  26 +elsif($action eq "save") {
  27 + # Accept names with spaces and/or extention
  28 + my $fname_parameter = ($query->url_param('keyword') =~ /([\w\s]+(\.\w+)*)/)[0]; # Untaint
  29 + if (! defined $fname_parameter) { die "Invalid filename!"; }
  30 + my $filename = $base_dir . $fname_parameter;
  31 +
  32 + my $fh = new IO::File ">" . $filename;
  33 + if (defined $fh) {
  34 + # Win32...
  35 + binmode $fh;
  36 +
  37 + #my $xml = $query->query_string();
  38 + my $xml = $query->param('POSTDATA');
  39 +
  40 + # Decode
  41 + $xml =~ tr/+/ /;
  42 + $xml =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
  43 +
  44 + print $fh $xml;
  45 +
  46 + $fh->close;
  47 + }
  48 +
  49 + print $query->header(-status => "201 File created");
  50 + }
  51 +
  52 +# Load XML from file
  53 +elsif($action eq "load") {
  54 + # Accept names with spaces and/or extention
  55 + my $fname_parameter = ($query->url_param('keyword') =~ /([\w\s]+(\.\w+)*)/)[0]; # Untaint
  56 + my $filename = $base_dir . $fname_parameter;
  57 +
  58 + undef $/; # Slurp
  59 + my $fh = new IO::File "< " . $filename;
  60 +
  61 + if (defined $fh) {
  62 + # Need this for UTF-8 AND Win32...
  63 + binmode($fh,":utf8");
  64 +
  65 + my $content = <$fh>;
  66 + $fh->close;
  67 +
  68 + print $query->header("text/xml"), $content;
  69 + } else { print $query->header(-status => "404 Not Found"); }
  70 + }
  71 +
  72 +else {
  73 + print $query->header(-status => "501 Not Implemented");
  74 + }
  75 +
0 76 \ No newline at end of file
... ...
resources/js/hayamiki_designer/backend/php-blank/index.php 0 → 100644
  1 +<?php
  2 + header("HTTP/1.0 501 Not Implemented");
  3 +?>
... ...
resources/js/hayamiki_designer/backend/php-cubrid/cubrid_mysql_compat.php 0 → 100644
  1 +<?php
  2 +/*
  3 +* Description: A Cubrid implementation of the equivalent MySQL PHP API functions.
  4 +*
  5 +* Copyright (c) 2010 Cubrid.
  6 +* www.cubrid.org
  7 +*
  8 +* This program is free software; you can redistribute it and/or modify
  9 +* it under the terms of the GNU General Public License as published by
  10 +* the Free Software Foundation; either version 2 of the License, or
  11 +* (at your option) any later version.
  12 +*
  13 +* This program is distributed in the hope that it will be useful,
  14 +* but WITHOUT ANY WARRANTY; without even the implied warranty of
  15 +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16 +* GNU General Public License for more details.
  17 +*
  18 +* You should have received a copy of the GNU General Public License
  19 +* along with this program; if not, write to the Free Software
  20 +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  21 +*
  22 +* Ver 1.2.1
  23 +* Last update: November 2010
  24 +*
  25 +*/
  26 +
  27 +// Global variables
  28 +$calculate_insert_id; // flag to indicate if calculate the last_insert_id
  29 +
  30 +$cubrid_last_insert_id; // keeps the last_insert_id value
  31 +$cubrid_default_port; // default port used to coonect to Cubrid, if not explicitely secified
  32 +$cubrid_database; // keeps the current database name
  33 +
  34 +// MySQL syntax:
  35 +// resource mysql_connect ( [string server [, string username [, string password [, bool new_link [, int client_flags]]]]] )
  36 +function cubrid_mysql_connect($server, $username, $password, $database) {
  37 + // Note: In Cubrid, the database name is mandatory
  38 + // initialize globals
  39 + $GLOBALS['calculate_last_insert_id'] = true;
  40 + $GLOBALS['cubrid_last_insert_id'] = 0;
  41 + $GLOBALS['cubrid_default_port'] = 30000; // or use 33000
  42 + $GLOBALS['cubrid_database'] = "";
  43 +
  44 + if (strpos($server, ":") > 0) {
  45 + list($host, $port)=explode(":", $server, 2);
  46 + } else {
  47 + $host=$server;
  48 + $port=$GLOBALS['cubrid_default_port']; // default port
  49 + }
  50 +
  51 + // save database name
  52 + $GLOBALS['cubrid_database']=$database;
  53 +
  54 + return cubrid_connect($host, $port, $database, $username, $password);
  55 +}
  56 +
  57 +// MySQL syntax:
  58 +// bool mysql_close ( [resource link_identifier] )
  59 +function cubrid_mysql_close($link_identifier) {
  60 + return cubrid_disconnect($link_identifier);
  61 +}
  62 +
  63 +// MySQL syntax:
  64 +function cubrid_mysql_errno($link_identifier = '') {
  65 + // int mysql_errno ( [resource link_identifier] )
  66 + return cubrid_error_code();
  67 +}
  68 +
  69 +// MySQL syntax:
  70 +function cubrid_mysql_error($link_identifier = '') {
  71 + // string mysql_error ( [resource link_identifier] )
  72 + return cubrid_error_msg();
  73 +}
  74 +
  75 +// MySQL syntax:
  76 +// resource mysql_query ( string query [, resource link_identifier] )
  77 +function cubrid_mysql_query_native($query, $link_identifier) {
  78 + $result=cubrid_execute($link_identifier, $query);
  79 + // Cubrid does not do commit automatically by default (auto-commit is off by default)
  80 + cubrid_commit ($link_identifier);
  81 + return $result;
  82 +}
  83 +
  84 +// MySQL syntax:
  85 +// resource mysql_query ( string query [, resource link_identifier] )
  86 +function cubrid_mysql_query($query, $link_identifier, $last_insert_id_column = '') {
  87 + $cubrid_query=trim($query); // need to trim to make sure we are handling properly the ";" terminator
  88 +
  89 + if ($GLOBALS['calculate_last_insert_id']) {
  90 + // HACK - Cubrid does not support yet INSERT_ID()
  91 + // We need to alter the INSERT query to be able to get last_insert_id
  92 + if (startsWith($cubrid_query, "insert", false)) {
  93 + if ($cubrid_query[strlen($cubrid_query) - 1] == ";") { // remove the ";" last char
  94 + $cubrid_query=substr($cubrid_query, 0, strlen($cubrid_query) - 1) . " INTO :xyz;";
  95 + } else {
  96 + $cubrid_query=$cubrid_query . " INTO :xyz;";
  97 + }
  98 + }
  99 + }
  100 +
  101 + $result=cubrid_execute($link_identifier, $cubrid_query);
  102 +
  103 + if (!$result) {
  104 + return false;
  105 + }
  106 +
  107 + if ($GLOBALS['calculate_last_insert_id']) {
  108 + if (startsWith($cubrid_query, "insert", false)) {
  109 + // get the last_insert_id for the specified column (In Cubrid can be multiple auto_increment columns)
  110 + if (strlen($last_insert_id_column) > 0) {
  111 + $GLOBALS['cubrid_last_insert_id']=cubrid_get_value(cubrid_last_insert_id_query($last_insert_id_column),
  112 + $link_identifier);
  113 + }
  114 + } else {
  115 + $GLOBALS['cubrid_last_insert_id']=0; // (re)set to 0
  116 + }
  117 + }
  118 + cubrid_commit ($link_identifier);
  119 + return $result;
  120 +}
  121 +
  122 +// MySQL syntax:
  123 +// array mysql_free_result ( resource $link_identifier )
  124 +function cubrid_mysql_free_result($link_identifier) {
  125 + return cubrid_free_result($link_identifier);
  126 +}
  127 +
  128 +// MySQL syntax:
  129 +// array mysql_fetch_row ( resource result )
  130 +function cubrid_mysql_fetch_row($result) {
  131 + return cubrid_fetch_row($result);
  132 +}
  133 +
  134 +// MySQL syntax:
  135 +// array mysql_fetch_array ( resource result [, int result_type] )
  136 +function cubrid_mysql_fetch_array($result, $result_type = 0) {
  137 + return cubrid_fetch($result, $result_type);
  138 +}
  139 +
  140 +// MySQL syntax:
  141 +// object mysql_fetch_object ( resource result )
  142 +function cubrid_mysql_fetch_object($result) {
  143 + return cubrid_fetch_object($result);
  144 +}
  145 +
  146 +// MySQL syntax:
  147 +// bool mysql_data_seek ( resource result, int row_number )
  148 +function cubrid_mysql_move_cursor($result, $offset) {
  149 + return cubrid_move_cursor($result, $offset);
  150 +}
  151 +
  152 +// MySQL syntax:
  153 +// object mysql_fetch_field ( resource result [, int field_offset] )
  154 +function cubrid_mysql_fetch_field($result) {
  155 + return cubrid_fetch_field($result);
  156 +}
  157 +
  158 +// MySQL syntax:
  159 +// int mysql_insert_id ( [resource link_identifier] )
  160 +function cubrid_mysql_insert_id($link_identifier = -1) {
  161 + return $GLOBALS['cubrid_last_insert_id'];
  162 +}
  163 +
  164 +// MySQL syntax:
  165 +// int mysql_num_rows ( resource result )
  166 +function cubrid_mysql_num_rows($resultSet) {
  167 + return cubrid_num_rows($resultSet);
  168 +}
  169 +
  170 +// MySQL syntax:
  171 +// int mysql_num_fields ( resource result )
  172 +function cubrid_mysql_num_fields($resultSet) {
  173 + return cubrid_num_cols($resultSet);
  174 +}
  175 +
  176 +// MySQL syntax:
  177 +// bool mysql_data_seek ( resource result, int row_number )
  178 +function cubrid_mysql_data_seek($result, $row_number) {
  179 + return cubrid_data_seek($result, $row_number);
  180 +}
  181 +
  182 +// MySQL syntax:
  183 +// Zero if successful. Non-zero if an error occurred.
  184 +function cubrid_mysql_commit($link_identifier) {
  185 + return cubrid_commit($link_identifier);
  186 +}
  187 +
  188 +// MySQL syntax:
  189 +// Zero if successful. Non-zero if an error occurred.
  190 +function cubrid_mysql_rollback($link_identifier) {
  191 + return cubrid_rollback($link_identifier);
  192 +}
  193 +
  194 +// MySQL syntax:
  195 +// string mysql_real_escape_string ( string unescaped_string [, resource link_identifier] )
  196 +function cubrid_mysql_real_escape_string($unescaped_string, $link_identifier = '') {
  197 + return str_replace("'", "''", $unescaped_string);
  198 +}
  199 +
  200 +// MySQL syntax:
  201 +// string mysql_result ( resource $result , int $row [, mixed $field = 0 ] )
  202 +function cubrid_mysql_result($result, $row, $field = 0) {
  203 + return cubrid_result($result, $row, $field);
  204 +}
  205 +
  206 +// MySQL syntax:
  207 +// array mysql_fetch_assoc ( resource $result )
  208 +function cubrid_mysql_fetch_assoc($result) {
  209 + return cubrid_fetch_assoc($result);
  210 +}
  211 +
  212 +// implements SHOW TABLES
  213 +function cubrid_SHOW_TABLES($link_identifier) {
  214 + return cubrid_mysql_query_native(get_SQL_SHOW_TABLES(), $link_identifier);
  215 +}
  216 +
  217 +// implements DESCRIBE
  218 +function cubrid_DESCRIBE($table, $link_identifier) {
  219 + return cubrid_mysql_query_native(get_SQL_describeTableSQL($table), $link_identifier);
  220 +}
  221 +
  222 +// implements SHOW INDEX
  223 +function cubrid_SHOW_INDEX_FROM($table, $link_identifier) {
  224 + return cubrid_mysql_query_native(get_SQL_SHOW_INDEX_FROM($table), $link_identifier);
  225 +}
  226 +
  227 +// gets data type for a table
  228 +function cubrid_ColumnDataType($identifier, $table, $column) {
  229 + $id_result =cubrid_mysql_query_native(get_SQL_ColumnDataType($table, $column), $identifier);
  230 + $id_row =cubrid_fetch_row($id_result);
  231 + cubrid_free_result ($id_result);
  232 + $calculated_value=$id_row[0];
  233 + return $calculated_value;
  234 +}
  235 +
  236 +// gets a single value as a query result
  237 +function cubrid_get_value($query, $link_identifier) {
  238 + $result=cubrid_execute($link_identifier, $query);
  239 +
  240 + if ($result) {
  241 + $row =cubrid_fetch_row($result);
  242 + $value=$row[0];
  243 + } else {
  244 + return -1;
  245 + }
  246 +
  247 + return $value;
  248 +}
  249 +
  250 +// returns the last_insert_id value
  251 +function cubrid_last_insert_id_query($last_insert_id_column, $cubrid_var = "xyz") {
  252 + return "SELECT :" . $cubrid_var . "." . $last_insert_id_column . " FROM db_root";
  253 +}
  254 +
  255 +// returns the last_insert_id value
  256 +function cubrid_last_insert_id($last_insert_id_column, $link_identifier, $cubrid_var = "xyz") {
  257 + return cubrid_get_value(cubrid_last_insert_id_query($last_insert_id_column), $link_identifier);
  258 +}
  259 +
  260 +// return the current Cubrid database name
  261 +function cubrid_current_database() {
  262 + return $GLOBALS['cubrid_database'];
  263 +}
  264 +
  265 +// The following columns are returned:
  266 +// Field, Type, Null (YES,NO), Key (PRI,MUL), Default, Extra
  267 +function get_SQL_describeTableSQL($table) {
  268 + $sql="";
  269 + $sql=$sql . "SELECT a.attr_name as \"Field\"," . " ";
  270 + $sql=$sql . "a.data_type || '(' || a.prec || ',' || a.scale || ')' as \"Type\"," . " ";
  271 + $sql=$sql . "a.prec || ',' || a.scale as \"Size\"," . " ";
  272 + $sql=$sql . "a.is_nullable as \"Null\"," . " ";
  273 + $sql=$sql . "'*' as \"Key\"," . " ";
  274 + $sql=$sql . "a.default_value as \"Default\"," . " ";
  275 + $sql=$sql . "'' as \"Extra\"" . " ";
  276 + $sql=$sql . "FROM db_attribute a" . " ";
  277 + $sql=$sql . "WHERE a.class_name='" . $table . "'" . " ";
  278 + $sql=$sql . "order by a.def_order ASC";
  279 +
  280 + return $sql;
  281 +}
  282 +
  283 +// The column data type is returned
  284 +function get_SQL_ColumnDataType($table, $column) {
  285 + $sql="";
  286 + $sql=$sql . "SELECT a.data_type" . " ";
  287 + $sql=$sql . "FROM db_attribute a" . " ";
  288 + $sql=$sql . "WHERE a.class_name='" . $table . "'" . " ";
  289 + $sql=$sql . "AND a.attr_name='" . $column . "'" . " ";
  290 + $sql=$sql . "order by a.def_order ASC";
  291 +
  292 + return $sql;
  293 +}
  294 +
  295 +// The following columns are returned:
  296 +// Table,Non_unique,Key_name,Seq_in_index,Column_name,Collation,Cardinality,Sub_part,Packed,Index_type,Comment
  297 +function get_SQL_SHOW_INDEX_FROM($table) {
  298 + $query="";
  299 + $query=$query . "select distinct a.class_name as \"Table\"," . " ";
  300 + $query=$query . "DECODE(a.is_unique, 'YES', 'True') as \"Non_unique\"," . " ";
  301 + $query=$query . "a.index_name as \"Key_name\"," . " ";
  302 + $query=$query . "b.key_order as \"Seq_in_index\"," . " ";
  303 + $query=$query . "b.key_attr_name as \"Column_name\"," . " ";
  304 + $query=$query . "'' as \"Collation\"," . " ";
  305 + $query=$query . "'' as \"Cardinality\"," . " ";
  306 + $query=$query . "'' as \"Sub_part\"," . " ";
  307 + $query=$query . "'' as \"Packed\"," . " ";
  308 + $query=$query . "'' as \"Index_type\"," . " ";
  309 + $query=$query . "'' as \"Comment\"" . " ";
  310 + $query=$query . "from \"db_index\" a, \"db_index_key\" b" . " ";
  311 + $query=$query . "where a.index_name = b.index_name" . " ";
  312 + $query=$query . "and b.key_attr_name in (select attr_name from db_attribute where class_name = '" . $table . "')" . " ";
  313 + $query=$query . "and a.is_foreign_key = 'NO'" . " ";
  314 + $query=$query . "and a.class_name = '" . $table . "'" . " ";
  315 + $query=$query . "order by a.index_name, b.key_order,b.key_attr_name";
  316 +
  317 + return $query;
  318 +}
  319 +
  320 +// returns the list of non-system tables
  321 +function get_SQL_SHOW_TABLES($pattern = '') {
  322 + if (strlen($pattern) > 0) {
  323 + return "select class_name from db_class where class_type='CLASS' and is_system_class='NO' WHERE class_name LIKE '"
  324 + . $pattern . "' order by class_name ASC";
  325 + } else {
  326 + return "select class_name from db_class where class_type='CLASS' and is_system_class='NO' order by class_name ASC";
  327 + }
  328 +}
  329 +
  330 +// gets Primary Keys information
  331 +function columnIsPK($dbl, $table, $column) {
  332 + $ret = false;
  333 +
  334 + $sql = "";
  335 + $sql = $sql . "select db_index_key.key_attr_name" . " ";
  336 + $sql = $sql . "from db_index, db_index_key" . " ";
  337 + $sql = $sql . "where db_index.index_name = db_index_key.index_name" . " ";
  338 + $sql = $sql . "and db_index.class_name='" . $table . "'" . " ";
  339 + $sql = $sql . "and db_index_key.key_attr_name='" . $column . "'" . " ";
  340 + $sql = $sql . "and db_index.is_primary_key='YES'";
  341 +
  342 + $tableSql = cubrid_execute($dbl, $sql);
  343 +
  344 + if (@cubrid_num_rows($tableSql) > 0) {
  345 + $ret=true;
  346 + }
  347 +
  348 + return $ret;
  349 +}
  350 +
  351 +// emulates DROP TABLE IF EXISTS
  352 +function DROP_TABLE_IF_EXISTS($tablename, $link_identifier) {
  353 + $id_result
  354 + =cubrid_mysql_query_native("SELECT class_name FROM db_class WHERE class_name='" . $tablename . "'",
  355 + $link_identifier);
  356 + $rows=cubrid_num_rows($id_result);
  357 +
  358 + if ($rows > 0) {
  359 + cubrid_execute($link_identifier, "DROP TABLE " . $tablename);
  360 + }
  361 +}
  362 +
  363 +// The following columns are returned:
  364 +// Field, Type, Null (YES,NO), Key (PRI,MUL), Default, Extra
  365 +function get_SQL_SHOW_COLUMNS($table) {
  366 + $sql="";
  367 + $sql=$sql . "SELECT a.attr_name as \"Field\"," . " ";
  368 + $sql=$sql . "a.data_type || '(' || a.prec || ',' || a.scale || ')' as \"Type\"," . " ";
  369 + $sql=$sql . "a.prec || ',' || a.scale as \"Size\"," . " ";
  370 + $sql=$sql . "a.is_nullable as \"Null\"," . " ";
  371 + $sql=$sql . "'*' as \"Key\"," . " ";
  372 + $sql=$sql . "a.default_value as \"Default\"," . " ";
  373 + $sql=$sql . "'' as \"Extra\"" . " ";
  374 + $sql=$sql . "FROM db_attribute a" . " ";
  375 + $sql=$sql . "WHERE a.class_name='" . $table . "'" . " ";
  376 + $sql=$sql . "order by a.def_order ASC";
  377 +
  378 + return $sql;
  379 +}
  380 +
  381 +function startsWith($haystack, $needle, $case = true) {
  382 + if ($case) {
  383 + return strpos($haystack, $needle, 0) == 0;
  384 + } else {
  385 + return stripos($haystack, $needle, 0) == 0;
  386 + }
  387 +}
  388 +
  389 +function endsWith($haystack, $needle, $case = true) {
  390 + $expectedPosition=strlen($haystack) - strlen($needle);
  391 +
  392 + if ($case) {
  393 + return strrpos($haystack, $needle, 0) == $expectedPosition;
  394 + } else {
  395 + return strripos($haystack, $needle, 0) == $expectedPosition;
  396 + }
  397 +}
  398 +
  399 +?>
0 400 \ No newline at end of file
... ...
resources/js/hayamiki_designer/backend/php-cubrid/database.sql 0 → 100644
  1 +DROP TABLE `wwwsqldesigner`;
  2 +
  3 +CREATE TABLE `wwwsqldesigner` (
  4 + `keyword` varchar(30) NOT NULL,
  5 + `data` string,
  6 + `dt` timestamp,
  7 + PRIMARY KEY (`keyword`)
  8 +);
... ...
resources/js/hayamiki_designer/backend/php-cubrid/index.php 0 → 100644
  1 +<?php
  2 + require_once('cubrid_mysql_compat.php');
  3 +
  4 + if (!function_exists('cubrid_connect') || !function_exists('cubrid_mysql_connect')) {
  5 + echo "Either Cubrid or the Cubrid MySQL compatibility library is not detected." . "<br />";
  6 + echo "Please check your instalation." . "<br />";
  7 + die;
  8 + }
  9 +
  10 + set_time_limit(0);
  11 +
  12 + function setup_saveloadlist() {
  13 + define("SERVER", "localhost:30000");
  14 + define("USER", "dba");
  15 + define("PASSWORD", "");
  16 + define("DB", "demodb");
  17 + define("TABLE", "wwwsqldesigner");
  18 + }
  19 + function setup_import() {
  20 + define("SERVER", "localhost:30000");
  21 + define("USER", "dba");
  22 + define("PASSWORD", "");
  23 + define("DB", "demodb");
  24 + }
  25 + function connect() {
  26 + $conn = cubrid_mysql_connect(SERVER, USER, PASSWORD, DB);
  27 + if (!$conn) {
  28 + return false;
  29 + }
  30 + return $conn;
  31 + }
  32 +
  33 + function import($conn) {
  34 + $xml = "";
  35 +
  36 + $arr = array();
  37 + @ $datatypes = file("../../db/cubrid/datatypes.xml");
  38 + $arr[] = $datatypes[0];
  39 + $arr[] = '<sql db="cubrid">';
  40 + for ($i=1;$i<count($datatypes);$i++) {
  41 + $arr[] = $datatypes[$i];
  42 + }
  43 +
  44 + $result = cubrid_mysql_query_native("select class_name from db_class WHERE class_type='CLASS' and is_system_class = 'NO' order by class_name", $conn);
  45 + if (cubrid_mysql_num_rows($result) > 0) {
  46 + while ($row = cubrid_mysql_fetch_assoc($result)) {
  47 + $table = $row["class_name"];
  48 + $xml .= '<table name="'.$table.'">';
  49 +
  50 + $q = get_SQL_describeTableSQL($table);
  51 + $result2 = cubrid_mysql_query_native($q, $conn);
  52 + while ($row = cubrid_mysql_fetch_assoc($result2)) {
  53 + $name = $row["Field"];
  54 + $type = str_replace(",0)", ")", $row["Type"]);
  55 + $null = ($row["Null"] == "YES" ? "1" : "0");
  56 + $def = $row["Default"];
  57 + $ai = (preg_match("/auto_increment/i",$row["Extra"]) ? "1" : "0");
  58 + if ($def == "NULL") {
  59 + $def = "";
  60 + }
  61 + $xml .= '<row name="'.$name.'" null="'.$null.'" autoincrement="'.$ai.'">';
  62 + $xml .= '<datatype>'.strtoupper($type).'</datatype>';
  63 + $xml .= '<default>'.$def.'</default>';
  64 +
  65 + /* fk constraints */
  66 + /*
  67 + $q = "SELECT
  68 + REFERENCED_TABLE_NAME AS 'table', REFERENCED_COLUMN_NAME AS 'column'
  69 + FROM KEY_COLUMN_USAGE k
  70 + LEFT JOIN TABLE_CONSTRAINTS c
  71 + ON k.CONSTRAINT_NAME = c.CONSTRAINT_NAME
  72 + WHERE CONSTRAINT_TYPE = 'FOREIGN KEY'
  73 + AND c.TABLE_SCHEMA = '".$db."' AND c.TABLE_NAME = '".$table."'
  74 + AND k.COLUMN_NAME = '".$name."'";
  75 + */
  76 + $q = "SELECT NULL AS `table`, NULL AS `column` FROM db_root"; //no PHP support in CUBRID for FK
  77 + $result3 = cubrid_mysql_query_native($q, $conn);
  78 +
  79 + while ($row = cubrid_mysql_fetch_assoc($result3)) {
  80 + $xml .= '<relation table="'.$row["table"].'" row="'.$row["column"].'" />';
  81 + }
  82 +
  83 + $xml .= '</row>';
  84 + }
  85 +
  86 + /* keys */
  87 + $q = get_SQL_SHOW_INDEX_FROM($table);
  88 + $result2 = cubrid_mysql_query_native($q, $conn);
  89 + $idx = array();
  90 +
  91 + while ($row = cubrid_mysql_fetch_assoc($result2)) {
  92 + $name = $row["Key_name"];
  93 + if (array_key_exists($name, $idx)) {
  94 + $obj = $idx[$name];
  95 + } else {
  96 + $t = "INDEX";
  97 +
  98 + if ($row["Non_unique"] == "0") {
  99 + $t = "UNIQUE";
  100 + }
  101 +
  102 + if(columnIsPK($conn, $table, $row["Column_name"])) {
  103 + $t = "PRIMARY";
  104 + }
  105 +
  106 + $obj = array(
  107 + "columns" => array(),
  108 + "type" => $t
  109 + );
  110 + }
  111 +
  112 + $obj["columns"][] = $row["Column_name"];
  113 + $idx[$name] = $obj;
  114 + }
  115 +
  116 + foreach ($idx as $name=>$obj) {
  117 + $xml .= '<key name="'.$name.'" type="'.$obj["type"].'">';
  118 + for ($i=0;$i<count($obj["columns"]);$i++) {
  119 + $col = $obj["columns"][$i];
  120 + $xml .= '<part>'.$col.'</part>';
  121 + }
  122 + $xml .= '</key>';
  123 + }
  124 + $xml .= "</table>";
  125 + }
  126 + } else {
  127 + $xml = "<No tables found/>";
  128 + }
  129 + $arr[] = $xml;
  130 + $arr[] = '</sql>';
  131 + return implode("\n",$arr);
  132 + }
  133 +
  134 + ///////////////////////////////////////////////////////////////////////////////////////////////////////
  135 +
  136 + $a = (isset($_GET["action"]) ? $_GET["action"] : false);
  137 + switch ($a) {
  138 + case "list":
  139 + setup_saveloadlist();
  140 + $conn = connect();
  141 + $sql = "SELECT `keyword`, DATE_FORMAT(`dt`, '%d-%M-%Y %H:%i') AS dt FROM ".TABLE." ORDER BY dt DESC";
  142 + $result = cubrid_mysql_query_native($sql, $conn);
  143 + if(cubrid_mysql_num_rows($result) > 0) {
  144 + while ($row = cubrid_mysql_fetch_assoc($result)) {
  145 + echo $row["keyword"]." [".$row["dt"]."]\n";
  146 + }
  147 + }
  148 + break;
  149 + case "save":
  150 + setup_saveloadlist();
  151 + $conn = connect();
  152 + $keyword = (isset($_GET["keyword"]) ? $_GET["keyword"] : "");
  153 + $keyword = cubrid_mysql_real_escape_string($keyword);
  154 + $data = file_get_contents("php://input");
  155 + if (get_magic_quotes_gpc() || get_magic_quotes_runtime()) {
  156 + $data = stripslashes($data);
  157 + }
  158 + $data = cubrid_mysql_real_escape_string($data);
  159 + $r = cubrid_mysql_query_native("SELECT * FROM ".TABLE." WHERE `keyword` = '".$keyword."'", $conn);
  160 + if (cubrid_mysql_num_rows($r) > 0) {
  161 + $res = cubrid_mysql_query_native("UPDATE ".TABLE." SET `data` = '".$data."', `dt`=SYS_TIMESTAMP WHERE `keyword` = '".$keyword."'", $conn);
  162 + } else {
  163 + $res = cubrid_mysql_query_native("INSERT INTO ".TABLE." (`keyword`, `data`, `dt`) VALUES ('".$keyword."', '".$data."', SYS_TIMESTAMP)", $conn);
  164 + }
  165 + if (!$res) {
  166 + header("HTTP/1.0 500 Internal Server Error");
  167 + } else {
  168 + header("HTTP/1.0 201 Created");
  169 + }
  170 + break;
  171 + case "load":
  172 + setup_saveloadlist();
  173 + $conn = connect();
  174 + $keyword = (isset($_GET["keyword"]) ? $_GET["keyword"] : "");
  175 + $keyword = cubrid_mysql_real_escape_string($keyword);
  176 + $result = cubrid_mysql_query_native("SELECT `data` FROM ".TABLE." WHERE `keyword` = '".$keyword."'", $conn);
  177 + $row = cubrid_mysql_fetch_assoc($result);
  178 + if (!$row) {
  179 + header("HTTP/1.0 404 Not Found");
  180 + } else {
  181 + header("Content-type: text/xml");
  182 + echo $row["data"];
  183 + }
  184 + break;
  185 + case "import":
  186 + setup_import();
  187 + $conn = connect();
  188 + header("Content-type: text/xml");
  189 + $txt = import($conn);
  190 + echo $txt;
  191 + break;
  192 + default: header("HTTP/1.0 501 Not Implemented");
  193 + }
  194 +
  195 +?>
0 196 \ No newline at end of file
... ...
resources/js/hayamiki_designer/backend/php-file/data/default 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8" ?><sql><datatypes db="mysql">
  2 + <group label="Numeric" color="rgb(238,238,170)">
  3 + <type label="Integer" length="0" sql="INTEGER" re="INT" quote=""/>
  4 + <type label="Decimal" length="1" sql="DECIMAL" re="DEC" quote=""/>
  5 + <type label="Single precision" length="0" sql="FLOAT" quote=""/>
  6 + <type label="Double precision" length="0" sql="DOUBLE" re="DOUBLE" quote=""/>
  7 + </group>
  8 +
  9 + <group label="Character" color="rgb(255,200,200)">
  10 + <type label="Char" length="1" sql="CHAR" quote="'"/>
  11 + <type label="Varchar" length="1" sql="VARCHAR" quote="'"/>
  12 + <type label="Text" length="0" sql="MEDIUMTEXT" re="TEXT" quote="'"/>
  13 + <type label="Binary" length="1" sql="BINARY" quote="'"/>
  14 + <type label="Varbinary" length="1" sql="VARBINARY" quote="'"/>
  15 + <type label="BLOB" length="0" sql="BLOB" re="BLOB" quote="'"/>
  16 + </group>
  17 +
  18 + <group label="Date &amp; Time" color="rgb(200,255,200)">
  19 + <type label="Date" length="0" sql="DATE" quote="'"/>
  20 + <type label="Time" length="0" sql="TIME" quote="'"/>
  21 + <type label="Datetime" length="0" sql="DATETIME" quote="'"/>
  22 + <type label="Year" length="0" sql="YEAR" quote=""/>
  23 + <type label="Timestamp" length="0" sql="TIMESTAMP" quote="'"/>
  24 + </group>
  25 +
  26 + <group label="Miscellaneous" color="rgb(200,200,255)">
  27 + <type label="ENUM" length="1" sql="ENUM" quote=""/>
  28 + <type label="SET" length="1" sql="SET" quote=""/>
  29 + </group>
  30 +</datatypes><table x="50" y="50" name="Producer"><row name="id" null="0" autoincrement="1"><datatype>INTEGER</datatype></row><row name="name" null="1" autoincrement="0"><datatype>VARCHAR(100)</datatype><default>NULL</default></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="574" y="66" name="Consumer"><row name="id" null="0" autoincrement="1"><datatype>INTEGER</datatype></row><row name="name" null="1" autoincrement="0"><datatype>VARCHAR(100)</datatype><default>NULL</default></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="195" y="333" name="Product"><row name="id" null="0" autoincrement="1"><datatype>INTEGER</datatype></row><row name="id_Producer" null="0" autoincrement="1"><datatype>INTEGER</datatype><relation table="Producer" row="id" /></row><row name="name" null="1" autoincrement="0"><datatype>VARCHAR(100)</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="383" y="227" name="Garbage"><row name="id" null="0" autoincrement="1"><datatype>INTEGER</datatype></row><row name="id_Product" null="0" autoincrement="1"><datatype>INTEGER</datatype><relation table="Product" row="id" /></row><row name="id_Consumer" null="0" autoincrement="1"><datatype>INTEGER</datatype><relation table="Consumer" row="id" /></row><row name="consumed" null="0" autoincrement="0"><datatype>TIMESTAMP</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table></sql>
0 31 \ No newline at end of file
... ...
resources/js/hayamiki_designer/backend/php-file/index.php 0 → 100644
  1 +<?php
  2 + $a = (isset($_GET["action"]) ? $_GET["action"] : false);
  3 + switch ($a) {
  4 + case "list":
  5 + $files = glob("data/*");
  6 + foreach ($files as $file) {
  7 + $name = basename($file);
  8 + echo $name."\n";
  9 + }
  10 + break;
  11 + case "save":
  12 + $keyword = (isset($_GET["keyword"]) ? $_GET["keyword"] : "");
  13 + $keyword = "data/".basename($keyword);
  14 + $f = fopen($keyword, "w");
  15 + $data = file_get_contents("php://input");
  16 + if (get_magic_quotes_gpc() || get_magic_quotes_runtime()) {
  17 + $data = stripslashes($data);
  18 + }
  19 + fwrite($f, $data);
  20 + fclose($f);
  21 + header("HTTP/1.0 201 Created");
  22 + break;
  23 + case "load":
  24 + $keyword = (isset($_GET["keyword"]) ? $_GET["keyword"] : "");
  25 + $keyword = "data/".basename($keyword);
  26 + if (!file_exists($keyword)) {
  27 + header("HTTP/1.0 404 Not Found");
  28 + } else {
  29 + header("Content-type: text/xml");
  30 + echo file_get_contents($keyword);
  31 + }
  32 + break;
  33 + default: header("HTTP/1.0 501 Not Implemented");
  34 + }
  35 +?>
... ...
resources/js/hayamiki_designer/backend/php-mysql+file/data/default 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8" ?><sql><datatypes db="mysql">
  2 + <group label="Numeric" color="rgb(238,238,170)">
  3 + <type label="Integer" length="0" sql="INTEGER" re="INT" quote=""/>
  4 + <type label="Decimal" length="1" sql="DECIMAL" re="DEC" quote=""/>
  5 + <type label="Single precision" length="0" sql="FLOAT" quote=""/>
  6 + <type label="Double precision" length="0" sql="DOUBLE" re="DOUBLE" quote=""/>
  7 + </group>
  8 +
  9 + <group label="Character" color="rgb(255,200,200)">
  10 + <type label="Char" length="1" sql="CHAR" quote="'"/>
  11 + <type label="Varchar" length="1" sql="VARCHAR" quote="'"/>
  12 + <type label="Text" length="0" sql="MEDIUMTEXT" re="TEXT" quote="'"/>
  13 + <type label="Binary" length="1" sql="BINARY" quote="'"/>
  14 + <type label="Varbinary" length="1" sql="VARBINARY" quote="'"/>
  15 + <type label="BLOB" length="0" sql="BLOB" re="BLOB" quote="'"/>
  16 + </group>
  17 +
  18 + <group label="Date &amp; Time" color="rgb(200,255,200)">
  19 + <type label="Date" length="0" sql="DATE" quote="'"/>
  20 + <type label="Time" length="0" sql="TIME" quote="'"/>
  21 + <type label="Datetime" length="0" sql="DATETIME" quote="'"/>
  22 + <type label="Year" length="0" sql="YEAR" quote=""/>
  23 + <type label="Timestamp" length="0" sql="TIMESTAMP" quote="'"/>
  24 + </group>
  25 +
  26 + <group label="Miscellaneous" color="rgb(200,200,255)">
  27 + <type label="ENUM" length="1" sql="ENUM" quote=""/>
  28 + <type label="SET" length="1" sql="SET" quote=""/>
  29 + </group>
  30 +</datatypes><table x="50" y="50" name="Producer"><row name="id" null="0" autoincrement="1"><datatype>INTEGER</datatype></row><row name="name" null="1" autoincrement="0"><datatype>VARCHAR(100)</datatype><default>NULL</default></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="574" y="66" name="Consumer"><row name="id" null="0" autoincrement="1"><datatype>INTEGER</datatype></row><row name="name" null="1" autoincrement="0"><datatype>VARCHAR(100)</datatype><default>NULL</default></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="195" y="333" name="Product"><row name="id" null="0" autoincrement="1"><datatype>INTEGER</datatype></row><row name="id_Producer" null="0" autoincrement="1"><datatype>INTEGER</datatype><relation table="Producer" row="id" /></row><row name="name" null="1" autoincrement="0"><datatype>VARCHAR(100)</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="383" y="227" name="Garbage"><row name="id" null="0" autoincrement="1"><datatype>INTEGER</datatype></row><row name="id_Product" null="0" autoincrement="1"><datatype>INTEGER</datatype><relation table="Product" row="id" /></row><row name="id_Consumer" null="0" autoincrement="1"><datatype>INTEGER</datatype><relation table="Consumer" row="id" /></row><row name="consumed" null="0" autoincrement="0"><datatype>TIMESTAMP</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table></sql>
0 31 \ No newline at end of file
... ...
resources/js/hayamiki_designer/backend/php-mysql+file/index.php 0 → 100644
  1 +<?php
  2 + /**
  3 + * This file contains the plugin to allow importing from a MySQL database
  4 + * but instead of saving data to that database it will write it instead to
  5 + * a static XML file. The load function will echo out the contents of the
  6 + * file.
  7 + *
  8 + * When saving/loading the script will only accept alphanumeric w/ underscore
  9 + * filenames between 1 and 100 characters (yes, its arbitrary, change it if
  10 + * you don't like it :p).
  11 + *
  12 + * No validation is performed on the XML data saved to file. A malicious user
  13 + * could potentially upload a HUGE file so be aware of this when you configure
  14 + * your server. No user authentication is included.
  15 + *
  16 + * Please note that this is not all my work. Large portions of it have been
  17 + * copied from the php-mysql and php-file plugins.
  18 + *
  19 + * @author 'Kabal458' <Kabal458@gmail.com>
  20 + * @since 10-July-2009
  21 + */
  22 +
  23 + // Define these constants for importing from your MySQL database. MySQL
  24 + // usually stores your metadata inside the `information_schema` database
  25 + // on the `TABLES` table
  26 + define('HOST', 'localhost');
  27 + define('USER', 'root');
  28 + define('PASS', 'password');
  29 + define('DB', 'information_schema');
  30 +
  31 + // This constant is the regular expression used to validate the filename
  32 + define('FILENAME_REGEX', '^[A-Za-z0-9_]{1,100}$');
  33 +
  34 + // Pull the action variable from the GET and validate it
  35 + $action = isset($_GET['action']) ? $_GET['action'] : '';
  36 +
  37 + if(!in_array($action, array('list','save','load','import'))) {
  38 + header('HTTP/1.0 501 Not Implemented');
  39 + exit;
  40 + }
  41 +
  42 + // Save and Load actions must have the 'keyword' GET variable to work,
  43 + // I've used a regular expression to keep filenames simple and valid
  44 + // so that they don't do anything unintended.
  45 + if($action == 'save' || $action == 'load') {
  46 + if(!isset($_GET['keyword']) || !ereg(FILENAME_REGEX, $_GET['keyword'])) {
  47 + header('HTTP/1.0 400 Bad Request');
  48 + exit;
  49 + }
  50 + }
  51 +
  52 + // The import action requires the database variable to be set
  53 + if($action == 'import' && !isset($_GET['database'])) {
  54 + header('HTTP/1.0 400 Bad Request');
  55 + exit;
  56 + }
  57 +
  58 + // Based on the action variable return appropriate data
  59 + switch($action) {
  60 + case 'list':
  61 + // List all files in the data directory
  62 + foreach (glob('data/*') as $file)
  63 + echo basename($file)."\n";
  64 + break;
  65 +
  66 + case 'save':
  67 + // Open the file for writing
  68 + $f = fopen('data/'.$_GET['keyword'], 'w');
  69 +
  70 + // Read in the contents of the XML file from input
  71 + $data = file_get_contents('php://input');
  72 + if (get_magic_quotes_gpc() || get_magic_quotes_runtime()) {
  73 + $data = stripslashes($data);
  74 + }
  75 +
  76 + // Write the data to the file and close the file
  77 + fwrite($f, $data);
  78 + fclose($f);
  79 +
  80 + // Write the response HTTP code
  81 + header('HTTP/1.0 201 Created');
  82 + break;
  83 +
  84 + case 'load':
  85 + $keyword = 'data/' . $_GET['keyword'];
  86 + if (!file_exists($keyword)) {
  87 + header('HTTP/1.0 404 Not Found');
  88 + } else {
  89 + header('Content-type: text/xml');
  90 + echo file_get_contents($keyword);
  91 + }
  92 + break;
  93 +
  94 + case 'import':
  95 + // The import command may take some time, so make sure that PHP won't timeout
  96 + set_time_limit(0);
  97 +
  98 + // I've included the mysql_import function from the php_mysql plugin as its
  99 + // own file for future compatibility and to take so much code out of this one
  100 + // file.
  101 + require_once 'mysql_import.php';
  102 +
  103 + // Connect to the MySQL Database, short circuiting ensures that this code will
  104 + // execute without error
  105 + if (!mysql_connect(HOST,USER,PASS) || !mysql_select_db(DB)) {
  106 + header("HTTP/1.0 503 Service Unavailable");
  107 + exit;
  108 + }
  109 +
  110 + header("Content-type: text/xml");
  111 + echo import();
  112 +
  113 + break;
  114 + }
  115 +?>
... ...
resources/js/hayamiki_designer/backend/php-mysql+file/mysql_import.php 0 → 100644
  1 +<?php
  2 + function import() {
  3 + $db = (isset($_GET["database"]) ? $_GET["database"] : "information_schema");
  4 + $db = mysql_real_escape_string($db);
  5 + $xml = "";
  6 +
  7 + $arr = array();
  8 + @ $datatypes = file("../../db/mysql/datatypes.xml");
  9 + $arr[] = $datatypes[0];
  10 + $arr[] = '<sql db="mysql">';
  11 + for ($i=1;$i<count($datatypes);$i++) {
  12 + $arr[] = $datatypes[$i];
  13 + }
  14 +
  15 + $result = mysql_query("SELECT * FROM TABLES WHERE TABLE_SCHEMA = '".$db."'");
  16 + while ($row = mysql_fetch_array($result)) {
  17 + $table = $row["TABLE_NAME"];
  18 + $xml .= '<table name="'.$table.'">';
  19 + $comment = (isset($row["TABLE_COMMENT"]) ? $row["TABLE_COMMENT"] : "");
  20 + if ($comment) { $xml .= '<comment>'.$comment.'</comment>'; }
  21 +
  22 + $q = "SELECT * FROM COLUMNS WHERE TABLE_NAME = '".$table."' AND TABLE_SCHEMA = '".$db."'";
  23 + $result2 = mysql_query($q);
  24 + while ($row = mysql_fetch_array($result2)) {
  25 + $name = $row["COLUMN_NAME"];
  26 + $type = $row["COLUMN_TYPE"];
  27 + $comment = (isset($row["COLUMN_COMMENT"]) ? $row["COLUMN_COMMENT"] : "");
  28 + $null = ($row["IS_NULLABLE"] == "YES" ? "0" : "1");
  29 + $def = $row["COLUMN_DEFAULT"];
  30 + $ai = (preg_match("/auto_increment/i",$row["EXTRA"]) ? "1" : "0");
  31 + if ($def == "NULL") { $def = ""; }
  32 + $xml .= '<row name="'.$name.'" null="'.$null.'" autoincrement="'.$ai.'">';
  33 + $xml .= '<datatype>'.strtoupper($type).'</datatype>';
  34 + $xml .= '<default>'.$def.'</default>';
  35 + if ($comment) { $xml .= '<comment>'.$comment.'</comment>'; }
  36 +
  37 + /* fk constraints */
  38 + $q = "SELECT
  39 + REFERENCED_TABLE_NAME AS 'table', REFERENCED_COLUMN_NAME AS 'column'
  40 + FROM KEY_COLUMN_USAGE k
  41 + LEFT JOIN TABLE_CONSTRAINTS c
  42 + ON k.CONSTRAINT_NAME = c.CONSTRAINT_NAME
  43 + WHERE CONSTRAINT_TYPE = 'FOREIGN KEY'
  44 + AND c.TABLE_SCHEMA = '".$db."' AND c.TABLE_NAME = '".$table."'
  45 + AND k.COLUMN_NAME = '".$name."'";
  46 + $result3 = mysql_query($q);
  47 +
  48 + while ($row = mysql_fetch_array($result3)) {
  49 + $xml .= '<relation table="'.$row["table"].'" row="'.$row["column"].'" />';
  50 + }
  51 +
  52 + $xml .= '</row>';
  53 + }
  54 +
  55 + /* keys */
  56 + $q = "SELECT * FROM STATISTICS WHERE TABLE_NAME = '".$table."' AND TABLE_SCHEMA = '".$db."' ORDER BY SEQ_IN_INDEX ASC";
  57 + $result2 = mysql_query($q);
  58 + $idx = array();
  59 +
  60 + while ($row = mysql_fetch_array($result2)) {
  61 + $name = $row["INDEX_NAME"];
  62 + if (array_key_exists($name, $idx)) {
  63 + $obj = $idx[$name];
  64 + } else {
  65 + $type = $row["INDEX_TYPE"];
  66 + $t = "INDEX";
  67 + if ($type == "FULLTEXT") { $t = $type; }
  68 + if ($row["NON_UNIQUE"] == "0") { $t = "UNIQUE"; }
  69 + if ($name == "PRIMARY") { $t = "PRIMARY"; }
  70 +
  71 + $obj = array(
  72 + "columns" => array(),
  73 + "type" => $t
  74 + );
  75 + }
  76 +
  77 + $obj["columns"][] = $row["COLUMN_NAME"];
  78 + $idx[$name] = $obj;
  79 + }
  80 +
  81 + foreach ($idx as $name=>$obj) {
  82 + $xml .= '<key name="'.$name.'" type="'.$obj["type"].'">';
  83 + for ($i=0;$i<count($obj["columns"]);$i++) {
  84 + $col = $obj["columns"][$i];
  85 + $xml .= '<part>'.$col.'</part>';
  86 + }
  87 + $xml .= '</key>';
  88 + }
  89 + $xml .= "</table>";
  90 + }
  91 + $arr[] = $xml;
  92 + $arr[] = '</sql>';
  93 + return implode("\n",$arr);
  94 + }
  95 +?>
0 96 \ No newline at end of file
... ...
resources/js/hayamiki_designer/backend/php-mysql/database.sql 0 → 100644
  1 +DROP TABLE IF EXISTS `wwwsqldesigner`;
  2 +
  3 +CREATE TABLE `wwwsqldesigner` (
  4 + `keyword` varchar(30) NOT NULL default '',
  5 + `data` mediumtext,
  6 + `dt` timestamp,
  7 + PRIMARY KEY (`keyword`)
  8 +);
... ...
resources/js/hayamiki_designer/backend/php-mysql/index.php 0 → 100644
  1 +<?php
  2 + set_time_limit(0);
  3 + function setup_saveloadlist() {
  4 + define("SERVER","localhost");
  5 + define("USER","");
  6 + define("PASSWORD","");
  7 + define("DB","home");
  8 + define("TABLE","wwwsqldesigner");
  9 + }
  10 + function setup_import() {
  11 + define("SERVER","localhost");
  12 + define("USER","");
  13 + define("PASSWORD","");
  14 + define("DB","information_schema");
  15 + }
  16 + class mysqlDB {
  17 + var $_conn;
  18 + function connect() {
  19 + $conn = mysqli_connect(SERVER,USER,PASSWORD);
  20 + $this->setLink($conn);
  21 + if (!$this->getLink()){
  22 + return false;
  23 + }
  24 + $res = mysqli_select_db($this->getLink(), DB);
  25 + if (!$res){
  26 + // Data Base Not configured
  27 + echo "You have to configure the DataBase";
  28 + return false;
  29 + }
  30 + return true;
  31 + }
  32 + function getLink(){
  33 + return $this->_conn;
  34 + }
  35 + function setLink($conn){
  36 + $this->_conn = $conn;
  37 + }
  38 +
  39 + function import() {
  40 + $db = (isset($_GET["database"]) ? $_GET["database"] : "information_schema");
  41 + $db = mysqli_real_escape_string($this->getLink(), $db);
  42 + $xml = "";
  43 +
  44 + $arr = array();
  45 + @ $datatypes = file("../../db/mysql/datatypes.xml");
  46 + $arr[] = $datatypes[0];
  47 + $arr[] = '<sql db="mysql">';
  48 + for ($i=1;$i<count($datatypes);$i++) {
  49 + $arr[] = $datatypes[$i];
  50 + }
  51 +
  52 + $result = mysqli_query($this->getLink(), "SELECT * FROM TABLES WHERE TABLE_SCHEMA = '".$db."'");
  53 + while ($row = mysqli_fetch_array($result)) {
  54 + $table = $row["TABLE_NAME"];
  55 + $xml .= '<table name="'.$table.'">';
  56 + $comment = (isset($row["TABLE_COMMENT"]) ? $row["TABLE_COMMENT"] : "");
  57 + if ($comment) { $xml .= '<comment>'.htmlspecialchars($comment).'</comment>'; }
  58 +
  59 + $q = "SELECT * FROM COLUMNS WHERE TABLE_NAME = '".$table."' AND TABLE_SCHEMA = '".$db."'";
  60 + $result2 = mysqli_query($this->getLink(), $q);
  61 + while ($row = mysqli_fetch_array($result2)) {
  62 + $name = $row["COLUMN_NAME"];
  63 + $type = $row["COLUMN_TYPE"];
  64 + $comment = (isset($row["COLUMN_COMMENT"]) ? $row["COLUMN_COMMENT"] : "");
  65 + $null = ($row["IS_NULLABLE"] == "YES" ? "1" : "0");
  66 +
  67 + if (preg_match("/binary/i",$row["COLUMN_TYPE"])) {
  68 + $def = bin2hex($row["COLUMN_DEFAULT"]);
  69 + } else {
  70 + $def = $row["COLUMN_DEFAULT"];
  71 + }
  72 +
  73 + $ai = (preg_match("/auto_increment/i",$row["EXTRA"]) ? "1" : "0");
  74 + if ($def == "NULL") { $def = ""; }
  75 + $xml .= '<row name="'.$name.'" null="'.$null.'" autoincrement="'.$ai.'">';
  76 + $xml .= '<datatype>'.strtoupper($type).'</datatype>';
  77 + $xml .= '<default>'.$def.'</default>';
  78 + if ($comment) { $xml .= '<comment>'.htmlspecialchars($comment).'</comment>'; }
  79 +
  80 + /* fk constraints */
  81 + $q = "SELECT
  82 + REFERENCED_TABLE_NAME AS 'table', REFERENCED_COLUMN_NAME AS 'column'
  83 + FROM KEY_COLUMN_USAGE k
  84 + LEFT JOIN TABLE_CONSTRAINTS c
  85 + ON k.CONSTRAINT_NAME = c.CONSTRAINT_NAME
  86 + WHERE CONSTRAINT_TYPE = 'FOREIGN KEY'
  87 + AND c.TABLE_SCHEMA = '".$db."' AND c.TABLE_NAME = '".$table."'
  88 + AND k.COLUMN_NAME = '".$name."'";
  89 + $result3 = mysqli_query($this->getLink(), $q);
  90 +
  91 + while ($row = mysqli_fetch_array($result3)) {
  92 + $xml .= '<relation table="'.$row["table"].'" row="'.$row["column"].'" />';
  93 + }
  94 +
  95 + $xml .= '</row>';
  96 + }
  97 +
  98 + /* keys */
  99 + $q = "SELECT * FROM STATISTICS WHERE TABLE_NAME = '".$table."' AND TABLE_SCHEMA = '".$db."' ORDER BY SEQ_IN_INDEX ASC";
  100 + $result2 =mysqli_query($this->getLink(),$q);
  101 + $idx = array();
  102 +
  103 + while ($row = mysqli_fetch_array($result2)) {
  104 + $name = $row["INDEX_NAME"];
  105 + if (array_key_exists($name, $idx)) {
  106 + $obj = $idx[$name];
  107 + } else {
  108 + $type = $row["INDEX_TYPE"];
  109 + $t = "INDEX";
  110 + if ($type == "FULLTEXT") { $t = $type; }
  111 + if ($row["NON_UNIQUE"] == "0") { $t = "UNIQUE"; }
  112 + if ($name == "PRIMARY") { $t = "PRIMARY"; }
  113 +
  114 + $obj = array(
  115 + "columns" => array(),
  116 + "type" => $t
  117 + );
  118 + }
  119 +
  120 + $obj["columns"][] = $row["COLUMN_NAME"];
  121 + $idx[$name] = $obj;
  122 + }
  123 +
  124 + foreach ($idx as $name=>$obj) {
  125 + $xml .= '<key name="'.$name.'" type="'.$obj["type"].'">';
  126 + for ($i=0;$i<count($obj["columns"]);$i++) {
  127 + $col = $obj["columns"][$i];
  128 + $xml .= '<part>'.$col.'</part>';
  129 + }
  130 + $xml .= '</key>';
  131 + }
  132 + $xml .= "</table>";
  133 + }
  134 + $arr[] = $xml;
  135 + $arr[] = '</sql>';
  136 + return implode("\n",$arr);
  137 + }
  138 + }
  139 +
  140 +
  141 + $a = (isset($_GET["action"]) ? $_GET["action"] : false);
  142 + switch ($a) {
  143 + case "list":
  144 + setup_saveloadlist();
  145 + $DBHandler = new mysqlDB();
  146 + if (!$DBHandler->connect()) {
  147 + header("HTTP/1.0 503 Service Unavailable");
  148 + break;
  149 + }
  150 + $result = mysqli_query($DBHandler->getLink(), "SELECT keyword FROM ".TABLE." ORDER BY dt DESC");
  151 + while ($row = mysqli_fetch_assoc($result)) {
  152 + echo $row["keyword"]."\n";
  153 + }
  154 + break;
  155 + case "save":
  156 + setup_saveloadlist();
  157 + $DBHandler = new mysqlDB();
  158 + if (!$DBHandler->connect()) {
  159 + header("HTTP/1.0 503 Service Unavailable");
  160 + break;
  161 + }
  162 + $keyword = (isset($_GET["keyword"]) ? $_GET["keyword"] : "");
  163 + $keyword = mysqli_real_escape_string($DBHandler->getLink(), $keyword);
  164 + $data = file_get_contents("php://input");
  165 + if (get_magic_quotes_gpc() || get_magic_quotes_runtime()) {
  166 + $data = stripslashes($data);
  167 + }
  168 + $data = mysqli_real_escape_string($DBHandler->getLink(), $data);
  169 + $r = mysqli_query($DBHandler->getLink(), "SELECT * FROM ".TABLE." WHERE keyword = '".$keyword."'");
  170 + if (mysqli_num_rows($r) > 0) {
  171 + $res = mysqli_query($DBHandler->getLink(), "UPDATE ".TABLE." SET data = '".$data."' WHERE keyword = '".$keyword."'");
  172 + } else {
  173 + $res = mysqli_query($DBHandler->getLink(), "INSERT INTO ".TABLE." (keyword, data) VALUES ('".$keyword."', '".$data."')");
  174 + }
  175 + if (!$res) {
  176 + header("HTTP/1.0 500 Internal Server Error");
  177 + } else {
  178 + header("HTTP/1.0 201 Created");
  179 + }
  180 + break;
  181 + case "load":
  182 + setup_saveloadlist();
  183 + $DBHandler = new mysqlDB();
  184 + if (!$DBHandler->connect()) {
  185 + header("HTTP/1.0 503 Service Unavailable");
  186 + break;
  187 + }
  188 + $keyword = (isset($_GET["keyword"]) ? $_GET["keyword"] : "");
  189 + $keyword = mysqli_real_escape_string($DBHandler->getLink(), $keyword);
  190 + $result = mysqli_query($DBHandler->getLink(), "SELECT `data` FROM ".TABLE." WHERE keyword = '".$keyword."'");
  191 + $row = mysqli_fetch_assoc($result);
  192 + if (!$row) {
  193 + header("HTTP/1.0 404 Not Found");
  194 + } else {
  195 + header("Content-type: text/xml");
  196 + echo $row["data"];
  197 + }
  198 + break;
  199 + case "import":
  200 + setup_import();
  201 + $DBHandler = new mysqlDB();
  202 + if (!$DBHandler->connect()) {
  203 + header("HTTP/1.0 503 Service Unavailable");
  204 + break;
  205 + }
  206 +
  207 + header("Content-type: text/xml");
  208 + echo $DBHandler->import();
  209 + break;
  210 + default: header("HTTP/1.0 501 Not Implemented");
  211 + }
  212 +
  213 +
  214 + /*
  215 + list: 501/200
  216 + load: 501/200/404
  217 + save: 501/201
  218 + import: 501/200
  219 + */
  220 +?>
0 221 \ No newline at end of file
... ...
resources/js/hayamiki_designer/backend/php-pdo/AbstractLayer.php 0 → 100644
  1 +<?php
  2 +
  3 +class AbstractLayer
  4 +{
  5 +
  6 + public static $pdo = NULL;
  7 +
  8 + # Generic
  9 + public static function protect($value,$alias=NULL) {BackendPhpPdo::getException('Not Implemented');}
  10 +
  11 + # saveloadlist
  12 + public static function Keywords($table,$keyword='') {BackendPhpPdo::getException('Not Implemented');}
  13 + public static function KeywordsInsert($table,$keyword,$data) {BackendPhpPdo::getException('Not Implemented');}
  14 + public static function KeywordsUpdate($table,$keyword,$data) {BackendPhpPdo::getException('Not Implemented');}
  15 +
  16 + # datatypes
  17 + public static function DatatypesFile() {BackendPhpPdo::getException('Not Implemented');}
  18 +
  19 + # model
  20 + public static function Tables() {BackendPhpPdo::getException('Not Implemented');}
  21 + public static function Columns($table) {BackendPhpPdo::getException('Not Implemented');}
  22 + public static function Relations($table,$column) {BackendPhpPdo::getException('Not Implemented');}
  23 + public static function Keys($table) {BackendPhpPdo::getException('Not Implemented');}
  24 +
  25 +}
  26 +
  27 +?>
... ...
resources/js/hayamiki_designer/backend/php-pdo/LayerMYSQL.php 0 → 100644
  1 +<?php
  2 +
  3 +class LayerMYSQL extends AbstractLayer
  4 +{
  5 + # Generic
  6 + public static function protect($value,$alias=NULL)
  7 + {
  8 + return '`'.str_replace('.','`.`',$value).'`'.($alias?' `'.$alias.'`':'');
  9 + }
  10 +
  11 + # saveloadlist
  12 + public static function Keywords($table,$keyword='')
  13 + {
  14 + $req = '
  15 + SELECT
  16 + ';
  17 + if($keyword)
  18 + $req .= ' '.self::protect('data').' ';
  19 + else
  20 + $req .= ' '.self::protect('keyword').' ';
  21 + $req .= '
  22 + FROM '.self::protect($table).'
  23 + ';
  24 + if($keyword)
  25 + $req .= ' WHERE '.self::protect('keyword').' = ? ';
  26 + else
  27 + $req .= ' ORDER BY '.self::protect('dt').' DESC ';
  28 +
  29 + $q = self::$pdo->prepare($req);
  30 + if($keyword)
  31 + $q->bindValue($keyword,'string');
  32 + return $q->execute();
  33 + }
  34 + public static function KeywordsInsert($table,$keyword,$data)
  35 + {
  36 + $req = '
  37 + INSERT INTO '.self::protect($table).'
  38 + ('.self::protect('keyword').', '.self::protect('data').')
  39 + VALUES (?, ?)
  40 + ';
  41 + return self::$pdo->prepare($req)->bindValue($keyword,'string')->bindValue($data,'string')->execute();
  42 + }
  43 + public static function KeywordsUpdate($table,$keyword,$data)
  44 + {
  45 + $req = '
  46 + UPDATE '.self::protect($table).'
  47 + SET '.self::protect('data').' = ?
  48 + WHERE '.self::protect('keyword').' = ?
  49 + ';
  50 + return self::$pdo->prepare($req)->bindValue($data,'string')->bindValue($keyword,'string')->execute();
  51 + }
  52 +
  53 + # datatypes
  54 + public static function DatatypesFile()
  55 + {
  56 + return dirname(__FILE__).'/../../db/mysql/datatypes.xml';
  57 + }
  58 +
  59 + # model
  60 + public static $schema = NULL;
  61 + public static function Tables()
  62 + {
  63 + if(is_null(self::$schema))
  64 + self::$schema = BackendPhpPdo::req('database');
  65 + if(is_null(self::$schema))
  66 + self::$schema = 'information_schema';
  67 +
  68 + $req = '
  69 + SELECT
  70 + '.self::protect('TABLE_NAME').' as '.self::protect('name').',
  71 + '.self::protect('TABLE_COMMENT').' as '.self::protect('comment').'
  72 + FROM '.self::protect('TABLES').'
  73 + WHERE
  74 + '.self::protect('TABLE_SCHEMA').' = ?
  75 + ';
  76 + return self::$pdo->prepare($req)->bindValue(self::$schema,'string')->execute()->fetchAll();
  77 + }
  78 + private static $columns = array();
  79 + public static function Columns($table)
  80 + {
  81 + if(isset(self::$columns[$table['name']]))
  82 + return self::$columns[$table['name']];
  83 + if(!empty(self::$columns))
  84 + return array();
  85 +
  86 + $req = '
  87 + SELECT
  88 + '.self::protect('TABLE_NAME').' as '.self::protect('table').',
  89 + '.self::protect('COLUMN_NAME').' as '.self::protect('name').',
  90 + '.self::protect('COLUMN_TYPE').' as '.self::protect('type').',
  91 + '.self::protect('IS_NULLABLE').' as '.self::protect('null').',
  92 + '.self::protect('COLUMN_DEFAULT').' as '.self::protect('default').',
  93 + '.self::protect('COLUMN_COMMENT').' as '.self::protect('comment').',
  94 + '.self::protect('EXTRA').' as '.self::protect('autoincrement').'
  95 + FROM '.self::protect('COLUMNS').'
  96 + WHERE
  97 + '.self::protect('TABLE_SCHEMA').' = ?
  98 + ';
  99 + $columns = self::$pdo->prepare($req)->bindValue(self::$schema,'string')->execute()->fetchAll();
  100 + foreach($columns as $k=>$column)
  101 + {
  102 + $column['type'] = strtoupper($column['type']);
  103 + $column['null'] = ($column['null'] == 'YES' ? '1' : '0');
  104 + $column['default'] = ($column['default'] == 'NULL' ? '' : $column['default']);
  105 + $column['autoincrement'] = preg_match('/auto_increment/i',$column['autoincrement']) ? '1' : '0';
  106 + self::$columns[$column['table']][] = $column;
  107 + }
  108 + return self::$columns[$table['name']];
  109 + }
  110 + private static $relations = array();
  111 + public static function Relations($table,$column)
  112 + {
  113 + if(isset(self::$relations[$table['name']][$column['name']]))
  114 + return self::$relations[$table['name']][$column['name']];
  115 + if(!empty(self::$relations))
  116 + return array();
  117 +
  118 + $req = '
  119 + SELECT
  120 + '.self::protect('c.TABLE_NAME').' as '.self::protect('table_src').',
  121 + '.self::protect('k.COLUMN_NAME').' as '.self::protect('column_src').',
  122 + '.self::protect('REFERENCED_TABLE_NAME').' as '.self::protect('table').',
  123 + '.self::protect('REFERENCED_COLUMN_NAME').' as '.self::protect('column').'
  124 + FROM '.self::protect('KEY_COLUMN_USAGE','k').'
  125 + LEFT JOIN '.self::protect('TABLE_CONSTRAINTS','c').'
  126 + ON '.self::protect('k.CONSTRAINT_NAME').' = '.self::protect('c.CONSTRAINT_NAME').'
  127 + WHERE
  128 + '.self::protect('c.TABLE_SCHEMA').' = ?
  129 + ';
  130 + $relations = self::$pdo->prepare($req)->bindValue(self::$schema,'string')->execute()->fetchAll();
  131 + foreach($relations as $relation)
  132 + self::$relations[$relation['table_src']][$relation['column_src']][] = $relation;
  133 +
  134 + if(isset(self::$relations[$table['name']][$column['name']]))
  135 + return self::$relations[$table['name']][$column['name']];
  136 + return array();
  137 + }
  138 + private static $keys = array();
  139 + public static function Keys($table)
  140 + {
  141 + if(isset(self::$keys[$table['name']]))
  142 + return self::$keys[$table['name']];
  143 + if(!empty(self::$keys))
  144 + return array();
  145 +
  146 + $req = '
  147 + SELECT
  148 + '.self::protect('TABLE_NAME').' as '.self::protect('table').',
  149 + '.self::protect('INDEX_NAME').' as '.self::protect('name').',
  150 + '.self::protect('INDEX_TYPE').' as '.self::protect('type').',
  151 + '.self::protect('COLUMN_NAME').' as '.self::protect('column').',
  152 + '.self::protect('NON_UNIQUE').' as '.self::protect('non_unique').'
  153 + FROM '.self::protect('STATISTICS').'
  154 + WHERE
  155 + '.self::protect('TABLE_SCHEMA').' = ?
  156 + ORDER BY '.self::protect('SEQ_IN_INDEX').'
  157 + ';
  158 + $indexes = self::$pdo->prepare($req)->bindValue(self::$schema,'string')->execute()->fetchAll();
  159 +
  160 + $keys = array();
  161 + foreach($indexes as $index)
  162 + {
  163 + if($index['type'] != 'FULLTEXT')
  164 + $index['type'] = 'INDEX';
  165 + if($index['non_unique'] == '0')
  166 + $index['type'] = 'UNIQUE';
  167 + if($index['name'] == 'PRIMARY')
  168 + $index['type'] = 'PRIMARY';
  169 + self::$keys[$index['table']][$index['name']]['type'] = $index['type'];
  170 + self::$keys[$index['table']][$index['name']]['columns'][] = $index['column'];
  171 + }
  172 +
  173 + if (isset(self::$keys[$table['name']])) {
  174 + return self::$keys[$table['name']];
  175 + } else {
  176 + return array();
  177 + }
  178 + }
  179 +}
  180 +
  181 +?>
... ...
resources/js/hayamiki_designer/backend/php-pdo/LayerPGSQL.php 0 → 100644
  1 +<?php
  2 +
  3 +class LayerPGSQL extends AbstractLayer
  4 +{
  5 + # Generic
  6 + public static function protect($value,$alias=NULL)
  7 + {
  8 + return '"'.str_replace('.','"."',$value).'"'.($alias?' "'.$alias.'"':'');
  9 + }
  10 +
  11 + # saveloadlist
  12 + public static function Keywords($table,$keyword='')
  13 + {
  14 + $req = '
  15 + SELECT
  16 + ';
  17 + if($keyword)
  18 + $req .= ' '.self::protect('xmldata').' ';
  19 + else
  20 + $req .= ' '.self::protect('keyword').' ';
  21 + $req .= '
  22 + FROM '.self::protect($table).'
  23 + ';
  24 + if($keyword)
  25 + $req .= ' WHERE '.self::protect('keyword').' = ? ';
  26 + else
  27 + $req .= ' ORDER BY '.self::protect('dt').' DESC ';
  28 +
  29 + $q = self::$pdo->prepare($req);
  30 + if($keyword)
  31 + $q->bindValue($keyword,'string');
  32 + return $q->execute();
  33 + }
  34 + public static function KeywordsInsert($table,$keyword,$data)
  35 + {
  36 + $req = '
  37 + INSERT INTO '.self::protect($table).'
  38 + ('.self::protect('keyword').', '.self::protect('xmldata').')
  39 + VALUES (?, ?)
  40 + ';
  41 + return self::$pdo->prepare($req)->bindValue($keyword,'string')->bindValue($data,'string')->execute();
  42 + }
  43 + public static function KeywordsUpdate($table,$keyword,$data)
  44 + {
  45 + $req = '
  46 + UPDATE '.self::protect($table).'
  47 + SET '.self::protect('xmldata').' = ?
  48 + WHERE '.self::protect('keyword').' = ?
  49 + ';
  50 + return self::$pdo->prepare($req)->bindValue($data,'string')->bindValue($keyword,'string')->execute();
  51 + }
  52 +
  53 + # datatypes
  54 + public static function DatatypesFile()
  55 + {
  56 + return dirname(__FILE__).'/../../db/postgresql/datatypes.xml';
  57 + }
  58 +
  59 + # model
  60 + public static function Tables()
  61 + {
  62 + $req = '
  63 + SELECT
  64 + '.self::protect('relname').' as '.self::protect('name').',
  65 + '.self::protect('c.oid').' as '.self::protect('oid').',
  66 + (SELECT pg_catalog.obj_description('.self::protect('c.oid').', \'pg_class\')) as '.self::protect('comment').'
  67 + FROM pg_catalog.pg_class '.self::protect('c').'
  68 + WHERE
  69 + '.self::protect('c.relname').' !~ \'^(pg_|sql_)\'
  70 + AND '.self::protect('c.relkind').' = \'r\'
  71 + ';
  72 + return self::$pdo->prepare($req)->execute()->fetchAll();
  73 + }
  74 + private static $columns = array();
  75 + public static function Columns($table)
  76 + {
  77 + if(isset(self::$columns[$table['name']]))
  78 + return self::$columns[$table['name']];
  79 + if(!empty(self::$columns))
  80 + return array();
  81 +
  82 + $req = '
  83 + SELECT
  84 + '.self::protect('table_name').' as '.self::protect('table').',
  85 + '.self::protect('column_name').' as '.self::protect('name').',
  86 + '.self::protect('data_type').' as '.self::protect('type').',
  87 + '.self::protect('is_nullable').' as '.self::protect('null').',
  88 + '.self::protect('column_default').' as '.self::protect('default')/*.',
  89 +* col_description(? ,ordinal_position) as '.self::protect('comment').'*/.'
  90 + FROM information_schema.columns
  91 + ORDER BY '.self::protect('ordinal_position').'
  92 + ';
  93 + $columns = self::$pdo->prepare($req)->execute()->fetchAll();
  94 + foreach($columns as $k=>$column)
  95 + {
  96 + $column['type'] = strtoupper($column['type']);
  97 + $column['null'] = ($column['null'] == 'YES' ? '1' : '0');
  98 + $column['default'] = ($column['default'] == 'NULL' ? '' : $column['default']);
  99 + $column['autoincrement'] = '0';
  100 + self::$columns[$column['table']][] = $column;
  101 + }
  102 + return self::$columns[$table['name']];
  103 + }
  104 + private static $relations = array();
  105 + public static function Relations($table,$column)
  106 + {
  107 + if(isset(self::$relations[$table['name']][$column['name']]))
  108 + return self::$relations[$table['name']][$column['name']];
  109 + if(!empty(self::$relations))
  110 + return array();
  111 +
  112 + $req = '
  113 + SELECT
  114 + '.self::protect('kku.table_name').' as '.self::protect('table_src').',
  115 + '.self::protect('kku.column_name').' as '.self::protect('column_src').',
  116 + '.self::protect('ccu.table_name').' as '.self::protect('table').',
  117 + '.self::protect('ccu.column_name').' as '.self::protect('column').'
  118 + FROM '.self::protect('information_schema.table_constraints','tc').'
  119 + LEFT JOIN '.self::protect('information_schema.constraint_column_usage','ccu').'
  120 + ON '.self::protect('tc.constraint_name').' = '.self::protect('ccu.constraint_name').'
  121 + LEFT JOIN '.self::protect('information_schema.key_column_usage','kku').'
  122 + ON '.self::protect('kku.constraint_name').' = '.self::protect('ccu.constraint_name').'
  123 + WHERE
  124 + '.self::protect('constraint_type').' = ?
  125 + ';
  126 + $relations = self::$pdo->prepare($req)->bindValue('FOREIGN KEY','string')->execute()->fetchAll();
  127 + foreach($relations as $relation)
  128 + self::$relations[$relation['table_src']][$relation['column_src']][] = $relation;
  129 +
  130 + if(isset(self::$relations[$table['name']][$column['name']]))
  131 + return self::$relations[$table['name']][$column['name']];
  132 + return array();
  133 + }
  134 + private static $keys = array();
  135 + public static function Keys($table)
  136 + {
  137 + if(isset(self::$keys[$table['name']]))
  138 + return self::$keys[$table['name']];
  139 + if(!empty(self::$keys))
  140 + return array();
  141 +
  142 + $req = '
  143 + SELECT
  144 + '.self::protect('tc.table_name').' as '.self::protect('table').',
  145 + '.self::protect('tc.constraint_name').' as '.self::protect('name').',
  146 + '.self::protect('tc.constraint_type').' as '.self::protect('type').',
  147 + '.self::protect('kcu.column_name').' as '.self::protect('column').'
  148 + FROM '.self::protect('information_schema.table_constraints','tc').'
  149 + LEFT JOIN '.self::protect('information_schema.key_column_usage','kcu').'
  150 + ON '.self::protect('tc.constraint_catalog').' = '.self::protect('tc.constraint_catalog').'
  151 + AND '.self::protect('tc.constraint_schema').' = '.self::protect('kcu.constraint_schema').'
  152 + AND '.self::protect('tc.constraint_name').' = '.self::protect('kcu.constraint_name').'
  153 + WHERE
  154 + '.self::protect('constraint_type').' != ?
  155 + ORDER BY '.self::protect('tc.constraint_name').'
  156 + ';
  157 + $contraints = self::$pdo->prepare($req)->bindValue('FOREIGN KEY','string')->execute()->fetchAll();
  158 +
  159 + $req = '
  160 + SELECT
  161 + '.self::protect('pci.relname').' as '.self::protect('table').',
  162 + '.self::protect('pcx.relname').' as '.self::protect('name').',
  163 + '.self::protect('pa.attname').' as '.self::protect('column').',
  164 + '.self::protect('indisunique').' as '.self::protect('unique').',
  165 + '.self::protect('indisprimary').' as '.self::protect('primary').'
  166 + FROM '.self::protect('pg_index','pi').'
  167 + LEFT JOIN '.self::protect('pg_class','pcx').'
  168 + ON '.self::protect('pi.indexrelid').' = '.self::protect('pcx.oid').'
  169 + LEFT JOIN '.self::protect('pg_class','pci').'
  170 + ON '.self::protect('pi.indrelid').' = '.self::protect('pci.oid').'
  171 + LEFT JOIN '.self::protect('pg_attribute','pa').'
  172 + ON '.self::protect('pa.attrelid').' = '.self::protect('pci.oid').'
  173 + AND '.self::protect('pa.attnum').' = ANY('.self::protect('pi.indkey').')
  174 + ORDER BY '.self::protect('pa.attnum').'
  175 + ';
  176 + $indexes = self::$pdo->prepare($req)->execute()->fetchAll();
  177 +
  178 + $keys = array();
  179 + foreach($contraints as $constraint)
  180 + {
  181 + if($constraint['type'] == 'CHECK')
  182 + continue;
  183 + if($constraint['type'] == 'PRIMARY KEY')
  184 + $constraint['type'] = 'PRIMARY';
  185 + self::$keys[$constraint['table']][$constraint['name']]['type'] = $constraint['type'];
  186 + self::$keys[$constraint['table']][$constraint['name']]['columns'][] = $constraint['column'];
  187 + }
  188 + foreach($indexes as $index)
  189 + {
  190 + if($index['unique'] == 't' || $index['primary'] == 't')
  191 + continue;
  192 + self::$keys[$index['table']][$index['name']]['type'] = 'INDEX';
  193 + self::$keys[$index['table']][$index['name']]['columns'][] = $index['column'];
  194 + }
  195 +
  196 + return self::$keys[$table['name']];
  197 + }
  198 +
  199 +}
  200 +
  201 +?>
... ...
resources/js/hayamiki_designer/backend/php-pdo/index.php 0 → 100644
  1 +<?php
  2 +
  3 +error_reporting(E_ALL);
  4 +
  5 +class BackendPhpPdo
  6 +{
  7 +
  8 + public static function getConfig($id)
  9 + {
  10 + switch($id)
  11 + {
  12 + case 'saveloadlist':
  13 + $type = 'pgsql';
  14 + $dsn = 'pgsql:dbname=wwwsqldesigner';
  15 + $user = 'wwwsqldesigner';
  16 + $pass = 'xxx';
  17 + $table = 'wwwsqldesigner';
  18 + return array($type,$dsn,$user,$pass,$table);
  19 + case 'import':
  20 + $type = 'pgsql';
  21 + $dsn = 'pgsql:dbname=wwwsqldesigner;host=localhost';
  22 + $type = 'mysql';
  23 + $dsn = 'mysql:dbname=wwwsqldesigner;host=localhost';
  24 + $user = 'wwwsqldesigner';
  25 + $pass = 'xxx';
  26 + return array($type,$dsn,$user,$pass);
  27 + }
  28 + }
  29 +
  30 + public $what = '';
  31 + # PDO
  32 + public $type = NULL;
  33 + public $pdo = NULL;
  34 + # PDO STATEMENT
  35 + public $pdo_statement = NULL;
  36 + public $req = '';
  37 + public $pos = 0;
  38 + # EXCEPTION
  39 + public $message = NULL;
  40 + public $trace = array();
  41 + # BENCH
  42 + public $in = 0;
  43 + public $out = 0;
  44 + public static $benchs = array();
  45 +
  46 + # Constructors
  47 + public static function getPdo($type,$dsn,$user,$password)
  48 + {
  49 + $obj = new BackendPhpPdo();
  50 + $obj->what = 'PDO';
  51 + $obj->type = $type;
  52 + try {
  53 + $obj->pdo = new PDO($dsn,$user,$password);
  54 + } catch( Exception $e ) {
  55 + self::getException($e);
  56 + }
  57 + if(empty($obj->pdo))
  58 + self::getException($obj);
  59 + return $obj;
  60 + }
  61 + public static function getPdoStatement($pdo=NULL,$pdo_statement=NULL,$req='',$in=NULL)
  62 + {
  63 + $obj = new BackendPhpPdo();
  64 + $obj->what = 'PDO_STATEMENT';
  65 + $obj->pdo = $pdo;
  66 + $obj->pdo_statement = $pdo_statement;
  67 + $obj->req = $req;
  68 + $obj->in = $in;
  69 + if(empty($obj->pdo_statement))
  70 + self::getException($obj);
  71 + return $obj;
  72 + }
  73 + public static function getException($message)
  74 + {
  75 + $trace = debug_backtrace();
  76 + if(is_object($message))
  77 + {
  78 + if($message instanceOf Exception)
  79 + $trace = $message->getTrace();
  80 + $message = $message->getMessage();
  81 + }
  82 + $obj = new BackendPhpPdo();
  83 + $obj->what = 'EXCEPTION';
  84 + $obj->message = $message;
  85 + $obj->trace = $trace;
  86 + header("HTTP/1.0 500 Internal Server Error");
  87 + echo $obj->getMessage();
  88 + die();
  89 + }
  90 + public static function getBench($in=NULL,$message='')
  91 + {
  92 + $t = microtime(true);
  93 + if(is_null($in))
  94 + return $t;
  95 + $obj = new BackendPhpPdo();
  96 + $obj->what = 'BENCH';
  97 + $obj->in = $in;
  98 + $obj->out = $t;
  99 + $obj->message = $message;
  100 + self::$benchs[] = $obj;
  101 + return $t;
  102 + }
  103 +
  104 + # PDO
  105 + public function prepare($req)
  106 + {
  107 + $in = self::getBench();
  108 + $args = func_get_args();
  109 + try {
  110 + $pdo_statement = call_user_func_array(array($this->pdo,'prepare'),$args);
  111 + } catch (Exception $e) {
  112 + self::getException($e);
  113 + }
  114 + return self::getPDOStatement($this->pdo,$pdo_statement,$req,$in);
  115 + }
  116 + public function query($req)
  117 + {
  118 + $in = self::getBench();
  119 + $args = func_get_args();
  120 + try {
  121 + $pdo_statement = call_user_func_array(array($this->pdo,'query'),$args);
  122 + } catch (Exception $e) {
  123 + self::getException($e);
  124 + }
  125 + return self::getPDOStatement($this->pdo,$pdo_statement,$req,$in);
  126 + }
  127 + public static $dones = array();
  128 + public function getClass()
  129 + {
  130 + if(empty(self::$dones))
  131 + require_once(dirname(__FILE__).DIRECTORY_SEPARATOR.'AbstractLayer.php');
  132 + AbstractLayer::$pdo = $this;
  133 +
  134 + $class = 'Layer'.strtoupper($this->type);
  135 + if(isset(self::$dones[$class]))
  136 + return $class;
  137 +
  138 + $file = dirname(__FILE__).DIRECTORY_SEPARATOR.$class.'.php';
  139 + if(!file_exists($file))
  140 + self::getException('Layer not implemented : '.$this->type);
  141 + require_once($file);
  142 +
  143 + self::$dones[$class] = 1;
  144 + return $class;
  145 + }
  146 + public function getLayer()
  147 + {
  148 + $class = $this->getClass();
  149 + $args = func_get_args();
  150 + $method = str_replace(' ','',ucwords(str_replace('-',' ',array_shift($args))));
  151 + if(!method_exists($class,$method))
  152 + self::getException($class.'::'.$method.' not implemented');
  153 + return call_user_func_array(array($class,$method),$args);
  154 + }
  155 +
  156 + # PDO STATEMENT
  157 + public function execute()
  158 + {
  159 + $count = count(explode('?',$this->req))-1;
  160 + if($count != $this->pos)
  161 + self::getException('Not enough or too much bindValue in regards to the number of "?" : '.$this->req.' ('.$this->pos.';'.$count.')');
  162 + $this->pos = 0;
  163 + $args = func_get_args();
  164 + $status = call_user_func_array(array($this->pdo_statement,'execute'),$args);
  165 + self::getBench($this->in,'execute');
  166 + if(!$status)
  167 + self::getException($this);
  168 + return $this;
  169 + }
  170 + public function fetchName()
  171 + {
  172 + $args = func_get_args();
  173 + $args[] = PDO::FETCH_ASSOC;
  174 + $results = call_user_func_array(array($this->pdo_statement,'fetchAll'),$args);
  175 + return $results;
  176 + }
  177 + public function fetchNum()
  178 + {
  179 + $args = func_get_args();
  180 + $args[] = PDO::FETCH_NUM;
  181 + $results = call_user_func_array(array($this->pdo_statement,'fetchAll'),$args);
  182 + return $results;
  183 + }
  184 + public function fetchOne()
  185 + {
  186 + $args = func_get_args();
  187 + $results = call_user_func_array(array($this->pdo_statement,'fetchAll'),$args);
  188 + foreach($results as $k=>$result)
  189 + if(count($result) == 2)
  190 + $results[$k] = $result[0];
  191 + return $results;
  192 + }
  193 + public function fetchAll()
  194 + {
  195 + $args = func_get_args();
  196 + $results = call_user_func_array(array($this->pdo_statement,'fetchAll'),$args);
  197 + self::getBench($this->in,'fetch');
  198 + return $results;
  199 + }
  200 + public function bindValue($value,$type)
  201 + {
  202 + switch($type)
  203 + {
  204 + case 'int': $type = PDO::PARAM_INT; break;
  205 + case 'string': $type = PDO::PARAM_STR; break;
  206 + case 'resource': $type = PDO::PARAM_LOB; break;
  207 + default: self::getException('Unknown type : '.$type); break;
  208 + }
  209 + $this->pdo_statement->bindValue(++$this->pos,$value,$type);
  210 + return $this;
  211 + }
  212 +
  213 + # General
  214 + public function getMessage()
  215 + {
  216 + switch($this->what)
  217 + {
  218 + case 'EXCEPTION':
  219 + $trace = array();
  220 + foreach($this->trace as $e)
  221 + {
  222 + if(!isset($e['file'])) $e['file'] = '<i>user_func</i>';
  223 + if(!isset($e['line'])) $e['line'] = '0';
  224 + if(!isset($e['class'])) $e['class'] = '';
  225 + if(!isset($e['type'])) $e['type'] = '';
  226 + $trace[] = '<small>'.$e['file'].':'.$e['line'].'</small> '.$e['class'].$e['type'].$e['function'];
  227 + }
  228 + return '<strong>'.$this->message.'</strong>'."\n".'<hr />'."\n".implode('<br />'."\n",$trace);
  229 + case 'PDO':
  230 + if(empty($this->pdo))
  231 + return 'Fail to connect.';
  232 + $error = $this->pdo->errorInfo();
  233 + return $error[0].':'.$error[1].' <pre>'.$error[2].'</pre><pre>'.$this->req.'</pre>';
  234 + case 'PDO_STATEMENT':
  235 + if(empty($this->pdo_statement))
  236 + $error = $this->pdo->errorInfo();
  237 + else
  238 + $error = $this->pdo_statement->errorInfo();
  239 + return $error[0].':'.$error[1].' <pre>'.$error[2].'</pre><pre>'.$this->req.'</pre>';
  240 + case 'BENCH':
  241 + return (round(($this->out-$this->in)*1000)/1000).'s '.$this->message;
  242 + }
  243 + }
  244 + public function getTrace()
  245 + {
  246 + switch($this->what)
  247 + {
  248 + case 'EXCEPTION':
  249 + return $this->trace;
  250 + default:
  251 + return array();
  252 + }
  253 + }
  254 +
  255 + public static function fetchDatatypes($file)
  256 + {
  257 + if(!file_exists($file))
  258 + {
  259 + $header = '<'.'?xml version="1.0" ?'.'>';
  260 + $datatypes = '';
  261 + }
  262 + else
  263 + {
  264 + $datatypes = file($file);
  265 + $header = array_shift($datatypes);
  266 + $datatypes = implode('',$datatypes);
  267 + }
  268 + return array($header,$datatypes);
  269 + }
  270 + public static function buildXML($pdo)
  271 + {
  272 + list($header,$datatypes) = self::fetchDatatypes($pdo->getLayer('datatypes-file'));
  273 +
  274 + $xml = array();
  275 + $xml[] = $header;
  276 + $xml[] = '<sql db="'.$pdo->type.'">';
  277 + $xml[] = $datatypes;
  278 +
  279 + $tables = $pdo->getLayer('tables');
  280 + foreach($tables as $table)
  281 + {
  282 + $xmltable = '<table name="'.$table['name'].'">';
  283 + if(!empty($table['comment']))
  284 + $xmltable .= '<comment>'.$table['comment'].'</comment>';
  285 +
  286 + $columns = $pdo->getLayer('columns',$table);
  287 + foreach($columns as $column)
  288 + {
  289 + $xmlcolumn = '<row name="'.$column['name'].'" null="'.$column['null'].'" autoincrement="'.$column['autoincrement'].'">';
  290 + $xmlcolumn .= '<datatype>'.strtoupper($column['type']).'</datatype>';
  291 + $xmlcolumn .= '<default>'.$column['default'].'</default>';
  292 + if(!empty($column['comment']))
  293 + $xmlcolumn .= '<comment>'.$column['comment'].'</comment>';
  294 +
  295 + $relations = $pdo->getLayer('relations',$table,$column);
  296 + foreach($relations as $relation)
  297 + $xmlcolumn .= '<relation table="'.$relation['table'].'" row="'.$relation['column'].'" />';
  298 +
  299 + $xmlcolumn .= '</row>';
  300 + $xmltable .= $xmlcolumn;
  301 + }
  302 +
  303 + $keys = $pdo->getLayer('keys',$table);
  304 + foreach($keys as $name=>$key)
  305 + {
  306 + $xmlkey = '<key name="'.$name.'" type="'.$key['type'].'">';
  307 +
  308 + foreach($key['columns'] as $column)
  309 + if(!empty($column))
  310 + $xmlkey .= '<part>'.$column.'</part>';
  311 +
  312 + $xmlkey .= '</key>';
  313 + $xmltable .= $xmlkey;
  314 + }
  315 +
  316 + $xmltable .= '</table>';
  317 + $xml[] = $xmltable;
  318 + }
  319 +
  320 + $xml[] = '</sql>';
  321 +
  322 + return implode("\n",$xml);
  323 + }
  324 +
  325 + public static function actionList()
  326 + {
  327 + list($type,$dsn,$user,$pass,$table) = self::getConfig('saveloadlist');
  328 + $pdo = self::getPdo($type,$dsn,$user,$pass);
  329 + $r = $pdo->getLayer('keywords',$table)->fetchOne();
  330 + foreach($r as $keyword)
  331 + echo $keyword."\n";
  332 + }
  333 + public static function actionSave($key='keyword')
  334 + {
  335 + $keyword = self::req($key);
  336 + $data = file_get_contents("php://input");
  337 + if (get_magic_quotes_gpc() || get_magic_quotes_runtime())
  338 + $data = stripslashes($data);
  339 +
  340 + list($type,$dsn,$user,$pass,$table) = self::getConfig('saveloadlist');
  341 + $pdo = self::getPdo($type,$dsn,$user,$pass);
  342 +
  343 + $r = $pdo->getLayer('keywords',$table,$keyword)->fetchOne();
  344 + if(count($r) > 0)
  345 + $pdo->getLayer('keywords-update',$table,$keyword,$data);
  346 + else
  347 + $pdo->getLayer('keywords-insert',$table,$keyword,$data);
  348 +
  349 + header("HTTP/1.0 201 Created");
  350 + }
  351 + public static function actionLoad($key='keyword')
  352 + {
  353 + $keyword = self::req($key);
  354 +
  355 + list($type,$dsn,$user,$pass,$table) = self::getConfig('saveloadlist');
  356 + $pdo = self::getPdo($type,$dsn,$user,$pass);
  357 +
  358 + $r = $pdo->getLayer('keywords',$table,$keyword)->fetchOne();
  359 + if(count($r) > 0)
  360 + {
  361 + header("Content-type: text/xml");
  362 + echo $r[0];
  363 + }
  364 + else
  365 + header("HTTP/1.0 404 Not Found");
  366 + die();
  367 + }
  368 + public static function actionImport()
  369 + {
  370 + ob_start();
  371 +
  372 + list($type,$dsn,$user,$pass) = self::getConfig('import');
  373 + $pdo = self::getPdo($type,$dsn,$user,$pass);
  374 +
  375 + $xml = self::buildXML($pdo);
  376 +
  377 + if(!ob_get_contents())
  378 + header("Content-type: text/xml");
  379 + echo $xml;
  380 + die();
  381 + }
  382 +
  383 + public static function req($key)
  384 + {
  385 + return isset($_REQUEST[$key])?$_REQUEST[$key]:NULL;
  386 + }
  387 + public static function controler($key='action')
  388 + {
  389 + $action = self::req($key);
  390 + switch(strtolower($action))
  391 + {
  392 + case 'list':
  393 + return self::actionList();
  394 + case 'save':
  395 + return self::actionSave();
  396 + case 'load':
  397 + return self::actionLoad();
  398 + case 'import':
  399 + return self::actionImport();
  400 + default:
  401 + header("HTTP/1.0 501 Not Implemented");
  402 + echo 'Action not implemented';
  403 + die();
  404 + }
  405 + }
  406 +}
  407 +
  408 +function bench()
  409 +{
  410 + foreach(BackendPhpPdo::$benchs as $bench)
  411 + echo $bench->getMessage().'<br />';
  412 +}
  413 +//register_shutdown_function('bench');
  414 +
  415 +BackendPhpPdo::controler();
  416 +
  417 +?>
... ...
resources/js/hayamiki_designer/backend/php-postgresql/README 0 → 100644
  1 +Postgresql server backend for wwwsqldesigner
  2 +version 0.1 beta
  3 +
  4 +
  5 +Instructions:
  6 +
  7 +If you want to save/load your diagrams in a database...
  8 +
  9 +1) Create a login role called 'wwwsqldesigner' using 'xxx' as password.
  10 +2) Create a databse called 'wwwsqldesigner' with...
  11 + owner as 'wwwsqldesigner',
  12 + UTF-8 encoding,
  13 + and template0
  14 +3) Connect to this newly created database and run the database.sql script
  15 + located in this folder.
  16 +4) Edit config.js located in the js directory...
  17 + change default database to postgresql,
  18 + add postgresql to available backends
  19 +5) If you want to import the schema of an an already created database,
  20 + edit the index.php script located in this directory
... ...
resources/js/hayamiki_designer/backend/php-postgresql/database.sql 0 → 100644
  1 +DROP TABLE IF EXISTS wwwsqldesigner;
  2 +
  3 +CREATE TABLE wwwsqldesigner (
  4 + keyword varchar(30) NOT NULL,
  5 + xmldata text,
  6 + dt timestamp,
  7 + PRIMARY KEY (keyword)
  8 +);
... ...
resources/js/hayamiki_designer/backend/php-postgresql/index.php 0 → 100644
  1 +<?php
  2 +
  3 +// ---------------------------------------------------------------------
  4 +// Postgresql server backend for wwwsqldesigner
  5 +// version 0.1 beta
  6 +// Based on the mysql server backend provided with wwwsqldesigner 2.3.2
  7 +//
  8 +//
  9 +//
  10 +// Issues relating to using wwwsqldesigner with postgresl:
  11 +// * Request dialog for a database name is not needed. Enter anything when
  12 +// requested.
  13 +// * There can be user-defined types in Postgresql which is not found in
  14 +// '../../db/postgresql/datatypes.xml'.
  15 +// * There is no auto increment column in Postgresql. Ignore the checkbox,
  16 +// use the serial type when building your tables; if importing, you should
  17 +// see an Integer type and a default value of something similar to
  18 +// nextval('"someSequenceName"'::regclass).
  19 +// ---------------------------------------------------------------------
  20 +
  21 +// Parameters for the application database
  22 + function setup_saveloadlist() {
  23 + Define("HOST_ADDR", "localhost"); // if the database cluster is on the same server as this application use 'localhost' otherwise the appropriate address (192.168.0.2 for example).
  24 + Define("PORT_NO", "5432"); // default port is 5432. If you have or had more than one db cluster at the same time, consider ports 5433,... etc.
  25 + Define("DATABASE_NAME", "wwwsqldesigner"); // leave as is
  26 + Define("USER_NAME", "wwwsqldesigner"); // leave as is
  27 + Define("PASSWORD", "xxx"); // leave as is
  28 + Define("TABLE", "wwwsqldesigner"); // leave as is
  29 + }
  30 +
  31 +// Parameters for the database you want to import in the application
  32 + function setup_import() {
  33 + Define("HOST_ADDR", "localhost"); // if the database cluster is on the same server as this application use 'localhost' otherwise the appropriate address (192.168.0.2 for example).
  34 + Define("PORT_NO", "5432"); // default port is 5432. If you have or had more than one db cluster at the same time, consider ports 5433,... etc.
  35 + Define("DATABASE_NAME", "testdb"); // the database you want to import
  36 + Define("USER_NAME", "username"); // role having rights to read the database
  37 + Define("PASSWORD", "??????"); // password for role
  38 + }
  39 +
  40 + function connect() {
  41 + $str="host=".HOST_ADDR." port=".PORT_NO." dbname=".DATABASE_NAME." user=".USER_NAME." password=".PASSWORD;
  42 + $conn = pg_connect($str);
  43 + if (!$conn){
  44 + header("HTTP/1.0 503 Service Unavailable");
  45 + break;
  46 + }
  47 + return $conn;
  48 + }
  49 +
  50 + function import($conn) {
  51 + // $db = (isset($_GET["database"]) ? $_GET["database"] : "information_schema");
  52 + // $db = pg_escape_string($conn, $db);
  53 + $xml = "";
  54 + $arr = array();
  55 + @ $datatypes = file("../../db/postgresql/datatypes.xml");
  56 + $arr[] = $datatypes[0];
  57 + $arr[] = '<sql db="postgresql">';
  58 + for ($i=1;$i<count($datatypes);$i++) {
  59 + $arr[] = $datatypes[$i];
  60 + }
  61 +
  62 + // in Postgresql comments are not stored in the ANSI information_schema (compliant to the standard);
  63 + // so we will need to access the pg_catalog and may as well get the table names at the same time.
  64 + $qstr = "
  65 + SELECT relname as table_name,
  66 + c.oid as table_oid,
  67 + (SELECT pg_catalog.obj_description(c.oid, 'pg_class')) as comment
  68 + FROM pg_catalog.pg_class c
  69 + WHERE c.relname !~ '^(pg_|sql_)' AND relkind = 'r'
  70 + ORDER BY table_name;
  71 + ;";
  72 +
  73 + $result = pg_query($conn, $qstr);
  74 + while ($row = pg_fetch_array($result)) {
  75 + $table = $row["table_name"];
  76 + $table_oid = $row["table_oid"];
  77 + $xml .= '<table name="'.$table.'">';
  78 + $comment = (isset($row["comment"]) ? $row["comment"] : "");
  79 + if ($comment) { $xml .= '<comment>'.$comment.'</comment>'; }
  80 + $qstr = "
  81 + SELECT *, col_description(".$table_oid.",ordinal_position) as column_comment
  82 + FROM information_schema.columns
  83 + WHERE table_name = '".$table."'
  84 + ORDER BY ordinal_position
  85 + ;";
  86 + $result2 = pg_query($conn, $qstr);
  87 + while ($row = pg_fetch_array($result2)) {
  88 + $name = $row["column_name"];
  89 + $type = $row["data_type"]; // maybe use "udt_name" instead to consider user types
  90 + $comment = (isset($row["column_comment"]) ? $row["column_comment"] : "");
  91 + $null = ($row["is_nullable"] == "YES" ? "1" : "0");
  92 + $def = $row["column_default"];
  93 + // $ai:autoincrement... Not in postgresql, Ignore
  94 + $ai = "0";
  95 + if ($def == "NULL") { $def = ""; }
  96 + $xml .= '<row name="'.$name.'" null="'.$null.'" autoincrement="'.$ai.'">';
  97 + $xml .= '<datatype>'.strtoupper($type).'</datatype>';
  98 + $xml .= '<default>'.$def.'</default>';
  99 + if ($comment) { $xml .= '<comment>'.$comment.'</comment>'; }
  100 +
  101 + /* fk constraints */
  102 + $qstr = "
  103 + SELECT kku.column_name,
  104 + ccu.table_name AS references_table,
  105 + ccu.column_name AS references_field
  106 + FROM information_schema.table_constraints tc
  107 + LEFT JOIN information_schema.constraint_column_usage ccu
  108 + ON tc.constraint_name = ccu.constraint_name
  109 + LEFT JOIN information_schema.key_column_usage kku
  110 + ON kku.constraint_name = ccu.constraint_name
  111 + WHERE constraint_type = 'FOREIGN KEY'
  112 + AND kku.table_name = '".$table."'
  113 + AND kku.column_name = '".$name."'
  114 + ;";
  115 +
  116 + $result3 = pg_query($conn, $qstr);
  117 +
  118 + while ($row = pg_fetch_array($result3)) {
  119 + $xml .= '<relation table="'.$row["references_table"].'" row="'.$row["references_field"].'" />';
  120 + }
  121 +
  122 + $xml .= '</row>';
  123 + }
  124 +
  125 + // keys
  126 + $qstr = "
  127 + SELECT tc.constraint_name,
  128 + tc.constraint_type,
  129 + kcu.column_name
  130 + FROM information_schema.table_constraints tc
  131 + LEFT JOIN information_schema.key_column_usage kcu
  132 + ON tc.constraint_catalog = kcu.constraint_catalog
  133 + AND tc.constraint_schema = kcu.constraint_schema
  134 + AND tc.constraint_name = kcu.constraint_name
  135 + WHERE tc.table_name = '".$table."' AND constraint_type != 'FOREIGN KEY'
  136 + ORDER BY tc.constraint_name
  137 + ;";
  138 + $result2 = pg_query($conn, $qstr);
  139 + $keyname1 = "";
  140 + while ($row2 = pg_fetch_array($result2)){
  141 + $keyname = $row2["constraint_name"];
  142 + if ($keyname != $keyname1) {
  143 + if ($keyname1 != "") { $xml .= '</key>'; }
  144 + if ($row2["constraint_type"] == "PRIMARY KEY") { $row2["constraint_type"] = "PRIMARY"; }
  145 + if (endsWith($keyname, '_not_null') and $row2["constraint_type"] === "CHECK") {
  146 + $keyname = "";
  147 + continue;
  148 + }
  149 + $xml .= '<key name="'.$keyname.'" type="'.$row2["constraint_type"].'">';
  150 + $xml .= isset($row2["column_name"]) ? '<part>'.$row2["column_name"].'</part>' : "";
  151 + } else {
  152 + $xml .= isset($row2["column_name"]) ? '<part>'.$row2["column_name"].'</part>' : "";
  153 + }
  154 + $keyname1 = $keyname;
  155 + }
  156 + if ($keyname1 != "") { $xml .= '</key>'; }
  157 +
  158 + // index
  159 + $qstr = 'SELECT pcx."relname" as "INDEX_NAME", pa."attname" as
  160 + "COLUMN_NAME", * FROM "pg_index" pi LEFT JOIN "pg_class" pcx ON pi."indexrelid" =
  161 + pcx."oid" LEFT JOIN "pg_class" pci ON pi."indrelid" = pci."oid" LEFT JOIN
  162 + "pg_attribute" pa ON pa."attrelid" = pci."oid" AND pa."attnum" = ANY(pi."indkey")
  163 + WHERE pci."relname" = \''.$table.'\' order by pa."attnum"';
  164 + $result2 = pg_query($conn, $qstr);
  165 + $idx = array();
  166 + while ($row2 = pg_fetch_array($result2)) {
  167 + $name = $row2["INDEX_NAME"];
  168 + if (array_key_exists($name, $idx)) {
  169 + $obj = $idx[$name];
  170 + } else {
  171 + $t = "INDEX";
  172 + if ($row2['indisunique'] == 't') {
  173 + $t = "UNIQUE";
  174 + break;
  175 + }
  176 + if ($row2['indisprimary'] == 't') {
  177 + $t = "PRIMARY";
  178 + break;
  179 + }
  180 +
  181 + $obj = array(
  182 + "columns" => array(),
  183 + "type" => $t
  184 + );
  185 + }
  186 +
  187 + $obj["columns"][] = $row2["COLUMN_NAME"];
  188 + $idx[$name] = $obj;
  189 + }
  190 +
  191 + foreach ($idx as $name=>$obj) {
  192 + $xmlkey = '<key name="'.$name.'" type="'.$obj["type"].'">';
  193 + for ($i=0;$i<count($obj["columns"]);$i++) {
  194 + $col = $obj["columns"][$i];
  195 + $xmlkey .= '<part>'.$col.'</part>';
  196 + }
  197 + $xmlkey .= '</key>';
  198 + $xml .= $xmlkey;
  199 + }
  200 +
  201 + $xml .= "</table>";
  202 +
  203 + }
  204 + $arr[] = $xml;
  205 + $arr[] = '</sql>';
  206 + return implode("\n",$arr);
  207 + }
  208 +
  209 + function endsWith($haystack, $needle)
  210 + {
  211 + return (substr($haystack, -strlen($needle)) === $needle);
  212 + }
  213 +
  214 + $a = (isset($_GET["action"]) ? $_GET["action"] : false);
  215 + switch ($a) {
  216 + case "list":
  217 + setup_saveloadlist();
  218 + $conn = connect();
  219 + $qstr = "SELECT keyword FROM ".TABLE." ORDER BY dt DESC";
  220 + $result = pg_query($conn, $qstr);
  221 + while ($row = pg_fetch_assoc($result)) {
  222 + echo $row["keyword"]."\n";
  223 + }
  224 + break;
  225 + case "save":
  226 + setup_saveloadlist();
  227 + $conn = connect();
  228 + $keyword = (isset($_GET["keyword"]) ? $_GET["keyword"] : "");
  229 + $keyword = pg_escape_string($conn,$keyword);
  230 + $data = file_get_contents("php://input");
  231 + if (get_magic_quotes_gpc() || get_magic_quotes_runtime()) {
  232 + $data = stripslashes($data);
  233 + }
  234 + $data = pg_escape_string($conn,$data);
  235 + $qstr = "SELECT * FROM ".TABLE." WHERE keyword = '".$keyword."'";
  236 + $r = pg_query($conn, $qstr);
  237 + if (pg_num_rows($r) > 0) {
  238 + $qstr = "UPDATE ".TABLE." SET xmldata = '".$data."' WHERE keyword = '".$keyword."'";
  239 + $res = pg_query($conn, $qstr);
  240 + } else {
  241 + $qstr = "INSERT INTO ".TABLE." (keyword, xmldata) VALUES ('".$keyword."', '".$data."')";
  242 + $res = pg_query($conn, $qstr);
  243 + }
  244 + if (!$res) {
  245 + header("HTTP/1.0 500 Internal Server Error");
  246 + } else {
  247 + header("HTTP/1.0 201 Created");
  248 + }
  249 + break;
  250 + case "load":
  251 + setup_saveloadlist();
  252 + $conn = connect();
  253 + $keyword = (isset($_GET["keyword"]) ? $_GET["keyword"] : "");
  254 + $keyword = pg_escape_string($conn, $keyword);
  255 + $qstr = "SELECT xmldata FROM ".TABLE." WHERE keyword = '".$keyword."'";
  256 + $result = pg_query($conn, $qstr);
  257 + $row = pg_fetch_assoc($result);
  258 + if (!$row) {
  259 + header("HTTP/1.0 404 Not Found");
  260 + } else {
  261 + header("Content-type: text/xml");
  262 + echo $row["xmldata"];
  263 + }
  264 + break;
  265 + case "import":
  266 + setup_import();
  267 + $conn = connect();
  268 + header("Content-type: text/xml");
  269 + echo import($conn);
  270 + break;
  271 + default: header("HTTP/1.0 501 Not Implemented");
  272 + }
  273 +
  274 +
  275 + /*
  276 + list: 501/200
  277 + load: 501/200/404
  278 + save: 501/201
  279 + import: 501/200
  280 + */
  281 +?>
... ...
resources/js/hayamiki_designer/backend/php-sqlite/index.php 0 → 100644
  1 +<?php
  2 + $pdo = null;
  3 +
  4 + function setup_saveloadlist() {
  5 + define( "FILE" , "wwwsqldesigner.sqlite" );
  6 + define( "TABLE" , "wwwsqldesigner" );
  7 + }
  8 + function setup_import() {
  9 + header( 'HTTP/1.0 501 Not Implemented' );
  10 + die;
  11 + }
  12 + function connect() {
  13 + global $pdo;
  14 + $initReq = false;
  15 + if( !file_exists( FILE ) ) $initReq = true;
  16 + $pdo = new PDO("sqlite:" . FILE);
  17 + if( !$pdo ) return false;
  18 + if( $initReq ) {
  19 + $initSQL = "CREATE TABLE wwwsqldesigner (
  20 + keyword varchar(30) NOT NULL default '',
  21 + data TEXT ,
  22 + dt DATETIME DEFAULT CURRENT_TIMESTAMP ,
  23 + PRIMARY KEY ( keyword )
  24 + );";
  25 + $res = $pdo->exec( $initSQL );
  26 + return ($res !== false);
  27 + }
  28 + return true;
  29 + }
  30 + function import() {
  31 + header( 'HTTP/1.0 501 Not Implemented' );
  32 + }
  33 +
  34 + $a = (isset($_GET["action"]) ? $_GET["action"] : false);
  35 + switch( $a ) {
  36 + case 'list' :
  37 + setup_saveloadlist();
  38 + if( !connect() ) {
  39 + header( 'HTTP/1.0 503 Service Unavailable' );
  40 + break;
  41 + }
  42 + $result = $pdo->query( "SELECT keyword FROM ".TABLE);
  43 + $data = $result->fetchAll();
  44 + if( count($data) > 0 ) {
  45 + foreach ($data as $row) {
  46 + echo $row['keyword']."\n";
  47 + }
  48 + } else {
  49 + echo "--No Designs Saved";
  50 + }
  51 + break;
  52 + case 'save' :
  53 + setup_saveloadlist();
  54 + if( !connect() ) {
  55 + header( 'HTTP/1.0 503 Service Unavailable' );
  56 + break;
  57 + }
  58 +
  59 + $keyword = ( isset( $_GET['keyword'] ) ? $_GET['keyword'] : '' );
  60 + $data = file_get_contents( "php://input" );
  61 + if( get_magic_quotes_gpc()
  62 + || get_magic_quotes_runtime() ) {
  63 + $data = stripslashes( $data );
  64 + }
  65 +
  66 + $statement = $pdo->prepare("SELECT COUNT(*) AS c FROM ".TABLE." WHERE keyword = ?");
  67 + $statement->execute(array($keyword));
  68 + $result = $statement->fetchAll();
  69 + if ($result[0]["c"] > 0) {
  70 + $result = $pdo->prepare( "UPDATE ".TABLE." SET data = ? WHERE keyword = ?")->execute(array($data, $keyword));
  71 + } else {
  72 + $result = $pdo->prepare( "INSERT INTO ".TABLE." (keyword, data) VALUES (?, ?)")->execute(array($keyword, $data));
  73 + }
  74 +
  75 + if( !$result ) {
  76 + header( 'HTTP/1.0 500 Internal Server Error' );
  77 + } else {
  78 + header( 'HTTP/1.0 201 Created' );
  79 + }
  80 + break;
  81 + case 'load' :
  82 + setup_saveloadlist();
  83 + if ( !connect() ) {
  84 + header( 'HTTP/1.0 503 Service Unavailable' );
  85 + break;
  86 + }
  87 + $keyword = ( isset( $_GET['keyword'] ) ? $_GET['keyword'] : '' );
  88 +
  89 + $statement = $pdo->prepare( "SELECT data FROM ".TABLE." WHERE keyword = ?");
  90 + $statement->execute(array($keyword));
  91 + $data = $statement->fetchAll();
  92 +
  93 + if( !count($data) ) {
  94 + header( 'HTTP/1.0 404 Not Found' );
  95 + } else {
  96 + header( 'Content-type: text/xml' );
  97 + echo $data[0]['data'];
  98 + }
  99 + break;
  100 + case 'import' :
  101 + setup_import();
  102 + default:
  103 + header( 'HTTP/1.0 501 Not Implemented' );
  104 + }
  105 +
  106 +
  107 + /*
  108 + list: 501/200
  109 + load: 501/200/404
  110 + save: 501/201
  111 + import: 501/200
  112 + */
  113 +?>
... ...
resources/js/hayamiki_designer/backend/php-sqlite/wwwsqldesigner.sqlite 0 → 100644
No preview for this file type
resources/js/hayamiki_designer/db/cubrid/datatypes.xml 0 → 100644
  1 +<?xml version="1.0"?>
  2 +<datatypes db="cubrid">
  3 + <group label="Numeric" color="rgb(238,238,170)">
  4 + <type label="Short" length="0" sql="SHORT" quote="" />
  5 + <type label="Smallint" length="0" sql="SMALLINT" quote="" />
  6 + <type label="Integer" length="0" sql="INTEGER" quote="" />
  7 + <type label="Bigint" length="0" sql="BIGINT" quote="" />
  8 +
  9 + <type label="Numeric / Decimal" length="1" sql="DECIMAL" quote="" />
  10 + <type label="Float / Single precision" length="0" sql="FLOAT" quote="" />
  11 + <type label="Double precision" length="0" sql="DOUBLE" quote="" />
  12 +
  13 + <type label="Monetary" length="0" sql="MONETARY" re="MONETARY" quote="" />
  14 + </group>
  15 +
  16 + <group label="Character" color="rgb(255,200,200)">
  17 + <type label="Char" length="1" sql="CHAR" quote="'"/>
  18 + <type label="Varchar" length="1" sql="VARCHAR" quote="'"/>
  19 + <type label="String" length="0" sql="STRING" quote="'"/>
  20 + </group>
  21 +
  22 + <group label="National Character" color="rgb(255,225,200)">
  23 + <type label="Nchar" length="1" sql="NCHAR" quote="'"/>
  24 + <type label="Nchar Varying" length="1" sql="NCHAR VARYING" quote="'"/>
  25 + </group>
  26 +
  27 + <group label="Date &amp; Time" color="rgb(200,255,200)">
  28 + <type label="Date" length="0" sql="DATE" quote="'" />
  29 + <type label="Time" length="0" sql="TIME" quote="'" />
  30 + <type label="Datetime" length="0" sql="DATETIME" quote="'" />
  31 + <type label="Timestamp" length="0" sql="TIMESTAMP" quote="'" />
  32 + </group>
  33 +
  34 + <group label="Collections" color="rgb(200,200,255)">
  35 + <type label="Set" length="0" sql="SET" quote="" />
  36 + <type label="Multiset" length="0" sql="MULTISET" quote="" />
  37 + <type label="List" length="0" sql="LIST" quote="" />
  38 + </group>
  39 +
  40 + <group label="Bit strings" color="rgb(200,200,200)">
  41 + <type label="Bit" length="1" sql="BIT" quote=""/>
  42 + <type label="Bit Varying" length="1" sql="BIT VARYING" quote=""/>
  43 + </group>
  44 +</datatypes>
... ...
resources/js/hayamiki_designer/db/cubrid/output.xsl 0 → 100644
  1 +<?xml version="1.0" ?>
  2 +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3 +<xsl:output method="text"/>
  4 +<xsl:template match="/sql">
  5 +--
  6 +-- CUBRID SQL Script
  7 +--
  8 +<!-- tables -->
  9 + <xsl:for-each select="table">
  10 +<xsl:text>
  11 +</xsl:text>
  12 + <xsl:text>-- Table `</xsl:text>
  13 + <xsl:value-of select="@name" />
  14 + <xsl:text>`</xsl:text>
  15 +<xsl:text>
  16 +</xsl:text>
  17 +<xsl:text>
  18 +</xsl:text>
  19 +
  20 + <xsl:text>-- DROP TABLE `</xsl:text>
  21 + <xsl:value-of select="@name" />
  22 + <xsl:text>`;</xsl:text>
  23 +<xsl:text>
  24 +</xsl:text>
  25 +<xsl:text>
  26 +</xsl:text>
  27 +
  28 + <xsl:text>CREATE TABLE `</xsl:text>
  29 + <xsl:value-of select="@name" />
  30 + <xsl:text>` (</xsl:text>
  31 +<xsl:text>
  32 +</xsl:text>
  33 + <xsl:for-each select="row">
  34 + <xsl:text> `</xsl:text>
  35 + <xsl:value-of select="@name" />
  36 + <xsl:text>` </xsl:text>
  37 +
  38 + <xsl:value-of select="datatype" />
  39 + <xsl:text></xsl:text>
  40 +
  41 + <xsl:if test="@null = 0">
  42 + <xsl:text> NOT NULL</xsl:text>
  43 + </xsl:if>
  44 +
  45 + <xsl:if test="@autoincrement = 1">
  46 + <xsl:text> AUTO_INCREMENT</xsl:text>
  47 + </xsl:if>
  48 +
  49 + <xsl:if test="default">
  50 + <xsl:text> DEFAULT </xsl:text>
  51 + <xsl:value-of select="default" />
  52 + <xsl:text></xsl:text>
  53 + </xsl:if>
  54 +
  55 + <xsl:if test="not (position()=last())">
  56 + <xsl:text>,</xsl:text>
  57 +<xsl:text>
  58 +</xsl:text>
  59 + </xsl:if>
  60 + </xsl:for-each>
  61 +
  62 +<!-- keys -->
  63 + <xsl:for-each select="key">
  64 + <xsl:text>,</xsl:text>
  65 +<xsl:text>
  66 +</xsl:text>
  67 + <xsl:choose>
  68 + <xsl:when test="@type = 'PRIMARY'"> PRIMARY KEY (</xsl:when>
  69 + <xsl:when test="@type = 'UNIQUE'"> UNIQUE KEY (</xsl:when>
  70 + <xsl:otherwise>KEY (</xsl:otherwise>
  71 + </xsl:choose>
  72 +
  73 + <xsl:for-each select="part">
  74 + <xsl:text>`</xsl:text><xsl:value-of select="." /><xsl:text>`</xsl:text>
  75 + <xsl:if test="not (position() = last())">
  76 + <xsl:text>, </xsl:text>
  77 + </xsl:if>
  78 + </xsl:for-each>
  79 + <xsl:text>)</xsl:text>
  80 + </xsl:for-each>
  81 +<xsl:text>
  82 +</xsl:text>
  83 + <xsl:text>);</xsl:text>
  84 +<xsl:text>
  85 +</xsl:text>
  86 +
  87 +</xsl:for-each>
  88 +
  89 +<xsl:text>
  90 +</xsl:text>
  91 +<xsl:text>
  92 +-- Foreign Keys
  93 +</xsl:text>
  94 +<xsl:text>
  95 +</xsl:text>
  96 +
  97 +<!-- fk -->
  98 + <xsl:for-each select="table">
  99 + <xsl:for-each select="row">
  100 + <xsl:for-each select="relation">
  101 + <xsl:text>ALTER TABLE `</xsl:text>
  102 + <xsl:value-of select="../../@name" />
  103 + <xsl:text>` ADD FOREIGN KEY (`</xsl:text>
  104 + <xsl:value-of select="../@name" />
  105 + <xsl:text>`) REFERENCES `</xsl:text>
  106 + <xsl:value-of select="@table" />
  107 + <xsl:text>` (`</xsl:text>
  108 + <xsl:value-of select="@row" />
  109 + <xsl:text>`);</xsl:text>
  110 +<xsl:text>
  111 +</xsl:text>
  112 + </xsl:for-each>
  113 + </xsl:for-each>
  114 + </xsl:for-each>
  115 +<xsl:text>
  116 +</xsl:text>
  117 +
  118 +<xsl:text>
  119 +</xsl:text>
  120 +<xsl:text>
  121 +-- Test Data
  122 +</xsl:text>
  123 +<xsl:text>
  124 +</xsl:text>
  125 +
  126 + <xsl:for-each select="table">
  127 + <xsl:text>-- INSERT INTO `</xsl:text><xsl:value-of select="@name" />
  128 + <xsl:text>` (</xsl:text>
  129 + <xsl:for-each select="row">
  130 + <xsl:text>`</xsl:text>
  131 + <xsl:value-of select="@name" />
  132 + <xsl:text>`</xsl:text>
  133 + <xsl:if test="not (position()=last())">
  134 + <xsl:text>,</xsl:text>
  135 + </xsl:if>
  136 + </xsl:for-each>
  137 + <xsl:text>) VALUES
  138 +-- (</xsl:text>
  139 + <xsl:for-each select="row">
  140 + <xsl:text>''</xsl:text>
  141 + <xsl:if test="not (position()=last())">
  142 + <xsl:text>,</xsl:text>
  143 + </xsl:if>
  144 + </xsl:for-each>
  145 + <xsl:text>);</xsl:text>
  146 +<xsl:text>
  147 +</xsl:text>
  148 + </xsl:for-each>
  149 +
  150 +</xsl:template>
  151 +</xsl:stylesheet>
  152 +
... ...
resources/js/hayamiki_designer/db/hayamiki/datatypes.xml 0 → 100644
  1 +<?xml version="1.0"?>
  2 +<datatypes db="hayamiki">
  3 + <group label="Affinity">
  4 + <type label="char field" default="" length="1" sql="VARCHAR" quote="'" color="rgb(255,200,200)" />
  5 + <type label="text_field" default="" length="0" sql="STRING" quote="'" color="rgb(238,238,170)" />
  6 + <type label="integer_field" default="0" length="0" sql="INTEGER" quote="" color="rgb(238,238,170)" />
  7 + <type label="date_field" length="0" sql="DATE" quote="'" />
  8 + <type label="time_field" length="0" sql="TIME" quote="'" />
  9 + <type label="datetime_field" length="0" sql="DATETIME" quote="'" />
  10 + <type label="boolean_field" default="" length="0" sql="BOOL" quote="" color="rgb(200,255,200)" />
  11 + </group>
  12 +</datatypes>
... ...
resources/js/hayamiki_designer/db/hayamiki/output.xsl 0 → 100644
  1 +<?xml version="1.0" ?>
  2 +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3 +<xsl:output method="text"/>
  4 +<xsl:template match="/sql">
  5 +
  6 +<!-- tables -->
  7 + <xsl:for-each select="table">
  8 + <xsl:text>CREATE TABLE '</xsl:text>
  9 + <xsl:value-of select="@name" />
  10 + <xsl:text>' (
  11 +</xsl:text>
  12 + <xsl:for-each select="row">
  13 + <xsl:variable name="name" select="@name" />
  14 +
  15 + <xsl:text>'</xsl:text><xsl:value-of select="@name" /><xsl:text>' </xsl:text>
  16 +
  17 + <xsl:value-of select="datatype" />
  18 +
  19 + <xsl:if test="@null = 0">
  20 + <xsl:text> NOT NULL </xsl:text>
  21 + </xsl:if>
  22 +
  23 +
  24 + <xsl:if test="default">
  25 + <xsl:text> DEFAULT </xsl:text>
  26 + <xsl:value-of select="default" />
  27 + </xsl:if>
  28 +
  29 + <!-- autoincrement/primary key after column - only when composed of 1 part -->
  30 + <xsl:for-each select="../key">
  31 + <xsl:if test="@type = 'PRIMARY' and count(child::part) = 1">
  32 + <xsl:for-each select="part">
  33 + <xsl:if test="$name = .">
  34 + <xsl:text> PRIMARY KEY</xsl:text>
  35 + </xsl:if>
  36 + </xsl:for-each>
  37 + </xsl:if>
  38 + </xsl:for-each>
  39 +
  40 + <xsl:if test="@autoincrement = 1">
  41 + <xsl:text> AUTOINCREMENT</xsl:text>
  42 + </xsl:if>
  43 +
  44 + <!-- fk -->
  45 + <xsl:for-each select="relation">
  46 + <xsl:text> REFERENCES '</xsl:text>
  47 + <xsl:value-of select="@table" />
  48 + <xsl:text>' ('</xsl:text>
  49 + <xsl:value-of select="@row" />
  50 + <xsl:text>')</xsl:text>
  51 + </xsl:for-each>
  52 +
  53 + <xsl:if test="not (position()=last())">
  54 + <xsl:text>,
  55 +</xsl:text>
  56 + </xsl:if>
  57 + </xsl:for-each>
  58 +
  59 + <!-- keys after table -->
  60 + <xsl:for-each select="key">
  61 + <xsl:if test="@type = 'UNIQUE' or (@type = 'PRIMARY' and count(child::part) > 1)">
  62 + <xsl:text>,
  63 +</xsl:text>
  64 + <xsl:choose>
  65 + <xsl:when test="@type = 'PRIMARY'">PRIMARY KEY</xsl:when>
  66 + <xsl:when test="@type = 'UNIQUE'">UNIQUE</xsl:when>
  67 + </xsl:choose>
  68 + <xsl:text> (</xsl:text>
  69 +
  70 + <xsl:for-each select="part">
  71 + <xsl:value-of select="." />
  72 + <xsl:if test="not (position() = last())">
  73 + <xsl:text>, </xsl:text>
  74 + </xsl:if>
  75 + </xsl:for-each>
  76 + <xsl:text>)</xsl:text>
  77 + </xsl:if>
  78 +
  79 + </xsl:for-each>
  80 +
  81 + <xsl:text>
  82 +);
  83 +
  84 +</xsl:text>
  85 +
  86 + </xsl:for-each>
  87 +
  88 + <xsl:for-each select="table">
  89 + <xsl:for-each select="key">
  90 + <xsl:if test="@type = 'INDEX'">
  91 + <xsl:text>CREATE INDEX '</xsl:text>
  92 + <xsl:value-of select="@name" />
  93 + <xsl:text>' ON '</xsl:text>
  94 + <xsl:value-of select="../@name" />
  95 + <xsl:text>' ('</xsl:text>
  96 + <xsl:for-each select="part">
  97 + <xsl:value-of select="." />
  98 + <xsl:if test="not (position() = last())">
  99 + <xsl:text>', '</xsl:text>
  100 + </xsl:if>
  101 + </xsl:for-each>
  102 + <xsl:text>');
  103 +</xsl:text>
  104 + </xsl:if>
  105 + </xsl:for-each>
  106 + </xsl:for-each>
  107 +
  108 +</xsl:template>
  109 +</xsl:stylesheet>
... ...
resources/js/hayamiki_designer/db/mssql/datatypes.xml 0 → 100644
  1 +<?xml version="1.0"?>
  2 +<!--
  3 + MsSQL XML Datatypes for WWW SQL Designer v 2.x
  4 + Version: 0.1
  5 + Author: schliden@gmail.com
  6 +-->
  7 +<datatypes db="mssql">
  8 + <group label="Integer" color="rgb(238,238,170)">
  9 + <type label="TinyInt" length="0" sql="tinyint" re="INT" quote="" bytes="1" note="Integer data: 0 to 255" />
  10 + <type label="SmallInt" length="0" sql="smallint" re="INT" quote="" bytes="2" note="Integer data: -32,768 to 32,767" />
  11 + <type label="Int" length="0" sql="int" re="INT" quote="" bytes="4" note="Integer data: -2,147,483,648 to 2,147,483,647" />
  12 + <type label="BigInt" length="0" sql="bigint" re="INT" quote="" bytes="8" note="Integer data: -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807" />
  13 + </group>
  14 +
  15 + <group label="Monetary" color="rgb(238,238,170)">
  16 + <type label="Money" length="0" sql="money" re="FLOAT" quote="" bytes="8" note="Integer data: -922,337,203,685,477.5808 to 922,337,203,685,477.5807" />
  17 + <type label="SmallMoney" length="0" sql="smallmoney" re="FLOAT" quote="" bytes="4" note="-214,748.3648 to 214,748.3647" />
  18 + </group>
  19 +
  20 + <group label="Numeric" color="rgb(238,238,170)">
  21 + <type label="Real" length="0" sql="real" re="FLOAT" quote="" bytes="4" note="Floating precision number data: -3.402823E+38 to 3.402823E+38" />
  22 + <type label="Float" length="0" sql="float" re="FLOAT" quote="" bytes="8" note="Floating precision number data: -4.94E+324 to 4.94E+324" />
  23 + <type label="Decimal" length="1" sql="decimal" re="DEC" quote="" bytes="n*" note="Fixed precision and scale numeric data: -10^38 +1 to 10^38 -1 (decimal and numeric are synonyms)" />
  24 + <type label="Numeric" length="1" sql="numeric" re="DEC" quote="" bytes="n*" note="Fixed precision and scale numeric data: -10^38 +1 to 10^38 -1 (decimal and numeric are synonyms)" />
  25 + </group>
  26 +
  27 + <group label="Character" color="rgb(255,200,200)">
  28 + <type label="Char" length="0" sql="char" quote="'" bytes="n" note="Fixed-length character data with a maximum length of 8,000 characters" />
  29 + <type label="Varchar" length="1" sql="varchar" quote="'" bytes="m &lt;= n" note="Variable-length data with a maximum of 8,000 characters" />
  30 + <type label="Text" length="1" sql="text" quote="'" bytes="&lt;= 2,147,483,647" note="Variable-length data with a maximum length of 2,147,483,647 characters" />
  31 + <type label="XML" length="0" sql="xml" quote="'" bytes="n" note="XML" />
  32 + </group>
  33 +
  34 + <group label="Unicode Character" color="rgb(255,200,200)">
  35 + <type label="nChar" length="0" sql="nchar" quote="'" bytes="n" note="Fixed-length Unicode data with a maximum length of 4,000 characters" />
  36 + <type label="nVarchar" length="1" sql="nvarchar" quote="'" bytes="m &lt;= n" note="Variable-length Unicode data with a maximum length of 4,000 characters" />
  37 + <type label="nText" length="1" sql="ntext" quote="'" bytes="&lt;= 2,147,483,647" note="Variable-length Unicode data with a maximum length of 1,073,741,823 characters" />
  38 + </group>
  39 +
  40 +
  41 + <group label="Date &amp; Time" color="rgb(200,255,200)">
  42 + <type label="Datetime" length="0" sql="datetime" quote="" bytes="8" note="Jan 1, 1753 to Dec 31, 9999" />
  43 + <type label="SmallDateTime" length="0" sql="smalldatetime" quote="" bytes="4" note="Jan 1, 1900 to Dec 31, 2079" />
  44 + </group>
  45 +
  46 + <group label="Binary" color="rgb(200,200,255)">
  47 + <type label="Binary" length="0" sql="binary" quote="'" bytes="n" note="Fixed-length binary data with a maximum length of 8,000 bytes" />
  48 + <type label="Varbinary" length="1" sql="varbinary" quote="'" bytes="m &lt;= n" note="Variable-length binary data with a maximum length of 8,000 bytes" />
  49 + </group>
  50 +
  51 + <group label="Miscellaneous" color="rgb(200,220,255)">
  52 + <type label="Bit" length="0" sql="bit" quote="" bytes="1" note="Boolean: 1 or 0" />
  53 + <type label="Image" length="1" sql="image" re="BLOB" quote="" bytes="0 to 2,147,483,647" note="Variable-length binary data with a maximum length of 2,147,483,647 bytes" />
  54 + <type label="Timestamp" length="0" sql="timestamp" quote="" bytes="8" note="Locally unique binary number updated as a row gets updated" />
  55 + <type label="SQL Variant" length="1" sql="sql_variant" quote="" bytes="" note="Stores any datatype except text, ntext, image, timestamp" />
  56 + <type label="Uniqueidentifier" length="1" sql="uniqueidentifier" quote="" bytes="16" note="GUID" />
  57 + </group>
  58 +</datatypes>
... ...
resources/js/hayamiki_designer/db/mssql/output.xsl 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!--
  3 + XML 2 MsSQL XSL transformation for WWW SQL Designer v 2.x
  4 + Version: 0.2
  5 + Author: peter@pcurd.co.uk (Peter) 17/03/2009
  6 + Author: schliden@gmail.com
  7 +-->
  8 +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  9 +<xsl:output method="text"/>
  10 +<xsl:template match="/sql">
  11 +
  12 +<!-- tables -->
  13 + <xsl:for-each select="table">
  14 + <xsl:text>CREATE TABLE [</xsl:text>
  15 + <xsl:value-of select="@name"/>
  16 + <xsl:text>] (
  17 +</xsl:text>
  18 + <xsl:for-each select="row">
  19 + <xsl:text> [</xsl:text>
  20 + <xsl:value-of select="@name"/>
  21 + <xsl:text>] </xsl:text>
  22 +
  23 + <xsl:value-of select="datatype"/>
  24 + <xsl:text> </xsl:text>
  25 +
  26 + <xsl:if test="@null = 0">
  27 + <xsl:text>NOT NULL </xsl:text>
  28 + </xsl:if>
  29 +
  30 + <xsl:if test="@autoincrement = 1">
  31 + <xsl:text>IDENTITY (1, 1) </xsl:text>
  32 + </xsl:if>
  33 +
  34 + <xsl:if test="not (position()=last())">
  35 + <xsl:text>,</xsl:text>
  36 + </xsl:if>
  37 +
  38 + <xsl:if test="comment">
  39 + <xsl:text> -- </xsl:text><xsl:value-of select="comment"/>
  40 + </xsl:if>
  41 +
  42 + <xsl:if test="not (position()=last())">
  43 + <xsl:text>
  44 +</xsl:text>
  45 + </xsl:if>
  46 + </xsl:for-each>
  47 +
  48 +
  49 + <xsl:for-each select="key">
  50 + <xsl:if test="@type = 'PRIMARY' or @type = 'FULLTEXT' or @type = 'UNIQUE'">
  51 + <xsl:text>,
  52 +</xsl:text>
  53 +
  54 + <xsl:if test="not (@name='')">
  55 + <xsl:text>CONSTRAINT </xsl:text>
  56 + <xsl:value-of select="@name"/>
  57 + </xsl:if>
  58 + <xsl:choose>
  59 + <xsl:when test="@type = 'PRIMARY'"> PRIMARY KEY (</xsl:when>
  60 + <xsl:when test="@type = 'FULLTEXT'"> FULLTEXT KEY (</xsl:when>
  61 + <xsl:when test="@type = 'UNIQUE'"> UNIQUE KEY (</xsl:when>
  62 + <!-- <xsl:otherwise>KEY (</xsl:otherwise> --> <!-- No otherwise for MSSQL -->
  63 + </xsl:choose>
  64 +
  65 + <!-- MSSQL only recognises these 'key' types -->
  66 +
  67 +
  68 + <xsl:for-each select="part">
  69 + <xsl:text>[</xsl:text><xsl:value-of select="."/><xsl:text>]</xsl:text>
  70 + <xsl:if test="not (position() = last())">
  71 + <xsl:text>, </xsl:text>
  72 + </xsl:if>
  73 + </xsl:for-each>
  74 + <xsl:text>)</xsl:text>
  75 + </xsl:if>
  76 +
  77 +
  78 + </xsl:for-each>
  79 +
  80 +
  81 +
  82 +
  83 + <xsl:text>
  84 +) ON [PRIMARY]
  85 +GO
  86 +
  87 +</xsl:text>
  88 +
  89 + </xsl:for-each>
  90 +<!-- fk -->
  91 + <xsl:for-each select="table">
  92 + <xsl:for-each select="row">
  93 + <xsl:for-each select="relation">
  94 + <xsl:text>ALTER TABLE [</xsl:text>
  95 + <xsl:value-of select="../../@name"/>
  96 + <xsl:text>] ADD FOREIGN KEY (</xsl:text>
  97 + <xsl:value-of select="../@name"/>
  98 + <xsl:text>) REFERENCES [</xsl:text>
  99 + <xsl:value-of select="@table"/>
  100 + <xsl:text>] ([</xsl:text>
  101 + <xsl:value-of select="@row"/>
  102 + <xsl:text>]);
  103 +
  104 +</xsl:text>
  105 + </xsl:for-each>
  106 + </xsl:for-each>
  107 + </xsl:for-each>
  108 +
  109 + <!-- fk -->
  110 + <xsl:for-each select="table">
  111 + <xsl:for-each select="key">
  112 + <xsl:if test="@type = 'INDEX'">
  113 + <xsl:text>CREATE INDEX </xsl:text>
  114 + <xsl:value-of select="@name"/>
  115 + <xsl:text> ON [</xsl:text>
  116 + <xsl:value-of select="../@name"/>
  117 + <xsl:text>] ([</xsl:text>
  118 + <xsl:for-each select="part">
  119 + <xsl:value-of select="."/>
  120 + <xsl:text>]</xsl:text>
  121 + <xsl:if test="not (position() = last())">
  122 + <xsl:text>, </xsl:text>
  123 + </xsl:if>
  124 + </xsl:for-each>
  125 + <xsl:text>);
  126 +</xsl:text>
  127 + </xsl:if>
  128 + </xsl:for-each>
  129 + </xsl:for-each>
  130 +
  131 +
  132 +</xsl:template>
  133 +</xsl:stylesheet>
0 134 \ No newline at end of file
... ...
resources/js/hayamiki_designer/db/mysql/datatypes.xml 0 → 100644
  1 +<?xml version="1.0"?>
  2 +<datatypes db="mysql">
  3 + <group label="Numeric" color="rgb(238,238,170)">
  4 + <type label="Integer" length="0" sql="INTEGER" quote="" />
  5 + <type label="TINYINT" length="0" sql="TINYINT" quote="" />
  6 + <type label="SMALLINT" length="0" sql="SMALLINT" quote="" />
  7 + <type label="MEDIUMINT" length="0" sql="MEDIUMINT" quote="" />
  8 + <type label="INT" length="0" sql="INT" quote="" />
  9 + <type label="BIGINT" length="0" sql="BIGINT" quote="" />
  10 + <type label="Decimal" length="1" sql="DECIMAL" re="DEC" quote="" />
  11 + <type label="Single precision" length="0" sql="FLOAT" quote="" />
  12 + <type label="Double precision" length="0" sql="DOUBLE" re="DOUBLE" quote="" />
  13 + </group>
  14 +
  15 + <group label="Character" color="rgb(255,200,200)">
  16 + <type label="Char" length="1" sql="CHAR" quote="'"/>
  17 + <type label="Varchar" length="1" sql="VARCHAR" quote="'"/>
  18 + <type label="Text" length="0" sql="MEDIUMTEXT" re="TEXT" quote="'"/>
  19 + <type label="Binary" length="1" sql="BINARY" quote="'"/>
  20 + <type label="Varbinary" length="1" sql="VARBINARY" quote="'"/>
  21 + <type label="BLOB" length="0" sql="BLOB" re="BLOB" quote="'"/>
  22 + </group>
  23 +
  24 + <group label="Date &amp; Time" color="rgb(200,255,200)">
  25 + <type label="Date" length="0" sql="DATE" quote="'" />
  26 + <type label="Time" length="0" sql="TIME" quote="'" />
  27 + <type label="Datetime" length="0" sql="DATETIME" quote="'" />
  28 + <type label="Year" length="0" sql="YEAR" quote="" />
  29 + <type label="Timestamp" length="0" sql="TIMESTAMP" quote="'" />
  30 + </group>
  31 +
  32 + <group label="Miscellaneous" color="rgb(200,200,255)">
  33 + <type label="ENUM" length="1" sql="ENUM" quote="" />
  34 + <type label="SET" length="1" sql="SET" quote="" />
  35 + <type label="Bit" length="0" sql="bit" quote="" />
  36 + </group>
  37 +</datatypes>
... ...
resources/js/hayamiki_designer/db/mysql/output.xsl 0 → 100644
  1 +<?xml version="1.0" ?>
  2 +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3 +<xsl:output method="text"/>
  4 +
  5 +<xsl:template name="replace-substring">
  6 + <xsl:param name="value" />
  7 + <xsl:param name="from" />
  8 + <xsl:param name="to" />
  9 + <xsl:choose>
  10 + <xsl:when test="contains($value,$from)">
  11 + <xsl:value-of select="substring-before($value,$from)" />
  12 + <xsl:value-of select="$to" />
  13 + <xsl:call-template name="replace-substring">
  14 + <xsl:with-param name="value" select="substring-after($value,$from)" />
  15 + <xsl:with-param name="from" select="$from" />
  16 + <xsl:with-param name="to" select="$to" />
  17 + </xsl:call-template>
  18 + </xsl:when>
  19 + <xsl:otherwise>
  20 + <xsl:value-of select="$value" />
  21 + </xsl:otherwise>
  22 + </xsl:choose>
  23 +</xsl:template>
  24 +
  25 +<xsl:template match="/sql">
  26 +
  27 +<xsl:text>
  28 +-- ---
  29 +-- Globals
  30 +-- ---
  31 +
  32 +-- SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
  33 +-- SET FOREIGN_KEY_CHECKS=0;
  34 +
  35 +</xsl:text>
  36 +
  37 +<!-- tables -->
  38 + <xsl:for-each select="table">
  39 + <xsl:text>-- ---
  40 +-- Table '</xsl:text>
  41 + <xsl:value-of select="@name" />
  42 + <xsl:text>'
  43 +-- </xsl:text>
  44 + <xsl:if test="comment">
  45 + <xsl:call-template name="replace-substring">
  46 + <xsl:with-param name="value" select="comment" />
  47 + <xsl:with-param name="from" select='"&apos;"' />
  48 + <xsl:with-param name="to" select='"&apos;&apos;"' />
  49 + </xsl:call-template>
  50 + </xsl:if>
  51 + <xsl:text>
  52 +-- ---
  53 +
  54 +</xsl:text>
  55 +
  56 +<xsl:text>DROP TABLE IF EXISTS `</xsl:text>
  57 + <xsl:value-of select="@name" />
  58 + <xsl:text>`;
  59 +
  60 +</xsl:text>
  61 +
  62 +<xsl:text>CREATE TABLE `</xsl:text>
  63 + <xsl:value-of select="@name" />
  64 + <xsl:text>` (
  65 +</xsl:text>
  66 + <xsl:for-each select="row">
  67 + <xsl:text> `</xsl:text>
  68 + <xsl:value-of select="@name" />
  69 + <xsl:text>` </xsl:text>
  70 +
  71 + <xsl:value-of select="datatype" />
  72 + <xsl:text></xsl:text>
  73 +
  74 + <xsl:choose>
  75 + <xsl:when test="@null = 0"> NOT NULL</xsl:when>
  76 + <xsl:otherwise> NULL</xsl:otherwise>
  77 + </xsl:choose>
  78 +
  79 + <xsl:if test="@autoincrement = 1">
  80 + <xsl:text> AUTO_INCREMENT</xsl:text>
  81 + </xsl:if>
  82 +
  83 + <xsl:if test="default">
  84 + <xsl:text> DEFAULT </xsl:text>
  85 + <xsl:value-of select="default" />
  86 + <xsl:text></xsl:text>
  87 + </xsl:if>
  88 +
  89 + <xsl:if test="comment">
  90 + <xsl-text> COMMENT '</xsl-text>
  91 + <xsl:call-template name="replace-substring">
  92 + <xsl:with-param name="value" select="substring(comment, 1, 60)" />
  93 + <xsl:with-param name="from" select='"&apos;"' />
  94 + <xsl:with-param name="to" select='"&apos;&apos;"' />
  95 + </xsl:call-template>
  96 + <xsl-text>'</xsl-text>
  97 + </xsl:if>
  98 +
  99 + <xsl:if test="not (position()=last())">
  100 + <xsl:text>,
  101 +</xsl:text>
  102 + </xsl:if>
  103 + </xsl:for-each>
  104 +
  105 +<!-- keys -->
  106 + <xsl:for-each select="key">
  107 + <xsl:text>,
  108 +</xsl:text>
  109 + <xsl:choose>
  110 + <xsl:when test="@type = 'PRIMARY'"> PRIMARY KEY (</xsl:when>
  111 + <xsl:when test="@type = 'FULLTEXT'"> FULLTEXT KEY (</xsl:when>
  112 + <xsl:when test="@type = 'UNIQUE'"> UNIQUE KEY (</xsl:when>
  113 + <xsl:otherwise>KEY (</xsl:otherwise>
  114 + </xsl:choose>
  115 +
  116 + <xsl:for-each select="part">
  117 + <xsl:text>`</xsl:text><xsl:value-of select="." /><xsl:text>`</xsl:text>
  118 + <xsl:if test="not (position() = last())">
  119 + <xsl:text>, </xsl:text>
  120 + </xsl:if>
  121 + </xsl:for-each>
  122 + <xsl:text>)</xsl:text>
  123 +
  124 + </xsl:for-each>
  125 +
  126 + <xsl:text>
  127 +)</xsl:text>
  128 +
  129 +
  130 +
  131 + <xsl:if test="comment">
  132 +<xsl-text> COMMENT '</xsl-text>
  133 + <xsl:call-template name="replace-substring">
  134 + <xsl:with-param name="value" select="substring(comment, 1, 60)" />
  135 + <xsl:with-param name="from" select='"&apos;"' />
  136 + <xsl:with-param name="to" select='"&apos;&apos;"' />
  137 + </xsl:call-template>
  138 +<xsl-text>'</xsl-text>
  139 + </xsl:if>
  140 +<xsl-text>;
  141 +
  142 +</xsl-text>
  143 +
  144 + </xsl:for-each>
  145 +
  146 +<xsl:text>-- ---
  147 +-- Foreign Keys
  148 +-- ---
  149 +
  150 +</xsl:text>
  151 +
  152 +<!-- fk -->
  153 + <xsl:for-each select="table">
  154 + <xsl:for-each select="row">
  155 + <xsl:for-each select="relation">
  156 + <xsl:text>ALTER TABLE `</xsl:text>
  157 + <xsl:value-of select="../../@name" />
  158 + <xsl:text>` ADD FOREIGN KEY (</xsl:text>
  159 + <xsl:value-of select="../@name" />
  160 + <xsl:text>) REFERENCES `</xsl:text>
  161 + <xsl:value-of select="@table" />
  162 + <xsl:text>` (`</xsl:text>
  163 + <xsl:value-of select="@row" />
  164 + <xsl:text>`);
  165 +</xsl:text>
  166 + </xsl:for-each>
  167 + </xsl:for-each>
  168 + </xsl:for-each>
  169 +
  170 +<xsl:text>
  171 +-- ---
  172 +-- Table Properties
  173 +-- ---
  174 +
  175 +</xsl:text>
  176 + <xsl:for-each select="table">
  177 + <xsl:text>-- ALTER TABLE `</xsl:text><xsl:value-of select="@name" />
  178 + <xsl:text>` ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
  179 +</xsl:text>
  180 + </xsl:for-each>
  181 +
  182 +
  183 +
  184 +<xsl:text>
  185 +-- ---
  186 +-- Test Data
  187 +-- ---
  188 +
  189 +</xsl:text>
  190 + <xsl:for-each select="table">
  191 + <xsl:text>-- INSERT INTO `</xsl:text><xsl:value-of select="@name" />
  192 + <xsl:text>` (</xsl:text>
  193 + <xsl:for-each select="row">
  194 + <xsl:text>`</xsl:text>
  195 + <xsl:value-of select="@name" />
  196 + <xsl:text>`</xsl:text>
  197 + <xsl:if test="not (position()=last())">
  198 + <xsl:text>,</xsl:text>
  199 + </xsl:if>
  200 + </xsl:for-each>
  201 + <xsl:text>) VALUES
  202 +-- (</xsl:text>
  203 + <xsl:for-each select="row">
  204 + <xsl:text>''</xsl:text>
  205 +
  206 + <xsl:if test="not (position()=last())">
  207 + <xsl:text>,</xsl:text>
  208 + </xsl:if>
  209 + </xsl:for-each>
  210 +
  211 + <xsl:text>);
  212 +</xsl:text>
  213 + </xsl:for-each>
  214 +
  215 +
  216 +</xsl:template>
  217 +</xsl:stylesheet>
  218 +
... ...
resources/js/hayamiki_designer/db/oracle/datatypes.xml 0 → 100644
  1 +<?xml version="1.0"?>
  2 +<datatypes db="oracle">
  3 + <group label="Number" color="rgb(238,238,170)">
  4 + <type label="NUMERIC" length="0" sql="DECIMAL" re="INT" quote="" />
  5 + <type label="NUMBER" length="0" sql="DECIMAL" re="INT" quote="" />
  6 + <type label="Decimal" length="1" sql="DECIMAL" re="DEC" quote="" />
  7 + <type label="Single precision" length="0" sql="FLOAT" quote="" />
  8 + <type label="Double precision" length="0" sql="DOUBLE" re="DOUBLE" quote="" />
  9 + </group>
  10 +
  11 + <group label="Character" color="rgb(255,200,200)">
  12 + <type label="Char" length="1" sql="CHAR" quote="'"/>
  13 + <type label="NCHAR" length="1" sql="NCHAR" quote="'"/>
  14 + <type label="Varchar2" length="1" sql="VARCHAR2" quote="'"/>
  15 + <type label="CLOB" length="0" sql="MEDIUMTEXT" re="TEXT" quote="'"/>
  16 + <type label="Binary" length="1" sql="BINARY" quote="'"/>
  17 + <type label="Varbinary" length="1" sql="VARBINARY" quote="'"/>
  18 + <type label="BLOB" length="0" sql="BLOB" re="BLOB" quote="'"/>
  19 + </group>
  20 +
  21 + <group label="Date &amp; Time" color="rgb(200,255,200)">
  22 + <type label="Date" length="0" sql="DATE" quote="'" />
  23 + <type label="Timestamp" length="0" sql="TIMESTAMP" quote="'" />
  24 + </group>
  25 +
  26 + <group label="Miscellaneous" color="rgb(200,200,255)">
  27 + <type label="ENUM" length="1" sql="ENUM" quote="" />
  28 + <type label="SET" length="1" sql="SET" quote="" />
  29 + </group>
  30 +</datatypes>
... ...
resources/js/hayamiki_designer/db/oracle/output.xsl 0 → 100644
  1 +<?xml version="1.0" ?>
  2 +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3 +<xsl:output method="text"/>
  4 +
  5 +<xsl:template name="replace-substring">
  6 + <xsl:param name="value" />
  7 + <xsl:param name="from" />
  8 + <xsl:param name="to" />
  9 + <xsl:choose>
  10 + <xsl:when test="contains($value,$from)">
  11 + <xsl:value-of select="substring-before($value,$from)" />
  12 + <xsl:value-of select="$to" />
  13 + <xsl:call-template name="replace-substring">
  14 + <xsl:with-param name="value" select="substring-after($value,$from)" />
  15 + <xsl:with-param name="from" select="$from" />
  16 + <xsl:with-param name="to" select="$to" />
  17 + </xsl:call-template>
  18 + </xsl:when>
  19 + <xsl:otherwise>
  20 + <xsl:value-of select="$value" />
  21 + </xsl:otherwise>
  22 + </xsl:choose>
  23 +</xsl:template>
  24 +
  25 +<xsl:template match="/sql">
  26 +
  27 +<!-- tables -->
  28 + <xsl:for-each select="table">
  29 + <xsl:variable name="table" select="@name" />
  30 + <xsl:text>CREATE TABLE `</xsl:text>
  31 + <xsl:value-of select="@name" />
  32 + <xsl:text>` (
  33 +</xsl:text>
  34 + <xsl:for-each select="row">
  35 + <xsl:text>`</xsl:text>
  36 + <xsl:value-of select="@name" />
  37 + <xsl:text>` </xsl:text>
  38 +
  39 + <xsl:value-of select="datatype" />
  40 + <xsl:text> </xsl:text>
  41 +
  42 + <xsl:if test="@null = 0">
  43 + <xsl:text>NOT NULL </xsl:text>
  44 + </xsl:if>
  45 +
  46 + <!-- needs to be fixed using sequences
  47 + <xsl:if test="@autoincrement = 1">
  48 + <xsl:text>AUTO_INCREMENT </xsl:text>
  49 + </xsl:if>
  50 + -->
  51 +
  52 + <xsl:if test="default">
  53 + <xsl:text>DEFAULT </xsl:text>
  54 + <xsl:value-of select="default" />
  55 + <xsl:text> </xsl:text>
  56 + </xsl:if>
  57 +
  58 + <xsl:if test="not (position()=last())">
  59 + <xsl:text>,
  60 +</xsl:text>
  61 + </xsl:if>
  62 + </xsl:for-each>
  63 +
  64 +<!-- keys -->
  65 + <xsl:for-each select="key">
  66 + <xsl:text>,
  67 +</xsl:text>
  68 + <xsl:choose>
  69 + <xsl:when test="@type = 'PRIMARY'">PRIMARY KEY (</xsl:when>
  70 + <xsl:when test="@type = 'FULLTEXT'">FULLTEXT KEY (</xsl:when>
  71 + <xsl:when test="@type = 'UNIQUE'">UNIQUE KEY (</xsl:when>
  72 + <xsl:otherwise>KEY (</xsl:otherwise>
  73 + </xsl:choose>
  74 +
  75 + <xsl:for-each select="part">
  76 + <xsl:text>`</xsl:text><xsl:value-of select="." /><xsl:text>`</xsl:text>
  77 + <xsl:if test="not (position() = last())">
  78 + <xsl:text>, </xsl:text>
  79 + </xsl:if>
  80 + </xsl:for-each>
  81 + <xsl:text>)</xsl:text>
  82 +
  83 + </xsl:for-each>
  84 +
  85 + <xsl:text>
  86 +);
  87 +</xsl:text>
  88 +
  89 + <xsl:if test="comment">
  90 + <xsl:text>COMMENT ON TABLE `</xsl:text>
  91 + <xsl:value-of select="@name" />
  92 + <xsl:text>` IS '</xsl:text>
  93 + <xsl:call-template name="replace-substring">
  94 + <xsl:with-param name="value" select="comment" />
  95 + <xsl:with-param name="from" select='"&apos;"' />
  96 + <xsl:with-param name="to" select='"&apos;&apos;"' />
  97 + </xsl:call-template>
  98 + <xsl:text>';
  99 +</xsl:text>
  100 + </xsl:if>
  101 +
  102 + <xsl:for-each select="row">
  103 + <xsl:if test="comment">
  104 + <xsl:text>COMMENT ON COLUMN `</xsl:text>
  105 + <xsl:value-of select="$table" />
  106 + <xsl:text>`.`</xsl:text>
  107 + <xsl:value-of select="@name" />
  108 + <xsl:text>` IS '</xsl:text>
  109 + <xsl:call-template name="replace-substring">
  110 + <xsl:with-param name="value" select="comment" />
  111 + <xsl:with-param name="from" select='"&apos;"' />
  112 + <xsl:with-param name="to" select='"&apos;&apos;"' />
  113 + </xsl:call-template>
  114 + <xsl:text>';
  115 +</xsl:text>
  116 + </xsl:if>
  117 + </xsl:for-each>
  118 +
  119 + </xsl:for-each>
  120 +
  121 +<!-- fk -->
  122 + <xsl:for-each select="table">
  123 + <xsl:for-each select="row">
  124 + <xsl:for-each select="relation">
  125 + <xsl:text>ALTER TABLE `</xsl:text>
  126 + <xsl:value-of select="../../@name" />
  127 + <xsl:text>` ADD FOREIGN KEY (</xsl:text>
  128 + <xsl:value-of select="../@name" />
  129 + <xsl:text>) REFERENCES `</xsl:text>
  130 + <xsl:value-of select="@table" />
  131 + <xsl:text>` (`</xsl:text>
  132 + <xsl:value-of select="@row" />
  133 + <xsl:text>`);
  134 +</xsl:text>
  135 + </xsl:for-each>
  136 + </xsl:for-each>
  137 + </xsl:for-each>
  138 +
  139 +</xsl:template>
  140 +</xsl:stylesheet>
0 141 \ No newline at end of file
... ...
resources/js/hayamiki_designer/db/postgresql/datatypes.xml 0 → 100644
  1 +<?xml version="1.0"?>
  2 +<datatypes db="postgresql">
  3 + <group label="Numeric" color="rgb(238,238,170)">
  4 + <type label="Integer" length="0" sql="INTEGER" re="INT" quote="" />
  5 + <type label="Small Integer" length="0" sql="SMALLINT" quote="" />
  6 + <type label="Big Integer" length="0" sql="BIGINT" quote="" />
  7 + <type label="Decimal" length="1" sql="DECIMAL" re="numeric" quote="" />
  8 + <type label="Serial" length="0" sql="SERIAL" re="SERIAL4" fk="Integer" quote="" />
  9 + <type label="Big Serial" length="0" sql="BIGSERIAL" re="SERIAL8" fk="Big Integer" quote="" />
  10 + <type label="Real" length="0" sql="BIGINT" quote="" />
  11 + <type label="Single precision" length="0" sql="FLOAT" quote="" />
  12 + <type label="Double precision" length="0" sql="DOUBLE" re="DOUBLE" quote="" />
  13 + </group>
  14 +
  15 + <group label="Character" color="rgb(255,200,200)">
  16 + <type label="Char" length="1" sql="CHAR" quote="'"/>
  17 + <type label="Varchar" length="1" sql="VARCHAR" re="CHARACTER VARYING" quote="'"/>
  18 + <type label="Text" length="0" sql="TEXT" quote="'"/>
  19 + <type label="Binary" length="1" sql="BYTEA" quote="'"/>
  20 + <type label="Boolean" length="0" sql="BOOLEAN" quote="'"/>
  21 + </group>
  22 +
  23 + <group label="Date &amp; Time" color="rgb(200,255,200)">
  24 + <type label="Date" length="0" sql="DATE" quote="'" />
  25 + <type label="Time" length="1" sql="TIME" quote="'" />
  26 + <type label="Time w/ TZ" length="0" sql="TIME WITH TIME ZONE" quote="'" />
  27 + <type label="Interval" length="1" sql="INTERVAL" quote="'" />
  28 + <type label="Timestamp" length="1" sql="TIMESTAMP" quote="'" />
  29 + <type label="Timestamp w/ TZ" length="0" sql="TIMESTAMP WITH TIME ZONE" quote="'" />
  30 + <type label="Timestamp wo/ TZ" length="0" sql="TIMESTAMP WITHOUT TIME ZONE" quote="'" />
  31 + </group>
  32 +
  33 + <group label="Miscellaneous" color="rgb(200,200,255)">
  34 + <type label="XML" length="1" sql="XML" quote="'" />
  35 + <type label="Bit" length="1" sql="BIT" quote="'" />
  36 + <type label="Bit Varying" length="1" sql="VARBIT" re="BIT VARYING" quote="'" />
  37 + <type label="Inet Host Addr" length="0" sql="INET" quote="'" />
  38 + <type label="Inet CIDR Addr" length="0" sql="CIDR" quote="'" />
  39 + <type label="Geometry" length="0" sql="GEOMETRY" quote="'" />
  40 + </group>
  41 +</datatypes>
... ...
resources/js/hayamiki_designer/db/postgresql/output.xsl 0 → 100644
  1 +<?xml version="1.0" ?>
  2 +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3 +<xsl:output method="text"/>
  4 +
  5 +<xsl:template name="replace-substring">
  6 + <xsl:param name="value" />
  7 + <xsl:param name="from" />
  8 + <xsl:param name="to" />
  9 + <xsl:choose>
  10 + <xsl:when test="contains($value,$from)">
  11 + <xsl:value-of select="substring-before($value,$from)" />
  12 + <xsl:value-of select="$to" />
  13 + <xsl:call-template name="replace-substring">
  14 + <xsl:with-param name="value" select="substring-after($value,$from)" />
  15 + <xsl:with-param name="from" select="$from" />
  16 + <xsl:with-param name="to" select="$to" />
  17 + </xsl:call-template>
  18 + </xsl:when>
  19 + <xsl:otherwise>
  20 + <xsl:value-of select="$value" />
  21 + </xsl:otherwise>
  22 + </xsl:choose>
  23 +</xsl:template>
  24 +
  25 +<xsl:template match="/sql">
  26 +
  27 +<!-- tables -->
  28 + <xsl:for-each select="table">
  29 + <xsl:text>CREATE TABLE "</xsl:text>
  30 + <xsl:value-of select="@name" />
  31 + <xsl:text>" (
  32 +</xsl:text>
  33 + <xsl:for-each select="row">
  34 + <xsl:text>"</xsl:text>
  35 + <xsl:value-of select="@name" />
  36 + <xsl:text>" </xsl:text>
  37 +
  38 + <xsl:choose>
  39 + <xsl:when test="@autoincrement = 1">
  40 + <!-- use postgresql SERIAL shortcut for columns marked as
  41 + auto-increment. this creates integer column,
  42 + corresponding sequence, and default expression for the
  43 + column with nextval(). see:
  44 + http://www.postgresql.org/docs/current/static/datatype-numeric.html#DATATYPE-SERIAL
  45 + -->
  46 + <xsl:text> SERIAL</xsl:text>
  47 + </xsl:when>
  48 + <xsl:otherwise>
  49 + <xsl:value-of select="datatype" />
  50 + </xsl:otherwise>
  51 + </xsl:choose>
  52 + <xsl:text> </xsl:text>
  53 +
  54 + <xsl:if test="@null = 0">
  55 + <xsl:text>NOT NULL </xsl:text>
  56 + </xsl:if>
  57 +
  58 + <xsl:if test="default">
  59 + <xsl:if test=" default != 'NULL' ">
  60 + <xsl:text>DEFAULT </xsl:text>
  61 + <xsl:value-of select="default" />
  62 + <xsl:text> </xsl:text>
  63 + </xsl:if>
  64 + </xsl:if>
  65 +
  66 + <xsl:if test="comment">
  67 + <xsl:text>/* </xsl:text>
  68 + <xsl:value-of select="comment"/>
  69 + <xsl:text> */</xsl:text>
  70 + </xsl:if>
  71 +
  72 + <xsl:if test="not (position()=last())">
  73 + <xsl:text>,
  74 +</xsl:text>
  75 + </xsl:if>
  76 + </xsl:for-each>
  77 +
  78 +<!-- keys -->
  79 + <xsl:for-each select="key">
  80 + <xsl:text>,
  81 +</xsl:text>
  82 + <xsl:choose>
  83 + <xsl:when test="@type = 'PRIMARY'">PRIMARY KEY (</xsl:when>
  84 + <xsl:when test="@type = 'UNIQUE'">UNIQUE (</xsl:when>
  85 + <xsl:otherwise>KEY (</xsl:otherwise>
  86 + </xsl:choose>
  87 +
  88 + <xsl:for-each select="part">
  89 + <xsl:text>"</xsl:text><xsl:value-of select="." /><xsl:text>"</xsl:text>
  90 + <xsl:if test="not (position() = last())">
  91 + <xsl:text>, </xsl:text>
  92 + </xsl:if>
  93 + </xsl:for-each>
  94 + <xsl:text>)</xsl:text>
  95 +
  96 + </xsl:for-each>
  97 +
  98 + <xsl:text>
  99 +);
  100 +</xsl:text>
  101 +
  102 + <xsl:if test="comment">
  103 + <xsl:text>COMMENT ON TABLE "</xsl:text>
  104 + <xsl:value-of select="@name"/>
  105 + <xsl:text>" IS '</xsl:text>
  106 + <xsl:call-template name="replace-substring">
  107 + <xsl:with-param name="value" select="comment" />
  108 + <xsl:with-param name="from" select='"&apos;"' />
  109 + <xsl:with-param name="to" select='"&apos;&apos;"' />
  110 + </xsl:call-template>
  111 + <xsl:text>';
  112 +</xsl:text>
  113 + </xsl:if>
  114 +
  115 +<!-- column comments -->
  116 + <xsl:for-each select="row">
  117 + <xsl:if test="comment">
  118 + <xsl:text>COMMENT ON COLUMN "</xsl:text>
  119 + <xsl:value-of select="../@name"/>
  120 + <xsl:text>"."</xsl:text>
  121 + <xsl:value-of select="@name"/>
  122 + <xsl:text>" IS '</xsl:text>
  123 + <xsl:call-template name="replace-substring">
  124 + <xsl:with-param name="value" select="comment" />
  125 + <xsl:with-param name="from" select='"&apos;"' />
  126 + <xsl:with-param name="to" select='"&apos;&apos;"' />
  127 + </xsl:call-template>
  128 + <xsl:text>';
  129 +</xsl:text>
  130 + </xsl:if>
  131 + </xsl:for-each>
  132 +
  133 + <xsl:text>
  134 +</xsl:text>
  135 + </xsl:for-each>
  136 +
  137 +<!-- fk -->
  138 + <xsl:for-each select="table">
  139 + <xsl:for-each select="row">
  140 + <xsl:for-each select="relation">
  141 + <xsl:text>ALTER TABLE "</xsl:text>
  142 + <xsl:value-of select="../../@name" />
  143 + <xsl:text>" ADD FOREIGN KEY ("</xsl:text>
  144 + <xsl:value-of select="../@name" />
  145 + <xsl:text>") REFERENCES "</xsl:text>
  146 + <xsl:value-of select="@table" />
  147 + <xsl:text>" ("</xsl:text>
  148 + <xsl:value-of select="@row" />
  149 + <xsl:text>");
  150 +</xsl:text>
  151 + </xsl:for-each>
  152 + </xsl:for-each>
  153 + </xsl:for-each>
  154 +
  155 +</xsl:template>
  156 +</xsl:stylesheet>
... ...
resources/js/hayamiki_designer/db/sqlalchemy/datatypes.xml 0 → 100644
  1 +<?xml version="1.0"?>
  2 +<datatypes db="sqlalchemy">
  3 + <group label="Numeric" color="rgb(238,238,170)">
  4 + <type label="Integer" length="1" sql="sa.Integer" re="INTEGER" quote=""/>
  5 + <type label="Float" length="1" sql="sa.Float" re="DOUBLE" quote=""/>
  6 + <type label="Decimal" length="1" sql="sa.Numeric" re="DOUBLE" quote=""/>
  7 + </group>
  8 +
  9 + <group label="Character" color="rgb(255,200,200)">
  10 + <type label="String" length="1" sql="sa.String" quote="'"/>
  11 + <type label="Text" length="0" sql="sa.Text" quote="'"/>
  12 + </group>
  13 +
  14 + <group label="Date &amp; Time" color="rgb(200,255,200)">
  15 + <type label="Date" length="0" sql="sa.Date" quote="'"/>
  16 + <type label="Time" length="0" sql="sa.Time" quote="'"/>
  17 + <type label="Datetime" length="0" sql="sa.DateTime" quote="'"/>
  18 + <type label="Timestamp" length="0" sql="sa.Timestamp" quote="'"/>
  19 + <type label="Interval" length="0" sql="sa.Interval" quote="'"/>
  20 + </group>
  21 +
  22 + <group label="Miscellaneous" color="rgb(200,200,255)">
  23 + <type label="Boolean" length="0" sql="sa.Boolean" quote=""/>
  24 + <type label="BLOB" length="1" sql="sa.Binary" quote="'"/>
  25 + <type label="Pickle" length="0" sql="sa.PickleType" quote=""/>
  26 + </group>
  27 +</datatypes>
0 28 \ No newline at end of file
... ...
resources/js/hayamiki_designer/db/sqlalchemy/output.xsl 0 → 100644
  1 +<?xml version="1.0" encoding="us-ascii"?>
  2 +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  3 + <xsl:output method="text"/>
  4 +
  5 + <!-- Return length of element-->
  6 + <xsl:template name="getsize">
  7 + <xsl:param name="invalue"/>
  8 + <xsl:choose>
  9 + <xsl:when test="contains($invalue,'(')">
  10 + <xsl:variable name="part" select="substring-after($invalue,'(')"/>
  11 + <xsl:value-of select="substring-before($part,')')"/>
  12 + </xsl:when>
  13 + </xsl:choose>
  14 + </xsl:template>
  15 +
  16 + <!-- This is the root of output -->
  17 + <xsl:template match="/sql">
  18 + <xsl:text>db_engine = sa.create_engine('sqlite:///db.sqlite')&#xa;</xsl:text>
  19 + <xsl:text>metadata = sa.MetaData()&#xa;</xsl:text>
  20 + <!-- Use a table template to make the SA table object -->
  21 + <xsl:apply-templates select="table" />
  22 + <xsl:text>&#xa;</xsl:text>
  23 +
  24 + <!-- Construct the mapping objects -->
  25 + <xsl:text>&#xa;&#xa;# Mapping Objects</xsl:text>
  26 +
  27 + <xsl:for-each select="table">
  28 + <xsl:text>&#xa;</xsl:text>
  29 + <xsl:text>class </xsl:text>
  30 + <xsl:value-of select="@name"/>
  31 + <xsl:text>():&#xa;</xsl:text>
  32 + <xsl:text> def __init__(self</xsl:text>
  33 + <xsl:for-each select="row">
  34 + <xsl:text>, </xsl:text>
  35 + <xsl:value-of select="@name"/>
  36 + </xsl:for-each>
  37 + <xsl:text>):&#xa;</xsl:text>
  38 + <xsl:for-each select="row">
  39 + <xsl:text> self.</xsl:text>
  40 + <xsl:value-of select="@name"/>
  41 + <xsl:text> = </xsl:text>
  42 + <xsl:value-of select="@name"/>
  43 + <xsl:text>&#xa;</xsl:text>
  44 + </xsl:for-each>
  45 + <xsl:text>&#xa;</xsl:text>
  46 + <xsl:text> def __repr__(self):&#xa;</xsl:text>
  47 + <xsl:text> return "&lt;</xsl:text>
  48 + <xsl:value-of select="@name"/>
  49 + <xsl:text>(</xsl:text>
  50 + <xsl:for-each select="row">
  51 + <xsl:text>'%s'</xsl:text>
  52 + <xsl:if test="not (position()=last())">
  53 + <xsl:text>, </xsl:text>
  54 + </xsl:if>
  55 +
  56 + </xsl:for-each>
  57 + <xsl:text>)>" % (</xsl:text>
  58 + <xsl:for-each select="row">
  59 + <xsl:text>self.</xsl:text>
  60 + <xsl:value-of select="@name"/>
  61 + <xsl:if test="not (position()=last())">
  62 + <xsl:text>, </xsl:text>
  63 + </xsl:if>
  64 + </xsl:for-each>
  65 + <xsl:text>)&#xa;</xsl:text>
  66 + </xsl:for-each>
  67 +
  68 + <!-- Mapping the tables to the objects -->
  69 + <xsl:text>&#xa;&#xa;# Declare mappings</xsl:text>
  70 +
  71 + <xsl:for-each select="table">
  72 + <xsl:text>&#xa;mapper(</xsl:text>
  73 + <xsl:value-of select="@name"/>
  74 + <xsl:text>, </xsl:text>
  75 + <xsl:value-of select="@name"/>
  76 + <xsl:text>_table)</xsl:text>
  77 + </xsl:for-each>
  78 +
  79 + <!-- Create a session to manage the objects -->
  80 + <xsl:text>&#xa;&#xa;# Create a session</xsl:text>
  81 + <xsl:text>&#xa;session = sessionmaker(bind=db_engine)&#xa;</xsl:text>
  82 +
  83 + </xsl:template>
  84 +
  85 + <!-- What a Table look like -->
  86 + <xsl:template match="table">
  87 + <xsl:variable name="keys" select="''" />
  88 + <!-- First place the header -->
  89 + <xsl:text>&#xa;</xsl:text> <!-- Newline -->
  90 + <xsl:text>&#xa;# Table definition - </xsl:text><xsl:value-of select="@name"/>
  91 + <xsl:text>&#xa;# </xsl:text><xsl:value-of select="./comment"/>
  92 + <xsl:text>&#xa;</xsl:text>
  93 + <xsl:value-of select="@name"/>
  94 + <xsl:text>_table = sa.Table("</xsl:text>
  95 + <xsl:value-of select="@name"/>
  96 + <xsl:text>", metadata,</xsl:text>
  97 + <!-- Next iterate over the Columns -->
  98 + <xsl:apply-templates select="row"/>
  99 + <!-- Finish the table -->
  100 + <xsl:text>)</xsl:text>
  101 + </xsl:template>
  102 +
  103 + <xsl:template match="row">
  104 + <xsl:text>&#xa;</xsl:text> <!-- Newline -->
  105 + <xsl:if test="comment">
  106 + <xsl:text> </xsl:text> <!-- Pretty indentation -->
  107 + </xsl:if>
  108 + <xsl:apply-templates select="comment"/>
  109 + <xsl:text> </xsl:text>
  110 + <xsl:text>sa.Column('</xsl:text>
  111 + <xsl:value-of select="@name"/>
  112 + <xsl:variable name="rowname" select="@name" />
  113 + <xsl:text>'</xsl:text>
  114 + <!-- Add params for child nodes -->
  115 + <xsl:apply-templates select="datatype"/>
  116 + <xsl:apply-templates select="relation"/>
  117 + <!-- Add params for node params -->
  118 + <xsl:if test="@null='1'">
  119 + <xsl:text>, nullable=True</xsl:text>
  120 + </xsl:if>
  121 + <xsl:if test="@autoincrement='1'">
  122 +<!-- <xsl:if test="datatype='sa.Integer'"> --> <!-- I'd like to make this type specific, but I can't seem to get it to work right. -->
  123 + <xsl:text>, autoincrement=True</xsl:text>
  124 +<!-- </xsl:if> -->
  125 + </xsl:if>
  126 + <!-- Add other params -->
  127 + <xsl:for-each select="../key[@type='PRIMARY']/part">
  128 + <xsl:if test="$rowname = text()">, primary_key=True</xsl:if>
  129 + </xsl:for-each>
  130 +
  131 + <!-- Finish the row -->
  132 + <xsl:text>)</xsl:text>
  133 + <xsl:if test="not (position()=last())">
  134 + <xsl:text>,</xsl:text>
  135 + </xsl:if>
  136 + </xsl:template>
  137 +
  138 + <xsl:template match="datatype">
  139 + <xsl:text>, </xsl:text>
  140 + <xsl:choose>
  141 + <xsl:when test="contains(. ,'(')">
  142 + <xsl:value-of select="substring-before(. ,'(')"/>
  143 + <xsl:if test=".='sa.String'">
  144 + <xsl:text>, length=</xsl:text>
  145 + <xsl:call-template name="getsize">
  146 + <xsl:with-param name="invalue" select="."/>
  147 + </xsl:call-template>
  148 + </xsl:if>
  149 + </xsl:when>
  150 + <xsl:otherwise>
  151 + <xsl:value-of select="."/>
  152 + </xsl:otherwise>
  153 + </xsl:choose>
  154 + </xsl:template>
  155 +
  156 + <xsl:template match="relation">
  157 + <xsl:text>, sa.ForeignKey("</xsl:text>
  158 + <xsl:value-of select="@table" />
  159 + <xsl:text>.</xsl:text>
  160 + <xsl:value-of select="@row" />
  161 + <xsl:text>")</xsl:text>
  162 + </xsl:template>
  163 +
  164 + <xsl:template match="comment">
  165 + <xsl:text># </xsl:text>
  166 + <xsl:value-of select="../@name"/>
  167 + <xsl:text> - </xsl:text>
  168 + <xsl:value-of select="." />
  169 + <xsl:text>&#xa;</xsl:text>
  170 + </xsl:template>
  171 +
  172 +</xsl:stylesheet>
0 173 \ No newline at end of file
... ...
resources/js/hayamiki_designer/db/sqlite/datatypes.xml 0 → 100644
  1 +<?xml version="1.0"?>
  2 +<datatypes db="sqlite">
  3 + <group label="Affinity">
  4 + <type label="Text" default="" length="1" sql="TEXT" quote="'" color="rgb(255,200,200)" />
  5 + <type label="Numeric" default="0" length="0" sql="NUMERIC" quote="" color="rgb(238,238,170)" />
  6 + <type label="Integer" default="0" length="0" sql="INTEGER" quote="" color="rgb(238,238,170)" />
  7 + <type label="Real" default="0" length="0" sql="REAL" quote="" color="rgb(238,238,170)" />
  8 + <type label="None" default="" length="0" sql="NONE" quote="" color="rgb(200,255,200)" />
  9 + </group>
  10 +</datatypes>
... ...
resources/js/hayamiki_designer/db/sqlite/output.xsl 0 → 100644
  1 +<?xml version="1.0" ?>
  2 +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3 +<xsl:output method="text"/>
  4 +<xsl:template match="/sql">
  5 +
  6 +<!-- tables -->
  7 + <xsl:for-each select="table">
  8 + <xsl:text>CREATE TABLE '</xsl:text>
  9 + <xsl:value-of select="@name" />
  10 + <xsl:text>' (
  11 +</xsl:text>
  12 + <xsl:for-each select="row">
  13 + <xsl:variable name="name" select="@name" />
  14 +
  15 + <xsl:text>'</xsl:text><xsl:value-of select="@name" /><xsl:text>' </xsl:text>
  16 +
  17 + <xsl:value-of select="datatype" />
  18 +
  19 + <xsl:if test="@null = 0">
  20 + <xsl:text> NOT NULL </xsl:text>
  21 + </xsl:if>
  22 +
  23 +
  24 + <xsl:if test="default">
  25 + <xsl:text> DEFAULT </xsl:text>
  26 + <xsl:value-of select="default" />
  27 + </xsl:if>
  28 +
  29 + <!-- autoincrement/primary key after column - only when composed of 1 part -->
  30 + <xsl:for-each select="../key">
  31 + <xsl:if test="@type = 'PRIMARY' and count(child::part) = 1">
  32 + <xsl:for-each select="part">
  33 + <xsl:if test="$name = .">
  34 + <xsl:text> PRIMARY KEY</xsl:text>
  35 + </xsl:if>
  36 + </xsl:for-each>
  37 + </xsl:if>
  38 + </xsl:for-each>
  39 +
  40 + <xsl:if test="@autoincrement = 1">
  41 + <xsl:text> AUTOINCREMENT</xsl:text>
  42 + </xsl:if>
  43 +
  44 + <!-- fk -->
  45 + <xsl:for-each select="relation">
  46 + <xsl:text> REFERENCES '</xsl:text>
  47 + <xsl:value-of select="@table" />
  48 + <xsl:text>' ('</xsl:text>
  49 + <xsl:value-of select="@row" />
  50 + <xsl:text>')</xsl:text>
  51 + </xsl:for-each>
  52 +
  53 + <xsl:if test="not (position()=last())">
  54 + <xsl:text>,
  55 +</xsl:text>
  56 + </xsl:if>
  57 + </xsl:for-each>
  58 +
  59 + <!-- keys after table -->
  60 + <xsl:for-each select="key">
  61 + <xsl:if test="@type = 'UNIQUE' or (@type = 'PRIMARY' and count(child::part) > 1)">
  62 + <xsl:text>,
  63 +</xsl:text>
  64 + <xsl:choose>
  65 + <xsl:when test="@type = 'PRIMARY'">PRIMARY KEY</xsl:when>
  66 + <xsl:when test="@type = 'UNIQUE'">UNIQUE</xsl:when>
  67 + </xsl:choose>
  68 + <xsl:text> (</xsl:text>
  69 +
  70 + <xsl:for-each select="part">
  71 + <xsl:value-of select="." />
  72 + <xsl:if test="not (position() = last())">
  73 + <xsl:text>, </xsl:text>
  74 + </xsl:if>
  75 + </xsl:for-each>
  76 + <xsl:text>)</xsl:text>
  77 + </xsl:if>
  78 +
  79 + </xsl:for-each>
  80 +
  81 + <xsl:text>
  82 +);
  83 +
  84 +</xsl:text>
  85 +
  86 + </xsl:for-each>
  87 +
  88 + <xsl:for-each select="table">
  89 + <xsl:for-each select="key">
  90 + <xsl:if test="@type = 'INDEX'">
  91 + <xsl:text>CREATE INDEX '</xsl:text>
  92 + <xsl:value-of select="@name" />
  93 + <xsl:text>' ON '</xsl:text>
  94 + <xsl:value-of select="../@name" />
  95 + <xsl:text>' ('</xsl:text>
  96 + <xsl:for-each select="part">
  97 + <xsl:value-of select="." />
  98 + <xsl:if test="not (position() = last())">
  99 + <xsl:text>', '</xsl:text>
  100 + </xsl:if>
  101 + </xsl:for-each>
  102 + <xsl:text>');
  103 +</xsl:text>
  104 + </xsl:if>
  105 + </xsl:for-each>
  106 + </xsl:for-each>
  107 +
  108 +</xsl:template>
  109 +</xsl:stylesheet>
... ...
resources/js/hayamiki_designer/db/vfp9/datatypes.xml 0 → 100644
  1 +<?xml version="1.0"?>
  2 +<datatypes db="vfp9">
  3 + <group label="Keys" color="rgb(250,250,100)">
  4 + <type label="Integer" length="0" sql="INTEGER" quote=""/>
  5 + </group>
  6 + <group label="Numeric" color="rgb(255,255,200)">
  7 + <type label="Integer (not key)" length="0" sql="Integer" quote="" />
  8 + <type label="Numeric" length="1" sql="Numeric" quote="" />
  9 + <type label="Double" length="1" sql="Double" quote="" />
  10 + <type label="Float" length="1" sql="Float" quote="" />
  11 + </group>
  12 +
  13 + <group label="Logical" color="rgb(100,100,255)">
  14 + <type label="Logical" length="0" sql="Logical" quote="'"/>
  15 + </group>
  16 +
  17 + <group label="Text short (NOCPTR->DEFAULT)" color="rgb(255,200,200)">
  18 + <type label="Character" length="1" sql="Character" quote="'"/>
  19 + <type label="Varchar" length="1" sql="Varchar" quote="'"/>
  20 + </group>
  21 + <group label="Text long (NOCPTR->DEFAULT)" color="rgb(255,150,150)">
  22 + <type label="Memo" length="0" sql="Memo" quote="'"/>
  23 + </group>
  24 +
  25 + <group label="Date/Time" color="rgb(150,255,150)">
  26 + <type label="Date" length="0" sql="Date" quote="'" />
  27 + <type label="Datetime" length="0" sql="Datetime" quote="'" />
  28 + </group>
  29 +
  30 + <group label="Currency" color="rgb(200,100,255)">
  31 + <type label="Currency" length="0" sql="Currency" quote="'"/>
  32 + </group>
  33 +
  34 + <group label="Binary/Hexa" color="rgb(150,200,255)">
  35 + <type label="Varbinary" length="1" sql="Varbinary" quote="'"/>
  36 + <type label="Blob" length="0" sql="Blob" quote="'"/>
  37 + <type label="General" length="0" sql="General" quote="'"/>
  38 + </group>
  39 +</datatypes>
... ...
resources/js/hayamiki_designer/db/vfp9/output.xsl 0 → 100644
  1 +<?xml version="1.0" ?>
  2 +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3 +<xsl:output method="text"/>
  4 +
  5 +<xsl:template name="replace-substring">
  6 + <xsl:param name="value" />
  7 + <xsl:param name="from" />
  8 + <xsl:param name="to" />
  9 + <xsl:choose>
  10 + <xsl:when test="contains($value,$from)">
  11 + <xsl:value-of select="substring-before($value,$from)" />
  12 + <xsl:value-of select="$to" />
  13 + <xsl:call-template name="replace-substring">
  14 + <xsl:with-param name="value" select="substring-after($value,$from)" />
  15 + <xsl:with-param name="from" select="$from" />
  16 + <xsl:with-param name="to" select="$to" />
  17 + </xsl:call-template>
  18 + </xsl:when>
  19 + <xsl:otherwise>
  20 + <xsl:value-of select="$value" />
  21 + </xsl:otherwise>
  22 + </xsl:choose>
  23 +</xsl:template>
  24 +
  25 +<xsl:template match="/sql">
  26 +
  27 +
  28 +<!-- parameters/setting -->
  29 + <xsl:text>LPARAMETERS teLongName, tcCommand, tcPath
  30 +</xsl:text>
  31 + <xsl:text>* [teLongName] False: set llDbc=.F. and generates "FREE", Empty: generates without "FREE" and "NAME", otherwise generates "NAME teLongName"
  32 +</xsl:text>
  33 + <xsl:text>* [tcCommand] if used, &amp;tcCommand command will run after CREATE TABLE, f.e. "= MyProc( ALIAS(), m.lcTableComment, @lacComments )"
  34 +</xsl:text>
  35 + <xsl:text>* [tcPath] path where tables will be created (if not used, tables will be created in current folder)
  36 +
  37 +</xsl:text>
  38 + <xsl:text>LOCAL ARRAY lacComments[1,2]
  39 +</xsl:text>
  40 + <xsl:text>LOCAL llDbc, lcFreeOrName, lcTableComment
  41 +</xsl:text>
  42 + <xsl:text>llDbc = VARTYPE( m.teLongName )=[C]
  43 +</xsl:text>
  44 + <xsl:text> * no special support for llDbc=True yet (you could improve db\vfp9\output.xsl and remove "xsl:if test=[1=2]" from it)
  45 +</xsl:text>
  46 + <xsl:text>lcFreeOrName = IIF( m.llDbc, IIF( EMPTY( m.teLongName ), [], [NAME "] + m.teLongName + ["] ), [FREE] )
  47 +</xsl:text>
  48 + <xsl:text>tcPath = IIF( VARTYPE( m.tcPath )=[L], [], ADDBS( m.tcPath ) )
  49 +</xsl:text>
  50 + <xsl:text>
  51 +</xsl:text>
  52 +
  53 +
  54 +<!-- tables -->
  55 + <xsl:for-each select="table">
  56 + <xsl:text>ERASE '</xsl:text>
  57 + <xsl:value-of select="@name" />
  58 + <xsl:text>.dbf'</xsl:text>
  59 + <xsl:text>
  60 +</xsl:text>
  61 + <xsl:text>ERASE '</xsl:text>
  62 + <xsl:value-of select="@name" />
  63 + <xsl:text>.fpt'</xsl:text>
  64 + <xsl:text>
  65 +</xsl:text>
  66 + <xsl:text>ERASE '</xsl:text>
  67 + <xsl:value-of select="@name" />
  68 + <xsl:text>.cdx'</xsl:text>
  69 + <xsl:text>
  70 +</xsl:text>
  71 + <xsl:text>ERASE '</xsl:text>
  72 + <xsl:value-of select="@name" />
  73 + <xsl:text>.bak'</xsl:text>
  74 + <xsl:text>
  75 +</xsl:text>
  76 + <xsl:text>ERASE '</xsl:text>
  77 + <xsl:value-of select="@name" />
  78 + <xsl:text>.tbk'</xsl:text>
  79 + <xsl:text>
  80 +
  81 +</xsl:text>
  82 +
  83 + <xsl:text>CREATE TABLE (m.tcPath + '</xsl:text>
  84 + <xsl:value-of select="@name" />
  85 + <xsl:text>') &amp;lcFreeOrName</xsl:text>
  86 + <xsl:text> ( ;
  87 +</xsl:text>
  88 + <xsl:for-each select="row">
  89 + <xsl:text></xsl:text>
  90 + <xsl:value-of select="@name" />
  91 + <xsl:text> </xsl:text>
  92 +
  93 + <xsl:value-of select="datatype" />
  94 + <xsl:text> </xsl:text>
  95 +
  96 + <xsl:if test="@null = 0">
  97 + <xsl:text>NOT NULL </xsl:text>
  98 + </xsl:if>
  99 + <xsl:if test="@null = 1">
  100 + <xsl:text>NULL </xsl:text>
  101 + </xsl:if>
  102 +
  103 + <xsl:if test="@autoincrement = 1">
  104 + <xsl:text>AutoInc </xsl:text>
  105 + </xsl:if>
  106 +
  107 + <xsl:if test="default">
  108 + <!-- VFP9 Support DEFAULT.., NOCPTRANS, ..<xsl:text>DEFAULT </xsl:text> -->
  109 + <xsl:variable name="cdefault" select="default"/>
  110 + <xsl:value-of select="substring($cdefault,2,string-length($cdefault)-2)" />
  111 + <xsl:text> </xsl:text>
  112 + </xsl:if>
  113 +
  114 +<xsl:if test="1=2"> <!-- VFP9 no .dbc support yet -->
  115 + <xsl:if test="comment">
  116 + <xsl:text>COMMENT '</xsl:text>
  117 + <xsl:call-template name="replace-substring">
  118 + <xsl:with-param name="value" select="comment" />
  119 + <xsl:with-param name="from" select='"&apos;"' />
  120 + <xsl:with-param name="to" select='"&apos;&apos;"' />
  121 + </xsl:call-template>
  122 + <xsl:text>' </xsl:text>
  123 + </xsl:if>
  124 +</xsl:if> <!-- VFP9 no .dbc support yet -->
  125 +
  126 + <xsl:if test="not (position()=last())">
  127 + <xsl:text>, ;
  128 +</xsl:text>
  129 + </xsl:if>
  130 + <xsl:if test="position()=last()">
  131 + <xsl:text> ;
  132 +</xsl:text>
  133 + </xsl:if>
  134 + </xsl:for-each>
  135 +
  136 +<!-- keys -->
  137 +<xsl:if test="1=2"> <!-- VFP9 no .dbc support yet -->
  138 + <xsl:for-each select="key">
  139 + <xsl:text>,
  140 +</xsl:text>
  141 + <xsl:choose>
  142 + <xsl:when test="@type = 'PRIMARY'">PRIMARY KEY (</xsl:when>
  143 + <xsl:when test="@type = 'FULLTEXT'">FULLTEXT KEY (</xsl:when>
  144 + <xsl:when test="@type = 'UNIQUE'">UNIQUE KEY (</xsl:when>
  145 + <xsl:otherwise>KEY (</xsl:otherwise>
  146 + </xsl:choose>
  147 +
  148 + <xsl:for-each select="part">
  149 + <xsl:text></xsl:text><xsl:value-of select="." /><xsl:text></xsl:text>
  150 + <xsl:if test="not (position() = last())">
  151 + <xsl:text>, </xsl:text>
  152 + </xsl:if>
  153 + </xsl:for-each>
  154 + <xsl:text>)</xsl:text>
  155 +
  156 + </xsl:for-each>
  157 +
  158 +</xsl:if> <!-- VFP9 no .dbc support yet -->
  159 + <xsl:text>)
  160 +
  161 +</xsl:text>
  162 + <xsl:text>lcTableComment = '</xsl:text>
  163 + <xsl:call-template name="replace-substring">
  164 + <xsl:with-param name="value" select="comment" />
  165 + <xsl:with-param name="from" select='"&apos;"' />
  166 + <xsl:with-param name="to" select='"&apos;&apos;"' />
  167 + </xsl:call-template>
  168 + <xsl:text>'
  169 +</xsl:text>
  170 +
  171 +
  172 +<!-- VFP9 call command/function after table was created -->
  173 + <xsl:text>DIMENSION lacComments[FCOUNT(),2]
  174 +</xsl:text>
  175 + <xsl:for-each select="row">
  176 + <xsl:text> lacComments[</xsl:text>
  177 + <xsl:value-of select="position()" />
  178 + <xsl:text>,1] = '</xsl:text>
  179 + <xsl:value-of select="@name" />
  180 + <xsl:text>'
  181 +</xsl:text>
  182 + <xsl:text> lacComments[</xsl:text>
  183 + <xsl:value-of select="position()" />
  184 + <xsl:text>,2] = '</xsl:text>
  185 + <xsl:call-template name="replace-substring">
  186 + <xsl:with-param name="value" select="comment" />
  187 + <xsl:with-param name="from" select='"&apos;"' />
  188 + <xsl:with-param name="to" select='"&apos;&apos;"' />
  189 + </xsl:call-template>
  190 + <xsl:text>'
  191 +</xsl:text>
  192 + </xsl:for-each>
  193 + <xsl:text>
  194 +</xsl:text>
  195 + <xsl:text>IF NOT EMPTY( m.tcCommand )
  196 +</xsl:text>
  197 + <xsl:text> &amp;tcCommand
  198 +</xsl:text>
  199 + <xsl:text>ENDIF
  200 +
  201 +</xsl:text>
  202 +<!-- VFP9 call command/function after table was created finished -->
  203 +
  204 +
  205 + </xsl:for-each>
  206 +
  207 +<!-- fk -->
  208 +<xsl:if test="1=2"> <!-- VFP9 no .dbc support yet -->
  209 + <xsl:for-each select="table">
  210 + <xsl:for-each select="row">
  211 + <xsl:for-each select="relation">
  212 + <xsl:text>ALTER TABLE </xsl:text>
  213 + <xsl:value-of select="../../@name" />
  214 + <xsl:text> ADD FOREIGN KEY (</xsl:text>
  215 + <xsl:value-of select="../@name" />
  216 + <xsl:text>) REFERENCES </xsl:text>
  217 + <xsl:value-of select="@table" />
  218 + <xsl:text> (</xsl:text>
  219 + <xsl:value-of select="@row" />
  220 + <xsl:text>);
  221 +</xsl:text>
  222 + </xsl:for-each>
  223 + </xsl:for-each>
  224 + </xsl:for-each>
  225 +</xsl:if> <!-- VFP9 no .dbc support yet -->
  226 +
  227 +
  228 +</xsl:template>
  229 +</xsl:stylesheet>
... ...
resources/js/hayamiki_designer/db/vfp9/readme_vfp9.txt 0 → 100644
  1 +07.12.2009
  2 + vfp9 support for WwwSQLDesigner
  3 + by zvolsky@seznam.cz
  4 +
  5 +
  6 +Installation:
  7 +-------------
  8 +vfp9 support is standard part of WwwSQLDesigner - simple choose database vfp9 in Settings.
  9 +
  10 +You can change the generated script by patch/replace of db\vfp9\output.xsl.
  11 +
  12 +
  13 +WwwSQLDesigner basics:
  14 +----------------------
  15 +To start click Index.html.
  16 +Never use Page Refresh (F5) - data will be lost!
  17 +Use Save button to generate FoxPro script with CREATE TABLEs.
  18 +Use Save/Read and Save XML buttons to generate XML and copy-paste it into text file to save your work.
  19 +Use Save/Read and Read XML buttons to continue work.
  20 +
  21 +
  22 +Use of VFP9 support:
  23 +--------------------
  24 +Textbox "Default" in Field adding has different meaning. Here you can enter all foxpro keywords, which follow field definition.
  25 +No word "DEFAULT" is added. To use some DEFAULT, write "DEFAULT value". If you let just "NULL" in Textbox "Default",
  26 +you will receive FoxPro error. Write "DEFAULT .NULL." instead.
  27 +
  28 +Data types Binary aren't in list. Use standard Varchar, Character, Memo instead and write "NOCPTRANS" into the "Default" textbox.
  29 +
  30 +Data type "Integer (not key)" differents (from the primary/foreign key) just in its color (but generates standard Integer).
  31 +
  32 +
  33 +
  34 +Generated VFP script contains (optional) parameters, which change behavior of CREATE TABLE commands:
  35 +teLongName gives a possibility to generate FREE or NAME keywords.
  36 +tcCommand can fire immediately after each CREATE TABLE (new table is selected).
  37 + F.e. "= MyProc( ALIAS(), m.lcTableComment, @lacComments )" gives access to alias and all comments from model inside MyProc() procedure.
  38 +tcPath can control path, where tables will be created.
  39 +
  40 +Comments aren't copied directly into target database.
  41 +Instead of this, they are prepared in lcTableComment variable (table comment) and in lacComments array (field comments) before &tcCommand call.
  42 +So you can work with comments in your user defined code as you want.
... ...
resources/js/hayamiki_designer/db/web2py/datatypes.xml 0 → 100644
  1 +<?xml version="1.0"?>
  2 +<datatypes db="web2py">
  3 + <group label="Numeric" color="rgb(238,238,170)">
  4 + <type label="Integer" length="1" sql="integer" re="INTEGER" quote=""/>
  5 + <type label="Double precision" length="1" sql="double" re="DOUBLE" quote=""/>
  6 + </group>
  7 + <group label="Character" color="rgb(255,200,200)">
  8 + <type label="String" length="1" sql="string" quote="'"/>
  9 + <type label="Text" length="1" sql="text" quote="'"/>
  10 + <type label="BLOB" length="1" sql="blob" quote="'"/>
  11 + </group>
  12 + <group label="Date &amp; Time" color="rgb(200,255,200)">
  13 + <type label="Time" length="0" sql="time" quote="'"/>
  14 + <type label="Date" length="0" sql="date" quote="'"/>
  15 + <type label="Datetime" length="0" sql="datetime" quote="'"/>
  16 + </group>
  17 + <group label="Miscellaneous" color="rgb(200,200,255)">
  18 + <type label="Boolean" length="0" sql="boolean" quote=""/>
  19 + <type label="Upload" length="0" sql="upload" quote=""/>
  20 + <type label="Password" length="0" sql="password" quote=""/>
  21 + </group>
  22 +</datatypes>
... ...
resources/js/hayamiki_designer/db/web2py/output.xsl 0 → 100644
  1 +<?xml version="1.0" encoding="us-ascii"?>
  2 +<!-- License public domain -->
  3 +<!-- Created by Boris Manojlovic <boris DOT manojlovic AT steki DOT net> -->
  4 +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  5 + <xsl:output method="text"/>
  6 + <xsl:template name="replace-substring">
  7 + <xsl:param name="value"/>
  8 + <xsl:param name="from"/>
  9 + <xsl:param name="to"/>
  10 + <xsl:choose>
  11 + <xsl:when test="contains($value,$from)">
  12 + <xsl:value-of select="substring-before($value,$from)"/>
  13 + <xsl:value-of select="$to"/>
  14 + <xsl:call-template name="replace-substring">
  15 + <xsl:with-param name="value" select="substring-after($value,$from)"/>
  16 + <xsl:with-param name="from" select="$from"/>
  17 + <xsl:with-param name="to" select="$to"/>
  18 + </xsl:call-template>
  19 + </xsl:when>
  20 + <xsl:otherwise>
  21 + <xsl:value-of select="$value"/>
  22 + </xsl:otherwise>
  23 + </xsl:choose>
  24 + </xsl:template>
  25 + <!-- return length of element-->
  26 + <xsl:template name="getsize">
  27 + <xsl:param name="invalue"/>
  28 + <xsl:choose>
  29 + <xsl:when test="contains($invalue,'(')">
  30 + <xsl:variable name="part" select="substring-after($invalue,'(')"/>
  31 + <xsl:value-of select="substring-before($part,')')"/>
  32 + </xsl:when>
  33 + </xsl:choose>
  34 + </xsl:template>
  35 + <!-- return web2py python representation of table -->
  36 + <xsl:template name="tableparser">
  37 + <xsl:param name="tabledata"/>
  38 + <xsl:text>dbOBJECT.define_table("</xsl:text>
  39 + <xsl:value-of select="@name"/>
  40 + <xsl:text>",</xsl:text>
  41 + <xsl:for-each select="row">
  42 + <xsl:variable name="row"><xsl:value-of select="@name" /></xsl:variable>
  43 + <xsl:choose>
  44 + <!-- ignore id fields as web2py needs it for building relations and will create them automatically -->
  45 + <xsl:when test="not(@name = 'id')">
  46 + <xsl:text>&#xa; Field("</xsl:text>
  47 + <xsl:value-of select="@name"/>
  48 + <xsl:text>"</xsl:text>
  49 + <xsl:choose>
  50 + <xsl:when test="not (relation)">
  51 + <xsl:text>, </xsl:text>
  52 + <xsl:choose>
  53 + <xsl:when test="contains(datatype,'(')">
  54 + <xsl:text>"</xsl:text>
  55 + <xsl:value-of select="substring-before(datatype,'(')"/>
  56 + <xsl:text>", length=</xsl:text>
  57 + <xsl:call-template name="getsize">
  58 + <xsl:with-param name="invalue" select="datatype"/>
  59 + </xsl:call-template>
  60 + <xsl:text>, </xsl:text>
  61 + </xsl:when>
  62 + <xsl:otherwise>
  63 + <xsl:text>"</xsl:text>
  64 + <xsl:value-of select="datatype"/>
  65 + <xsl:text>", </xsl:text>
  66 + </xsl:otherwise>
  67 + </xsl:choose>
  68 + <xsl:if test="@null = 0">
  69 + <xsl:text>notnull=True, </xsl:text>
  70 + </xsl:if>
  71 + <xsl:choose>
  72 + <xsl:when test="default">
  73 + <xsl:text>default=</xsl:text>
  74 + <xsl:choose>
  75 + <xsl:when test="default = 'NULL'">
  76 + <xsl:text>None</xsl:text>
  77 + </xsl:when>
  78 + <xsl:otherwise>
  79 + <xsl:value-of select="default"/>
  80 + </xsl:otherwise>
  81 + </xsl:choose>
  82 + </xsl:when>
  83 + <xsl:otherwise>
  84 + <xsl:text>default=None</xsl:text>
  85 + </xsl:otherwise>
  86 + </xsl:choose>
  87 + </xsl:when>
  88 + <xsl:otherwise>
  89 + <xsl:text>, "reference </xsl:text>
  90 + <xsl:for-each select="relation">
  91 + <xsl:value-of select="@table"/>
  92 + </xsl:for-each>
  93 + <xsl:text>"</xsl:text>
  94 + </xsl:otherwise>
  95 + </xsl:choose>
  96 +
  97 + <!-- keys -->
  98 + <xsl:for-each select="../key[@type='UNIQUE']/part">
  99 + <xsl:if test="text() = $row">, unique=True</xsl:if>
  100 + </xsl:for-each>
  101 +
  102 + <xsl:text>)</xsl:text>
  103 + </xsl:when>
  104 + </xsl:choose>
  105 + <xsl:if test="not (position()=last())">
  106 + <xsl:if test="not (@name = 'id')">
  107 + <xsl:text>,</xsl:text>
  108 + </xsl:if>
  109 + </xsl:if>
  110 + </xsl:for-each>
  111 +
  112 + <xsl:text>)</xsl:text>
  113 + <xsl:text>&#xa;&#xa;</xsl:text>
  114 +
  115 + </xsl:template>
  116 + <!-- parsing db xml file -->
  117 + <xsl:template match="/sql">
  118 + <xsl:text>""" database class object creation (initialization) """&#xa;</xsl:text>
  119 + <xsl:text>if request.env.web2py_runtime_gae: # if running on Google App Engine &#xa;</xsl:text>
  120 + <xsl:text> dbOBJECT = DAL('gae') # connect to Google BigTable &#xa;</xsl:text>
  121 + <xsl:text> session.connect(request, response, db=dbOBJECT) # and store sessions and tickets there &#xa;</xsl:text>
  122 + <xsl:text>else: # else use a normal relational database &#xa;</xsl:text>
  123 + <xsl:text> dbOBJECT = DAL("sqlite://dbOBJECT.db")&#xa;&#xa;</xsl:text>
  124 + <!-- doing two pass: first ignore tables with relations as they will raise exception if table referenced still does not exist (not instantiated) -->
  125 + <!-- this is not bullet proff but should be sufficient for small projects will be in TODO :) -->
  126 + <xsl:for-each select="table">
  127 + <xsl:if test="not (row/relation)">
  128 + <xsl:call-template name="tableparser">
  129 + <xsl:with-param name="tabledata" select="table"/>
  130 + </xsl:call-template>
  131 + </xsl:if>
  132 + </xsl:for-each>
  133 + <!-- calling second pass ignore non relation tables -->
  134 + <xsl:for-each select="table">
  135 + <xsl:if test="row/relation">
  136 + <xsl:call-template name="tableparser">
  137 + <xsl:with-param name="tabledata" select="table"/>
  138 + </xsl:call-template>
  139 + </xsl:if>
  140 + </xsl:for-each>
  141 + <!-- end of for-each select="table" -->
  142 + <!-- fk -->
  143 + <xsl:text>""" Relations between tables (remove fields you don't need from requires) """&#xa;</xsl:text>
  144 + <!-- dbOBJECT.druga.prva_id.requires=IS_IN_DB(db, 'auth_user.id','%(id)s: %(first_name)s %(last_name)s') -->
  145 + <xsl:for-each select="table">
  146 + <xsl:for-each select="row">
  147 + <xsl:for-each select="relation">
  148 + <xsl:variable name="tablename">
  149 + <xsl:value-of select="@table"/>
  150 + </xsl:variable>
  151 + <xsl:text>dbOBJECT.</xsl:text>
  152 + <xsl:value-of select="../../@name"/>
  153 + <xsl:text>.</xsl:text>
  154 + <xsl:value-of select="../@name"/>
  155 + <xsl:text>.requires=IS_IN_DB( dbOBJECT, '</xsl:text>
  156 + <xsl:value-of select="@table"/>
  157 + <xsl:text>.id', '</xsl:text>
  158 + <!-- hardcoded as this is expected from web2py every table to have anyway :) -->
  159 + <xsl:for-each select="//table">
  160 + <!-- have to do this way to find our table->row->names-->
  161 + <xsl:if test="@name = $tablename">
  162 + <xsl:for-each select="row">
  163 + <xsl:if test="not(@name = 'id') and not(datatype = 'password')">
  164 + <!-- do not show password and id fields by default in select box -->
  165 + <xsl:text> %(</xsl:text>
  166 + <xsl:value-of select="@name"/>
  167 + <xsl:text>)s</xsl:text>
  168 + </xsl:if>
  169 + </xsl:for-each>
  170 + </xsl:if>
  171 + </xsl:for-each>
  172 + <xsl:text>')&#xa;</xsl:text>
  173 + </xsl:for-each>
  174 + </xsl:for-each>
  175 + </xsl:for-each>
  176 + </xsl:template>
  177 +</xsl:stylesheet>
... ...
resources/js/hayamiki_designer/dropbox-oauth-receiver.html 0 → 100644
  1 +<!DOCTYPE html>
  2 +<html lang="en">
  3 + <head>
  4 + <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/dropbox.js/0.10.2/dropbox.min.js"></script>
  5 + <script type="text/javascript">
  6 + Dropbox.AuthDriver.Popup.oauthReceiver();
  7 + </script>
  8 + </head>
  9 + <body>
  10 + <h1>Dropbox sign-in successful</h1>
  11 +
  12 + <p>Please close this window.</p>
  13 + </body>
  14 +</html>
0 15 \ No newline at end of file
... ...
resources/js/hayamiki_designer/images/ScreenLayout.png 0 → 100644

16 KB

resources/js/hayamiki_designer/images/addingKeys.png 0 → 100644

16.3 KB

resources/js/hayamiki_designer/images/back.png 0 → 100644

1 KB

resources/js/hayamiki_designer/images/columnDetail.png 0 → 100644

8.02 KB

resources/js/hayamiki_designer/images/constrained.png 0 → 100644

7.11 KB

resources/js/hayamiki_designer/images/down.gif 0 → 100644

58 Bytes

resources/js/hayamiki_designer/images/editTable.png 0 → 100644

10.7 KB

resources/js/hayamiki_designer/images/finalExample.png 0 → 100644

329 KB

resources/js/hayamiki_designer/images/selectedColumn.png 0 → 100644

3.79 KB

resources/js/hayamiki_designer/images/throbber.gif 0 → 100644

825 Bytes

resources/js/hayamiki_designer/images/up.gif 0 → 100644

58 Bytes

resources/js/hayamiki_designer/index.html 0 → 100644
  1 +<!doctype html>
  2 +<!--
  3 + WWW SQL Designer, (C) 2005-2015 Ondrej Zara, ondras@zarovi.cz
  4 + Version: 2.7
  5 + See license.txt for licencing information.
  6 +-->
  7 +<html>
  8 +<head>
  9 + <title>WWW SQL Designer</title>
  10 + <meta name="viewport" content="initial-scale=1,maximum-scale=1" />
  11 + <meta charset="utf-8" />
  12 + <link rel="stylesheet" href="styles/style.css" media="all" />
  13 + <!--[if IE 6]><link rel="stylesheet" type="text/css" href="styles/ie6.css" /><![endif]-->
  14 + <!--[if IE 7]><link rel="stylesheet" type="text/css" href="styles/ie7.css" /><![endif]-->
  15 + <link rel="stylesheet" href="styles/print.css" type="text/css" media="print" />
  16 + <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/dropbox.js/0.10.2/dropbox.min.js"></script>
  17 +
  18 + <script src="js/oz.js"></script>
  19 + <script src="js/config.js"></script>
  20 + <script src="js/globals.js"></script>
  21 + <script src="js/visual.js"></script>
  22 + <script src="js/row.js"></script>
  23 + <script src="js/table.js"></script>
  24 + <script src="js/relation.js"></script>
  25 + <script src="js/key.js"></script>
  26 + <script src="js/rubberband.js"></script>
  27 + <script src="js/map.js"></script>
  28 + <script src="js/toggle.js"></script>
  29 + <script src="js/io.js"></script>
  30 + <script src="js/tablemanager.js"></script>
  31 + <script src="js/rowmanager.js"></script>
  32 + <script src="js/keymanager.js"></script>
  33 + <script src="js/window.js"></script>
  34 + <script src="js/options.js"></script>
  35 + <script src="js/wwwsqldesigner.js"></script>
  36 +</head>
  37 +
  38 +<body>
  39 + <div id="area"></div>
  40 +
  41 + <div id="controls">
  42 + <div id="bar">
  43 + <div id="toggle"></div>
  44 + <input type="button" id="saveload" />
  45 +
  46 + <hr/>
  47 +
  48 + <input type="button" id="addtable" />
  49 + <input type="button" id="edittable" />
  50 + <input type="button" id="tablekeys" />
  51 + <input type="button" id="removetable" />
  52 + <input type="button" id="aligntables" />
  53 + <input type="button" id="cleartables" />
  54 +
  55 + <hr/>
  56 +
  57 + <input type="button" id="addrow" />
  58 + <input type="button" id="editrow" />
  59 + <input type="button" id="uprow" class="small" /><input type="button" id="downrow" class="small"/>
  60 + <input type="button" id="foreigncreate" />
  61 + <input type="button" id="foreignconnect" />
  62 + <input type="button" id="foreigndisconnect" />
  63 + <input type="button" id="removerow" />
  64 +
  65 + <hr/>
  66 +
  67 + <input type="button" id="options" />
  68 + <a href="https://github.com/ondras/wwwsqldesigner/wiki" target="_blank"><input type="button" id="docs" value="" /></a>
  69 + </div>
  70 +
  71 + <div id="rubberband"></div>
  72 +
  73 + <div id="minimap"></div>
  74 +
  75 + <div id="background"></div>
  76 +
  77 + <div id="window">
  78 + <div id="windowtitle"><img id="throbber" src="images/throbber.gif" alt="" title=""/></div>
  79 + <div id="windowcontent"></div>
  80 + <input type="button" id="windowok" />
  81 + <input type="button" id="windowcancel" />
  82 + </div>
  83 + </div> <!-- #controls -->
  84 +
  85 + <div id="opts">
  86 + <table>
  87 + <tbody>
  88 + <tr>
  89 + <td>
  90 + * <label id="language" for="optionlocale"></label>
  91 + </td>
  92 + <td>
  93 + <select id="optionlocale"><option></option></select>
  94 + </td>
  95 + </tr>
  96 + <tr>
  97 + <td>
  98 + * <label id="db" for="optiondb"></label>
  99 + </td>
  100 + <td>
  101 + <select id="optiondb"><option></option></select>
  102 + </td>
  103 + </tr>
  104 + <tr>
  105 + <td>
  106 + <label id="snap" for="optionsnap"></label>
  107 + </td>
  108 + <td>
  109 + <input type="text" size="4" id="optionsnap" />
  110 + <span class="small" id="optionsnapnotice"></span>
  111 + </td>
  112 + </tr>
  113 + <tr>
  114 + <td>
  115 + <label id="pattern" for="optionpattern"></label>
  116 + </td>
  117 + <td>
  118 + <input type="text" size="6" id="optionpattern" />
  119 + <span class="small" id="optionpatternnotice"></span>
  120 + </td>
  121 + </tr>
  122 + <tr>
  123 + <td>
  124 + <label id="hide" for="optionhide"></label>
  125 + </td>
  126 + <td>
  127 + <input type="checkbox" id="optionhide" />
  128 + </td>
  129 + </tr>
  130 + <tr>
  131 + <td>
  132 + * <label id="vector" for="optionvector"></label>
  133 + </td>
  134 + <td>
  135 + <input type="checkbox" id="optionvector" />
  136 + </td>
  137 + </tr>
  138 + <tr>
  139 + <td>
  140 + * <label id="showsize" for="optionshowsize"></label>
  141 + </td>
  142 + <td>
  143 + <input type="checkbox" id="optionshowsize" />
  144 + </td>
  145 + </tr>
  146 + <tr>
  147 + <td>
  148 + * <label id="showtype" for="optionshowtype"></label>
  149 + </td>
  150 + <td>
  151 + <input type="checkbox" id="optionshowtype" />
  152 + </td>
  153 + </tr>
  154 + </tbody>
  155 + </table>
  156 +
  157 + <hr />
  158 +
  159 + * <span class="small" id="optionsnotice"></span>
  160 + </div>
  161 +
  162 + <div id="io">
  163 + <table>
  164 + <tbody>
  165 + <tr>
  166 + <td style="width:60%">
  167 + <fieldset>
  168 + <legend id="client"></legend>
  169 + <div id="singlerow">
  170 + <input type="button" id="clientsave" />
  171 + <input type="button" id="clientload" />
  172 + </div>
  173 + <div id="singlerow">
  174 + <input type="button" id="clientlocalsave" />
  175 + <input type="button" id="clientlocalload" />
  176 + <input type="button" id="clientlocallist" />
  177 + </div>
  178 + <div id="singlerow">
  179 + <input type="button" id="dropboxsave" /><!-- may get hidden by dropBoxInit() -->
  180 + <input type="button" id="dropboxload" /><!-- may get hidden by dropBoxInit() -->
  181 + <input type="button" id="dropboxlist" /><!-- may get hidden by dropBoxInit() -->
  182 + </div>
  183 + <hr/>
  184 + <input type="button" id="clientsql" />
  185 + </fieldset>
  186 + </td>
  187 + <td style="width:40%">
  188 + <fieldset>
  189 + <legend id="server"></legend>
  190 + <label for="backend" id="backendlabel"></label> <select id="backend"><option></option></select>
  191 + <hr/>
  192 + <input type="button" id="serversave" />
  193 + <input type="button" id="quicksave" />
  194 + <input type="button" id="serverload" />
  195 + <input type="button" id="serverlist" />
  196 + <input type="button" id="serverimport" />
  197 + </fieldset>
  198 + </td>
  199 + </tr>
  200 + <tr>
  201 + <td colspan="2">
  202 + <fieldset>
  203 + <legend id="output"></legend>
  204 + <textarea id="textarea" rows="1" cols="1"></textarea><!--modified by javascript later-->
  205 + </fieldset>
  206 + </td>
  207 + </tr>
  208 + </tbody>
  209 + </table>
  210 + </div>
  211 +
  212 + <div id="keys">
  213 + <fieldset>
  214 + <legend id="keyslistlabel"></legend>
  215 + <select id="keyslist"><option></option></select>
  216 + <input type="button" id="keyadd" />
  217 + <input type="button" id="keyremove" />
  218 + </fieldset>
  219 + <fieldset>
  220 + <legend id="keyedit"></legend>
  221 + <table>
  222 + <tbody>
  223 + <tr>
  224 + <td>
  225 + <label for="keytype" id="keytypelabel"></label>
  226 + <select id="keytype"><option></option></select>
  227 + </td>
  228 + <td></td>
  229 + <td>
  230 + <label for="keyname" id="keynamelabel"></label>
  231 + <input type="text" id="keyname" size="10" />
  232 + </td>
  233 + </tr>
  234 + <tr>
  235 + <td colspan="3"><hr/></td>
  236 + </tr>
  237 + <tr>
  238 + <td>
  239 + <label for="keyfields" id="keyfieldslabel"></label><br/>
  240 + <select id="keyfields" size="5" multiple="multiple"><option></option></select>
  241 + </td>
  242 + <td>
  243 + <input type="button" id="keyleft" value="&lt;&lt;" /><br/>
  244 + <input type="button" id="keyright" value="&gt;&gt;" /><br/>
  245 + </td>
  246 + <td>
  247 + <label for="keyavail" id="keyavaillabel"></label><br/>
  248 + <select id="keyavail" size="5" multiple="multiple"><option></option></select>
  249 + </td>
  250 + </tr>
  251 + </tbody>
  252 + </table>
  253 + </fieldset>
  254 + </div>
  255 +
  256 + <div id="table">
  257 + <table>
  258 + <tbody>
  259 + <tr>
  260 + <td>
  261 + <label id="tablenamelabel" for="tablename"></label>
  262 + </td>
  263 + <td>
  264 + <input id="tablename" type="text" />
  265 + </td>
  266 + </tr>
  267 + <tr>
  268 + <td>
  269 + <label id="tablecommentlabel" for="tablecomment"></label>
  270 + </td>
  271 + <td>
  272 + <textarea rows="5" cols="40" id="tablecomment"></textarea>
  273 + </td>
  274 + </tr>
  275 + </tbody>
  276 + </table>
  277 + </div>
  278 + <script type="text/javascript">
  279 + var d = new SQL.Designer();
  280 + </script>
  281 +</body>
  282 +</html>
... ...
resources/js/hayamiki_designer/js/config.js 0 → 100644
  1 +var CONFIG = {
  2 + AVAILABLE_DBS: ["hayamiki"],
  3 + DEFAULT_DB: "hayamiki",
  4 +
  5 + AVAILABLE_LOCALES: ["ar", "cs", "de", "el", "en", "eo", "es", "fr", "hu", "it", "ja", "nl", "pl", "pt_BR", "ro", "ru", "sv", "zh"],
  6 + DEFAULT_LOCALE: "en",
  7 +
  8 + AVAILABLE_BACKENDS: ["php-mysql", "php-blank", "php-file", "php-sqlite", "php-mysql+file", "php-postgresql", "php-pdo", "perl-file", "php-cubrid", "asp-file"],
  9 + DEFAULT_BACKEND: ["php-mysql"],
  10 +
  11 + RELATION_THICKNESS: 2,
  12 + RELATION_SPACING: 15,
  13 + RELATION_COLORS: ["#000", "#800", "#080", "#008", "#088", "#808", "#088"],
  14 +
  15 + STATIC_PATH: "",
  16 + XHR_PATH: "",
  17 +
  18 + /*
  19 + * The key below needs to be set individually by you if you want to use the Dropbox load/save feature.
  20 + * To do that, first sign up with Dropbox (may require a specific developer / SDK sign-up), go to
  21 + * https://www.dropbox.com/developers/apps and use "Create app" to add a new "Dropbox API app".
  22 + * Limit the app to its own folder. Call it, for instance, "wwwsqldesigner".
  23 + * Under "OAuth 2", "Redirect URIs", add the URL to the "dropbox-oauth-receiver.html" file on your server.
  24 + * E.g, if you install wwwsqldesigner on your local web server under "http://localhost/sqldesigner/", then add
  25 + * http://localhost/sqldesigner/dropbox-oauth-receiver.html as a Redirection URI.
  26 + * Copy the shown "App key" and paste it here below instead of the null value:
  27 + */
  28 + DROPBOX_KEY: null // such as: "d6stdscwewhl6sa"
  29 +
  30 +}
... ...
resources/js/hayamiki_designer/js/globals.js 0 → 100644
  1 +function _(str) { /* getText */
  2 + if (!(str in window.LOCALE)) { return str; }
  3 + return window.LOCALE[str];
  4 +}
  5 +
  6 +if (typeof String.prototype.endsWith !== 'function') {
  7 + String.prototype.endsWith = function(suffix) {
  8 + return this.indexOf(suffix, this.length - suffix.length) !== -1;
  9 + };
  10 +}
  11 +
  12 +if (!String.prototype.trim) {
  13 + String.prototype.trim = function() {
  14 + return this.match(/^\s*([\s\S]*?)\s*$/)[1];
  15 + }
  16 +}
  17 +
  18 +if (!String.trim) {
  19 + String.trim = function(obj) { return String.prototype.trim.call(obj);}
  20 +}
  21 +
  22 +if (!Object.create) {
  23 + Object.create = function (o) {
  24 + if (arguments.length > 1) { throw new Error("Object.create polyfill only accepts the first parameter"); }
  25 + var tmp = function() {};
  26 + tmp.prototype = o;
  27 + return new tmp();
  28 + };
  29 +}
  30 +
  31 +var DATATYPES = false;
  32 +var LOCALE = {};
  33 +var SQL = {
  34 + _subscribers: {},
  35 +
  36 + publish: function(message, publisher, data) {
  37 + var subscribers = this._subscribers[message] || [];
  38 + var obj = {
  39 + target: publisher,
  40 + data: data
  41 + }
  42 + subscribers.forEach(function(subscriber) { subscriber(obj); });
  43 + },
  44 +
  45 + subscribe: function(message, subscriber) {
  46 + if (!(message in this._subscribers)) {
  47 + this._subscribers[message] = [];
  48 + }
  49 + var index = this._subscribers[message].indexOf(subscriber);
  50 + if (index == -1) { this._subscribers[message].push(subscriber); }
  51 + },
  52 +
  53 + unsubscribe: function(message, subscriber) {
  54 + var index = this._subscribers[message].indexOf(subscriber);
  55 + if (index > -1) { this._subscribers[message].splice(index, 1); }
  56 + },
  57 +
  58 + escape: function(str) {
  59 + return str.replace(/&/g, "&amp;").replace(/>/g, "&gt;").replace(/</g, "&lt;");
  60 + }
  61 +}
  62 +
  63 +window.onbeforeunload = function(e) {
  64 + return ""; /* some browsers will show this text, some won't. */
  65 +}
... ...
resources/js/hayamiki_designer/js/io.js 0 → 100644
  1 +SQL.IO = function(owner) {
  2 + this.owner = owner;
  3 + this._name = ""; /* last used name with server load/save */
  4 + this.lastUsedName = ""; /* last used name with local storage or dropbox load/save */
  5 + this.dom = {
  6 + container:OZ.$("io")
  7 + };
  8 +
  9 + var ids = ["saveload","clientlocalsave", "clientsave", "clientlocalload", "clientlocallist","clientload", "clientsql",
  10 + "dropboxsave", "dropboxload", "dropboxlist",
  11 + "quicksave", "serversave", "serverload",
  12 + "serverlist", "serverimport"];
  13 + for (var i=0;i<ids.length;i++) {
  14 + var id = ids[i];
  15 + var elm = OZ.$(id);
  16 + this.dom[id] = elm;
  17 + elm.value = _(id);
  18 + }
  19 +
  20 + this.dom.quicksave.value += " (F2)";
  21 +
  22 + var ids = ["client","server","output","backendlabel"];
  23 + for (var i=0;i<ids.length;i++) {
  24 + var id = ids[i];
  25 + var elm = OZ.$(id);
  26 + elm.innerHTML = _(id);
  27 + }
  28 +
  29 + this.dom.ta = OZ.$("textarea");
  30 + this.dom.backend = OZ.$("backend");
  31 +
  32 + /* init dropbox before hiding the container so it can adjust its buttons */
  33 + this.dropBoxInit();
  34 +
  35 + this.dom.container.parentNode.removeChild(this.dom.container);
  36 + this.dom.container.style.visibility = "";
  37 +
  38 + this.saveresponse = this.saveresponse.bind(this);
  39 + this.loadresponse = this.loadresponse.bind(this);
  40 + this.listresponse = this.listresponse.bind(this);
  41 + this.importresponse = this.importresponse.bind(this);
  42 +
  43 + OZ.Event.add(this.dom.saveload, "click", this.click.bind(this));
  44 + OZ.Event.add(this.dom.clientlocalsave, "click", this.clientlocalsave.bind(this));
  45 + OZ.Event.add(this.dom.clientsave, "click", this.clientsave.bind(this));
  46 + OZ.Event.add(this.dom.clientlocalload, "click", this.clientlocalload.bind(this));
  47 + OZ.Event.add(this.dom.clientlocallist, "click", this.clientlocallist.bind(this));
  48 + OZ.Event.add(this.dom.clientload, "click", this.clientload.bind(this));
  49 + OZ.Event.add(this.dom.dropboxload, "click", this.dropboxload.bind(this));
  50 + OZ.Event.add(this.dom.dropboxsave, "click", this.dropboxsave.bind(this));
  51 + OZ.Event.add(this.dom.dropboxlist, "click", this.dropboxlist.bind(this));
  52 + OZ.Event.add(this.dom.clientsql, "click", this.clientsql.bind(this));
  53 + OZ.Event.add(this.dom.quicksave, "click", this.quicksave.bind(this));
  54 + OZ.Event.add(this.dom.serversave, "click", this.serversave.bind(this));
  55 + OZ.Event.add(this.dom.serverload, "click", this.serverload.bind(this));
  56 + OZ.Event.add(this.dom.serverlist, "click", this.serverlist.bind(this));
  57 + OZ.Event.add(this.dom.serverimport, "click", this.serverimport.bind(this));
  58 + OZ.Event.add(document, "keydown", this.press.bind(this));
  59 + this.build();
  60 +}
  61 +
  62 +SQL.IO.prototype.build = function() {
  63 + OZ.DOM.clear(this.dom.backend);
  64 +
  65 + var bs = CONFIG.AVAILABLE_BACKENDS;
  66 + var be = CONFIG.DEFAULT_BACKEND;
  67 + var r = window.location.search.substring(1).match(/backend=([^&]*)/);
  68 + if (r) {
  69 + req = r[1];
  70 + if (bs.indexOf(req) != -1) {
  71 + be = req;
  72 + }
  73 + }
  74 + for (var i=0;i<bs.length;i++) {
  75 + var o = OZ.DOM.elm("option");
  76 + o.value = bs[i];
  77 + o.innerHTML = bs[i];
  78 + this.dom.backend.appendChild(o);
  79 + if (bs[i] == be) { this.dom.backend.selectedIndex = i; }
  80 + }
  81 +}
  82 +
  83 +SQL.IO.prototype.click = function() { /* open io dialog */
  84 + this.build();
  85 + this.dom.ta.value = "";
  86 + this.dom.clientsql.value = _("clientsql") + " (" + window.DATATYPES.getAttribute("db") + ")";
  87 + this.owner.window.open(_("saveload"),this.dom.container);
  88 +}
  89 +
  90 +SQL.IO.prototype.fromXMLText = function(xml) {
  91 + try {
  92 + if (window.DOMParser) {
  93 + var parser = new DOMParser();
  94 + var xmlDoc = parser.parseFromString(xml, "text/xml");
  95 + } else if (window.ActiveXObject || "ActiveXObject" in window) {
  96 + var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
  97 + xmlDoc.loadXML(xml);
  98 + } else {
  99 + throw new Error("No XML parser available.");
  100 + }
  101 + } catch(e) {
  102 + alert(_("xmlerror")+': '+e.message);
  103 + return;
  104 + }
  105 + this.fromXML(xmlDoc);
  106 +}
  107 +
  108 +SQL.IO.prototype.fromXML = function(xmlDoc) {
  109 + if (!xmlDoc || !xmlDoc.documentElement) {
  110 + alert(_("xmlerror")+': Null document');
  111 + return false;
  112 + }
  113 + this.owner.fromXML(xmlDoc.documentElement);
  114 + this.owner.window.close();
  115 + return true;
  116 +}
  117 +
  118 +SQL.IO.prototype.clientsave = function() {
  119 + var xml = this.owner.toXML();
  120 + this.dom.ta.value = xml;
  121 +}
  122 +
  123 +SQL.IO.prototype.clientload = function() {
  124 + var xml = this.dom.ta.value;
  125 + if (!xml) {
  126 + alert(_("empty"));
  127 + return;
  128 + }
  129 +
  130 + this.fromXMLText(xml);
  131 +}
  132 +
  133 +SQL.IO.prototype.promptName = function(title, suffix) {
  134 + var lastUsedName = this.owner.getOption("lastUsedName") || this.lastUsedName;
  135 + var name = prompt(_(title), lastUsedName);
  136 + if (!name) { return null; }
  137 + if (suffix && name.endsWith(suffix)) {
  138 + // remove suffix from name
  139 + name = name.substr(0, name.length-4);
  140 + }
  141 + this.owner.setOption("lastUsedName", name);
  142 + this.lastUsedName = name; // save this also in variable in case cookies are disabled
  143 + return name;
  144 +}
  145 +
  146 +SQL.IO.prototype.clientlocalsave = function() {
  147 + if (!window.localStorage) {
  148 + alert("Sorry, your browser does not seem to support localStorage.");
  149 + return;
  150 + }
  151 +
  152 + var xml = this.owner.toXML();
  153 + if (xml.length >= (5*1024*1024)/2) { /* this is a very big db structure... */
  154 + alert("Warning: your database structure is above 5 megabytes in size, this is above the localStorage single key limit allowed by some browsers, example Mozilla Firefox 10");
  155 + return;
  156 + }
  157 +
  158 + var key = this.promptName("serversaveprompt");
  159 + if (!key) { return; }
  160 +
  161 + key = "wwwsqldesigner_databases_" + (key || "default");
  162 +
  163 + try {
  164 + localStorage.setItem(key, xml);
  165 + if (localStorage.getItem(key) != xml) { throw new Error("Content verification failed"); }
  166 + } catch (e) {
  167 + alert("Error saving database structure to localStorage! ("+e.message+")");
  168 + }
  169 +}
  170 +
  171 +SQL.IO.prototype.clientlocalload = function() {
  172 + if (!window.localStorage) {
  173 + alert("Sorry, your browser does not seem to support localStorage.");
  174 + return;
  175 + }
  176 +
  177 + var key = this.promptName("serverloadprompt");
  178 + if (!key) { return; }
  179 +
  180 + key = "wwwsqldesigner_databases_" + (key || "default");
  181 +
  182 + try {
  183 + var xml = localStorage.getItem(key);
  184 + if (!xml) { throw new Error("No data available"); }
  185 + } catch (e) {
  186 + alert("Error loading database structure from localStorage! ("+e.message+")");
  187 + return;
  188 + }
  189 +
  190 + this.fromXMLText(xml);
  191 +}
  192 +
  193 +SQL.IO.prototype.clientlocallist = function() {
  194 + if (!window.localStorage) {
  195 + alert("Sorry, your browser does not seem to support localStorage.");
  196 + return;
  197 + }
  198 +
  199 + /* --- Define some useful vars --- */
  200 + var baseKeysName = "wwwsqldesigner_databases_";
  201 + var localLen = localStorage.length;
  202 + var data = "";
  203 + var schemasFound = false;
  204 + var code = 200;
  205 +
  206 + /* --- work --- */
  207 + try {
  208 + for (var i = 0; i< localLen; ++i) {
  209 + var key = localStorage.key(i);
  210 + if((new RegExp(baseKeysName)).test(key)) {
  211 + var result = key.substring(baseKeysName.length);
  212 + schemasFound = true;
  213 + data += result + "\n";
  214 + }
  215 + }
  216 + if (!schemasFound) {
  217 + throw new Error("No data available");
  218 + }
  219 + } catch (e) {
  220 + alert("Error loading database names from localStorage! ("+e.message+")");
  221 + return;
  222 + }
  223 + this.listresponse(data, code);
  224 +}
  225 +
  226 +/* ------------------------- Dropbox start ------------------------ */
  227 +
  228 +/**
  229 + * The following code uses this lib: https://github.com/dropbox/dropbox-js
  230 + */
  231 +SQL.IO.prototype.dropBoxInit = function() {
  232 + if (CONFIG.DROPBOX_KEY) {
  233 + this.dropboxClient = new Dropbox.Client({ key: CONFIG.DROPBOX_KEY });
  234 + } else {
  235 + this.dropboxClient = null;
  236 + // Hide the Dropbox buttons
  237 + var elems = document.querySelectorAll("[id^=dropbox]"); // gets all tags whose id start with "dropbox"
  238 + [].slice.call(elems).forEach(
  239 + function(elem) { elem.style.display = "none"; }
  240 + );
  241 + }
  242 +}
  243 +
  244 +SQL.IO.prototype.showDropboxError = function(error) {
  245 + var prefix = _("Dropbox error")+": ";
  246 + var msg = error.status;
  247 +
  248 + switch (error.status) {
  249 + case Dropbox.ApiError.INVALID_TOKEN:
  250 + // If you're using dropbox.js, the only cause behind this error is that
  251 + // the user token expired.
  252 + // Get the user through the authentication flow again.
  253 + msg = _("Token expired - retry the operation, authenticating again with Dropbox");
  254 + this.dropboxClient.reset();
  255 + break;
  256 +
  257 + case Dropbox.ApiError.NOT_FOUND:
  258 + // The file or folder you tried to access is not in the user's Dropbox.
  259 + // Handling this error is specific to your application.
  260 + msg = _("File not found");
  261 + break;
  262 +
  263 + case Dropbox.ApiError.OVER_QUOTA:
  264 + // The user is over their Dropbox quota.
  265 + // Tell them their Dropbox is full. Refreshing the page won't help.
  266 + msg = _("Dropbox is full");
  267 + break;
  268 +
  269 + case Dropbox.ApiError.RATE_LIMITED:
  270 + // Too many API requests. Tell the user to try again later.
  271 + // Long-term, optimize your code to use fewer API calls.
  272 + break;
  273 +
  274 + case Dropbox.ApiError.NETWORK_ERROR:
  275 + // An error occurred at the XMLHttpRequest layer.
  276 + // Most likely, the user's network connection is down.
  277 + // API calls will not succeed until the user gets back online.
  278 + msg = _("Network error");
  279 + break;
  280 +
  281 + case Dropbox.ApiError.INVALID_PARAM:
  282 + case Dropbox.ApiError.OAUTH_ERROR:
  283 + case Dropbox.ApiError.INVALID_METHOD:
  284 + default:
  285 + // Caused by a bug in dropbox.js, in your application, or in Dropbox.
  286 + // Tell the user an error occurred, ask them to refresh the page.
  287 + }
  288 +
  289 + alert (prefix+msg);
  290 +};
  291 +
  292 +SQL.IO.prototype.showDropboxAuthenticate = function(connectedCallBack) {
  293 + if (!this.dropboxClient) return false;
  294 +
  295 + // We want to use a popup window for authentication as the default redirection won't work for us as it'll make us lose our schema data
  296 + var href = window.location.href;
  297 + var prefix = href.substring(0, href.lastIndexOf('/')) + "/";
  298 + this.dropboxClient.authDriver(new Dropbox.AuthDriver.Popup({ receiverUrl: prefix+"dropbox-oauth-receiver.html" }));
  299 +
  300 + // Now let's authenticate us
  301 + var sql_io = this;
  302 + sql_io.dropboxClient.authenticate( function(error, client) {
  303 + if (error) {
  304 + sql_io.showDropboxError(error);
  305 + } else {
  306 + // We're authenticated
  307 + connectedCallBack();
  308 + }
  309 + return;
  310 + });
  311 +
  312 + return true;
  313 +}
  314 +
  315 +SQL.IO.prototype.dropboxsave = function() {
  316 + var sql_io = this;
  317 + sql_io.showDropboxAuthenticate( function() {
  318 + var key = sql_io.promptName("serversaveprompt", ".xml");
  319 + if (!key) { return; }
  320 +
  321 + var filename = (key || "default") + ".xml";
  322 +
  323 + sql_io.listresponse("Saving...", 200);
  324 + var xml = sql_io.owner.toXML();
  325 + sql_io.dropboxClient.writeFile(filename, xml, function(error, stat) {
  326 + if (error) {
  327 + sql_io.listresponse("", 200);
  328 + return sql_io.showDropboxError(error);
  329 + }
  330 + sql_io.listresponse(filename+" "+_("was saved to Dropbox"), 200);
  331 + });
  332 + });
  333 +}
  334 +
  335 +SQL.IO.prototype.dropboxload = function() {
  336 + var sql_io = this;
  337 + sql_io.showDropboxAuthenticate( function() {
  338 + var key = sql_io.promptName("serverloadprompt", ".xml");
  339 + if (!key) { return; }
  340 +
  341 + var filename = (key || "default") + ".xml";
  342 +
  343 + sql_io.listresponse("Loading...", 200);
  344 + sql_io.dropboxClient.readFile(filename, function(error, data) {
  345 + sql_io.listresponse("", 200);
  346 + if (error) {
  347 + return sql_io.showDropboxError(error);
  348 + }
  349 + sql_io.fromXMLText(data);
  350 + });
  351 + });
  352 +}
  353 +
  354 +SQL.IO.prototype.dropboxlist = function() {
  355 + var sql_io = this;
  356 + sql_io.showDropboxAuthenticate( function() {
  357 + sql_io.listresponse("Loading...", 200);
  358 + sql_io.dropboxClient.readdir("/", function(error, entries) {
  359 + if (error) {
  360 + sql_io.listresponse("", 200);
  361 + return sql_io.showDropboxError(error);
  362 + }
  363 + var data = entries.join("\n")+"\n";
  364 + sql_io.listresponse(data, 200);
  365 + });
  366 + });
  367 +}
  368 +
  369 +
  370 +/* ------------------------- Dropbox end ------------------------ */
  371 +
  372 +SQL.IO.prototype.clientsql = function() {
  373 + var bp = this.owner.getOption("staticpath");
  374 + var path = bp + "db/"+window.DATATYPES.getAttribute("db")+"/output.xsl";
  375 + this.owner.window.showThrobber();
  376 + OZ.Request(path, this.finish.bind(this), {xml:true});
  377 +}
  378 +
  379 +SQL.IO.prototype.finish = function(xslDoc) {
  380 + this.owner.window.hideThrobber();
  381 + var xml = this.owner.toXML();
  382 + var sql = "";
  383 + try {
  384 + if (window.XSLTProcessor && window.DOMParser) {
  385 + var parser = new DOMParser();
  386 + var xmlDoc = parser.parseFromString(xml, "text/xml");
  387 + var xsl = new XSLTProcessor();
  388 + xsl.importStylesheet(xslDoc);
  389 + var result = xsl.transformToDocument(xmlDoc);
  390 + sql = result.documentElement.textContent;
  391 + } else if (window.ActiveXObject || "ActiveXObject" in window) {
  392 + var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
  393 + xmlDoc.loadXML(xml);
  394 + sql = xmlDoc.transformNode(xslDoc);
  395 + } else {
  396 + throw new Error("No XSLT processor available");
  397 + }
  398 + } catch(e) {
  399 + alert(_("xmlerror")+': '+e.message);
  400 + return;
  401 + }
  402 + this.dom.ta.value = sql.trim();
  403 +}
  404 +
  405 +SQL.IO.prototype.serversave = function(e, keyword) {
  406 + var name = keyword || prompt(_("serversaveprompt"), this._name);
  407 + if (!name) { return; }
  408 + this._name = name;
  409 + var xml = this.owner.toXML();
  410 + var bp = this.owner.getOption("xhrpath");
  411 + var url = bp + "backend/"+this.dom.backend.value+"/?action=save&keyword="+encodeURIComponent(name);
  412 + var h = {"Content-type":"application/xml"};
  413 + this.owner.window.showThrobber();
  414 + this.owner.setTitle(name);
  415 + OZ.Request(url, this.saveresponse, {xml:true, method:"post", data:xml, headers:h});
  416 +}
  417 +
  418 +SQL.IO.prototype.quicksave = function(e) {
  419 + this.serversave(e, this._name);
  420 +}
  421 +
  422 +SQL.IO.prototype.serverload = function(e, keyword) {
  423 + var name = keyword || prompt(_("serverloadprompt"), this._name);
  424 + if (!name) { return; }
  425 + this._name = name;
  426 + var bp = this.owner.getOption("xhrpath");
  427 + var url = bp + "backend/"+this.dom.backend.value+"/?action=load&keyword="+encodeURIComponent(name);
  428 + this.owner.window.showThrobber();
  429 + this.name = name;
  430 + OZ.Request(url, this.loadresponse, {xml:true});
  431 +}
  432 +
  433 +SQL.IO.prototype.serverlist = function(e) {
  434 + var bp = this.owner.getOption("xhrpath");
  435 + var url = bp + "backend/"+this.dom.backend.value+"/?action=list";
  436 + this.owner.window.showThrobber();
  437 + OZ.Request(url, this.listresponse);
  438 +}
  439 +
  440 +SQL.IO.prototype.serverimport = function(e) {
  441 + var name = prompt(_("serverimportprompt"), "");
  442 + if (!name) { return; }
  443 + var bp = this.owner.getOption("xhrpath");
  444 + var url = bp + "backend/"+this.dom.backend.value+"/?action=import&database="+name;
  445 + this.owner.window.showThrobber();
  446 + OZ.Request(url, this.importresponse, {xml:true});
  447 +}
  448 +
  449 +SQL.IO.prototype.check = function(code) {
  450 + switch (code) {
  451 + case 201:
  452 + case 404:
  453 + case 500:
  454 + case 501:
  455 + case 503:
  456 + var lang = "http"+code;
  457 + this.dom.ta.value = _("httpresponse")+": "+_(lang);
  458 + return false;
  459 + break;
  460 + default: return true;
  461 + }
  462 +}
  463 +
  464 +SQL.IO.prototype.saveresponse = function(data, code) {
  465 + this.owner.window.hideThrobber();
  466 + this.check(code);
  467 +}
  468 +
  469 +SQL.IO.prototype.loadresponse = function(data, code) {
  470 + this.owner.window.hideThrobber();
  471 + if (!this.check(code)) { return; }
  472 + this.fromXML(data);
  473 + this.owner.setTitle(this.name);
  474 +}
  475 +
  476 +SQL.IO.prototype.listresponse = function(data, code) {
  477 + this.owner.window.hideThrobber();
  478 + if (!this.check(code)) { return; }
  479 + this.dom.ta.value = data;
  480 +}
  481 +
  482 +SQL.IO.prototype.importresponse = function(data, code) {
  483 + this.owner.window.hideThrobber();
  484 + if (!this.check(code)) { return; }
  485 + if (this.fromXML(data)) {
  486 + this.owner.alignTables();
  487 + }
  488 +}
  489 +
  490 +SQL.IO.prototype.press = function(e) {
  491 + switch (e.keyCode) {
  492 + case 113:
  493 + if (OZ.opera) {
  494 + e.preventDefault();
  495 + }
  496 + this.quicksave(e);
  497 + break;
  498 + }
  499 +}
... ...
resources/js/hayamiki_designer/js/key.js 0 → 100644
  1 +/* --------------------- db index ------------ */
  2 +SQL.Key = function(owner, type, name) {
  3 + this.owner = owner;
  4 + this.rows = [];
  5 + this.type = type || "INDEX";
  6 + this.name = name || "";
  7 + SQL.Visual.apply(this);
  8 +}
  9 +SQL.Key.prototype = Object.create(SQL.Visual.prototype);
  10 +
  11 +SQL.Key.prototype.setName = function(n) {
  12 + this.name = n;
  13 +}
  14 +
  15 +SQL.Key.prototype.getName = function() {
  16 + return this.name;
  17 +}
  18 +
  19 +SQL.Key.prototype.setType = function(t) {
  20 + if (!t) { return; }
  21 + this.type = t;
  22 + for (var i=0;i<this.rows.length;i++) { this.rows[i].redraw(); }
  23 +}
  24 +
  25 +SQL.Key.prototype.getType = function() {
  26 + return this.type;
  27 +}
  28 +
  29 +SQL.Key.prototype.addRow = function(r) {
  30 + if (r.owner != this.owner) { return; }
  31 + this.rows.push(r);
  32 + r.addKey(this);
  33 +}
  34 +
  35 +SQL.Key.prototype.removeRow = function(r) {
  36 + var idx = this.rows.indexOf(r);
  37 + if (idx == -1) { return; }
  38 + r.removeKey(this);
  39 + this.rows.splice(idx,1);
  40 +}
  41 +
  42 +SQL.Key.prototype.destroy = function() {
  43 + for (var i=0;i<this.rows.length;i++) {
  44 + this.rows[i].removeKey(this);
  45 + }
  46 +}
  47 +
  48 +SQL.Key.prototype.getLabel = function() {
  49 + return this.name || this.type;
  50 +}
  51 +
  52 +SQL.Key.prototype.toXML = function() {
  53 + var xml = "";
  54 + xml += '<key type="'+this.getType()+'" name="'+this.getName()+'">\n';
  55 + for (var i=0;i<this.rows.length;i++) {
  56 + var r = this.rows[i];
  57 + xml += '<part>'+r.getTitle()+'</part>\n';
  58 + }
  59 + xml += '</key>\n';
  60 + return xml;
  61 +}
  62 +
  63 +SQL.Key.prototype.fromXML = function(node) {
  64 + this.setType(node.getAttribute("type"));
  65 + this.setName(node.getAttribute("name"));
  66 + var parts = node.getElementsByTagName("part");
  67 + for (var i=0;i<parts.length;i++) {
  68 + var name = parts[i].firstChild.nodeValue;
  69 + var row = this.owner.findNamedRow(name);
  70 + this.addRow(row);
  71 + }
  72 +}
... ...
resources/js/hayamiki_designer/js/keymanager.js 0 → 100644
  1 +/* ----------------- key manager ---------- */
  2 +
  3 +SQL.KeyManager = function(owner) {
  4 + this.owner = owner;
  5 + this.dom = {
  6 + container:OZ.$("keys")
  7 + }
  8 + this.build();
  9 +}
  10 +
  11 +SQL.KeyManager.prototype.build = function() {
  12 + this.dom.list = OZ.$("keyslist");
  13 + this.dom.type = OZ.$("keytype");
  14 + this.dom.name = OZ.$("keyname");
  15 + this.dom.left = OZ.$("keyleft");
  16 + this.dom.right = OZ.$("keyright");
  17 + this.dom.fields = OZ.$("keyfields");
  18 + this.dom.avail = OZ.$("keyavail");
  19 + this.dom.listlabel = OZ.$("keyslistlabel");
  20 +
  21 + var ids = ["keyadd","keyremove"];
  22 + for (var i=0;i<ids.length;i++) {
  23 + var id = ids[i];
  24 + var elm = OZ.$(id);
  25 + this.dom[id] = elm;
  26 + elm.value = _(id);
  27 + }
  28 +
  29 + var ids = ["keyedit","keytypelabel","keynamelabel","keyfieldslabel","keyavaillabel"];
  30 + for (var i=0;i<ids.length;i++) {
  31 + var id = ids[i];
  32 + var elm = OZ.$(id);
  33 + elm.innerHTML = _(id);
  34 + }
  35 +
  36 + var types = ["PRIMARY","INDEX","UNIQUE","FULLTEXT"];
  37 + OZ.DOM.clear(this.dom.type);
  38 + for (var i=0;i<types.length;i++) {
  39 + var o = OZ.DOM.elm("option");
  40 + o.innerHTML = types[i];
  41 + o.value = types[i];
  42 + this.dom.type.appendChild(o);
  43 + }
  44 +
  45 + this.purge = this.purge.bind(this);
  46 +
  47 + OZ.Event.add(this.dom.list, "change", this.listchange.bind(this));
  48 + OZ.Event.add(this.dom.type, "change", this.typechange.bind(this));
  49 + OZ.Event.add(this.dom.name, "keyup", this.namechange.bind(this));
  50 + OZ.Event.add(this.dom.keyadd, "click", this.add.bind(this));
  51 + OZ.Event.add(this.dom.keyremove, "click", this.remove.bind(this));
  52 + OZ.Event.add(this.dom.left, "click", this.left.bind(this));
  53 + OZ.Event.add(this.dom.right, "click", this.right.bind(this));
  54 +
  55 + this.dom.container.parentNode.removeChild(this.dom.container);
  56 +}
  57 +
  58 +SQL.KeyManager.prototype.listchange = function(e) {
  59 + this.switchTo(this.dom.list.selectedIndex);
  60 +}
  61 +
  62 +SQL.KeyManager.prototype.typechange = function(e) {
  63 + this.key.setType(this.dom.type.value);
  64 + this.redrawListItem();
  65 +}
  66 +
  67 +SQL.KeyManager.prototype.namechange = function(e) {
  68 + this.key.setName(this.dom.name.value);
  69 + this.redrawListItem();
  70 +}
  71 +
  72 +SQL.KeyManager.prototype.add = function(e) {
  73 + var type = (this.table.keys.length ? "INDEX" : "PRIMARY");
  74 + this.table.addKey(type);
  75 + this.sync(this.table);
  76 + this.switchTo(this.table.keys.length-1);
  77 +}
  78 +
  79 +SQL.KeyManager.prototype.remove = function(e) {
  80 + var index = this.dom.list.selectedIndex;
  81 + if (index == -1) { return; }
  82 + var r = this.table.keys[index];
  83 + this.table.removeKey(r);
  84 + this.sync(this.table);
  85 +}
  86 +
  87 +SQL.KeyManager.prototype.purge = function() { /* remove empty keys */
  88 + for (var i=this.table.keys.length-1;i>=0;i--) {
  89 + var k = this.table.keys[i];
  90 + if (!k.rows.length) { this.table.removeKey(k); }
  91 + }
  92 +}
  93 +
  94 +SQL.KeyManager.prototype.sync = function(table) { /* sync content with given table */
  95 + this.table = table;
  96 + this.dom.listlabel.innerHTML = _("keyslistlabel").replace(/%s/,table.getTitle());
  97 +
  98 + OZ.DOM.clear(this.dom.list);
  99 + for (var i=0;i<table.keys.length;i++) {
  100 + var k = table.keys[i];
  101 + var o = OZ.DOM.elm("option");
  102 + this.dom.list.appendChild(o);
  103 + var str = (i+1)+": "+k.getLabel();
  104 + o.innerHTML = str;
  105 + }
  106 + if (table.keys.length) {
  107 + this.switchTo(0);
  108 + } else {
  109 + this.disable();
  110 + }
  111 +}
  112 +
  113 +SQL.KeyManager.prototype.redrawListItem = function() {
  114 + var index = this.table.keys.indexOf(this.key);
  115 + this.option.innerHTML = (index+1)+": "+this.key.getLabel();
  116 +}
  117 +
  118 +SQL.KeyManager.prototype.switchTo = function(index) { /* show Nth key */
  119 + this.enable();
  120 + var k = this.table.keys[index];
  121 + this.key = k;
  122 + this.option = this.dom.list.getElementsByTagName("option")[index];
  123 +
  124 + this.dom.list.selectedIndex = index;
  125 + this.dom.name.value = k.getName();
  126 +
  127 + var opts = this.dom.type.getElementsByTagName("option");
  128 + for (var i=0;i<opts.length;i++) {
  129 + if (opts[i].value == k.getType()) { this.dom.type.selectedIndex = i; }
  130 + }
  131 +
  132 + OZ.DOM.clear(this.dom.fields);
  133 + for (var i=0;i<k.rows.length;i++) {
  134 + var o = OZ.DOM.elm("option");
  135 + o.innerHTML = k.rows[i].getTitle();
  136 + o.value = o.innerHTML;
  137 + this.dom.fields.appendChild(o);
  138 + }
  139 +
  140 + OZ.DOM.clear(this.dom.avail);
  141 + for (var i=0;i<this.table.rows.length;i++) {
  142 + var r = this.table.rows[i];
  143 + if (k.rows.indexOf(r) != -1) { continue; }
  144 + var o = OZ.DOM.elm("option");
  145 + o.innerHTML = r.getTitle();
  146 + o.value = o.innerHTML;
  147 + this.dom.avail.appendChild(o);
  148 + }
  149 +}
  150 +
  151 +SQL.KeyManager.prototype.disable = function() {
  152 + OZ.DOM.clear(this.dom.fields);
  153 + OZ.DOM.clear(this.dom.avail);
  154 + this.dom.keyremove.disabled = true;
  155 + this.dom.left.disabled = true;
  156 + this.dom.right.disabled = true;
  157 + this.dom.list.disabled = true;
  158 + this.dom.name.disabled = true;
  159 + this.dom.type.disabled = true;
  160 + this.dom.fields.disabled = true;
  161 + this.dom.avail.disabled = true;
  162 +}
  163 +
  164 +SQL.KeyManager.prototype.enable = function() {
  165 + this.dom.keyremove.disabled = false;
  166 + this.dom.left.disabled = false;
  167 + this.dom.right.disabled = false;
  168 + this.dom.list.disabled = false;
  169 + this.dom.name.disabled = false;
  170 + this.dom.type.disabled = false;
  171 + this.dom.fields.disabled = false;
  172 + this.dom.avail.disabled = false;
  173 +}
  174 +
  175 +SQL.KeyManager.prototype.left = function(e) { /* add field to index */
  176 + var opts = this.dom.avail.getElementsByTagName("option");
  177 + for (var i=0;i<opts.length;i++) {
  178 + var o = opts[i];
  179 + if (o.selected) {
  180 + var row = this.table.findNamedRow(o.value);
  181 + this.key.addRow(row);
  182 + }
  183 + }
  184 + this.switchTo(this.dom.list.selectedIndex);
  185 +}
  186 +
  187 +SQL.KeyManager.prototype.right = function(e) { /* remove field from index */
  188 + var opts = this.dom.fields.getElementsByTagName("option");
  189 + for (var i=0;i<opts.length;i++) {
  190 + var o = opts[i];
  191 + if (o.selected) {
  192 + var row = this.table.findNamedRow(o.value);
  193 + this.key.removeRow(row);
  194 + }
  195 + }
  196 + this.switchTo(this.dom.list.selectedIndex);
  197 +}
  198 +
  199 +SQL.KeyManager.prototype.open = function(table) {
  200 + this.sync(table);
  201 + this.owner.window.open(_("tablekeys"),this.dom.container,this.purge);
  202 +}
... ...
resources/js/hayamiki_designer/js/map.js 0 → 100644
  1 +/* --------------------- minimap ------------ */
  2 +
  3 +SQL.Map = function(owner) {
  4 + this.owner = owner;
  5 + SQL.Visual.apply(this);
  6 + this.dom.container = OZ.$("minimap");
  7 + this.width = this.dom.container.offsetWidth - 2;
  8 + this.height = this.dom.container.offsetHeight - 2;
  9 +
  10 + this.dom.port = OZ.DOM.elm("div",{className:"port", zIndex:1});
  11 + this.dom.container.appendChild(this.dom.port);
  12 + this.sync = this.sync.bind(this);
  13 +
  14 + this.flag = false;
  15 + this.sync();
  16 +
  17 + OZ.Event.add(window, "resize", this.sync);
  18 + OZ.Event.add(window, "scroll", this.sync);
  19 + OZ.Event.add(this.dom.container, "mousedown", this.down.bind(this));
  20 + OZ.Event.add(this.dom.container, "touchstart", this.down.bind(this));
  21 + OZ.Event.add(this.dom.container, "touchmove", OZ.Event.prevent);
  22 +}
  23 +SQL.Map.prototype = Object.create(SQL.Visual.prototype);
  24 +
  25 +SQL.Map.prototype.down = function(e) { /* mousedown - move view and start drag */
  26 + this.flag = true;
  27 + this.dom.container.style.cursor = "move";
  28 + var pos = OZ.DOM.pos(this.dom.container);
  29 +
  30 + this.x = Math.round(pos[0] + this.l + this.w/2);
  31 + this.y = Math.round(pos[1] + this.t + this.h/2);
  32 + this.move(e);
  33 +
  34 + if (e.type == "touchstart") {
  35 + var eventMove = "touchmove";
  36 + var eventUp = "touchend";
  37 + } else {
  38 + var eventMove = "mousemove";
  39 + var eventUp = "mouseup";
  40 + }
  41 +
  42 + this.documentMove = OZ.Event.add(document, eventMove, this.move.bind(this));
  43 + this.documentUp = OZ.Event.add(document, eventUp, this.up.bind(this));
  44 +}
  45 +
  46 +SQL.Map.prototype.move = function(e) { /* mousemove */
  47 + if (!this.flag) { return; }
  48 + OZ.Event.prevent(e);
  49 +
  50 + if (e.type.match(/touch/)) {
  51 + if (e.touches.length > 1) { return; }
  52 + var event = e.touches[0];
  53 + } else {
  54 + var event = e;
  55 + }
  56 +
  57 + var dx = event.clientX - this.x;
  58 + var dy = event.clientY - this.y;
  59 + if (this.l + dx < 0) { dx = -this.l; }
  60 + if (this.t + dy < 0) { dy = -this.t; }
  61 + if (this.l + this.w + 4 + dx > this.width) { dx = this.width - 4 - this.l - this.w; }
  62 + if (this.t + this.h + 4 + dy > this.height) { dy = this.height - 4 - this.t - this.h; }
  63 +
  64 +
  65 + this.x += dx;
  66 + this.y += dy;
  67 +
  68 + this.l += dx;
  69 + this.t += dy;
  70 +
  71 + var coefX = this.width / this.owner.width;
  72 + var coefY = this.height / this.owner.height;
  73 + var left = this.l / coefX;
  74 + var top = this.t / coefY;
  75 +
  76 + if (OZ.webkit) {
  77 + document.body.scrollLeft = Math.round(left);
  78 + document.body.scrollTop = Math.round(top);
  79 + } else {
  80 + document.documentElement.scrollLeft = Math.round(left);
  81 + document.documentElement.scrollTop = Math.round(top);
  82 + }
  83 +
  84 + this.redraw();
  85 +}
  86 +
  87 +SQL.Map.prototype.up = function(e) { /* mouseup */
  88 + this.flag = false;
  89 + this.dom.container.style.cursor = "";
  90 + OZ.Event.remove(this.documentMove);
  91 + OZ.Event.remove(this.documentUp);
  92 +}
  93 +
  94 +SQL.Map.prototype.sync = function() { /* when window changes, adjust map */
  95 + var dims = OZ.DOM.win();
  96 + var scroll = OZ.DOM.scroll();
  97 + var scaleX = this.width / this.owner.width;
  98 + var scaleY = this.height / this.owner.height;
  99 +
  100 + var w = dims[0] * scaleX - 4 - 0;
  101 + var h = dims[1] * scaleY - 4 - 0;
  102 + var x = scroll[0] * scaleX;
  103 + var y = scroll[1] * scaleY;
  104 +
  105 + this.w = Math.round(w);
  106 + this.h = Math.round(h);
  107 + this.l = Math.round(x);
  108 + this.t = Math.round(y);
  109 +
  110 + this.redraw();
  111 +}
  112 +
  113 +SQL.Map.prototype.redraw = function() {
  114 + this.dom.port.style.width = this.w+"px";
  115 + this.dom.port.style.height = this.h+"px";
  116 + this.dom.port.style.left = this.l+"px";
  117 + this.dom.port.style.top = this.t+"px";
  118 +}
... ...
resources/js/hayamiki_designer/js/options.js 0 → 100644
  1 +/* --------------------- options ------------ */
  2 +
  3 +SQL.Options = function(owner) {
  4 + this.owner = owner;
  5 + this.dom = {
  6 + container:OZ.$("opts"),
  7 + btn:OZ.$("options")
  8 + }
  9 + this.dom.btn.value = _("options");
  10 + this.save = this.save.bind(this);
  11 + this.build();
  12 +}
  13 +
  14 +SQL.Options.prototype.build = function() {
  15 + this.dom.optionlocale = OZ.$("optionlocale");
  16 + this.dom.optiondb = OZ.$("optiondb");
  17 + this.dom.optionsnap = OZ.$("optionsnap");
  18 + this.dom.optionpattern = OZ.$("optionpattern");
  19 + this.dom.optionhide = OZ.$("optionhide");
  20 + this.dom.optionvector = OZ.$("optionvector");
  21 + this.dom.optionshowsize = OZ.$("optionshowsize");
  22 + this.dom.optionshowtype = OZ.$("optionshowtype");
  23 +
  24 + var ids = ["language","db","snap","pattern","hide","vector","showsize","showtype","optionsnapnotice","optionpatternnotice","optionsnotice"];
  25 + for (var i=0;i<ids.length;i++) {
  26 + var id = ids[i];
  27 + var elm = OZ.$(id);
  28 + elm.innerHTML = _(id);
  29 + }
  30 +
  31 + var ls = CONFIG.AVAILABLE_LOCALES;
  32 + OZ.DOM.clear(this.dom.optionlocale);
  33 + for (var i=0;i<ls.length;i++) {
  34 + var o = OZ.DOM.elm("option");
  35 + o.value = ls[i];
  36 + o.innerHTML = ls[i];
  37 + this.dom.optionlocale.appendChild(o);
  38 + if (this.owner.getOption("locale") == ls[i]) { this.dom.optionlocale.selectedIndex = i; }
  39 + }
  40 +
  41 + var dbs = CONFIG.AVAILABLE_DBS;
  42 + OZ.DOM.clear(this.dom.optiondb);
  43 + for (var i=0;i<dbs.length;i++) {
  44 + var o = OZ.DOM.elm("option");
  45 + o.value = dbs[i];
  46 + o.innerHTML = dbs[i];
  47 + this.dom.optiondb.appendChild(o);
  48 + if (this.owner.getOption("db") == dbs[i]) { this.dom.optiondb.selectedIndex = i; }
  49 + }
  50 +
  51 +
  52 + OZ.Event.add(this.dom.btn, "click", this.click.bind(this));
  53 +
  54 + this.dom.container.parentNode.removeChild(this.dom.container);
  55 +}
  56 +
  57 +SQL.Options.prototype.save = function() {
  58 + this.owner.setOption("locale",this.dom.optionlocale.value);
  59 + this.owner.setOption("db",this.dom.optiondb.value);
  60 + this.owner.setOption("snap",this.dom.optionsnap.value);
  61 + this.owner.setOption("pattern",this.dom.optionpattern.value);
  62 + this.owner.setOption("hide",this.dom.optionhide.checked ? "1" : "");
  63 + this.owner.setOption("vector",this.dom.optionvector.checked ? "1" : "");
  64 + this.owner.setOption("showsize",this.dom.optionshowsize.checked ? "1" : "");
  65 + this.owner.setOption("showtype",this.dom.optionshowtype.checked ? "1" : "");
  66 +}
  67 +
  68 +SQL.Options.prototype.click = function() {
  69 + this.owner.window.open(_("options"),this.dom.container,this.save);
  70 + this.dom.optionsnap.value = this.owner.getOption("snap");
  71 + this.dom.optionpattern.value = this.owner.getOption("pattern");
  72 + this.dom.optionhide.checked = this.owner.getOption("hide");
  73 + this.dom.optionvector.checked = this.owner.getOption("vector");
  74 + this.dom.optionshowsize.checked = this.owner.getOption("showsize");
  75 + this.dom.optionshowtype.checked = this.owner.getOption("showtype");
  76 +}
... ...
resources/js/hayamiki_designer/js/oz.js 0 → 100644
  1 +/* (c) 2007 - now() Ondrej Zara, 1.7 */
  2 +var OZ = {
  3 + $:function(x) { return typeof(x) == "string" ? document.getElementById(x) : x; },
  4 + select: function(x) { return document.querySelectorAll(x); },
  5 + opera:!!window.opera,
  6 + ie:!!document.attachEvent && !window.opera,
  7 + gecko:!!document.getAnonymousElementByAttribute,
  8 + webkit:!!navigator.userAgent.match(/webkit/i),
  9 + khtml:!!navigator.userAgent.match(/khtml/i) || !!navigator.userAgent.match(/konqueror/i),
  10 + Event:{
  11 + _id:0,
  12 + _byName:{},
  13 + _byID:{},
  14 + add:function(elm,event,cb) {
  15 + var id = OZ.Event._id++;
  16 + var element = OZ.$(elm);
  17 + var fnc = (element && element.attachEvent ? function() { return cb.apply(element,arguments); } : cb);
  18 + var rec = [element,event,fnc];
  19 + var parts = event.split(" ");
  20 + while (parts.length) {
  21 + var e = parts.pop();
  22 + if (element) {
  23 + if (element.addEventListener) {
  24 + element.addEventListener(e,fnc,false);
  25 + } else if (element.attachEvent) {
  26 + element.attachEvent("on"+e,fnc);
  27 + }
  28 + }
  29 + if (!(e in OZ.Event._byName)) { OZ.Event._byName[e] = {}; }
  30 + OZ.Event._byName[e][id] = rec;
  31 + }
  32 + OZ.Event._byID[id] = rec;
  33 + return id;
  34 + },
  35 + remove:function(id) {
  36 + var rec = OZ.Event._byID[id];
  37 + if (!rec) { return; }
  38 + var elm = rec[0];
  39 + var parts = rec[1].split(" ");
  40 + while (parts.length) {
  41 + var e = parts.pop();
  42 + if (elm) {
  43 + if (elm.removeEventListener) {
  44 + elm.removeEventListener(e,rec[2],false);
  45 + } else if (elm.detachEvent) {
  46 + elm.detachEvent("on"+e,rec[2]);
  47 + }
  48 + }
  49 + delete OZ.Event._byName[e][id];
  50 + }
  51 + delete OZ.Event._byID[id];
  52 + },
  53 + stop:function(e) { e.stopPropagation ? e.stopPropagation() : e.cancelBubble = true; },
  54 + prevent:function(e) { e.preventDefault ? e.preventDefault() : e.returnValue = false; },
  55 + target:function(e) { return e.target || e.srcElement; }
  56 + },
  57 + Class:function() {
  58 + var c = function() {
  59 + var init = arguments.callee.prototype.init;
  60 + if (init) { init.apply(this,arguments); }
  61 + };
  62 + c.implement = function(parent) {
  63 + for (var p in parent.prototype) { this.prototype[p] = parent.prototype[p]; }
  64 + return this;
  65 + };
  66 + c.extend = function(parent) {
  67 + var tmp = function(){};
  68 + tmp.prototype = parent.prototype;
  69 + this.prototype = new tmp();
  70 + this.prototype.constructor = this;
  71 + return this;
  72 + };
  73 + c.prototype.bind = function(fnc) { return fnc.bind(this); };
  74 + c.prototype.dispatch = function(type, data) {
  75 + var obj = {
  76 + type:type,
  77 + target:this,
  78 + timeStamp:(new Date()).getTime(),
  79 + data:data
  80 + }
  81 + var tocall = [];
  82 + var list = OZ.Event._byName[type];
  83 + for (var id in list) {
  84 + var item = list[id];
  85 + if (!item[0] || item[0] == this) { tocall.push(item[2]); }
  86 + }
  87 + var len = tocall.length;
  88 + for (var i=0;i<len;i++) { tocall[i](obj); }
  89 + }
  90 + return c;
  91 + },
  92 + DOM:{
  93 + elm:function(name, opts) {
  94 + var elm = document.createElement(name);
  95 + for (var p in opts) {
  96 + var val = opts[p];
  97 + if (p == "class") { p = "className"; }
  98 + if (p in elm) { elm[p] = val; }
  99 + }
  100 + OZ.Style.set(elm, opts);
  101 + return elm;
  102 + },
  103 + text:function(str) { return document.createTextNode(str); },
  104 + clear:function(node) { while (node.firstChild) {node.removeChild(node.firstChild);} },
  105 + pos:function(elm) { /* relative to _viewport_ */
  106 + var cur = OZ.$(elm);
  107 + var html = cur.ownerDocument.documentElement;
  108 + var parent = cur.parentNode;
  109 + var x = y = 0;
  110 + if (cur == html) { return [x,y]; }
  111 + while (1) {
  112 + if (OZ.Style.get(cur,"position") == "fixed") {
  113 + x += cur.offsetLeft;
  114 + y += cur.offsetTop;
  115 + return [x,y];
  116 + }
  117 +
  118 + if (OZ.opera && (parent == html || OZ.Style.get(cur,"display") != "block")) { } else {
  119 + x -= parent.scrollLeft;
  120 + y -= parent.scrollTop;
  121 + }
  122 + if (parent == cur.offsetParent || cur.parentNode == html) {
  123 + x += cur.offsetLeft;
  124 + y += cur.offsetTop;
  125 + cur = parent;
  126 + }
  127 +
  128 + if (parent == html) { return [x,y]; }
  129 + parent = parent.parentNode;
  130 + }
  131 + },
  132 + scroll:function() {
  133 + var x = document.documentElement.scrollLeft || document.body.scrollLeft || 0;
  134 + var y = document.documentElement.scrollTop || document.body.scrollTop || 0;
  135 + return [x,y];
  136 + },
  137 + win:function(avail) {
  138 + return (avail ? [window.innerWidth,window.innerHeight] : [document.documentElement.clientWidth,document.documentElement.clientHeight]);
  139 + },
  140 + hasClass:function(node, className) {
  141 + var cn = OZ.$(node).className;
  142 + var arr = (cn ? cn.split(" ") : []);
  143 + return (arr.indexOf(className) != -1);
  144 + },
  145 + addClass:function(node,className) {
  146 + if (OZ.DOM.hasClass(node, className)) { return; }
  147 + var cn = OZ.$(node).className;
  148 + var arr = (cn ? cn.split(" ") : []);
  149 + arr.push(className);
  150 + OZ.$(node).className = arr.join(" ");
  151 + },
  152 + removeClass:function(node, className) {
  153 + if (!OZ.DOM.hasClass(node, className)) { return; }
  154 + var cn = OZ.$(node).className;
  155 + var arr = (cn ? cn.split(" ") : []);
  156 + var arr = arr.filter(function($){ return $ != className; });
  157 + OZ.$(node).className = arr.join(" ");
  158 + },
  159 + append:function() {
  160 + if (arguments.length == 1) {
  161 + var arr = arguments[0];
  162 + var root = OZ.$(arr[0]);
  163 + for (var i=1;i<arr.length;i++) { root.appendChild(OZ.$(arr[i])); }
  164 + } else for (var i=0;i<arguments.length;i++) { OZ.DOM.append(arguments[i]); }
  165 + }
  166 + },
  167 + Style:{
  168 + get:function(elm, prop) {
  169 + if (document.defaultView && document.defaultView.getComputedStyle) {
  170 + try {
  171 + var cs = elm.ownerDocument.defaultView.getComputedStyle(elm,"");
  172 + } catch(e) {
  173 + return false;
  174 + }
  175 + if (!cs) { return false; }
  176 + return cs[prop];
  177 + } else {
  178 + return elm.currentStyle[prop];
  179 + }
  180 + },
  181 + set:function(elm, obj) {
  182 + for (var p in obj) {
  183 + var val = obj[p];
  184 + if (p == "opacity" && OZ.ie) {
  185 + p = "filter";
  186 + val = "alpha(opacity="+Math.round(100*val)+")";
  187 + elm.style.zoom = 1;
  188 + } else if (p == "float") {
  189 + p = (OZ.ie ? "styleFloat" : "cssFloat");
  190 + }
  191 + if (p in elm.style) { elm.style[p] = val; }
  192 + }
  193 + }
  194 + },
  195 + Request:function(url, callback, options) {
  196 + var o = {data:false, method:"get", headers:{}, xml:false}
  197 + for (var p in options) { o[p] = options[p]; }
  198 + o.method = o.method.toUpperCase();
  199 +
  200 + var xhr = false;
  201 + if (window.XMLHttpRequest) { xhr = new XMLHttpRequest(); }
  202 + else if (window.ActiveXObject) { xhr = new ActiveXObject("Microsoft.XMLHTTP"); }
  203 + else { return false; }
  204 + xhr.open(o.method, url, true);
  205 + xhr.onreadystatechange = function() {
  206 + if (xhr.readyState != 4) { return; }
  207 + if (!callback) { return; }
  208 + var data = (o.xml ? xhr.responseXML : xhr.responseText);
  209 + var headers = {};
  210 + var h = xhr.getAllResponseHeaders();
  211 + if (h) {
  212 + h = h.split(/[\r\n]/);
  213 + for (var i=0;i<h.length;i++) if (h[i]) {
  214 + var v = h[i].match(/^([^:]+): *(.*)$/);
  215 + headers[v[1]] = v[2];
  216 + }
  217 + }
  218 + callback(data,xhr.status,headers);
  219 + };
  220 + if (o.method == "POST") { xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); }
  221 + for (var p in o.headers) { xhr.setRequestHeader(p,o.headers[p]); }
  222 + xhr.send(o.data || null);
  223 + return xhr;
  224 + }
  225 +}
  226 +
  227 +if (!Function.prototype.bind) {
  228 + Function.prototype.bind = function(thisObj) {
  229 + var fn = this;
  230 + var args = Array.prototype.slice.call(arguments, 1);
  231 + return function() {
  232 + return fn.apply(thisObj, args.concat(Array.prototype.slice.call(arguments)));
  233 + }
  234 + }
  235 +};
  236 +
  237 +if (!Array.prototype.indexOf) {
  238 + Array.prototype.indexOf = function(item, from) {
  239 + var len = this.length;
  240 + var i = from || 0;
  241 + if (i < 0) { i += len; }
  242 + for (;i<len;i++) {
  243 + if (i in this && this[i] === item) { return i; }
  244 + }
  245 + return -1;
  246 + }
  247 +}
  248 +if (!Array.indexOf) {
  249 + Array.indexOf = function(obj, item, from) { return Array.prototype.indexOf.call(obj, item, from); }
  250 +}
  251 +
  252 +if (!Array.prototype.lastIndexOf) {
  253 + Array.prototype.lastIndexOf = function(item, from) {
  254 + var len = this.length;
  255 + var i = from || len-1;
  256 + if (i < 0) { i += len; }
  257 + for (;i>-1;i--) {
  258 + if (i in this && this[i] === item) { return i; }
  259 + }
  260 + return -1;
  261 + }
  262 +}
  263 +if (!Array.lastIndexOf) {
  264 + Array.lastIndexOf = function(obj, item, from) { return Array.prototype.lastIndexOf.call(obj, item, from); }
  265 +}
  266 +
  267 +if (!Array.prototype.forEach) {
  268 + Array.prototype.forEach = function(cb, _this) {
  269 + var len = this.length;
  270 + for (var i=0;i<len;i++) {
  271 + if (i in this) { cb.call(_this, this[i], i, this); }
  272 + }
  273 + }
  274 +}
  275 +if (!Array.forEach) {
  276 + Array.forEach = function(obj, cb, _this) { Array.prototype.forEach.call(obj, cb, _this); }
  277 +}
  278 +
  279 +if (!Array.prototype.every) {
  280 + Array.prototype.every = function(cb, _this) {
  281 + var len = this.length;
  282 + for (var i=0;i<len;i++) {
  283 + if (i in this && !cb.call(_this, this[i], i, this)) { return false; }
  284 + }
  285 + return true;
  286 + }
  287 +}
  288 +if (!Array.every) {
  289 + Array.every = function(obj, cb, _this) { return Array.prototype.every.call(obj, cb, _this); }
  290 +}
  291 +
  292 +if (!Array.prototype.some) {
  293 + Array.prototype.some = function(cb, _this) {
  294 + var len = this.length;
  295 + for (var i=0;i<len;i++) {
  296 + if (i in this && cb.call(_this, this[i], i, this)) { return true; }
  297 + }
  298 + return false;
  299 + }
  300 +}
  301 +if (!Array.some) {
  302 + Array.some = function(obj, cb, _this) { return Array.prototype.some.call(obj, cb, _this); }
  303 +}
  304 +
  305 +if (!Array.prototype.map) {
  306 + Array.prototype.map = function(cb, _this) {
  307 + var len = this.length;
  308 + var res = new Array(len);
  309 + for (var i=0;i<len;i++) {
  310 + if (i in this) { res[i] = cb.call(_this, this[i], i, this); }
  311 + }
  312 + return res;
  313 + }
  314 +}
  315 +if (!Array.map) {
  316 + Array.map = function(obj, cb, _this) { return Array.prototype.map.call(obj, cb, _this); }
  317 +}
  318 +
  319 +if (!Array.prototype.filter) {
  320 + Array.prototype.filter = function(cb, _this) {
  321 + var len = this.length;
  322 + var res = [];
  323 + for (var i=0;i<len;i++) {
  324 + if (i in this) {
  325 + var val = this[i];
  326 + if (cb.call(_this, val, i, this)) { res.push(val); }
  327 + }
  328 + }
  329 + return res;
  330 + }
  331 +}
  332 +if (!Array.filter) {
  333 + Array.filter = function(obj, cb, _this) { return Array.prototype.filter.call(obj, cb, _this); }
  334 +}
... ...
resources/js/hayamiki_designer/js/relation.js 0 → 100644
  1 +/* --------------------------- relation (connector) ----------- */
  2 +
  3 +SQL.Relation = function(owner, row1, row2) {
  4 + this.owner = owner;
  5 + this.row1 = row1;
  6 + this.row2 = row2;
  7 + this.color = "#000";
  8 + this.hidden = false;
  9 + SQL.Visual.apply(this);
  10 +
  11 + /* if one of the rows already has relations, inherit color */
  12 + var all = row1.relations.concat(row2.relations);
  13 + if (all.length) { /* inherit */
  14 + this.color = all[0].getColor();
  15 + } else if (CONFIG.RELATION_COLORS) { /* pick next */
  16 + SQL.Relation._counter++;
  17 + var colorIndex = SQL.Relation._counter - 1;
  18 + this.color = CONFIG.RELATION_COLORS[colorIndex % CONFIG.RELATION_COLORS.length];
  19 + }
  20 +
  21 + this.row1.addRelation(this);
  22 + this.row2.addRelation(this);
  23 + this.dom = [];
  24 +
  25 + if (this.owner.vector) {
  26 + var path = document.createElementNS(this.owner.svgNS, "path");
  27 + path.setAttribute("stroke", this.color);
  28 + path.setAttribute("stroke-width", CONFIG.RELATION_THICKNESS);
  29 + path.setAttribute("fill", "none");
  30 + this.owner.dom.svg.appendChild(path);
  31 + this.dom.push(path);
  32 + } else {
  33 + for (var i=0;i<3;i++) {
  34 + var div = OZ.DOM.elm("div",{position:"absolute",className:"relation",backgroundColor:this.color});
  35 + this.dom.push(div);
  36 + if (i & 1) { /* middle */
  37 + OZ.Style.set(div, {width:CONFIG.RELATION_THICKNESS+"px"});
  38 + } else { /* first & last */
  39 + OZ.Style.set(div, {height:CONFIG.RELATION_THICKNESS+"px"});
  40 + }
  41 + this.owner.dom.container.appendChild(div);
  42 + }
  43 + }
  44 +
  45 + this.redraw();
  46 +}
  47 +SQL.Relation._counter = 0;
  48 +SQL.Relation.prototype = Object.create(SQL.Visual.prototype);
  49 +
  50 +SQL.Relation.prototype.getColor = function() {
  51 + return this.color;
  52 +}
  53 +
  54 +SQL.Relation.prototype.show = function() {
  55 + this.hidden = false;
  56 + for (var i=0;i<this.dom.length;i++) {
  57 + this.dom[i].style.visibility = "";
  58 + }
  59 +}
  60 +
  61 +SQL.Relation.prototype.hide = function() {
  62 + this.hidden = true;
  63 + for (var i=0;i<this.dom.length;i++) {
  64 + this.dom[i].style.visibility = "hidden";
  65 + }
  66 +}
  67 +
  68 +SQL.Relation.prototype.redrawNormal = function(p1, p2, half) {
  69 + if (this.owner.vector) {
  70 + var str = "M "+p1[0]+" "+p1[1]+" C "+(p1[0] + half)+" "+p1[1]+" ";
  71 + str += (p2[0]-half)+" "+p2[1]+" "+p2[0]+" "+p2[1];
  72 + this.dom[0].setAttribute("d",str);
  73 + } else {
  74 + this.dom[0].style.left = p1[0]+"px";
  75 + this.dom[0].style.top = p1[1]+"px";
  76 + this.dom[0].style.width = half+"px";
  77 +
  78 + this.dom[1].style.left = (p1[0] + half) + "px";
  79 + this.dom[1].style.top = Math.min(p1[1],p2[1]) + "px";
  80 + this.dom[1].style.height = (Math.abs(p1[1] - p2[1])+CONFIG.RELATION_THICKNESS)+"px";
  81 +
  82 + this.dom[2].style.left = (p1[0]+half+1)+"px";
  83 + this.dom[2].style.top = p2[1]+"px";
  84 + this.dom[2].style.width = half+"px";
  85 + }
  86 +}
  87 +
  88 +SQL.Relation.prototype.redrawSide = function(p1, p2, x) {
  89 + if (this.owner.vector) {
  90 + var str = "M "+p1[0]+" "+p1[1]+" C "+x+" "+p1[1]+" ";
  91 + str += x+" "+p2[1]+" "+p2[0]+" "+p2[1];
  92 + this.dom[0].setAttribute("d",str);
  93 + } else {
  94 + this.dom[0].style.left = Math.min(x,p1[0])+"px";
  95 + this.dom[0].style.top = p1[1]+"px";
  96 + this.dom[0].style.width = Math.abs(p1[0]-x)+"px";
  97 +
  98 + this.dom[1].style.left = x+"px";
  99 + this.dom[1].style.top = Math.min(p1[1],p2[1]) + "px";
  100 + this.dom[1].style.height = (Math.abs(p1[1] - p2[1])+CONFIG.RELATION_THICKNESS)+"px";
  101 +
  102 + this.dom[2].style.left = Math.min(x,p2[0])+"px";
  103 + this.dom[2].style.top = p2[1]+"px";
  104 + this.dom[2].style.width = Math.abs(p2[0]-x)+"px";
  105 + }
  106 +}
  107 +
  108 +SQL.Relation.prototype.redraw = function() { /* draw connector */
  109 + if (this.hidden) { return; }
  110 + var t1 = this.row1.owner.dom.container;
  111 + var t2 = this.row2.owner.dom.container;
  112 +
  113 + var l1 = t1.offsetLeft;
  114 + var l2 = t2.offsetLeft;
  115 + var r1 = l1 + t1.offsetWidth;
  116 + var r2 = l2 + t2.offsetWidth;
  117 + var t1 = t1.offsetTop + this.row1.dom.container.offsetTop + Math.round(this.row1.dom.container.offsetHeight/2);
  118 + var t2 = t2.offsetTop + this.row2.dom.container.offsetTop + Math.round(this.row2.dom.container.offsetHeight/2);
  119 +
  120 + if (this.row1.owner.selected) { t1++; l1++; r1--; }
  121 + if (this.row2.owner.selected) { t2++; l2++; r2--; }
  122 +
  123 + var p1 = [0,0];
  124 + var p2 = [0,0];
  125 +
  126 + if (r1 < l2 || r2 < l1) { /* between tables */
  127 + if (Math.abs(r1 - l2) < Math.abs(r2 - l1)) {
  128 + p1 = [r1,t1];
  129 + p2 = [l2,t2];
  130 + } else {
  131 + p1 = [r2,t2];
  132 + p2 = [l1,t1];
  133 + }
  134 + var half = Math.floor((p2[0] - p1[0])/2);
  135 + this.redrawNormal(p1, p2, half);
  136 + } else { /* next to tables */
  137 + var x = 0;
  138 + var l = 0;
  139 + if (Math.abs(l1 - l2) < Math.abs(r1 - r2)) { /* left of tables */
  140 + p1 = [l1,t1];
  141 + p2 = [l2,t2];
  142 + x = Math.min(l1,l2) - CONFIG.RELATION_SPACING;
  143 + } else { /* right of tables */
  144 + p1 = [r1,t1];
  145 + p2 = [r2,t2];
  146 + x = Math.max(r1,r2) + CONFIG.RELATION_SPACING;
  147 + }
  148 + this.redrawSide(p1, p2, x);
  149 + } /* line next to tables */
  150 +}
  151 +
  152 +SQL.Relation.prototype.destroy = function() {
  153 + this.row1.removeRelation(this);
  154 + this.row2.removeRelation(this);
  155 + for (var i=0;i<this.dom.length;i++) {
  156 + this.dom[i].parentNode.removeChild(this.dom[i]);
  157 + }
  158 +}
... ...
resources/js/hayamiki_designer/js/row.js 0 → 100644
  1 +/* --------------------- table row ( = db column) ------------ */
  2 +SQL.Row = function(owner, title, data) {
  3 + this.owner = owner;
  4 + this.relations = [];
  5 + this.keys = [];
  6 + this.selected = false;
  7 + this.expanded = false;
  8 +
  9 + SQL.Visual.apply(this);
  10 +
  11 + this.data.type = 0;
  12 + this.data.size = "";
  13 + this.data.def = null;
  14 + this.data.nll = true;
  15 + this.data.ai = false;
  16 + this.data.comment = "";
  17 +
  18 + if (data) { this.update(data); }
  19 + this.setTitle(title);
  20 +}
  21 +SQL.Row.prototype = Object.create(SQL.Visual.prototype);
  22 +
  23 +SQL.Row.prototype._build = function() {
  24 + this.dom.container = OZ.DOM.elm("tbody");
  25 +
  26 + this.dom.content = OZ.DOM.elm("tr");
  27 + this.dom.selected = OZ.DOM.elm("div", {className:"selected",innerHTML:"&raquo;&nbsp;"});
  28 + this.dom.title = OZ.DOM.elm("div", {className:"title"});
  29 + var td1 = OZ.DOM.elm("td");
  30 + var td2 = OZ.DOM.elm("td", {className:"typehint"});
  31 + this.dom.typehint = td2;
  32 +
  33 + OZ.DOM.append(
  34 + [this.dom.container, this.dom.content],
  35 + [this.dom.content, td1, td2],
  36 + [td1, this.dom.selected, this.dom.title]
  37 + );
  38 +
  39 + this.enter = this.enter.bind(this);
  40 + this.changeComment = this.changeComment.bind(this);
  41 +
  42 + OZ.Event.add(this.dom.container, "click",this.click.bind(this));
  43 + OZ.Event.add(this.dom.container, "dblclick",this.dblclick.bind(this));
  44 +}
  45 +
  46 +SQL.Row.prototype.select = function() {
  47 + if (this.selected) { return; }
  48 + this.selected = true;
  49 + this.redraw();
  50 +}
  51 +
  52 +SQL.Row.prototype.deselect = function() {
  53 + if (!this.selected) { return; }
  54 + this.selected = false;
  55 + this.redraw();
  56 + this.collapse();
  57 +}
  58 +
  59 +SQL.Row.prototype.setTitle = function(t) {
  60 + var old = this.getTitle();
  61 + for (var i=0;i<this.relations.length;i++) {
  62 + var r = this.relations[i];
  63 + if (r.row1 != this) { continue; }
  64 + var tt = r.row2.getTitle().replace(new RegExp(old,"g"),t);
  65 + if (tt != r.row2.getTitle()) { r.row2.setTitle(tt); }
  66 + }
  67 +
  68 + SQL.Visual.prototype.setTitle.apply(this, [t]);
  69 +}
  70 +
  71 +SQL.Row.prototype.click = function(e) { /* clicked on row */
  72 + SQL.publish("rowclick", this);
  73 + this.owner.owner.rowManager.select(this);
  74 +}
  75 +
  76 +SQL.Row.prototype.dblclick = function(e) { /* dblclicked on row */
  77 + OZ.Event.prevent(e);
  78 + OZ.Event.stop(e);
  79 + this.expand();
  80 +}
  81 +
  82 +SQL.Row.prototype.update = function(data) { /* update subset of row data */
  83 + var des = SQL.Designer;
  84 + if (data.nll && data.def && data.def.match(/^null$/i)) { data.def = null; }
  85 +
  86 + for (var p in data) { this.data[p] = data[p]; }
  87 + if (!this.data.nll && this.data.def === null) { this.data.def = ""; }
  88 +
  89 + var elm = this.getDataType();
  90 + for (var i=0;i<this.relations.length;i++) {
  91 + var r = this.relations[i];
  92 + if (r.row1 == this) { r.row2.update({type:des.getFKTypeFor(this.data.type),size:this.data.size}); }
  93 + }
  94 + this.redraw();
  95 +}
  96 +
  97 +SQL.Row.prototype.up = function() { /* shift up */
  98 + var r = this.owner.rows;
  99 + var idx = r.indexOf(this);
  100 + if (!idx) { return; }
  101 + r[idx-1].dom.container.parentNode.insertBefore(this.dom.container,r[idx-1].dom.container);
  102 + r.splice(idx,1);
  103 + r.splice(idx-1,0,this);
  104 + this.redraw();
  105 +}
  106 +
  107 +SQL.Row.prototype.down = function() { /* shift down */
  108 + var r = this.owner.rows;
  109 + var idx = r.indexOf(this);
  110 + if (idx+1 == this.owner.rows.length) { return; }
  111 + r[idx].dom.container.parentNode.insertBefore(this.dom.container,r[idx+1].dom.container.nextSibling);
  112 + r.splice(idx,1);
  113 + r.splice(idx+1,0,this);
  114 + this.redraw();
  115 +}
  116 +
  117 +SQL.Row.prototype.buildEdit = function() {
  118 + OZ.DOM.clear(this.dom.container);
  119 +
  120 + var elms = [];
  121 + this.dom.name = OZ.DOM.elm("input");
  122 + this.dom.name.type = "text";
  123 + elms.push(["name",this.dom.name]);
  124 + OZ.Event.add(this.dom.name, "keypress", this.enter);
  125 +
  126 + this.dom.type = this.buildTypeSelect(this.data.type);
  127 + elms.push(["type",this.dom.type]);
  128 +
  129 + this.dom.size = OZ.DOM.elm("input");
  130 + this.dom.size.type = "text";
  131 + elms.push(["size",this.dom.size]);
  132 +
  133 + this.dom.def = OZ.DOM.elm("input");
  134 + this.dom.def.type = "text";
  135 + elms.push(["def",this.dom.def]);
  136 +
  137 + this.dom.ai = OZ.DOM.elm("input");
  138 + this.dom.ai.type = "checkbox";
  139 + elms.push(["ai",this.dom.ai]);
  140 +
  141 + this.dom.nll = OZ.DOM.elm("input");
  142 + this.dom.nll.type = "checkbox";
  143 + elms.push(["null",this.dom.nll]);
  144 +
  145 + this.dom.comment = OZ.DOM.elm("span",{className:"comment"});
  146 + this.dom.comment.innerHTML = "";
  147 + this.dom.comment.appendChild(document.createTextNode(this.data.comment));
  148 +
  149 + this.dom.commentbtn = OZ.DOM.elm("input");
  150 + this.dom.commentbtn.type = "button";
  151 + this.dom.commentbtn.value = _("comment");
  152 +
  153 + OZ.Event.add(this.dom.commentbtn, "click", this.changeComment);
  154 +
  155 + for (var i=0;i<elms.length;i++) {
  156 + var row = elms[i];
  157 + var tr = OZ.DOM.elm("tr");
  158 + var td1 = OZ.DOM.elm("td");
  159 + var td2 = OZ.DOM.elm("td");
  160 + var l = OZ.DOM.text(_(row[0])+": ");
  161 + OZ.DOM.append(
  162 + [tr, td1, td2],
  163 + [td1, l],
  164 + [td2, row[1]]
  165 + );
  166 + this.dom.container.appendChild(tr);
  167 + }
  168 +
  169 + var tr = OZ.DOM.elm("tr");
  170 + var td1 = OZ.DOM.elm("td");
  171 + var td2 = OZ.DOM.elm("td");
  172 + OZ.DOM.append(
  173 + [tr, td1, td2],
  174 + [td1, this.dom.comment],
  175 + [td2, this.dom.commentbtn]
  176 + );
  177 + this.dom.container.appendChild(tr);
  178 +}
  179 +
  180 +SQL.Row.prototype.changeComment = function(e) {
  181 + var c = prompt(_("commenttext"),this.data.comment);
  182 + if (c === null) { return; }
  183 + this.data.comment = c;
  184 + this.dom.comment.innerHTML = "";
  185 + this.dom.comment.appendChild(document.createTextNode(this.data.comment));
  186 +}
  187 +
  188 +SQL.Row.prototype.expand = function() {
  189 + if (this.expanded) { return; }
  190 + this.expanded = true;
  191 + this.buildEdit();
  192 + this.load();
  193 + this.redraw();
  194 + this.dom.name.focus();
  195 + this.dom.name.select();
  196 +}
  197 +
  198 +SQL.Row.prototype.collapse = function() {
  199 + if (!this.expanded) { return; }
  200 + this.expanded = false;
  201 +
  202 + var data = {
  203 + type: this.dom.type.selectedIndex,
  204 + def: this.dom.def.value,
  205 + size: this.dom.size.value,
  206 + nll: this.dom.nll.checked,
  207 + ai: this.dom.ai.checked
  208 + }
  209 +
  210 + OZ.DOM.clear(this.dom.container);
  211 + this.dom.container.appendChild(this.dom.content);
  212 +
  213 + this.update(data);
  214 + this.setTitle(this.dom.name.value);
  215 +}
  216 +
  217 +SQL.Row.prototype.load = function() { /* put data to expanded form */
  218 + this.dom.name.value = this.getTitle();
  219 + var def = this.data.def;
  220 + if (def === null) { def = "NULL"; }
  221 +
  222 + this.dom.def.value = def;
  223 + this.dom.size.value = this.data.size;
  224 + this.dom.nll.checked = this.data.nll;
  225 + this.dom.ai.checked = this.data.ai;
  226 +}
  227 +
  228 +SQL.Row.prototype.redraw = function() {
  229 + var color = this.getColor();
  230 + this.dom.container.style.backgroundColor = color;
  231 + OZ.DOM.removeClass(this.dom.title, "primary");
  232 + OZ.DOM.removeClass(this.dom.title, "key");
  233 + if (this.isPrimary()) { OZ.DOM.addClass(this.dom.title, "primary"); }
  234 + if (this.isKey()) { OZ.DOM.addClass(this.dom.title, "key"); }
  235 + this.dom.selected.style.display = (this.selected ? "" : "none");
  236 + this.dom.container.title = this.data.comment;
  237 +
  238 + var typehint = [];
  239 + if (this.owner.owner.getOption("showtype")) {
  240 + var elm = this.getDataType();
  241 + typehint.push(elm.getAttribute("sql"));
  242 + }
  243 +
  244 + if (this.owner.owner.getOption("showsize") && this.data.size) {
  245 + typehint.push("(" + this.data.size + ")");
  246 + }
  247 +
  248 + this.dom.typehint.innerHTML = typehint.join(" ");
  249 + this.owner.redraw();
  250 + this.owner.owner.rowManager.redraw();
  251 +}
  252 +
  253 +SQL.Row.prototype.addRelation = function(r) {
  254 + this.relations.push(r);
  255 +}
  256 +
  257 +SQL.Row.prototype.removeRelation = function(r) {
  258 + var idx = this.relations.indexOf(r);
  259 + if (idx == -1) { return; }
  260 + this.relations.splice(idx,1);
  261 +}
  262 +
  263 +SQL.Row.prototype.addKey = function(k) {
  264 + this.keys.push(k);
  265 + this.redraw();
  266 +}
  267 +
  268 +SQL.Row.prototype.removeKey = function(k) {
  269 + var idx = this.keys.indexOf(k);
  270 + if (idx == -1) { return; }
  271 + this.keys.splice(idx,1);
  272 + this.redraw();
  273 +}
  274 +
  275 +SQL.Row.prototype.getDataType = function() {
  276 + var type = this.data.type;
  277 + var elm = DATATYPES.getElementsByTagName("type")[type];
  278 + return elm;
  279 +}
  280 +
  281 +SQL.Row.prototype.getColor = function() {
  282 + var elm = this.getDataType();
  283 + var g = this.getDataType().parentNode;
  284 + return elm.getAttribute("color") || g.getAttribute("color") || "#fff";
  285 +}
  286 +
  287 +SQL.Row.prototype.buildTypeSelect = function(id) { /* build selectbox with avail datatypes */
  288 + var s = OZ.DOM.elm("select");
  289 + var gs = DATATYPES.getElementsByTagName("group");
  290 + for (var i=0;i<gs.length;i++) {
  291 + var g = gs[i];
  292 + var og = OZ.DOM.elm("optgroup");
  293 + og.style.backgroundColor = g.getAttribute("color") || "#fff";
  294 + og.label = g.getAttribute("label");
  295 + s.appendChild(og);
  296 + var ts = g.getElementsByTagName("type");
  297 + for (var j=0;j<ts.length;j++) {
  298 + var t = ts[j];
  299 + var o = OZ.DOM.elm("option");
  300 + if (t.getAttribute("color")) { o.style.backgroundColor = t.getAttribute("color"); }
  301 + if (t.getAttribute("note")) { o.title = t.getAttribute("note"); }
  302 + o.innerHTML = t.getAttribute("label");
  303 + og.appendChild(o);
  304 + }
  305 + }
  306 + s.selectedIndex = id;
  307 + return s;
  308 +}
  309 +
  310 +SQL.Row.prototype.destroy = function() {
  311 + SQL.Visual.prototype.destroy.apply(this);
  312 + while (this.relations.length) {
  313 + this.owner.owner.removeRelation(this.relations[0]);
  314 + }
  315 + for (var i=0;i<this.keys.length;i++){
  316 + this.keys[i].removeRow(this);
  317 + }
  318 +}
  319 +
  320 +SQL.Row.prototype.toXML = function() {
  321 + var xml = "";
  322 +
  323 + var t = this.getTitle().replace(/"/g,"&quot;");
  324 + var nn = (this.data.nll ? "1" : "0");
  325 + var ai = (this.data.ai ? "1" : "0");
  326 + xml += '<row name="'+t+'" null="'+nn+'" autoincrement="'+ai+'">\n';
  327 +
  328 + var elm = this.getDataType();
  329 + var t = elm.getAttribute("sql");
  330 + if (this.data.size.length) { t += "("+this.data.size+")"; }
  331 + xml += "<datatype>"+t+"</datatype>\n";
  332 +
  333 + if (this.data.def || this.data.def === null) {
  334 + var q = elm.getAttribute("quote");
  335 + var d = this.data.def;
  336 + if (d === null) {
  337 + d = "NULL";
  338 + } else if (d != "CURRENT_TIMESTAMP") {
  339 + d = q+d+q;
  340 + }
  341 + xml += "<default>"+SQL.escape(d)+"</default>";
  342 + }
  343 +
  344 + for (var i=0;i<this.relations.length;i++) {
  345 + var r = this.relations[i];
  346 + if (r.row2 != this) { continue; }
  347 + xml += '<relation table="'+r.row1.owner.getTitle()+'" row="'+r.row1.getTitle()+'" />\n';
  348 + }
  349 +
  350 + if (this.data.comment) {
  351 + xml += "<comment>"+SQL.escape(this.data.comment)+"</comment>\n";
  352 + }
  353 +
  354 + xml += "</row>\n";
  355 + return xml;
  356 +}
  357 +
  358 +SQL.Row.prototype.fromXML = function(node) {
  359 + var name = node.getAttribute("name");
  360 +
  361 + var obj = { type:0, size:"" };
  362 + obj.nll = (node.getAttribute("null") == "1");
  363 + obj.ai = (node.getAttribute("autoincrement") == "1");
  364 +
  365 + var cs = node.getElementsByTagName("comment");
  366 + if (cs.length && cs[0].firstChild) { obj.comment = cs[0].firstChild.nodeValue; }
  367 +
  368 + var d = node.getElementsByTagName("datatype");
  369 + if (d.length && d[0].firstChild) {
  370 + var s = d[0].firstChild.nodeValue;
  371 + var r = s.match(/^([^\(]+)(\((.*)\))?.*$/);
  372 + var type = r[1];
  373 + if (r[3]) { obj.size = r[3]; }
  374 + var types = window.DATATYPES.getElementsByTagName("type");
  375 + for (var i=0;i<types.length;i++) {
  376 + var sql = types[i].getAttribute("sql");
  377 + var re = types[i].getAttribute("re");
  378 + if (sql == type || (re && new RegExp(re).exec(type)) ) { obj.type = i; }
  379 + }
  380 + }
  381 +
  382 + var elm = DATATYPES.getElementsByTagName("type")[obj.type];
  383 + var d = node.getElementsByTagName("default");
  384 + if (d.length && d[0].firstChild) {
  385 + var def = d[0].firstChild.nodeValue;
  386 + obj.def = def;
  387 + var q = elm.getAttribute("quote");
  388 + if (q) {
  389 + var re = new RegExp("^"+q+"(.*)"+q+"$");
  390 + var r = def.match(re);
  391 + if (r) { obj.def = r[1]; }
  392 + }
  393 + }
  394 +
  395 + this.update(obj);
  396 + this.setTitle(name);
  397 +}
  398 +
  399 +SQL.Row.prototype.isPrimary = function() {
  400 + for (var i=0;i<this.keys.length;i++) {
  401 + var k = this.keys[i];
  402 + if (k.getType() == "PRIMARY") { return true; }
  403 + }
  404 + return false;
  405 +}
  406 +
  407 +SQL.Row.prototype.isUnique = function() {
  408 + for (var i=0;i<this.keys.length;i++) {
  409 + var k = this.keys[i];
  410 + var t = k.getType();
  411 + if (t == "PRIMARY" || t == "UNIQUE") { return true; }
  412 + }
  413 + return false;
  414 +}
  415 +
  416 +SQL.Row.prototype.isKey = function() {
  417 + return this.keys.length > 0;
  418 +}
  419 +
  420 +SQL.Row.prototype.enter = function(e) {
  421 + if (e.keyCode == 13) {
  422 + this.collapse();
  423 + }
  424 +}
... ...
resources/js/hayamiki_designer/js/rowmanager.js 0 → 100644
  1 +/* --------------------- row manager ------------ */
  2 +SQL.RowManager = function(owner) {
  3 + this.owner = owner;
  4 + this.dom = {};
  5 + this.selected = null;
  6 + this.creating = false;
  7 + this.connecting = false;
  8 +
  9 + var ids = ["editrow","removerow","uprow","downrow","foreigncreate","foreignconnect","foreigndisconnect"];
  10 + for (var i=0;i<ids.length;i++) {
  11 + var id = ids[i];
  12 + var elm = OZ.$(id);
  13 + this.dom[id] = elm;
  14 + elm.value = _(id);
  15 + }
  16 +
  17 + this.select(false);
  18 +
  19 + OZ.Event.add(this.dom.editrow, "click", this.edit.bind(this));
  20 + OZ.Event.add(this.dom.uprow, "click", this.up.bind(this));
  21 + OZ.Event.add(this.dom.downrow, "click", this.down.bind(this));
  22 + OZ.Event.add(this.dom.removerow, "click", this.remove.bind(this));
  23 + OZ.Event.add(this.dom.foreigncreate, "click", this.foreigncreate.bind(this));
  24 + OZ.Event.add(this.dom.foreignconnect, "click", this.foreignconnect.bind(this));
  25 + OZ.Event.add(this.dom.foreigndisconnect, "click", this.foreigndisconnect.bind(this));
  26 + OZ.Event.add(document, "keydown", this.press.bind(this));
  27 +
  28 + SQL.subscribe("tableclick", this.tableClick.bind(this));
  29 + SQL.subscribe("rowclick", this.rowClick.bind(this));
  30 +}
  31 +
  32 +SQL.RowManager.prototype.select = function(row) { /* activate a row */
  33 + if (this.selected === row) { return; }
  34 + if (this.selected) { this.selected.deselect(); }
  35 +
  36 + this.selected = row;
  37 + if (this.selected) { this.selected.select(); }
  38 + this.redraw();
  39 +}
  40 +
  41 +SQL.RowManager.prototype.tableClick = function(e) { /* create relation after clicking target table */
  42 + if (!this.creating) { return; }
  43 +
  44 + var r1 = this.selected;
  45 + var t2 = e.target;
  46 +
  47 + var p = this.owner.getOption("pattern");
  48 + p = p.replace(/%T/g,r1.owner.getTitle());
  49 + p = p.replace(/%t/g,t2.getTitle());
  50 + p = p.replace(/%R/g,r1.getTitle());
  51 +
  52 + var r2 = t2.addRow(p, r1.data);
  53 + r2.update({"type":SQL.Designer.getFKTypeFor(r1.data.type)});
  54 + r2.update({"ai":false});
  55 + this.owner.addRelation(r1, r2);
  56 +}
  57 +
  58 +SQL.RowManager.prototype.rowClick = function(e) { /* draw relation after clicking target row */
  59 + if (!this.connecting) { return; }
  60 +
  61 + var r1 = this.selected;
  62 + var r2 = e.target;
  63 +
  64 + if (r1 == r2) { return; }
  65 +
  66 + this.owner.addRelation(r1, r2);
  67 +}
  68 +
  69 +SQL.RowManager.prototype.foreigncreate = function(e) { /* start creating fk */
  70 + this.endConnect();
  71 + if (this.creating) {
  72 + this.endCreate();
  73 + } else {
  74 + this.creating = true;
  75 + this.dom.foreigncreate.value = "["+_("foreignpending")+"]";
  76 + }
  77 +}
  78 +
  79 +SQL.RowManager.prototype.foreignconnect = function(e) { /* start drawing fk */
  80 + this.endCreate();
  81 + if (this.connecting) {
  82 + this.endConnect();
  83 + } else {
  84 + this.connecting = true;
  85 + this.dom.foreignconnect.value = "["+_("foreignconnectpending")+"]";
  86 + }
  87 +}
  88 +
  89 +SQL.RowManager.prototype.foreigndisconnect = function(e) { /* remove connector */
  90 + var rels = this.selected.relations;
  91 + for (var i=rels.length-1;i>=0;i--) {
  92 + var r = rels[i];
  93 + if (r.row2 == this.selected) { this.owner.removeRelation(r); }
  94 + }
  95 + this.redraw();
  96 +}
  97 +
  98 +SQL.RowManager.prototype.endCreate = function() {
  99 + this.creating = false;
  100 + this.dom.foreigncreate.value = _("foreigncreate");
  101 +}
  102 +
  103 +SQL.RowManager.prototype.endConnect = function() {
  104 + this.connecting = false;
  105 + this.dom.foreignconnect.value = _("foreignconnect");
  106 +}
  107 +
  108 +SQL.RowManager.prototype.up = function(e) {
  109 + this.selected.up();
  110 + this.redraw();
  111 +}
  112 +
  113 +SQL.RowManager.prototype.down = function(e) {
  114 + this.selected.down();
  115 + this.redraw();
  116 +}
  117 +
  118 +SQL.RowManager.prototype.remove = function(e) {
  119 + var result = confirm(_("confirmrow")+" '"+this.selected.getTitle()+"' ?");
  120 + if (!result) { return; }
  121 + var t = this.selected.owner;
  122 + this.selected.owner.removeRow(this.selected);
  123 +
  124 + var next = false;
  125 + if (t.rows) { next = t.rows[t.rows.length-1]; }
  126 + this.select(next);
  127 +}
  128 +
  129 +SQL.RowManager.prototype.redraw = function() {
  130 + this.endCreate();
  131 + this.endConnect();
  132 + if (this.selected) {
  133 + var table = this.selected.owner;
  134 + var rows = table.rows;
  135 + this.dom.uprow.disabled = (rows[0] == this.selected);
  136 + this.dom.downrow.disabled = (rows[rows.length-1] == this.selected);
  137 + this.dom.removerow.disabled = false;
  138 + this.dom.editrow.disabled = false;
  139 + this.dom.foreigncreate.disabled = !(this.selected.isUnique());
  140 + this.dom.foreignconnect.disabled = !(this.selected.isUnique());
  141 +
  142 + this.dom.foreigndisconnect.disabled = true;
  143 + var rels = this.selected.relations;
  144 + for (var i=0;i<rels.length;i++) {
  145 + var r = rels[i];
  146 + if (r.row2 == this.selected) { this.dom.foreigndisconnect.disabled = false; }
  147 + }
  148 +
  149 + } else {
  150 + this.dom.uprow.disabled = true;
  151 + this.dom.downrow.disabled = true;
  152 + this.dom.removerow.disabled = true;
  153 + this.dom.editrow.disabled = true;
  154 + this.dom.foreigncreate.disabled = true;
  155 + this.dom.foreignconnect.disabled = true;
  156 + this.dom.foreigndisconnect.disabled = true;
  157 + }
  158 +}
  159 +
  160 +SQL.RowManager.prototype.press = function(e) {
  161 + if (!this.selected) { return; }
  162 +
  163 + var target = OZ.Event.target(e).nodeName.toLowerCase();
  164 + if (target == "textarea" || target == "input") { return; } /* not when in form field */
  165 +
  166 + switch (e.keyCode) {
  167 + case 38:
  168 + this.up();
  169 + OZ.Event.prevent(e);
  170 + break;
  171 + case 40:
  172 + this.down();
  173 + OZ.Event.prevent(e);
  174 + break;
  175 + case 46:
  176 + this.remove();
  177 + OZ.Event.prevent(e);
  178 + break;
  179 + case 13:
  180 + case 27:
  181 + this.selected.collapse();
  182 + break;
  183 + }
  184 +}
  185 +
  186 +SQL.RowManager.prototype.edit = function(e) {
  187 + this.selected.expand();
  188 +}
... ...
resources/js/hayamiki_designer/js/rubberband.js 0 → 100644
  1 +/* --------------------- rubberband -------------------- */
  2 +
  3 +SQL.Rubberband = function(owner) {
  4 + this.owner = owner;
  5 + SQL.Visual.apply(this);
  6 + this.dom.container = OZ.$("rubberband");
  7 + OZ.Event.add("area", "mousedown", this.down.bind(this));
  8 +}
  9 +SQL.Rubberband.prototype = Object.create(SQL.Visual.prototype);
  10 +
  11 +SQL.Rubberband.prototype.down = function(e) {
  12 + OZ.Event.prevent(e);
  13 + var scroll = OZ.DOM.scroll();
  14 + this.x = this.x0 = e.clientX + scroll[0];
  15 + this.y = this.y0 = e.clientY + scroll[1];
  16 + this.width = 0;
  17 + this.height = 0;
  18 + this.redraw();
  19 + this.documentMove = OZ.Event.add(document, "mousemove", this.move.bind(this));
  20 + this.documentUp = OZ.Event.add(document, "mouseup", this.up.bind(this));
  21 +}
  22 +
  23 +SQL.Rubberband.prototype.move = function(e) {
  24 + var scroll = OZ.DOM.scroll();
  25 + var x = e.clientX + scroll[0];
  26 + var y = e.clientY + scroll[1];
  27 + this.width = Math.abs(x-this.x0);
  28 + this.height = Math.abs(y-this.y0);
  29 + if (x<this.x0) { this.x = x; } else { this.x = this.x0; }
  30 + if (y<this.y0) { this.y = y; } else { this.y = this.y0; }
  31 + this.redraw();
  32 + this.dom.container.style.visibility = "visible";
  33 +}
  34 +
  35 +SQL.Rubberband.prototype.up = function(e) {
  36 + OZ.Event.prevent(e);
  37 + this.dom.container.style.visibility = "hidden";
  38 + OZ.Event.remove(this.documentMove);
  39 + OZ.Event.remove(this.documentUp);
  40 + this.owner.tableManager.selectRect(this.x, this.y, this.width, this.height);
  41 +}
  42 +
  43 +SQL.Rubberband.prototype.redraw = function() {
  44 + this.dom.container.style.left = this.x+"px";
  45 + this.dom.container.style.top = this.y+"px";
  46 + this.dom.container.style.width = this.width+"px";
  47 + this.dom.container.style.height = this.height+"px";
  48 +}
... ...
resources/js/hayamiki_designer/js/table.js 0 → 100644
  1 +/* --------------------- db table ------------ */
  2 +SQL.Table = function(owner, name, x, y, z) {
  3 + this.owner = owner;
  4 + this.rows = [];
  5 + this.keys = [];
  6 + this.zIndex = 0;
  7 + this._ec = [];
  8 +
  9 + this.flag = false;
  10 + this.selected = false;
  11 + SQL.Visual.apply(this);
  12 + this.data.comment = "";
  13 +
  14 + this.setTitle(name);
  15 + this.x = x || 0;
  16 + this.y = y || 0;
  17 + this.setZ(z);
  18 + this.snap();
  19 +}
  20 +SQL.Table.prototype = Object.create(SQL.Visual.prototype);
  21 +
  22 +SQL.Table.prototype._build = function() {
  23 + this.dom.container = OZ.DOM.elm("div", {className:"table"});
  24 + this.dom.content = OZ.DOM.elm("table");
  25 + var thead = OZ.DOM.elm("thead");
  26 + var tr = OZ.DOM.elm("tr");
  27 + this.dom.title = OZ.DOM.elm("td", {className:"title", colSpan:2});
  28 +
  29 + OZ.DOM.append(
  30 + [this.dom.container, this.dom.content],
  31 + [this.dom.content, thead],
  32 + [thead, tr],
  33 + [tr, this.dom.title]
  34 + );
  35 +
  36 + this.dom.mini = OZ.DOM.elm("div", {className:"mini"});
  37 + this.owner.map.dom.container.appendChild(this.dom.mini);
  38 +
  39 + this._ec.push(OZ.Event.add(this.dom.container, "click", this.click.bind(this)));
  40 + this._ec.push(OZ.Event.add(this.dom.container, "dblclick", this.dblclick.bind(this)));
  41 + this._ec.push(OZ.Event.add(this.dom.container, "mousedown", this.down.bind(this)));
  42 + this._ec.push(OZ.Event.add(this.dom.container, "touchstart", this.down.bind(this)));
  43 + this._ec.push(OZ.Event.add(this.dom.container, "touchmove", OZ.Event.prevent));
  44 +}
  45 +
  46 +SQL.Table.prototype.setTitle = function(t) {
  47 + var old = this.getTitle();
  48 + for (var i=0;i<this.rows.length;i++) {
  49 + var row = this.rows[i];
  50 + for (var j=0;j<row.relations.length;j++) {
  51 + var r = row.relations[j];
  52 + if (r.row1 != row) { continue; }
  53 + var tt = row.getTitle().replace(new RegExp(old,"g"),t);
  54 + if (tt != row.getTitle()) { row.setTitle(tt); }
  55 + }
  56 + }
  57 + SQL.Visual.prototype.setTitle.apply(this, [t]);
  58 +}
  59 +
  60 +SQL.Table.prototype.getRelations = function() {
  61 + var arr = [];
  62 + for (var i=0;i<this.rows.length;i++) {
  63 + var row = this.rows[i];
  64 + for (var j=0;j<row.relations.length;j++) {
  65 + var r = row.relations[j];
  66 + if (arr.indexOf(r) == -1) { arr.push(r); }
  67 + }
  68 + }
  69 + return arr;
  70 +}
  71 +
  72 +SQL.Table.prototype.showRelations = function() {
  73 + var rs = this.getRelations();
  74 + for (var i=0;i<rs.length;i++) { rs[i].show(); }
  75 +}
  76 +
  77 +SQL.Table.prototype.hideRelations = function() {
  78 + var rs = this.getRelations();
  79 + for (var i=0;i<rs.length;i++) { rs[i].hide(); }
  80 +}
  81 +
  82 +SQL.Table.prototype.click = function(e) {
  83 + OZ.Event.stop(e);
  84 + var t = OZ.Event.target(e);
  85 + this.owner.tableManager.select(this);
  86 +
  87 + if (t != this.dom.title) { return; } /* click on row */
  88 +
  89 + SQL.publish("tableclick", this);
  90 + this.owner.rowManager.select(false);
  91 +}
  92 +
  93 +SQL.Table.prototype.dblclick = function(e) {
  94 + var t = OZ.Event.target(e);
  95 + if (t == this.dom.title) { this.owner.tableManager.edit(); }
  96 +}
  97 +
  98 +SQL.Table.prototype.select = function() {
  99 + if (this.selected) { return; }
  100 + this.selected = true;
  101 + OZ.DOM.addClass(this.dom.container, "selected");
  102 + OZ.DOM.addClass(this.dom.mini, "mini_selected");
  103 + this.redraw();
  104 +}
  105 +
  106 +SQL.Table.prototype.deselect = function() {
  107 + if (!this.selected) { return; }
  108 + this.selected = false;
  109 + OZ.DOM.removeClass(this.dom.container, "selected");
  110 + OZ.DOM.removeClass(this.dom.mini, "mini_selected");
  111 + this.redraw();
  112 +}
  113 +
  114 +SQL.Table.prototype.addRow = function(title, data) {
  115 + var r = new SQL.Row(this, title, data);
  116 + this.rows.push(r);
  117 + this.dom.content.appendChild(r.dom.container);
  118 + this.redraw();
  119 + return r;
  120 +}
  121 +
  122 +SQL.Table.prototype.removeRow = function(r) {
  123 + var idx = this.rows.indexOf(r);
  124 + if (idx == -1) { return; }
  125 + r.destroy();
  126 + this.rows.splice(idx,1);
  127 + this.redraw();
  128 +}
  129 +
  130 +SQL.Table.prototype.addKey = function(name) {
  131 + var k = new SQL.Key(this, name);
  132 + this.keys.push(k);
  133 + return k;
  134 +}
  135 +
  136 +SQL.Table.prototype.removeKey = function(k) {
  137 + var idx = this.keys.indexOf(k);
  138 + if (idx == -1) { return; }
  139 + k.destroy();
  140 + this.keys.splice(idx,1);
  141 +}
  142 +
  143 +SQL.Table.prototype.redraw = function() {
  144 + var x = this.x;
  145 + var y = this.y;
  146 + if (this.selected) { x--; y--; }
  147 + this.dom.container.style.left = x+"px";
  148 + this.dom.container.style.top = y+"px";
  149 +
  150 + var ratioX = this.owner.map.width / this.owner.width;
  151 + var ratioY = this.owner.map.height / this.owner.height;
  152 +
  153 + var w = this.dom.container.offsetWidth * ratioX;
  154 + var h = this.dom.container.offsetHeight * ratioY;
  155 + var x = this.x * ratioX;
  156 + var y = this.y * ratioY;
  157 +
  158 + this.dom.mini.style.width = Math.round(w)+"px";
  159 + this.dom.mini.style.height = Math.round(h)+"px";
  160 + this.dom.mini.style.left = Math.round(x)+"px";
  161 + this.dom.mini.style.top = Math.round(y)+"px";
  162 +
  163 + this.width = this.dom.container.offsetWidth;
  164 + this.height = this.dom.container.offsetHeight;
  165 +
  166 + var rs = this.getRelations();
  167 + for (var i=0;i<rs.length;i++) { rs[i].redraw(); }
  168 +}
  169 +
  170 +SQL.Table.prototype.moveBy = function(dx, dy) {
  171 + this.x += dx;
  172 + this.y += dy;
  173 +
  174 + this.snap();
  175 + this.redraw();
  176 +}
  177 +
  178 +SQL.Table.prototype.moveTo = function(x, y) {
  179 + this.x = x;
  180 + this.y = y;
  181 +
  182 + this.snap();
  183 + this.redraw();
  184 +}
  185 +
  186 +SQL.Table.prototype.snap = function() {
  187 + var snap = parseInt(SQL.Designer.getOption("snap"));
  188 + if (snap) {
  189 + this.x = Math.round(this.x / snap) * snap;
  190 + this.y = Math.round(this.y / snap) * snap;
  191 + }
  192 +}
  193 +
  194 +SQL.Table.prototype.down = function(e) { /* mousedown - start drag */
  195 + OZ.Event.stop(e);
  196 + var t = OZ.Event.target(e);
  197 + if (t != this.dom.title) { return; } /* on a row */
  198 +
  199 + /* touch? */
  200 + if (e.type == "touchstart") {
  201 + var event = e.touches[0];
  202 + var moveEvent = "touchmove";
  203 + var upEvent = "touchend";
  204 + } else {
  205 + var event = e;
  206 + var moveEvent = "mousemove";
  207 + var upEvent = "mouseup";
  208 + }
  209 +
  210 + /* a non-shift click within a selection preserves the selection */
  211 + if (e.shiftKey || ! this.selected) {
  212 + this.owner.tableManager.select(this, e.shiftKey);
  213 + }
  214 +
  215 + var t = SQL.Table;
  216 + t.active = this.owner.tableManager.selection;
  217 + var n = t.active.length;
  218 + t.x = new Array(n);
  219 + t.y = new Array(n);
  220 + for (var i=0;i<n;i++) {
  221 + /* position relative to mouse cursor */
  222 + t.x[i] = t.active[i].x - event.clientX;
  223 + t.y[i] = t.active[i].y - event.clientY;
  224 + }
  225 +
  226 + if (this.owner.getOption("hide")) {
  227 + for (var i=0;i<n;i++) {
  228 + t.active[i].hideRelations();
  229 + }
  230 + }
  231 +
  232 + this.documentMove = OZ.Event.add(document, moveEvent, this.move.bind(this));
  233 + this.documentUp = OZ.Event.add(document, upEvent, this.up.bind(this));
  234 +}
  235 +
  236 +SQL.Table.prototype.toXML = function() {
  237 + var t = this.getTitle().replace(/"/g,"&quot;");
  238 + var xml = "";
  239 + xml += '<table x="'+this.x+'" y="'+this.y+'" name="'+t+'">\n';
  240 + for (var i=0;i<this.rows.length;i++) {
  241 + xml += this.rows[i].toXML();
  242 + }
  243 + for (var i=0;i<this.keys.length;i++) {
  244 + xml += this.keys[i].toXML();
  245 + }
  246 + var c = this.getComment();
  247 + if (c) {
  248 + xml += "<comment>"+SQL.escape(c)+"</comment>\n";
  249 + }
  250 + xml += "</table>\n";
  251 + return xml;
  252 +}
  253 +
  254 +SQL.Table.prototype.fromXML = function(node) {
  255 + var name = node.getAttribute("name");
  256 + this.setTitle(name);
  257 + var x = parseInt(node.getAttribute("x")) || 0;
  258 + var y = parseInt(node.getAttribute("y")) || 0;
  259 + this.moveTo(x, y);
  260 + var rows = node.getElementsByTagName("row");
  261 + for (var i=0;i<rows.length;i++) {
  262 + var row = rows[i];
  263 + var r = this.addRow("");
  264 + r.fromXML(row);
  265 + }
  266 + var keys = node.getElementsByTagName("key");
  267 + for (var i=0;i<keys.length;i++) {
  268 + var key = keys[i];
  269 + var k = this.addKey();
  270 + k.fromXML(key);
  271 + }
  272 + for (var i=0;i<node.childNodes.length;i++) {
  273 + var ch = node.childNodes[i];
  274 + if (ch.tagName && ch.tagName.toLowerCase() == "comment" && ch.firstChild) {
  275 + this.setComment(ch.firstChild.nodeValue);
  276 + }
  277 + }
  278 +}
  279 +
  280 +SQL.Table.prototype.getZ = function() {
  281 + return this.zIndex;
  282 +}
  283 +
  284 +SQL.Table.prototype.setZ = function(z) {
  285 + this.zIndex = z;
  286 + this.dom.container.style.zIndex = z;
  287 +}
  288 +
  289 +SQL.Table.prototype.findNamedRow = function(n) { /* return row with a given name */
  290 + for (var i=0;i<this.rows.length;i++) {
  291 + if (this.rows[i].getTitle() == n) { return this.rows[i]; }
  292 + }
  293 + return false;
  294 +}
  295 +
  296 +SQL.Table.prototype.setComment = function(c) {
  297 + this.data.comment = c;
  298 + this.dom.title.title = this.data.comment;
  299 +}
  300 +
  301 +SQL.Table.prototype.getComment = function() {
  302 + return this.data.comment;
  303 +}
  304 +
  305 +SQL.Table.prototype.move = function(e) { /* mousemove */
  306 + var t = SQL.Table;
  307 + SQL.Designer.removeSelection();
  308 + if (e.type == "touchmove") {
  309 + if (e.touches.length > 1) { return; }
  310 + var event = e.touches[0];
  311 + } else {
  312 + var event = e;
  313 + }
  314 +
  315 + for (var i=0;i<t.active.length;i++) {
  316 + var x = t.x[i] + event.clientX;
  317 + var y = t.y[i] + event.clientY;
  318 + x = Math.max(x, 0);
  319 + y = Math.max(y, 0);
  320 + t.active[i].moveTo(x,y);
  321 + }
  322 +}
  323 +
  324 +SQL.Table.prototype.up = function(e) {
  325 + var t = SQL.Table;
  326 + var d = SQL.Designer;
  327 + if (d.getOption("hide")) {
  328 + for (var i=0;i<t.active.length;i++) {
  329 + t.active[i].showRelations();
  330 + t.active[i].redraw();
  331 + }
  332 + }
  333 + t.active = false;
  334 + OZ.Event.remove(this.documentMove);
  335 + OZ.Event.remove(this.documentUp);
  336 + this.owner.sync();
  337 +}
  338 +
  339 +SQL.Table.prototype.destroy = function() {
  340 + SQL.Visual.prototype.destroy.apply(this);
  341 + this.dom.mini.parentNode.removeChild(this.dom.mini);
  342 + while (this.rows.length) {
  343 + this.removeRow(this.rows[0]);
  344 + }
  345 + this._ec.forEach(OZ.Event.remove, OZ.Event);
  346 +}
... ...
resources/js/hayamiki_designer/js/tablemanager.js 0 → 100644
  1 +/* --------------------- table manager ------------ */
  2 +
  3 +SQL.TableManager = function(owner) {
  4 + this.owner = owner;
  5 + this.dom = {
  6 + container:OZ.$("table"),
  7 + name:OZ.$("tablename"),
  8 + comment:OZ.$("tablecomment")
  9 + };
  10 + this.selection = [];
  11 + this.adding = false;
  12 +
  13 + var ids = ["addtable","removetable","aligntables","cleartables","addrow","edittable","tablekeys"];
  14 + for (var i=0;i<ids.length;i++) {
  15 + var id = ids[i];
  16 + var elm = OZ.$(id);
  17 + this.dom[id] = elm;
  18 + elm.value = _(id);
  19 + }
  20 +
  21 + var ids = ["tablenamelabel","tablecommentlabel"];
  22 + for (var i=0;i<ids.length;i++) {
  23 + var id = ids[i];
  24 + var elm = OZ.$(id);
  25 + elm.innerHTML = _(id);
  26 + }
  27 +
  28 +
  29 + this.select(false);
  30 +
  31 + this.save = this.save.bind(this);
  32 +
  33 + OZ.Event.add("area", "click", this.click.bind(this));
  34 + OZ.Event.add(this.dom.addtable, "click", this.preAdd.bind(this));
  35 + OZ.Event.add(this.dom.removetable, "click", this.remove.bind(this));
  36 + OZ.Event.add(this.dom.cleartables, "click", this.clear.bind(this));
  37 + OZ.Event.add(this.dom.addrow, "click", this.addRow.bind(this));
  38 + OZ.Event.add(this.dom.aligntables, "click", this.owner.alignTables.bind(this.owner));
  39 + OZ.Event.add(this.dom.edittable, "click", this.edit.bind(this));
  40 + OZ.Event.add(this.dom.tablekeys, "click", this.keys.bind(this));
  41 + OZ.Event.add(document, "keydown", this.press.bind(this));
  42 +
  43 + this.dom.container.parentNode.removeChild(this.dom.container);
  44 +}
  45 +
  46 +SQL.TableManager.prototype.addRow = function(e) {
  47 + var newrow = this.selection[0].addRow(_("newrow"));
  48 + this.owner.rowManager.select(newrow);
  49 + newrow.expand();
  50 +}
  51 +
  52 +SQL.TableManager.prototype.select = function(table, multi) { /* activate table */
  53 + if (table) {
  54 + if (multi) {
  55 + var i = this.selection.indexOf(table);
  56 + if (i < 0) {
  57 + this.selection.push(table);
  58 + } else {
  59 + this.selection.splice(i, 1);
  60 + }
  61 + } else {
  62 + if (this.selection[0] === table) { return; }
  63 + this.selection = [table];
  64 + }
  65 + } else {
  66 + this.selection = [];
  67 + }
  68 + this.processSelection();
  69 +}
  70 +
  71 +SQL.TableManager.prototype.processSelection = function() {
  72 + var tables = this.owner.tables;
  73 + for (var i=0;i<tables.length;i++) {
  74 + tables[i].deselect();
  75 + }
  76 + if (this.selection.length == 1) {
  77 + this.dom.addrow.disabled = false;
  78 + this.dom.edittable.disabled = false;
  79 + this.dom.tablekeys.disabled = false;
  80 + this.dom.removetable.value = _("removetable");
  81 + } else {
  82 + this.dom.addrow.disabled = true;
  83 + this.dom.edittable.disabled = true;
  84 + this.dom.tablekeys.disabled = true;
  85 + }
  86 + if (this.selection.length) {
  87 + this.dom.removetable.disabled = false;
  88 + if (this.selection.length > 1) { this.dom.removetable.value = _("removetables"); }
  89 + } else {
  90 + this.dom.removetable.disabled = true;
  91 + this.dom.removetable.value = _("removetable");
  92 + }
  93 + for (var i=0;i<this.selection.length;i++) {
  94 + var t = this.selection[i];
  95 + t.owner.raise(t);
  96 + t.select();
  97 + }
  98 +}
  99 +
  100 +SQL.TableManager.prototype.selectRect = function(x,y,width,height) { /* select all tables intersecting a rectangle */
  101 + this.selection = [];
  102 + var tables = this.owner.tables;
  103 + var x1 = x+width;
  104 + var y1 = y+height;
  105 + for (var i=0;i<tables.length;i++) {
  106 + var t = tables[i];
  107 + var tx = t.x;
  108 + var tx1 = t.x+t.width;
  109 + var ty = t.y;
  110 + var ty1 = t.y+t.height;
  111 + if (((tx>=x && tx<x1) || (tx1>=x && tx1<x1) || (tx<x && tx1>x1)) &&
  112 + ((ty>=y && ty<y1) || (ty1>=y && ty1<y1) || (ty<y && ty1>y1)))
  113 + { this.selection.push(t); }
  114 + }
  115 + this.processSelection();
  116 +}
  117 +
  118 +SQL.TableManager.prototype.click = function(e) { /* finish adding new table */
  119 + var newtable = false;
  120 + if (this.adding) {
  121 + this.adding = false;
  122 + OZ.DOM.removeClass("area","adding");
  123 + this.dom.addtable.value = this.oldvalue;
  124 + var scroll = OZ.DOM.scroll();
  125 + var x = e.clientX + scroll[0];
  126 + var y = e.clientY + scroll[1];
  127 + newtable = this.owner.addTable(_("newtable"),x,y);
  128 + var r = newtable.addRow("id",{ai:true});
  129 + var k = newtable.addKey("PRIMARY","");
  130 + k.addRow(r);
  131 + }
  132 + this.select(newtable);
  133 + this.owner.rowManager.select(false);
  134 + if (this.selection.length == 1) { this.edit(e); }
  135 +}
  136 +
  137 +SQL.TableManager.prototype.preAdd = function(e) { /* click add new table */
  138 + if (this.adding) {
  139 + this.adding = false;
  140 + OZ.DOM.removeClass("area","adding");
  141 + this.dom.addtable.value = this.oldvalue;
  142 + } else {
  143 + this.adding = true;
  144 + OZ.DOM.addClass("area","adding");
  145 + this.oldvalue = this.dom.addtable.value;
  146 + this.dom.addtable.value = "["+_("addpending")+"]";
  147 + }
  148 +}
  149 +
  150 +SQL.TableManager.prototype.clear = function(e) { /* remove all tables */
  151 + if (!this.owner.tables.length) { return; }
  152 + var result = confirm(_("confirmall")+" ?");
  153 + if (!result) { return; }
  154 + this.owner.clearTables();
  155 +}
  156 +
  157 +SQL.TableManager.prototype.remove = function(e) {
  158 + var titles = this.selection.slice(0);
  159 + for (var i=0;i<titles.length;i++) { titles[i] = "'"+titles[i].getTitle()+"'"; }
  160 + var result = confirm(_("confirmtable")+" "+titles.join(", ")+"?");
  161 + if (!result) { return; }
  162 + var sel = this.selection.slice(0);
  163 + for (var i=0;i<sel.length;i++) { this.owner.removeTable(sel[i]); }
  164 +}
  165 +
  166 +SQL.TableManager.prototype.edit = function(e) {
  167 + this.owner.window.open(_("edittable"), this.dom.container, this.save);
  168 +
  169 + var title = this.selection[0].getTitle();
  170 + this.dom.name.value = title;
  171 + try { /* throws in ie6 */
  172 + this.dom.comment.value = this.selection[0].getComment();
  173 + } catch(e) {}
  174 +
  175 + /* pre-select table name */
  176 + this.dom.name.focus();
  177 + if (OZ.ie) {
  178 + try { /* throws in ie6 */
  179 + this.dom.name.select();
  180 + } catch(e) {}
  181 + } else {
  182 + this.dom.name.setSelectionRange(0, title.length);
  183 + }
  184 +}
  185 +
  186 +SQL.TableManager.prototype.keys = function(e) { /* open keys dialog */
  187 + this.owner.keyManager.open(this.selection[0]);
  188 +}
  189 +
  190 +SQL.TableManager.prototype.save = function() {
  191 + this.selection[0].setTitle(this.dom.name.value);
  192 + this.selection[0].setComment(this.dom.comment.value);
  193 +}
  194 +
  195 +SQL.TableManager.prototype.press = function(e) {
  196 + var target = OZ.Event.target(e).nodeName.toLowerCase();
  197 + if (target == "textarea" || target == "input") { return; } /* not when in form field */
  198 +
  199 + if (this.owner.rowManager.selected) { return; } /* do not process keypresses if a row is selected */
  200 +
  201 + if (!this.selection.length) { return; } /* nothing if selection is active */
  202 +
  203 + switch (e.keyCode) {
  204 + case 46:
  205 + this.remove();
  206 + OZ.Event.prevent(e);
  207 + break;
  208 + }
  209 +}
... ...
resources/js/hayamiki_designer/js/toggle.js 0 → 100644
  1 +/* ------------------ minimize/restore bar ----------- */
  2 +
  3 +SQL.Toggle = function(elm) {
  4 + this._state = null;
  5 + this._elm = elm;
  6 + OZ.Event.add(elm, "click", this._click.bind(this));
  7 +
  8 + var defaultState = true;
  9 + if (document.location.href.match(/toolbar=hidden/)) { defaultState = false; }
  10 + this._switch(defaultState);
  11 +}
  12 +
  13 +SQL.Toggle.prototype._click = function(e) {
  14 + this._switch(!this._state);
  15 +}
  16 +
  17 +SQL.Toggle.prototype._switch = function(state) {
  18 + this._state = state;
  19 + if (this._state) {
  20 + OZ.$("bar").style.height = "";
  21 + } else {
  22 + OZ.$("bar").style.overflow = "hidden";
  23 + OZ.$("bar").style.height = this._elm.offsetHeight + "px";
  24 + }
  25 + this._elm.className = (this._state ? "on" : "off");
  26 +}
... ...
resources/js/hayamiki_designer/js/visual.js 0 → 100644
  1 +/* -------------------- base visual element -------------------- */
  2 +SQL.Visual = function() {
  3 + this._init();
  4 + this._build();
  5 +}
  6 +
  7 +SQL.Visual.prototype._init = function() {
  8 + this.dom = {
  9 + container: null,
  10 + title: null
  11 + };
  12 + this.data = {
  13 + title:""
  14 + }
  15 +}
  16 +
  17 +SQL.Visual.prototype._build = function() {}
  18 +
  19 +SQL.Visual.prototype.toXML = function() {}
  20 +
  21 +SQL.Visual.prototype.fromXML = function(node) {}
  22 +
  23 +SQL.Visual.prototype.destroy = function() { /* "destructor" */
  24 + var p = this.dom.container.parentNode;
  25 + if (p && p.nodeType == 1) {
  26 + p.removeChild(this.dom.container);
  27 + }
  28 +}
  29 +
  30 +SQL.Visual.prototype.setTitle = function(text) {
  31 + if (!text) { return; }
  32 + this.data.title = text;
  33 + this.dom.title.innerHTML = text;
  34 +}
  35 +
  36 +SQL.Visual.prototype.getTitle = function() {
  37 + return this.data.title;
  38 +}
  39 +
  40 +SQL.Visual.prototype.redraw = function() {}
... ...
resources/js/hayamiki_designer/js/window.js 0 → 100644
  1 +/* --------------------- window ------------ */
  2 +
  3 +SQL.Window = function(owner) {
  4 + this.owner = owner;
  5 + this.dom = {
  6 + container:OZ.$("window"),
  7 + background:OZ.$("background"),
  8 + ok:OZ.$("windowok"),
  9 + cancel:OZ.$("windowcancel"),
  10 + title:OZ.$("windowtitle"),
  11 + content:OZ.$("windowcontent"),
  12 + throbber:OZ.$("throbber")
  13 + }
  14 + this.dom.ok.value = _("windowok");
  15 + this.dom.cancel.value = _("windowcancel");
  16 + this.dom.throbber.alt = this.dom.throbber.title = _("throbber");
  17 + OZ.Event.add(this.dom.ok, "click", this.ok.bind(this));
  18 + OZ.Event.add(this.dom.cancel, "click", this.close.bind(this));
  19 + OZ.Event.add(document, "keydown", this.key.bind(this));
  20 +
  21 + this.sync = this.sync.bind(this);
  22 +
  23 + OZ.Event.add(window, "scroll", this.sync);
  24 + OZ.Event.add(window, "resize", this.sync);
  25 + this.state = 0;
  26 + this.hideThrobber();
  27 +
  28 + this.sync();
  29 +}
  30 +
  31 +SQL.Window.prototype.showThrobber = function() {
  32 + this.dom.throbber.style.visibility = "";
  33 +}
  34 +
  35 +SQL.Window.prototype.hideThrobber = function() {
  36 + this.dom.throbber.style.visibility = "hidden";
  37 +}
  38 +
  39 +SQL.Window.prototype.open = function(title, content, callback) {
  40 + this.state = 1;
  41 + this.callback = callback;
  42 + while (this.dom.title.childNodes.length > 1) { this.dom.title.removeChild(this.dom.title.childNodes[1]); }
  43 +
  44 + var txt = OZ.DOM.text(title);
  45 + this.dom.title.appendChild(txt);
  46 + this.dom.background.style.visibility = "visible";
  47 + OZ.DOM.clear(this.dom.content);
  48 + this.dom.content.appendChild(content);
  49 +
  50 + var win = OZ.DOM.win();
  51 + var scroll = OZ.DOM.scroll();
  52 + this.dom.container.style.left = Math.round(scroll[0] + (win[0] - this.dom.container.offsetWidth)/2)+"px";
  53 + this.dom.container.style.top = Math.round(scroll[1] + (win[1] - this.dom.container.offsetHeight)/2)+"px";
  54 +
  55 + this.dom.cancel.style.visibility = (this.callback ? "" : "hidden");
  56 + this.dom.container.style.visibility = "visible";
  57 +
  58 + var formElements = ["input","select","textarea"];
  59 + var all = this.dom.container.getElementsByTagName("*");
  60 + for (var i=0;i<all.length;i++) {
  61 + if (formElements.indexOf(all[i].tagName.toLowerCase()) != -1) {
  62 + all[i].focus();
  63 + break;
  64 + }
  65 + }
  66 +}
  67 +
  68 +SQL.Window.prototype.key = function(e) {
  69 + if (!this.state) { return; }
  70 + if (e.keyCode == 13) { this.ok(e); }
  71 + if (e.keyCode == 27) { this.close(); }
  72 +}
  73 +
  74 +SQL.Window.prototype.ok = function(e) {
  75 + if (this.callback) { this.callback(); }
  76 + this.close();
  77 +}
  78 +
  79 +SQL.Window.prototype.close = function() {
  80 + if (!this.state) { return; }
  81 + this.state = 0;
  82 + this.dom.background.style.visibility = "hidden";
  83 + this.dom.container.style.visibility = "hidden";
  84 +}
  85 +
  86 +SQL.Window.prototype.sync = function() { /* adjust background position */
  87 + var dims = OZ.DOM.win();
  88 + var scroll = OZ.DOM.scroll();
  89 + this.dom.background.style.width = dims[0]+"px";
  90 + this.dom.background.style.height = dims[1]+"px";
  91 + this.dom.background.style.left = scroll[0]+"px";
  92 + this.dom.background.style.top = scroll[1]+"px";
  93 +}
... ...
resources/js/hayamiki_designer/js/wwwsqldesigner.js 0 → 100644
  1 +SQL.Designer = function() {
  2 + SQL.Designer = this;
  3 +
  4 + this.tables = [];
  5 + this.relations = [];
  6 + this.title = document.title;
  7 +
  8 + SQL.Visual.apply(this);
  9 + new SQL.Toggle(OZ.$("toggle"));
  10 +
  11 + this.dom.container = OZ.$("area");
  12 + this.minSize = [
  13 + this.dom.container.offsetWidth,
  14 + this.dom.container.offsetHeight
  15 + ];
  16 + this.width = this.minSize[0];
  17 + this.height = this.minSize[1];
  18 +
  19 + this.typeIndex = false;
  20 + this.fkTypeFor = false;
  21 +
  22 + this.vector = this.getOption("vector") && document.createElementNS;
  23 + if (this.vector) {
  24 + this.svgNS = "http://www.w3.org/2000/svg";
  25 + this.dom.svg = document.createElementNS(this.svgNS, "svg");
  26 + this.dom.container.appendChild(this.dom.svg);
  27 + }
  28 +
  29 + this.flag = 2;
  30 + this.requestLanguage();
  31 + this.requestDB();
  32 +}
  33 +SQL.Designer.prototype = Object.create(SQL.Visual.prototype);
  34 +
  35 +/* update area size */
  36 +SQL.Designer.prototype.sync = function() {
  37 + var w = this.minSize[0];
  38 + var h = this.minSize[0];
  39 + for (var i=0;i<this.tables.length;i++) {
  40 + var t = this.tables[i];
  41 + w = Math.max(w, t.x + t.width);
  42 + h = Math.max(h, t.y + t.height);
  43 + }
  44 +
  45 + this.width = w;
  46 + this.height = h;
  47 + this.map.sync();
  48 +
  49 + if (this.vector) {
  50 + this.dom.svg.setAttribute("width", this.width);
  51 + this.dom.svg.setAttribute("height", this.height);
  52 + }
  53 +}
  54 +
  55 +SQL.Designer.prototype.requestLanguage = function() { /* get locale file */
  56 + var lang = this.getOption("locale")
  57 + var bp = this.getOption("staticpath");
  58 + var url = bp + "locale/"+lang+".xml";
  59 + OZ.Request(url, this.languageResponse.bind(this), {method:"get", xml:true});
  60 +}
  61 +
  62 +SQL.Designer.prototype.languageResponse = function(xmlDoc) {
  63 + if (xmlDoc) {
  64 + var strings = xmlDoc.getElementsByTagName("string");
  65 + for (var i=0;i<strings.length;i++) {
  66 + var n = strings[i].getAttribute("name");
  67 + var v = strings[i].firstChild.nodeValue;
  68 + window.LOCALE[n] = v;
  69 + }
  70 + }
  71 + this.flag--;
  72 + if (!this.flag) { this.init2(); }
  73 +}
  74 +
  75 +SQL.Designer.prototype.requestDB = function() { /* get datatypes file */
  76 + var db = this.getOption("db");
  77 + var bp = this.getOption("staticpath");
  78 + var url = bp + "db/"+db+"/datatypes.xml";
  79 + OZ.Request(url, this.dbResponse.bind(this), {method:"get", xml:true});
  80 +}
  81 +
  82 +SQL.Designer.prototype.dbResponse = function(xmlDoc) {
  83 + if (xmlDoc) {
  84 + window.DATATYPES = xmlDoc.documentElement;
  85 + }
  86 + this.flag--;
  87 + if (!this.flag) { this.init2(); }
  88 +}
  89 +
  90 +SQL.Designer.prototype.init2 = function() { /* secondary init, after locale & datatypes were retrieved */
  91 + this.map = new SQL.Map(this);
  92 + this.rubberband = new SQL.Rubberband(this);
  93 + this.tableManager = new SQL.TableManager(this);
  94 + this.rowManager = new SQL.RowManager(this);
  95 + this.keyManager = new SQL.KeyManager(this);
  96 + this.io = new SQL.IO(this);
  97 + this.options = new SQL.Options(this);
  98 + this.window = new SQL.Window(this);
  99 +
  100 + this.sync();
  101 +
  102 + OZ.$("docs").value = _("docs");
  103 +
  104 + var url = window.location.href;
  105 + var r = url.match(/keyword=([^&]+)/);
  106 + if (r) {
  107 + var keyword = r[1];
  108 + this.io.serverload(false, keyword);
  109 + }
  110 + document.body.style.visibility = "visible";
  111 +}
  112 +
  113 +SQL.Designer.prototype.getMaxZ = function() { /* find max zIndex */
  114 + var max = 0;
  115 + for (var i=0;i<this.tables.length;i++) {
  116 + var z = this.tables[i].getZ();
  117 + if (z > max) { max = z; }
  118 + }
  119 +
  120 + OZ.$("controls").style.zIndex = max+5;
  121 + return max;
  122 +}
  123 +
  124 +SQL.Designer.prototype.addTable = function(name, x, y) {
  125 + var max = this.getMaxZ();
  126 + var t = new SQL.Table(this, name, x, y, max+1);
  127 + this.tables.push(t);
  128 + this.dom.container.appendChild(t.dom.container);
  129 + return t;
  130 +}
  131 +
  132 +SQL.Designer.prototype.removeTable = function(t) {
  133 + this.tableManager.select(false);
  134 + this.rowManager.select(false);
  135 + var idx = this.tables.indexOf(t);
  136 + if (idx == -1) { return; }
  137 + t.destroy();
  138 + this.tables.splice(idx,1);
  139 +}
  140 +
  141 +SQL.Designer.prototype.addRelation = function(row1, row2) {
  142 + var r = new SQL.Relation(this, row1, row2);
  143 + this.relations.push(r);
  144 + return r;
  145 +}
  146 +
  147 +SQL.Designer.prototype.removeRelation = function(r) {
  148 + var idx = this.relations.indexOf(r);
  149 + if (idx == -1) { return; }
  150 + r.destroy();
  151 + this.relations.splice(idx,1);
  152 +}
  153 +
  154 +SQL.Designer.prototype.getCookie = function() {
  155 + var c = document.cookie;
  156 + var obj = {};
  157 + var parts = c.split(";");
  158 + for (var i=0;i<parts.length;i++) {
  159 + var part = parts[i];
  160 + var r = part.match(/wwwsqldesigner=({.*?})/);
  161 + if (r) { obj = eval("("+r[1]+")"); }
  162 + }
  163 + return obj;
  164 +}
  165 +
  166 +SQL.Designer.prototype.setCookie = function(obj) {
  167 + var arr = [];
  168 + for (var p in obj) {
  169 + arr.push(p+":'"+obj[p]+"'");
  170 + }
  171 + var str = "{"+arr.join(",")+"}";
  172 + document.cookie = "wwwsqldesigner="+str+"; path=/";
  173 +}
  174 +
  175 +SQL.Designer.prototype.getOption = function(name) {
  176 + var c = this.getCookie();
  177 + if (name in c) { return c[name]; }
  178 + /* defaults */
  179 + switch (name) {
  180 + case "locale": return CONFIG.DEFAULT_LOCALE;
  181 + case "db": return CONFIG.DEFAULT_DB;
  182 + case "staticpath": return CONFIG.STATIC_PATH || "";
  183 + case "xhrpath": return CONFIG.XHR_PATH || "";
  184 + case "snap": return 0;
  185 + case "showsize": return 0;
  186 + case "showtype": return 0;
  187 + case "pattern": return "%R_%T";
  188 + case "hide": return false;
  189 + case "vector": return true;
  190 + default: return null;
  191 + }
  192 +}
  193 +
  194 +SQL.Designer.prototype.setOption = function(name, value) {
  195 + var obj = this.getCookie();
  196 + obj[name] = value;
  197 + this.setCookie(obj);
  198 +}
  199 +
  200 +SQL.Designer.prototype.raise = function(table) { /* raise a table */
  201 + var old = table.getZ();
  202 + var max = this.getMaxZ();
  203 + table.setZ(max);
  204 + for (var i=0;i<this.tables.length;i++) {
  205 + var t = this.tables[i];
  206 + if (t == table) { continue; }
  207 + if (t.getZ() > old) { t.setZ(t.getZ()-1); }
  208 + }
  209 + var m = table.dom.mini;
  210 + m.parentNode.appendChild(m);
  211 +}
  212 +
  213 +SQL.Designer.prototype.clearTables = function() {
  214 + while (this.tables.length) { this.removeTable(this.tables[0]); }
  215 + this.setTitle(false);
  216 +}
  217 +
  218 +SQL.Designer.prototype.alignTables = function() {
  219 + var win = OZ.DOM.win();
  220 + var avail = win[0] - OZ.$("bar").offsetWidth;
  221 + var x = 10;
  222 + var y = 10;
  223 + var max = 0;
  224 +
  225 + this.tables.sort(function(a,b){
  226 + return b.getRelations().length - a.getRelations().length;
  227 + });
  228 +
  229 + for (var i=0;i<this.tables.length;i++) {
  230 + var t = this.tables[i];
  231 + var w = t.dom.container.offsetWidth;
  232 + var h = t.dom.container.offsetHeight;
  233 + if (x + w > avail) {
  234 + x = 10;
  235 + y += 10 + max;
  236 + max = 0;
  237 + }
  238 + t.moveTo(x,y);
  239 + x += 10 + w;
  240 + if (h > max) { max = h; }
  241 + }
  242 +
  243 + this.sync();
  244 +}
  245 +
  246 +SQL.Designer.prototype.findNamedTable = function(name) { /* find row specified as table(row) */
  247 + for (var i=0;i<this.tables.length;i++) {
  248 + if (this.tables[i].getTitle() == name) { return this.tables[i]; }
  249 + }
  250 +}
  251 +
  252 +SQL.Designer.prototype.toXML = function() {
  253 + var xml = '<?xml version="1.0" encoding="utf-8" ?>\n';
  254 + xml += '<!-- SQL XML created by WWW SQL Designer, https://github.com/ondras/wwwsqldesigner/ -->\n';
  255 + xml += '<!-- Active URL: ' + location.href + ' -->\n';
  256 + xml += '<sql>\n';
  257 +
  258 + /* serialize datatypes */
  259 + if (window.XMLSerializer) {
  260 + var s = new XMLSerializer();
  261 + xml += s.serializeToString(window.DATATYPES);
  262 + } else if (window.DATATYPES.xml) {
  263 + xml += window.DATATYPES.xml;
  264 + } else {
  265 + alert(_("errorxml")+': '+e.message);
  266 + }
  267 +
  268 + for (var i=0;i<this.tables.length;i++) {
  269 + xml += this.tables[i].toXML();
  270 + }
  271 + xml += "</sql>\n";
  272 + return xml;
  273 +}
  274 +
  275 +SQL.Designer.prototype.fromXML = function(node) {
  276 + this.clearTables();
  277 + var types = node.getElementsByTagName("datatypes");
  278 + if (types.length) { window.DATATYPES = types[0]; }
  279 + var tables = node.getElementsByTagName("table");
  280 + for (var i=0;i<tables.length;i++) {
  281 + var t = this.addTable("", 0, 0);
  282 + t.fromXML(tables[i]);
  283 + }
  284 +
  285 + for (var i=0;i<this.tables.length;i++) { /* ff one-pixel shift hack */
  286 + this.tables[i].select();
  287 + this.tables[i].deselect();
  288 + }
  289 +
  290 + /* relations */
  291 + var rs = node.getElementsByTagName("relation");
  292 + for (var i=0;i<rs.length;i++) {
  293 + var rel = rs[i];
  294 + var tname = rel.getAttribute("table");
  295 + var rname = rel.getAttribute("row");
  296 +
  297 + var t1 = this.findNamedTable(tname);
  298 + if (!t1) { continue; }
  299 + var r1 = t1.findNamedRow(rname);
  300 + if (!r1) { continue; }
  301 +
  302 + tname = rel.parentNode.parentNode.getAttribute("name");
  303 + rname = rel.parentNode.getAttribute("name");
  304 + var t2 = this.findNamedTable(tname);
  305 + if (!t2) { continue; }
  306 + var r2 = t2.findNamedRow(rname);
  307 + if (!r2) { continue; }
  308 +
  309 + this.addRelation(r1, r2);
  310 + }
  311 +
  312 + this.sync();
  313 +}
  314 +
  315 +SQL.Designer.prototype.setTitle = function(t) {
  316 + document.title = this.title + (t ? " - "+t : "");
  317 +}
  318 +
  319 +SQL.Designer.prototype.removeSelection = function() {
  320 + var sel = (window.getSelection ? window.getSelection() : document.selection);
  321 + if (!sel) { return; }
  322 + if (sel.empty) { sel.empty(); }
  323 + if (sel.removeAllRanges) { sel.removeAllRanges(); }
  324 +}
  325 +
  326 +SQL.Designer.prototype.getTypeIndex = function(label) {
  327 + if (!this.typeIndex) {
  328 + this.typeIndex = {};
  329 + var types = window.DATATYPES.getElementsByTagName("type");
  330 + for (var i=0;i<types.length;i++) {
  331 + var l = types[i].getAttribute("label");
  332 + if (l) { this.typeIndex[l] = i; }
  333 + }
  334 + }
  335 + return this.typeIndex[label];
  336 +}
  337 +
  338 +SQL.Designer.prototype.getFKTypeFor = function(typeIndex) {
  339 + if (!this.fkTypeFor) {
  340 + this.fkTypeFor = {};
  341 + var types = window.DATATYPES.getElementsByTagName("type");
  342 + for (var i=0;i<types.length;i++) {
  343 + this.fkTypeFor[i] = i;
  344 + var fk = types[i].getAttribute("fk");
  345 + if (fk) { this.fkTypeFor[i] = this.getTypeIndex(fk); }
  346 + }
  347 + }
  348 + return this.fkTypeFor[typeIndex];
  349 +}
... ...
resources/js/hayamiki_designer/license.txt 0 → 100644
  1 +Copyright (c) 2005-2012, Ondrej Zara
  2 +All rights reserved.
  3 +
  4 +Redistribution and use in source and binary forms, with or without modification,
  5 +are permitted provided that the following conditions are met:
  6 +
  7 + * Redistributions of source code must retain the above copyright notice,
  8 + this list of conditions and the following disclaimer.
  9 + * Redistributions in binary form must reproduce the above copyright notice,
  10 + this list of conditions and the following disclaimer in the documentation
  11 + and/or other materials provided with the distribution.
  12 + * Neither the name of Ondrej Zara nor the names of its contributors may be used
  13 + to endorse or promote products derived from this software without specific
  14 + prior written permission.
  15 +
  16 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  17 +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  18 +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  19 +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  20 +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  21 +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  22 +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  23 +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  24 +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  25 +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
... ...
resources/js/hayamiki_designer/locale/ar.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<locale>
  3 + <!-- table management -->
  4 + <string name="addtable">إنشاء جدول</string>
  5 + <string name="edittable">تحرير جدول</string>
  6 + <string name="removetable">حذف جدول</string>
  7 + <string name="aligntables">محاذاة الجداول</string>
  8 + <string name="cleartables">حذف جميع البيانات</string>
  9 + <string name="confirmall">هل أنت متأكد من أنك تريد حذف جميع البيانات</string>
  10 + <string name="newtable">new table</string>
  11 + <string name="addpending">اختر المنطقة المحددة</string>
  12 + <string name="tablenamelabel">اسم الجول</string>
  13 + <string name="tablecommentlabel">وصف الجدول</string>
  14 +
  15 + <!-- row management -->
  16 + <string name="addrow">إنشاء حقل</string>
  17 + <string name="editrow">تحرير حقل</string>
  18 + <string name="removerow">حذف حقل</string>
  19 + <string name="uprow">أعلى</string>
  20 + <string name="downrow">أسفل</string>
  21 + <string name="newrow">new field</string>
  22 + <string name="foreigncreate">إنشاء مفتاح خارجي</string>
  23 + <string name="foreignpending">اختر الجدول المطلوب</string>
  24 + <string name="foreignconnect">ربط حقل بمفتاح خارجي</string>
  25 + <string name="foreignconnectpending">اختر الحقل المطلوب</string>
  26 + <string name="foreigndisconnect">حذف مفتاح خارجي</string>
  27 + <string name="confirmtable">هل أنت متأكد من أنك تريد حذف الجدول</string>
  28 + <string name="confirmrow">هل أنت متأكد من أنك تريد حذف الحقل</string>
  29 +
  30 + <!-- row edit -->
  31 + <string name="name">الإسم</string>
  32 + <string name="type">النوع</string>
  33 + <string name="size">الحجم</string>
  34 + <string name="def">الإفتراضي</string>
  35 + <string name="notnull">NOT NULL</string>
  36 + <string name="null">NULL</string>
  37 + <string name="ai">ترقيم تلقائي</string>
  38 + <string name="comment">تحرير تعليق</string>
  39 + <string name="commenttext">اكتب تعليقاً لهذا الحقل</string>
  40 +
  41 + <!-- windows & options -->
  42 + <string name="windowok">موافق</string>
  43 + <string name="windowcancel">إلغاء</string>
  44 + <string name="throbber">يرجى الإنتظار ...</string>
  45 + <string name="options">الخيارات</string>
  46 + <string name="language">لغة العرض</string>
  47 + <string name="db">قاعدة البيانات المستخدمة لحفظ التصاميم</string>
  48 + <string name="optionsnotice">بعض الخيارات يتم تفعيلها بعد تحديث الصفحة مع ملاحظة أنه يجب تفعيل (الكوكيز) لتعمل هذه الخيارات</string>
  49 + <string name="snap">Table snap distance</string>
  50 + <string name="optionsnapnotice">In pixels, 0 = disable snapping</string>
  51 + <string name="pattern">طريقة تنسيق أسماء المفاتيح الخارجية</string>
  52 + <string name="optionpatternnotice">%T = الجدول الرئيسي, %R = المفتاح الرئيسي, %t = الجدول الخارجي</string>
  53 + <string name="hide">إخفاء الخطوط عند تحريك الجدول؟</string>
  54 + <string name="vector">رسم خطوط ناعمة (إذا كان المتصفح يدعم ذلك) ؟</string>
  55 +
  56 +
  57 + <!-- keys -->
  58 + <string name="tablekeys">المفاتيح</string>
  59 + <string name="keyslistlabel">المفاتيح في الجدول "%s"</string>
  60 + <string name="keytypelabel">الأنواع:</string>
  61 + <string name="keynamelabel">الإسم:</string>
  62 + <string name="keyfieldslabel">مفاتيح الجدول</string>
  63 + <string name="keyavaillabel">الحقول المتاحة</string>
  64 + <string name="keyedit">تحرير مفتاح</string>
  65 + <string name="keyadd">إنشاء مفتاح</string>
  66 + <string name="keyremove">حذف مفتاح</string>
  67 +
  68 + <!-- io -->
  69 + <string name="saveload">حفظ / تحميل</string>
  70 + <string name="empty">قم بوضع بيانات نموذج XML في المربع أدناه، ثم حاول مرّة أخرى.</string>
  71 + <string name="client">العميل</string>
  72 + <string name="server">الخادم</string>
  73 + <string name="output">المدخلات / المخرجات</string>
  74 + <string name="clientsave">حفظ كنموذح XML</string>
  75 + <string name="clientload">إستيراد نموذج XML</string>
  76 + <string name="clientsql">حفظ كنموذج SQL</string>
  77 + <string name="backendlabel">Server backend:</string>
  78 + <string name="serversave">حفظ</string>
  79 + <string name="serverload">تحميل</string>
  80 + <string name="serverlist">List items</string>
  81 + <string name="serverimport">إستيراد من قاعدة بيانات</string>
  82 + <string name="serverloadprompt">Enter keyword under which your design was saved:</string>
  83 + <string name="serversaveprompt">Enter keyword under which your design will be saved:</string>
  84 + <string name="serverimportprompt">أدخل إسم قاعدة البيانات التي تريد إستيرادها:</string>
  85 + <string name="httpresponse">رد الخادم</string>
  86 + <string name="http201">تم الحفظ بنجاح</string>
  87 + <string name="http404">لم يتم العثور عليه</string>
  88 + <string name="http500">خطأ داخلي في الخادم</string>
  89 + <string name="http501">الخاصية غير موجودة</string>
  90 + <string name="http503">الخدمة غير متوفرة</string>
  91 +
  92 + <!-- misc -->
  93 + <string name="xmlerror">خطأ في نموذح XML</string>
  94 + <string name="docs">التوثيق</string>
  95 +
  96 +</locale>
... ...
resources/js/hayamiki_designer/locale/cs.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<locale>
  3 + <!-- table management -->
  4 + <string name="addtable">Přidat tabulku</string>
  5 + <string name="edittable">Upravit tabulku</string>
  6 + <string name="removetable">Smazat tabulku</string>
  7 + <string name="removetables">Smazat tabulky</string>
  8 + <string name="aligntables">Srovnat tabulky</string>
  9 + <string name="cleartables">Zrušit tabulky</string>
  10 + <string name="confirmall">Opravdu zrušit všechny tabulky</string>
  11 + <string name="newtable">nová tabulka</string>
  12 + <string name="addpending">umístit tabulku</string>
  13 + <string name="tablenamelabel">Jméno</string>
  14 + <string name="tablecommentlabel">Komentář</string>
  15 +
  16 + <!-- row management -->
  17 + <string name="addrow">Přidat položku</string>
  18 + <string name="editrow">Upravit položku</string>
  19 + <string name="removerow">Smazat položku</string>
  20 + <string name="uprow">Nahoru</string>
  21 + <string name="downrow">Dolů</string>
  22 + <string name="newrow">nová položka</string>
  23 + <string name="foreigncreate">Vyrobit cizí klíč</string>
  24 + <string name="foreignpending">klikni na cílovou tabulku</string>
  25 + <string name="foreignconnect">Propojit cizí klíč</string>
  26 + <string name="foreignconnectpending">klikni na cílové pole</string>
  27 + <string name="foreigndisconnect">Smazat cizí klíč</string>
  28 + <string name="confirmtable">Opravdu smazat tabulku</string>
  29 + <string name="confirmrow">Opravdu smazat položku</string>
  30 +
  31 + <!-- row edit -->
  32 + <string name="name">Jméno</string>
  33 + <string name="type">Typ</string>
  34 + <string name="size">Velikost</string>
  35 + <string name="def">Výchozí</string>
  36 + <string name="notnull">NOT NULL</string>
  37 + <string name="null">NULL</string>
  38 + <string name="ai">Autoincrement</string>
  39 + <string name="comment">Upravit komentář</string>
  40 + <string name="commenttext">VLožte komentář pro tuto položku</string>
  41 +
  42 + <!-- windows & options -->
  43 + <string name="windowok">OK</string>
  44 + <string name="windowcancel">Storno</string>
  45 + <string name="throbber">Prosím čekejte...</string>
  46 + <string name="options">Nastavení</string>
  47 + <string name="language">Jazyk</string>
  48 + <string name="db">Databáze pro nová schémata</string>
  49 + <string name="optionsnotice">Některá nastavení se projeví až po znovunačtení stránky. Aby nastavení fungovala, je nutné mít zapnuté cookies.</string>
  50 + <string name="snap">Vzdálenost přichytávání tabulek</string>
  51 + <string name="optionsnapnotice">V pixelech, 0 = bez přichytávání</string>
  52 + <string name="pattern">Vzor pro cizí jména</string>
  53 + <string name="optionpatternnotice">%T = primární tabulka, %R = primární klíč, %t = cizí tabulka</string>
  54 + <string name="hide">Schovat spojovníky při tažení tabulkou?</string>
  55 + <string name="vector">Vykreslovat oblé spojovníky (pakliže to prohlížeč podporuje)?</string>
  56 + <string name="showsize">Zobrazovat velikost polí v tabulce?</string>
  57 + <string name="showtype">Zobrazovat datový typ polí v tabulce?</string>
  58 +
  59 + <!-- keys -->
  60 + <string name="tablekeys">Klíče</string>
  61 + <string name="keyslistlabel">Klíče v tabulce "%s"</string>
  62 + <string name="keytypelabel">Typ:</string>
  63 + <string name="keynamelabel">Název:</string>
  64 + <string name="keyfieldslabel">Položky v klíči</string>
  65 + <string name="keyavaillabel">Dostupné položky</string>
  66 + <string name="keyedit">Upravit klíč</string>
  67 + <string name="keyadd">Přidat klíč</string>
  68 + <string name="keyremove">Smazat klíč</string>
  69 +
  70 + <!-- io -->
  71 + <string name="saveload">Uložit / Načíst</string>
  72 + <string name="empty">Prosím vložte XML data do textového pole níže.</string>
  73 + <string name="client">Klient</string>
  74 + <string name="server">Server</string>
  75 + <string name="output">Vstup / Výstup</string>
  76 + <string name="clientsave">Uložit XML</string>
  77 + <string name="clientload">Načíst XML</string>
  78 + <string name="clientlocalsave">Uložit v prohlížeči</string>
  79 + <string name="clientlocalload">Načíst z prohlížeče</string>
  80 + <string name="clientsql">Generovat SQL</string>
  81 + <string name="backendlabel">Server backend:</string>
  82 + <string name="serversave">Uložit</string>
  83 + <string name="quicksave">Rychle uložit</string>
  84 + <string name="serverload">Načíst</string>
  85 + <string name="serverlist">Vypsat položky</string>
  86 + <string name="serverimport">Importovat z databáze</string>
  87 + <string name="serverloadprompt">Zadejte označení, pod kterým bylo vaše schéma uloženo:</string>
  88 + <string name="serversaveprompt">Zadejte označení, pod kterým bude vaše schéma uloženo:</string>
  89 + <string name="serverimportprompt">Zadejte název databáze k importu:</string>
  90 + <string name="httpresponse">Odpověď od serveru</string>
  91 + <string name="http201">Uloženo</string>
  92 + <string name="http404">Neexistuje</string>
  93 + <string name="http500">Vnitřní chyba serveru</string>
  94 + <string name="http501">Není implementováno</string>
  95 + <string name="http503">Služba není dostupná</string>
  96 +
  97 + <!-- misc -->
  98 + <string name="xmlerror">XML chyba</string>
  99 + <string name="docs">Dokumentace</string>
  100 +
  101 +</locale>
... ...
resources/js/hayamiki_designer/locale/de.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<locale>
  3 + <!-- table management -->
  4 + <string name="addtable">Tabelle hinzufügen</string>
  5 + <string name="edittable">Tabelle bearbeiten</string>
  6 + <string name="removetable">Tabelle entfernen</string>
  7 + <string name="removetables">Tabellen entfernen</string>
  8 + <string name="aligntables">Tabellen ausrichten</string>
  9 + <string name="cleartables">Tabellen löschen</string>
  10 + <string name="confirmall">Wirklich alle Tabellen löschen</string>
  11 + <string name="newtable">Neue Tabelle</string>
  12 + <string name="addpending">Tabelle plazieren</string>
  13 + <string name="tablenamelabel">Name</string>
  14 + <string name="tablecommentlabel">Kommentar</string>
  15 +
  16 + <!-- row management -->
  17 + <string name="addrow">Feld hinzufügen</string>
  18 + <string name="editrow">Feld bearbeiten</string>
  19 + <string name="removerow">Feld entfernen</string>
  20 + <string name="uprow">Hoch</string>
  21 + <string name="downrow">Runter</string>
  22 + <string name="newrow">Neues Feld</string>
  23 + <string name="foreigncreate">Fremdschlüssel erstellen</string>
  24 + <string name="foreignpending">Ziel-Tabelle wählen</string>
  25 + <string name="foreignconnect">Fremdschlüssel Verknüpfung</string>
  26 + <string name="foreignconnectpending">Ziel-Zeile auswählen</string>
  27 + <string name="foreigndisconnect">Ziel-Zeile entfernen</string>
  28 + <string name="confirmtable">Tabelle wirklich löschen</string>
  29 + <string name="confirmrow">Feld wirklich löschen</string>
  30 +
  31 + <!-- row edit -->
  32 + <string name="name">Name</string>
  33 + <string name="type">Typ</string>
  34 + <string name="size">Größe</string>
  35 + <string name="def">Default</string>
  36 + <string name="notnull">NOT NULL</string>
  37 + <string name="null">NULL</string>
  38 + <string name="ai">Autoincrement</string>
  39 + <string name="comment">Kommentar bearbeiten</string>
  40 + <string name="commenttext">Kommentar zu diesem Feld eintragen:</string>
  41 +
  42 + <!-- windows & options -->
  43 + <string name="windowok">OK</string>
  44 + <string name="windowcancel">Abbrechen</string>
  45 + <string name="throbber">Bitte warten...</string>
  46 + <string name="options">Einstellungen</string>
  47 + <string name="language">Sprache</string>
  48 + <string name="db">Datenbank für neue Diagramme</string>
  49 + <string name="optionsnotice">Einige Optionen werden erst nach einem erneutem Seitenaufruf wirksam. Cookies müssen erlaubt sein.</string>
  50 + <string name="snap">Tabellen Ausrichtungsabstand</string>
  51 + <string name="optionsnapnotice">in Pixel, 0 = einrasten deaktivieren</string>
  52 + <string name="pattern">Format für die Namen der Fremdschlüssel</string>
  53 + <string name="optionpatternnotice">%T = Primärtabelle, %R = Primärschlüssel, %t = Fremdtabelle</string>
  54 + <string name="hide">Verstecke Verbindungslinien beim bewegen von Tabellen?</string>
  55 + <string name="vector">Zeichne gegrümmte Verbindungslinien (Browser-abhängig)?</string>
  56 +
  57 +
  58 + <!-- keys -->
  59 + <string name="tablekeys">Schlüssel</string>
  60 + <string name="keyslistlabel">Schlüssel in Tabelle "%s"</string>
  61 + <string name="keytypelabel">Typ:</string>
  62 + <string name="keynamelabel">Name:</string>
  63 + <string name="keyfieldslabel">Felder im Schlüssel</string>
  64 + <string name="keyavaillabel">Verfügbare Felder</string>
  65 + <string name="keyedit">Schlüssel bearbeiten</string>
  66 + <string name="keyadd">Schlüssel hinzufügen</string>
  67 + <string name="keyremove">Schlüssel entfernen</string>
  68 +
  69 + <!-- io -->
  70 + <string name="saveload">Speichern / Laden</string>
  71 + <string name="empty">Bitte fügen Sie die XML-Daten in das untere Textfeld ein und versuchen es erneut.</string>
  72 + <string name="client">Client</string>
  73 + <string name="server">Server</string>
  74 + <string name="output">Eingabe / Ausgabe</string>
  75 + <string name="clientsave">XML speichern</string>
  76 + <string name="clientload">XML laden</string>
  77 + <string name="clientsql">SQL erzeugen</string>
  78 + <string name="backendlabel">Server Basis:</string>
  79 + <string name="serversave">Speichern</string>
  80 + <string name="serverload">Laden</string>
  81 + <string name="serverlist">Einträge listen</string>
  82 + <string name="serverimport">Import aus DB</string>
  83 + <string name="serverloadprompt">Geben Sie das Stichwort ihres Diagramms ein, unter dem es gespeichert wurde:</string>
  84 + <string name="serversaveprompt">Geben Sie das Stichwort ihres Diagramms ein, unter dem es gespeichert werden soll:</string>
  85 + <string name="serverimportprompt">Geben Sie den Namen der zuimportierenden Datenbank ein:</string>
  86 + <string name="httpresponse">Server Antwort</string>
  87 + <string name="http201">gespeichert</string>
  88 + <string name="http404">Nicht gefunden</string>
  89 + <string name="http500">Interner Server Fehler</string>
  90 + <string name="http501">Nicht implementiert</string>
  91 + <string name="http503">Dienst nicht erreichbar</string>
  92 +
  93 + <!-- misc -->
  94 + <string name="xmlerror">XML Fehler</string>
  95 + <string name="docs">Dokumentation</string>
  96 +
  97 +</locale>
... ...
resources/js/hayamiki_designer/locale/el.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<locale>
  3 + <!-- table management -->
  4 + <string name="addtable">Προσθήκη πίνακα</string>
  5 + <string name="edittable">Επεξεργασία πίνακα</string>
  6 + <string name="removetable">Διαγραφή πίνακα</string>
  7 + <string name="removetables">Διαγραφή πινάκων</string>
  8 + <string name="aligntables">Στοίχιση Πινάκων</string>
  9 + <string name="cleartables">Καθαρισμός πινάκων</string>
  10 + <string name="confirmall">Διαγραφή όλων των πινάκων</string>
  11 + <string name="newtable">Νέος πίνακας</string>
  12 + <string name="addpending">τοποθέτηση πίνακα</string>
  13 + <string name="tablenamelabel">Όνομα</string>
  14 + <string name="tablecommentlabel">Σχόλιο</string>
  15 +
  16 + <!-- row management -->
  17 + <string name="addrow">Προσθήκη πεδίου</string>
  18 + <string name="editrow">Επεξεργασία πεδίου</string>
  19 + <string name="removerow">Διαγραφή πεδίου</string>
  20 + <string name="uprow">Πάνω</string>
  21 + <string name="downrow">Κάτω</string>
  22 + <string name="newrow">νέο πεδίο</string>
  23 + <string name="foreigncreate">Δημιουργία ξένου κλειδιού</string>
  24 + <string name="foreignpending">Κάντε κλικ στο άλλο πίνακα</string>
  25 + <string name="foreignconnect">Σένδεση ξένου κλειδιού</string>
  26 + <string name="foreignconnectpending">Κάντε κλικ στη γραμμή</string>
  27 + <string name="foreigndisconnect">Κάντε κλικ πεδίου</string>
  28 + <string name="confirmtable">Διαγραφή πίνακα. Είστε σίγουρος</string>
  29 + <string name="confirmrow">Διαγραφή πεδίου. Είστε σίγουρος</string>
  30 +
  31 + <!-- row edit -->
  32 + <string name="name">Όνομα</string>
  33 + <string name="type">Τύπος</string>
  34 + <string name="size">Μέγεθος</string>
  35 + <string name="def">Προεπιλογή</string>
  36 + <string name="notnull">NOT NULL</string>
  37 + <string name="null">NULL</string>
  38 + <string name="ai">Autoincrement</string>
  39 + <string name="comment">Επεξεργασία σχολίου</string>
  40 + <string name="commenttext">Σχολιάστε γι' αυτό το πεδίο</string>
  41 +
  42 + <!-- windows & options -->
  43 + <string name="windowok">OK</string>
  44 + <string name="windowcancel">Άκυρο</string>
  45 + <string name="throbber">Παρακαλώ περιμένετε...</string>
  46 + <string name="options">Επιλογές</string>
  47 + <string name="language">Γλώσσα</string>
  48 + <string name="db">Βάση δεδομένων για νέα σχέδιαγράμματα</string>
  49 + <string name="optionsnotice">Μερικές επιλογές ενεργοποιούνται μόνο μετά από καθολική ανανέωση της σελίδας.Τα Cookies πρέπει να είναι ενεργοποιημένα για να λειτουργούν οι επιλογές.</string>
  50 + <string name="snap">Απόσταση πινάκων</string>
  51 + <string name="optionsnapnotice">Σε pixels, 0 = απενεργοποίηση απόστασης</string>
  52 + <string name="pattern">Πρότυπο για ξένα κλειδιά</string>
  53 + <string name="optionpatternnotice">%T = πρωτεύων πίνακας, %R = προτεύον κλειδί, %t = ξένος πίνακας</string>
  54 + <string name="hide">Απόκρυψη συνδέσμων όταν σύρονται οι πίνακες;</string>
  55 + <string name="vector">Διάγραμμα με ομαλούς συνδέσμους(αν παρέχεται από τον περιηγητή);</string>
  56 +
  57 +
  58 + <!-- keys -->
  59 + <string name="tablekeys">Κλειδιά</string>
  60 + <string name="keyslistlabel">Κλειδιά στον πίνακα "%s"</string>
  61 + <string name="keytypelabel">Τύπος:</string>
  62 + <string name="keynamelabel">Όνομα:</string>
  63 + <string name="keyfieldslabel">Πεδία σε κλειδιά</string>
  64 + <string name="keyavaillabel">Διαθέσιμα πεδία</string>
  65 + <string name="keyedit">Επεξεργασία κλειδιού</string>
  66 + <string name="keyadd">Προσθήκη κλειδιού</string>
  67 + <string name="keyremove">Διαγραφή κλειδιού</string>
  68 +
  69 + <!-- io -->
  70 + <string name="saveload">Αποθήκ./Άνοιγμα</string>
  71 + <string name="empty">Κάντε επικόλληση των δεδομένων XML στο πεδίο κειμένου παρακάτω και δοκιμάστε ξανά.</string>
  72 + <string name="client">Πελάτης</string>
  73 + <string name="server">Διακομιστής</string>
  74 + <string name="output">Εισαγωγή/Εξαγωγή</string>
  75 + <string name="clientsave">Αποθήκευση XML</string>
  76 + <string name="clientload">Άνοιγμα XML</string>
  77 + <string name="clientsql">Δημιουργία SQL</string>
  78 + <string name="backendlabel">Διακομιστής:</string>
  79 + <string name="serversave">Αποθήκευση</string>
  80 + <string name="serverload">Άνοιγμα</string>
  81 + <string name="serverlist">Εμφάνιση λίστας</string>
  82 + <string name="serverimport">Εισαγωγή από βάση δεδομένων</string>
  83 + <string name="serverloadprompt">Πληκτρολογήστε το τίτλο του αποθηκευμένου σχεδιαγράμματος:</string>
  84 + <string name="serversaveprompt">Πληκτρολογήστε το τίτλο για την αποθήκευση του σχεδιαγράμματος:</string>
  85 + <string name="serverimportprompt">Δώστς όνομα βάσης δεδομένων για εισαγωγή:</string>
  86 + <string name="httpresponse">Απάντηση διακομιστή</string>
  87 + <string name="http201">Αποθηκεύθηκε</string>
  88 + <string name="http404">Δεν βρέθηκε</string>
  89 + <string name="http500">Εσωτερικό σφάλμα διακομιστή</string>
  90 + <string name="http501">Χωρίς σχεδίαση</string>
  91 + <string name="http503">Μη-διαθέσιμη Παροχή</string>
  92 +
  93 + <!-- misc -->
  94 + <string name="xmlerror">Σφάλμα XML</string>
  95 + <string name="docs">Οδηγίες</string>
  96 +
  97 +</locale>
... ...
resources/js/hayamiki_designer/locale/en.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<locale>
  3 + <!-- table management -->
  4 + <string name="addtable">Add table</string>
  5 + <string name="edittable">Edit table</string>
  6 + <string name="removetable">Remove table</string>
  7 + <string name="removetables">Remove tables</string>
  8 + <string name="aligntables">Align tables</string>
  9 + <string name="cleartables">Clear tables</string>
  10 + <string name="confirmall">Really delete all tables</string>
  11 + <string name="newtable">new table</string>
  12 + <string name="addpending">place table</string>
  13 + <string name="tablenamelabel">Name</string>
  14 + <string name="tablecommentlabel">Comment</string>
  15 +
  16 + <!-- row management -->
  17 + <string name="addrow">Add field</string>
  18 + <string name="editrow">Edit field</string>
  19 + <string name="removerow">Remove field</string>
  20 + <string name="uprow">Up</string>
  21 + <string name="downrow">Down</string>
  22 + <string name="newrow">new field</string>
  23 + <string name="foreigncreate">Create foreign key</string>
  24 + <string name="foreignpending">click target table</string>
  25 + <string name="foreignconnect">Connect foreign key</string>
  26 + <string name="foreignconnectpending">click target row</string>
  27 + <string name="foreigndisconnect">Remove foreign key</string>
  28 + <string name="confirmtable">Really delete table</string>
  29 + <string name="confirmrow">Really delete field</string>
  30 +
  31 + <!-- row edit -->
  32 + <string name="name">Name</string>
  33 + <string name="type">Type</string>
  34 + <string name="size">Size</string>
  35 + <string name="def">Default</string>
  36 + <string name="notnull">NOT NULL</string>
  37 + <string name="null">NULL</string>
  38 + <string name="ai">Autoincrement</string>
  39 + <string name="comment">Edit comment</string>
  40 + <string name="commenttext">Enter comment for this field</string>
  41 +
  42 + <!-- windows & options -->
  43 + <string name="windowok">OK</string>
  44 + <string name="windowcancel">Cancel</string>
  45 + <string name="throbber">Please wait...</string>
  46 + <string name="options">Options</string>
  47 + <string name="language">Language</string>
  48 + <string name="db">Database for new designs</string>
  49 + <string name="optionsnotice">Some options are applied only after full page reload. Cookies must be enabled for options to work.</string>
  50 + <string name="snap">Table snap distance</string>
  51 + <string name="optionsnapnotice">In pixels, 0 = disable snapping</string>
  52 + <string name="pattern">Pattern for foreign names</string>
  53 + <string name="optionpatternnotice">%T = primary table, %R = primary key, %t = foreign table</string>
  54 + <string name="hide">Hide connectors on table drag?</string>
  55 + <string name="vector">Draw smooth connectors (if supported by browser)?</string>
  56 + <string name="showsize">Show field size in table design?</string>
  57 + <string name="showtype">Show field datatype in table design?</string>
  58 +
  59 + <!-- keys -->
  60 + <string name="tablekeys">Keys</string>
  61 + <string name="keyslistlabel">Keys in table "%s"</string>
  62 + <string name="keytypelabel">Type:</string>
  63 + <string name="keynamelabel">Name:</string>
  64 + <string name="keyfieldslabel">Fields in key</string>
  65 + <string name="keyavaillabel">Available fields</string>
  66 + <string name="keyedit">Edit key</string>
  67 + <string name="keyadd">Add key</string>
  68 + <string name="keyremove">Remove key</string>
  69 +
  70 + <!-- io -->
  71 + <string name="saveload">Save / Load</string>
  72 + <string name="empty">Please paste XML data into the text area below and try again.</string>
  73 + <string name="client">Client</string>
  74 + <string name="server">Server</string>
  75 + <string name="output">Input / Output</string>
  76 + <string name="clientsave">Save XML</string>
  77 + <string name="clientload">Load XML</string>
  78 + <string name="clientlocalsave">Save in Browser</string>
  79 + <string name="clientlocalload">Load from Browser</string>
  80 + <string name="clientlocallist">List from Browser</string>
  81 + <string name="dropboxsave">Save to Dropbox</string>
  82 + <string name="dropboxload">Load from Dropbox</string>
  83 + <string name="dropboxlist">List from Dropbox</string>
  84 + <string name="clientsql">Generate SQL</string>
  85 + <string name="backendlabel">Server backend:</string>
  86 + <string name="serversave">Save</string>
  87 + <string name="quicksave">Quicksave</string>
  88 + <string name="serverload">Load</string>
  89 + <string name="serverlist">List items</string>
  90 + <string name="serverimport">Import from DB</string>
  91 + <string name="serverloadprompt">Enter keyword under which your design was saved:</string>
  92 + <string name="serversaveprompt">Enter keyword under which your design will be saved:</string>
  93 + <string name="serverimportprompt">Enter name of database to be imported:</string>
  94 + <string name="httpresponse">Server response</string>
  95 + <string name="http201">Saved</string>
  96 + <string name="http404">Not Found</string>
  97 + <string name="http500">Internal Server Error</string>
  98 + <string name="http501">Not Implemented</string>
  99 + <string name="http503">Service Unavailable</string>
  100 +
  101 + <!-- misc -->
  102 + <string name="xmlerror">XML error</string>
  103 + <string name="docs">Documentation</string>
  104 +
  105 +</locale>
... ...
resources/js/hayamiki_designer/locale/eo.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<locale>
  3 + <!-- table management -->
  4 + <string name="addtable">Aldoni tabelon</string>
  5 + <string name="edittable">Modifi la tabelon</string>
  6 + <string name="removetable">Forigi la tabelon</string>
  7 + <string name="removetables">Forigi la tabelojn</string>
  8 + <string name="aligntables">Ĝisrandigi la tabelojn</string>
  9 + <string name="cleartables">Vakigi la tabelon</string>
  10 + <string name="confirmall">Ja forigi ĉiujn tabelojn</string>
  11 + <string name="newtable">nova tabelo</string>
  12 + <string name="addpending">pozicii la tabelon</string>
  13 + <string name="tablenamelabel">Nomo</string>
  14 + <string name="tablecommentlabel">Komento</string>
  15 +
  16 + <!-- row management -->
  17 + <string name="addrow">Aldoni kampon</string>
  18 + <string name="editrow">Modifi la kampon</string>
  19 + <string name="removerow">Forigi la kampon</string>
  20 + <string name="uprow">Supre</string>
  21 + <string name="downrow">Sube</string>
  22 + <string name="newrow">nova kampo</string>
  23 + <string name="foreigncreate">Krei fremdan ŝlosilon</string>
  24 + <string name="foreignpending">alklaki la celan tabelon</string>
  25 + <string name="foreignconnect">Konekti fremdan ŝlosilon</string>
  26 + <string name="foreignconnectpending">alklaki la celan atributon</string>
  27 + <string name="foreigndisconnect">Forigi fremdan ŝlosilon</string>
  28 + <string name="confirmtable">Ja forigi la tabelon</string>
  29 + <string name="confirmrow">Ja forigi la kampon</string>
  30 +
  31 + <!-- row edit -->
  32 + <string name="name">Nomo</string>
  33 + <string name="type">Tipo</string>
  34 + <string name="size">Grandeco</string>
  35 + <string name="def">Defaŭlte</string>
  36 + <string name="notnull">NE NUL</string>
  37 + <string name="null">Senvalora</string>
  38 + <string name="ai">Memalkremento</string>
  39 + <string name="comment">Modifi la komenton</string>
  40 + <string name="commenttext">Entajpi komenton por tiu kampo</string>
  41 +
  42 + <!-- windows & options -->
  43 + <string name="windowok">Jes</string>
  44 + <string name="windowcancel">Rezigni</string>
  45 + <string name="throbber">Bonvolu atendi...</string>
  46 + <string name="options">Agordoj</string>
  47 + <string name="language">Lingvo</string>
  48 + <string name="db">Datumbazoj por novaj kreoj</string>
  49 + <string name="optionsnotice">Kelkaj agordoj estas aplikotaj post plena ŝarĝo de paĝo. Kuketoj devas esti ebligataj por ke la agordoj funkcias.</string>
  50 + <string name="snap">Kapto-distanco de tabelo</string>
  51 + <string name="optionsnapnotice">En rastrumeroj, 0 = malebligi kapton</string>
  52 + <string name="pattern">Motivo por fremdaj nomoj</string>
  53 + <string name="optionpatternnotice">%T = ĉefa tabelo, %R = ĉefa ŝlosilo, %t = fremda tabelo</string>
  54 + <string name="hide">Ĉu kaŝi konektiloj dum treno de tabelo?</string>
  55 + <string name="vector">Desegni glatajn konektilojn (se subtenata de retumilo)?</string>
  56 + <string name="showsize">Show field size in table design?</string>
  57 + <string name="showtype">Show field datatype in table design?</string>
  58 +
  59 + <!-- keys -->
  60 + <string name="tablekeys">Klavoj</string>
  61 + <string name="keyslistlabel">Ŝlosiloj en la tabelo "%s"</string>
  62 + <string name="keytypelabel">Tipo:</string>
  63 + <string name="keynamelabel">Nomo:</string>
  64 + <string name="keyfieldslabel">Kampoj en klavo</string>
  65 + <string name="keyavaillabel">Disponeblaj kampoj</string>
  66 + <string name="keyedit">Modifi ŝlosilon</string>
  67 + <string name="keyadd">Aldoni ŝlosilon</string>
  68 + <string name="keyremove">Forigi ŝlosilon</string>
  69 +
  70 + <!-- io -->
  71 + <string name="saveload">Konservi / Ŝargi</string>
  72 + <string name="empty">Bonvolu alglui XML datumon en la tekst-zono sube kaj provi de nove.</string>
  73 + <string name="client">Kliento</string>
  74 + <string name="server">Servilo</string>
  75 + <string name="output">Enigo / Eligo</string>
  76 + <string name="clientsave">Konservi XML</string>
  77 + <string name="clientload">Ŝargi XML</string>
  78 + <string name="clientsql">Krei SQL</string>
  79 + <string name="backendlabel">Servila administro:</string>
  80 + <string name="serversave">Konservi</string>
  81 + <string name="quicksave">Quicksave</string>
  82 + <string name="serverload">Ŝargi</string>
  83 + <string name="serverlist">Listigi erojn</string>
  84 + <string name="serverimport">Importi el datumbazo</string>
  85 + <string name="serverloadprompt">Entajpi ŝlosilvorton per kiu via fasonado estis konservita:</string>
  86 + <string name="serversaveprompt">Entajpi ŝlosilvorton per kiu via fasonado estos konservita:</string>
  87 + <string name="serverimportprompt">Entajpi la nomon de datumbazo importenda:</string>
  88 + <string name="httpresponse">Respondo de servilo</string>
  89 + <string name="http201">Konservita</string>
  90 + <string name="http404">Netrovita</string>
  91 + <string name="http500">Interna Servilo Eraro</string>
  92 + <string name="http501">Ne funkciigata</string>
  93 + <string name="http503">Servo Nedisponebla</string>
  94 +
  95 + <!-- misc -->
  96 + <string name="xmlerror">XML-eraro</string>
  97 + <string name="docs">Dokumentaro</string>
  98 +
  99 +</locale>
... ...
resources/js/hayamiki_designer/locale/es.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<locale>
  3 + <!-- table management -->
  4 + <string name="addtable">Agregar tabla</string>
  5 + <string name="edittable">Editar tabla</string>
  6 + <string name="removetable">Remover tabla</string>
  7 + <string name="removetable">Remover tablas</string>
  8 + <string name="aligntables">Alinear tablas</string>
  9 + <string name="cleartables">Limpiar tablas</string>
  10 + <string name="confirmall">Realmente borrar todas las tablas</string>
  11 + <string name="newtable">Nueva tabla</string>
  12 + <string name="addpending">Posicionar tabla</string>
  13 + <string name="tablenamelabel">Nombre</string>
  14 + <string name="tablecommentlabel">Comentario</string>
  15 +
  16 + <!-- row management -->
  17 + <string name="addrow">Agregar campo</string>
  18 + <string name="editrow">Editar campo</string>
  19 + <string name="removerow">Remover campo</string>
  20 + <string name="uprow">Arriba</string>
  21 + <string name="downrow">Abajo</string>
  22 + <string name="newrow">Nuevo campo</string>
  23 + <string name="foreigncreate">Crear llave for&#225;nea</string>
  24 + <string name="foreignpending">Conectar llave for&#225;nea</string>
  25 + <string name="foreignconnect">Conectar llave for&#225;nea</string>
  26 + <string name="foreignconnectpending">Hacer clic en el registro</string>
  27 + <string name="foreigndisconnect">Remover llave for&#225;nea</string>
  28 + <string name="confirmtable">Realmente borrar tabla</string>
  29 + <string name="confirmrow">Realmente borrar campo</string>
  30 +
  31 + <!-- row edit -->
  32 + <string name="name">Nombre</string>
  33 + <string name="type">Tipo</string>
  34 + <string name="size">Tama&#241;o</string>
  35 + <string name="def">Valor por predeterminado</string>
  36 + <string name="notnull">NOT NULL</string>
  37 + <string name="null">NULL</string>
  38 + <string name="ai">Auto incremento</string>
  39 + <string name="comment">Editar comentario</string>
  40 + <string name="commenttext">Entrar comentario para este campo</string>
  41 +
  42 + <!-- windows & options -->
  43 + <string name="windowok">Aceptar</string>
  44 + <string name="windowcancel">Cancelar</string>
  45 + <string name="throbber">Por favor esperar...</string>
  46 + <string name="options">Opciones</string>
  47 + <string name="language">Lenguaje</string>
  48 + <string name="db">Base de datos para nuevos dise&#241;os</string>
  49 + <string name="optionsnotice">Algunas opciones son aplicadas solo despúes de recargar totalmente la pagina. Las cookies deben estar
  50 +habilitadas para opciones de trabajo.</string>
  51 + <string name="snap">Tabla acceso remoto</string>
  52 + <string name="optionsnapnotice">En píxeles, 0 = deshabilitar acceso remoto</string>
  53 + <string name="pattern">Patrón para nombres for&#225;neos</string>
  54 + <string name="optionpatternnotice">%T = tabla primaria, %R = llave primaria, %t = tabla for&#225;nea</string>
  55 + <string name="hide">Esconder conectores en la tabla al arrastrar?</string>
  56 + <string name="vector">Dibujar conectores suave (si son soportados por el navegador)?</string>
  57 +
  58 +
  59 + <!-- keys -->
  60 + <string name="tablekeys">Llaves</string>
  61 + <string name="keyslistlabel">Llaves en la tabla "%s"</string>
  62 + <string name="keytypelabel">Tipo:</string>
  63 + <string name="keynamelabel">Nombre:</string>
  64 + <string name="keyfieldslabel">Campos en la llave</string>
  65 + <string name="keyavaillabel">Campos disponibles</string>
  66 + <string name="keyedit">Editar llave</string>
  67 + <string name="keyadd">Agregar llave</string>
  68 + <string name="keyremove">Remover llave</string>
  69 +
  70 + <!-- io -->
  71 + <string name="saveload">Guardar / Cargar</string>
  72 + <string name="empty">Favor de pegar el XML dentro del &#225;rea de texto siguiente e intentar nuevamente.</string>
  73 + <string name="client">Cliente</string>
  74 + <string name="server">Servidor</string>
  75 + <string name="output">Entrada / Salida</string>
  76 + <string name="clientsave">Guardar XML</string>
  77 + <string name="clientload">Cargar XML</string>
  78 + <string name="clientsql">Generar SQL</string>
  79 + <string name="backendlabel">Servidor backend:</string>
  80 + <string name="serversave">Guardar</string>
  81 + <string name="serverload">Cargar</string>
  82 + <string name="serverlist">Lista de articulos</string>
  83 + <string name="serverimport">Importar desde BD</string>
  84 + <string name="serverloadprompt">Entrar palabra bajo la cual tu dise&#241;o fue guardado:</string>
  85 + <string name="serversaveprompt">Entrar palabra bajo la cual tu dise&#241;o va a ser guardado:</string>
  86 + <string name="serverimportprompt">Entrar nombre de base de datos a ser importada:</string>
  87 + <string name="httpresponse">Respuesta del servidor</string>
  88 + <string name="http201">Guardado</string>
  89 + <string name="http404">No Encontrado</string>
  90 + <string name="http500">Error Interno del Servidor</string>
  91 + <string name="http501">No Implementado</string>
  92 + <string name="http503">Servicio No Disponible</string>
  93 +
  94 + <!-- misc -->
  95 + <string name="xmlerror">XML error</string>
  96 + <string name="docs">Documentación</string>
  97 +
  98 +</locale>
... ...
resources/js/hayamiki_designer/locale/fr.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<locale>
  3 + <!-- table management -->
  4 + <string name="addtable">Ajouter une table</string>
  5 + <string name="edittable">Éditer la table</string>
  6 + <string name="removetable">Supprimer la table</string>
  7 + <string name="removetables">Supprimer les tables</string>
  8 + <string name="aligntables">Aligner les tables</string>
  9 + <string name="cleartables">Supprimer les tables</string>
  10 + <string name="confirmall">Vraiment supprimer toutes les tables</string>
  11 + <string name="newtable">nouvelle table</string>
  12 + <string name="addpending">positionner la table</string>
  13 + <string name="tablenamelabel">Nom</string>
  14 + <string name="tablecommentlabel">Commentaire</string>
  15 +
  16 + <!-- row management -->
  17 + <string name="addrow">Ajouter un champ</string>
  18 + <string name="editrow">Éditer un champ</string>
  19 + <string name="removerow">Supprimer le champ</string>
  20 + <string name="uprow">Remonter</string>
  21 + <string name="downrow">Descendre</string>
  22 + <string name="newrow">Éditer un champ</string>
  23 + <string name="foreigncreate">Créer une clé étrangère</string>
  24 + <string name="foreignpending">Cliquez la destination</string>
  25 + <string name="foreignconnect">Connecter une clé étrangère</string>
  26 + <string name="foreignconnectpending">Cliquez la propriété cible</string>
  27 + <string name="foreigndisconnect">Supprimer la clé étrangère</string>
  28 + <string name="confirmtable">Voulez-vous vraiment supprimer cette table ?</string>
  29 + <string name="confirmrow">Voulez-vous vraiment supprimer ce champ ?</string>
  30 +
  31 + <!-- row edit -->
  32 + <string name="name">Nom</string>
  33 + <string name="type">Type</string>
  34 + <string name="size">Taille</string>
  35 + <string name="def">Défaut</string>
  36 + <string name="notnull">NON NUL</string>
  37 + <string name="null">valeur nulle</string>
  38 + <string name="ai">Auto-incrémental</string>
  39 + <string name="comment">Éditer le commentaire</string>
  40 + <string name="commenttext">Saisir un commentaire à propos de ce champ</string>
  41 +
  42 + <!-- windows & options -->
  43 + <string name="windowok">OK</string>
  44 + <string name="windowcancel">Annuler</string>
  45 + <string name="throbber">Veuillez patienter...</string>
  46 + <string name="options">Options</string>
  47 + <string name="language">Langue</string>
  48 + <string name="db">Format des nouvelles base de données</string>
  49 + <string name="optionsnotice">Ces options ne seront appliquées qu'après le rafraichissement complet de la page. Les cookies doivent être autorisés.</string>
  50 + <string name="snap">Magnétisme des tables</string>
  51 + <string name="optionsnapnotice">En pixels, 0 = magnétisme désactivé</string>
  52 + <string name="pattern">Motif pour les noms de clés étrangères</string>
  53 + <string name="optionpatternnotice">%T = table primaire, %R = clé primaire, %t = table étrangère</string>
  54 + <string name="hide">Cacher les connecteurs lors du déplacement des tables ?</string>
  55 + <string name="vector">Dessiner des connecteurs « adoucis » (si le navigateur le supporte) ?</string>
  56 + <string name="showsize">Afficher la taille du champ dans le schéma de table ?</string>
  57 + <string name="showtype">Afficher le type du champ dans le schéma de table ?</string>
  58 +
  59 + <!-- keys -->
  60 + <string name="tablekeys">Clés</string>
  61 + <string name="keyslistlabel">Clés dans la table « %s »</string>
  62 + <string name="keytypelabel">Type :</string>
  63 + <string name="keynamelabel">Nom :</string>
  64 + <string name="keyfieldslabel">Champs de clé</string>
  65 + <string name="keyavaillabel">Champs disponibles</string>
  66 + <string name="keyedit">Éditer la clé</string>
  67 + <string name="keyadd">Ajouter une clé</string>
  68 + <string name="keyremove">Supprimer la clé</string>
  69 +
  70 + <!-- io -->
  71 + <string name="saveload">Enregistrer / Charger</string>
  72 + <string name="empty">Merci de coller les données XML dans le champs prévu avant de ré-essayer.</string>
  73 + <string name="client">Client</string>
  74 + <string name="server">Serveur</string>
  75 + <string name="output">Entrée / Sortie</string>
  76 + <string name="clientsave">Enregistrer XML</string>
  77 + <string name="clientload">Charger XML</string>
  78 + <string name="clientlocalsave">Enregistrer dans le navigateur</string>
  79 + <string name="clientlocalload">Charger depuis le navigateur</string>
  80 + <string name="clientlocallist">Lister depuis le navigateur</string>
  81 + <string name="clientsql">Génerer SQL</string>
  82 + <string name="backendlabel">Méthode du serveur :</string>
  83 + <string name="serversave">Enregistrer</string>
  84 + <string name="quicksave">Enregistrer rapidement</string>
  85 + <string name="serverload">Charger</string>
  86 + <string name="serverlist">Éléments disponibles</string>
  87 + <string name="serverimport">Importer d'une base de données</string>
  88 + <string name="serverloadprompt">Saisir le mot-clé de votre schéma :</string>
  89 + <string name="serversaveprompt">Saisir un mot-clé pour sauvegarder votre schéma :</string>
  90 + <string name="serverimportprompt">Saisir le nom de la base de données à importer :</string>
  91 + <string name="httpresponse">Réponse du serveur</string>
  92 + <string name="http201">Sauvegardé</string>
  93 + <string name="http404">Introuvable</string>
  94 + <string name="http500">Erreur interne du serveur</string>
  95 + <string name="http501">Non Implementé</string>
  96 + <string name="http503">Service indisponible</string>
  97 +
  98 + <!-- misc -->
  99 + <string name="xmlerror">Erreur XML</string>
  100 + <string name="docs">Documentation</string>
  101 +
  102 +</locale>
... ...
resources/js/hayamiki_designer/locale/hu.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<locale>
  3 + <!-- table management -->
  4 + <string name="addtable">Tábla létrehozása</string>
  5 + <string name="edittable">Tábla módosítása</string>
  6 + <string name="removetable">Tábla törlése</string>
  7 + <string name="removetables">Táblak törlése</string>
  8 + <string name="aligntables">Táblák rendezése</string>
  9 + <string name="cleartables">Táblák törlése</string>
  10 + <string name="confirmall">Valóban töröljem az összes táblát</string>
  11 + <string name="newtable">tábla létrehozása</string>
  12 + <string name="addpending">tábla elhelyezése</string>
  13 + <string name="tablenamelabel">Név</string>
  14 + <string name="tablecommentlabel">Megjegyzés</string>
  15 +
  16 + <!-- row management -->
  17 + <string name="addrow">Mező létrehozása</string>
  18 + <string name="editrow">Mező módosítása</string>
  19 + <string name="removerow">Mező törlése</string>
  20 + <string name="uprow">Fel</string>
  21 + <string name="downrow">Le</string>
  22 + <string name="newrow">új mező</string>
  23 + <string name="foreigncreate">Idegen kulcs létrehozása</string>
  24 + <string name="foreignpending">kattintson a cél-táblára</string>
  25 + <string name="foreignconnect">Idegen kulcs kapcsolása</string>
  26 + <string name="foreignconnectpending">kattintson a cél-mezőre</string>
  27 + <string name="foreigndisconnect">Mező kulcs létrehozása</string>
  28 + <string name="confirmtable">Valóban töröljem a táblát</string>
  29 + <string name="confirmrow">Valóban töröljem a mezőt</string>
  30 +
  31 + <!-- row edit -->
  32 + <string name="name">Név</string>
  33 + <string name="type">Típus</string>
  34 + <string name="size">Méret</string>
  35 + <string name="def">Alapérték</string>
  36 + <string name="notnull">NOT NULL</string>
  37 + <string name="null">NULL</string>
  38 + <string name="ai">Automatikus növelés</string>
  39 + <string name="comment">Megjegyzés módosítása</string>
  40 + <string name="commenttext">Írjon megjegyzést ehhez a mezőhöz</string>
  41 +
  42 + <!-- windows & options -->
  43 + <string name="windowok">OK</string>
  44 + <string name="windowcancel">Mégsem</string>
  45 + <string name="throbber">Kérem várjon...</string>
  46 + <string name="options">Beállítások</string>
  47 + <string name="language">Nyelv</string>
  48 + <string name="db">Adatbázis az új terveknek</string>
  49 + <string name="optionsnotice">Egyes beállítások csak az oldal teljes újratöltése után érvényesülnek. A munkához szükséges engedélyezni a sütiket (cooky-kat).</string>
  50 + <string name="snap">Táblák illesztési távolsága</string>
  51 + <string name="optionsnapnotice">Pixel-ben megadva, 0 = illesztés tiltása</string>
  52 + <string name="pattern">Idegen nevek sablonja</string>
  53 + <string name="optionpatternnotice">%T = elsődleges tábla, %R = elsődleges kulcs, %t = idegen tábla</string>
  54 + <string name="hide">Elrejtsem a kapcsolókat a rajztáblán?</string>
  55 + <string name="vector">Kapcsolók finom kirajzolása (ha a böngésző lehetővé teszi)?</string>
  56 +
  57 +
  58 + <!-- keys -->
  59 + <string name="tablekeys">Kulcsok</string>
  60 + <string name="keyslistlabel">Kulcsok a "%s" táblában</string>
  61 + <string name="keytypelabel">Típus:</string>
  62 + <string name="keynamelabel">Név:</string>
  63 + <string name="keyfieldslabel">A kulcs mezői</string>
  64 + <string name="keyavaillabel">Elérhető mezők</string>
  65 + <string name="keyedit">Kulcs módosítása</string>
  66 + <string name="keyadd">Kulcs létrehozása</string>
  67 + <string name="keyremove">Kulcs törlése</string>
  68 +
  69 + <!-- io -->
  70 + <string name="saveload">Mentés / Beolvasás</string>
  71 + <string name="empty">Kérem illessze be az XML-tartalmat az alábbi szöveges mezőbe, és próbálja újra.</string>
  72 + <string name="client">Kliens</string>
  73 + <string name="server">Szerver</string>
  74 + <string name="output">Bemenet / Kimenet</string>
  75 + <string name="clientsave">XML mentése</string>
  76 + <string name="clientload">XML beolvasása</string>
  77 + <string name="clientsql">SQL generálása</string>
  78 + <string name="backendlabel">Szerver végpont:</string>
  79 + <string name="serversave">Mentés</string>
  80 + <string name="serverload">Betöltés</string>
  81 + <string name="serverlist">Tételek listázása</string>
  82 + <string name="serverimport">Importálás adatbázisból</string>
  83 + <string name="serverloadprompt">Írja be a kulcsszót, amely alapján a tervet elmentette:</string>
  84 + <string name="serversaveprompt">Írja be a kulcsszót, amely alapján a tervet el szeretné menteni:</string>
  85 + <string name="serverimportprompt">Írja be az importálandó adatbázis nevét:</string>
  86 + <string name="httpresponse">A szerver válasza</string>
  87 + <string name="http201">Elmentve</string>
  88 + <string name="http404">Nem találom</string>
  89 + <string name="http500">Belső szerver hiba</string>
  90 + <string name="http501">Nem lett végrehajtva</string>
  91 + <string name="http503">Szolgáltatás nem elérhető</string>
  92 +
  93 + <!-- misc -->
  94 + <string name="xmlerror">XML hiba</string>
  95 + <string name="docs">Dokumentáció</string>
  96 +
  97 +</locale>
... ...
resources/js/hayamiki_designer/locale/it.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<locale>
  3 + <!-- table management -->
  4 + <string name="addtable">Aggiungi tabella</string>
  5 + <string name="edittable">Modifica tabella</string>
  6 + <string name="removetable">Elimina tabella</string>
  7 + <string name="removetables">Elimina tabelle</string>
  8 + <string name="aligntables">Allinea tabelle</string>
  9 + <string name="cleartables">Cancella tabelle</string>
  10 + <string name="confirmall">Eliminare veramente le tabelle</string>
  11 + <string name="newtable">nuova tabella</string>
  12 + <string name="addpending">posiziona la tabella</string>
  13 + <string name="tablenamelabel">Nome</string>
  14 + <string name="tablecommentlabel">Oggetto</string>
  15 +
  16 + <!-- row management -->
  17 + <string name="addrow">Aggiungi campo</string>
  18 + <string name="editrow">Modifica campo</string>
  19 + <string name="removerow">Elimina campo</string>
  20 + <string name="uprow">Su</string>
  21 + <string name="downrow">Giù</string>
  22 + <string name="newrow">nuovo campo</string>
  23 + <string name="foreigncreate">Crea chiave esterna</string>
  24 + <string name="foreignpending">fai clic sulla destinazione</string>
  25 + <string name="foreignconnect">Connetti chiave esterna</string>
  26 + <string name="foreignconnectpending">fai clic sulla riga di destinazione</string>
  27 + <string name="foreigndisconnect">Rimuovi chiave esterna</string>
  28 + <string name="confirmtable">Cancellare veramente la tabella</string>
  29 + <string name="confirmrow">Cancellare veramente la riga</string>
  30 +
  31 + <!-- row edit -->
  32 + <string name="name">Nome</string>
  33 + <string name="type">Tipo</string>
  34 + <string name="size">Dimensione</string>
  35 + <string name="def">Predefinito</string>
  36 + <string name="notnull">QUALCOSA</string>
  37 + <string name="null">NULL</string>
  38 + <string name="ai">Autoincremento</string>
  39 + <string name="comment">Modifica commento</string>
  40 + <string name="commenttext">Inserisci commento per questo campo</string>
  41 +
  42 + <!-- windows & options -->
  43 + <string name="windowok">Conferma</string>
  44 + <string name="windowcancel">Annulla</string>
  45 + <string name="throbber">Attendere...</string>
  46 + <string name="options">Opzioni</string>
  47 + <string name="language">Lingua</string>
  48 + <string name="db">Database per nuovi progetti</string>
  49 + <string name="optionsnotice">Alcune opzioni diventano attive solo dopo il ricaricamento della pagina. Affinché le opzioni vengano mantenute, devono essere abilitati i cookies.</string>
  50 + <string name="snap">Griglia magnetica</string>
  51 + <string name="optionsnapnotice">In pixel, 0 = magnetismo disabilitato</string>
  52 + <string name="pattern">Modello per le chiavi esterne</string>
  53 + <string name="optionpatternnotice">%T = tabella principale, %R = chiave primaria, %t = tabella secondaria</string>
  54 + <string name="hide">Nascondi i connettori durante il trascinamento?</string>
  55 + <string name="vector">Disegna connettori arrotondati (se supportato dal browser)?</string>
  56 + <string name="showsize">Show field size in table design?</string>
  57 + <string name="showtype">Show field datatype in table design?</string>
  58 +
  59 + <!-- keys -->
  60 + <string name="tablekeys">Chiavi</string>
  61 + <string name="keyslistlabel">Chiavi nella tabella "%s"</string>
  62 + <string name="keytypelabel">Tipo:</string>
  63 + <string name="keynamelabel">Nome:</string>
  64 + <string name="keyfieldslabel">Campi nella chiave</string>
  65 + <string name="keyavaillabel">Campi disponibili</string>
  66 + <string name="keyedit">Modifica chiave</string>
  67 + <string name="keyadd">Aggiungi chiave</string>
  68 + <string name="keyremove">Rimuovi chiave</string>
  69 +
  70 + <!-- io -->
  71 + <string name="saveload">Salva / Carica</string>
  72 + <string name="empty">Reincolla i dati XML nell'area sottostante e prova di nuovo.</string>
  73 + <string name="client">Intestatario</string>
  74 + <string name="server">Server</string>
  75 + <string name="output">Ingresso / Uscita</string>
  76 + <string name="clientsave">Salva XML</string>
  77 + <string name="clientload">Carica XML</string>
  78 + <string name="clientsql">Genera SQL</string>
  79 + <string name="backendlabel">Server di backend:</string>
  80 + <string name="serversave">Salva</string>
  81 + <string name="quicksave">Quicksave</string>
  82 + <string name="serverload">Carica</string>
  83 + <string name="serverlist">Elenca elementi</string>
  84 + <string name="serverimport">Importa dal DB</string>
  85 + <string name="serverloadprompt">Inserisci la parola chiave con cui è stato salvato il progetto:</string>
  86 + <string name="serversaveprompt">Inserisci la parola chiave con cui salvare il progetto:</string>
  87 + <string name="serverimportprompt">Inserisci il nome del database da importare</string>
  88 + <string name="httpresponse">Risposta del server</string>
  89 + <string name="http201">Salvato</string>
  90 + <string name="http404">Non trovato</string>
  91 + <string name="http500">Errore interno del server</string>
  92 + <string name="http501">Non implementato</string>
  93 + <string name="http503">Servizio non disponibile</string>
  94 +
  95 + <!-- misc -->
  96 + <string name="xmlerror">Errore XML</string>
  97 + <string name="docs">Documentazione</string>
  98 +
  99 +</locale>
... ...
resources/js/hayamiki_designer/locale/ja.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<locale>
  3 + <!-- table management -->
  4 + <string name="addtable">テーブルを追加</string>
  5 + <string name="edittable">テーブルを編集</string>
  6 + <string name="removetable">テーブルを削除</string>
  7 + <string name="aligntables">テーブルを整列</string>
  8 + <string name="cleartables">全テーブルを削除</string>
  9 + <string name="confirmall">全テーブルを削除しますか</string>
  10 + <string name="newtable">新規テーブル</string>
  11 + <string name="addpending">テーブルを配置</string>
  12 + <string name="tablenamelabel">テーブル名</string>
  13 + <string name="tablecommentlabel">コメント</string>
  14 +
  15 + <!-- row management -->
  16 + <string name="addrow">列を追加</string>
  17 + <string name="editrow">列を編集</string>
  18 + <string name="removerow">列を削除</string>
  19 + <string name="uprow">上に</string>
  20 + <string name="downrow">下に</string>
  21 + <string name="newrow">新規列</string>
  22 + <string name="foreigncreate">外部キーとして移動</string>
  23 + <string name="foreignpending">対象テーブルを選択</string>
  24 + <string name="foreignconnect">外部キーを接続</string>
  25 + <string name="foreignconnectpending">対象列を選択</string>
  26 + <string name="foreigndisconnect">外部キーを削除</string>
  27 + <string name="confirmtable">テーブルを削除しますか</string>
  28 + <string name="confirmrow">列を削除しますか</string>
  29 +
  30 + <!-- row edit -->
  31 + <string name="name">列名</string>
  32 + <string name="type">型</string>
  33 + <string name="size">サイズ</string>
  34 + <string name="def">デフォルト値</string>
  35 + <string name="notnull">NOT NULL</string>
  36 + <string name="null">NULL</string>
  37 + <string name="ai">自動採番</string>
  38 + <string name="comment">コメントを編集</string>
  39 + <string name="commenttext">列のコメントを入力</string>
  40 +
  41 + <!-- windows & options -->
  42 + <string name="windowok">OK</string>
  43 + <string name="windowcancel">キャンセル</string>
  44 + <string name="throbber">しばらくお待ちください...</string>
  45 + <string name="options">オプション</string>
  46 + <string name="language">言語</string>
  47 + <string name="db">新しい設計で使用するデータベース</string>
  48 + <string name="optionsnotice">印は再読込後に反映されるオプションです。これらを動作させるにはクッキーを有効にしてください。</string>
  49 + <string name="snap">テーブルのスナップ単位</string>
  50 + <string name="optionsnapnotice">ピクセル(0 = スナップ無効)</string>
  51 + <string name="pattern">外部キーの命名規則</string>
  52 + <string name="optionpatternnotice">%T = 親テーブル, %R = プライマリーキー, %t = 子テーブル</string>
  53 + <string name="hide">テーブルをドラッグ中は線を隠す</string>
  54 + <string name="vector">滑らかな線を使う(要ブラウザのサポート)</string>
  55 +
  56 +
  57 + <!-- keys -->
  58 + <string name="tablekeys">キーの設定</string>
  59 + <string name="keyslistlabel">テーブル"%s"のキー</string>
  60 + <string name="keytypelabel">種類:</string>
  61 + <string name="keynamelabel">キー名:</string>
  62 + <string name="keyfieldslabel">キーの対象列</string>
  63 + <string name="keyavaillabel">選択可能な列</string>
  64 + <string name="keyedit">キーを編集</string>
  65 + <string name="keyadd">キーを追加</string>
  66 + <string name="keyremove">キーを削除</string>
  67 +
  68 + <!-- io -->
  69 + <string name="saveload">保存/読み込み</string>
  70 + <string name="empty">下の入出力欄にXMLデータを貼りつけてから実行してください。</string>
  71 + <string name="client">クライアント</string>
  72 + <string name="server">サーバ</string>
  73 + <string name="output">入力出欄</string>
  74 + <string name="clientsave">XMLを出力</string>
  75 + <string name="clientload">XMLを読込</string>
  76 + <string name="clientsql">SQLを生成</string>
  77 + <string name="backendlabel">サーバのバックエンド:</string>
  78 + <string name="serversave">保存</string>
  79 + <string name="serverload">読込</string>
  80 + <string name="serverlist">一覧</string>
  81 + <string name="serverimport">DBからインポート</string>
  82 + <string name="serverloadprompt">読み込む設計名を入力してください:</string>
  83 + <string name="serversaveprompt">保存する設計名を入力してください:</string>
  84 + <string name="serverimportprompt">インポートするDB名を入力してください:</string>
  85 + <string name="httpresponse">サーバレスポンス</string>
  86 + <string name="http201">Saved</string>
  87 + <string name="http404">Not Found</string>
  88 + <string name="http500">Internal Server Error</string>
  89 + <string name="http501">Not Implemented</string>
  90 + <string name="http503">Service Unavailable</string>
  91 +
  92 + <!-- misc -->
  93 + <string name="xmlerror">XMLエラー</string>
  94 + <string name="docs">ドキュメント</string>
  95 +
  96 +</locale>
... ...
resources/js/hayamiki_designer/locale/nl.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<locale>
  3 + <!-- table management -->
  4 + <string name="addtable">Tabel toevoegen</string>
  5 + <string name="edittable">Bewerk tabel</string>
  6 + <string name="removetable">Verwijder tabel</string>
  7 + <string name="removetables">Verwijder tabellen</string>
  8 + <string name="aligntables">Uitlijnen tabellen</string>
  9 + <string name="cleartables">Tabellen schonen</string>
  10 + <string name="confirmall">Wilt u echt alle tabellen verwijderen</string>
  11 + <string name="newtable">Nieuwe tabel</string>
  12 + <string name="addpending">Positioneer tabel</string>
  13 + <string name="tablenamelabel">Naam</string>
  14 + <string name="tablecommentlabel">Opmerkingen</string>
  15 +
  16 + <!-- row management -->
  17 + <string name="addrow">Veld toevoegen</string>
  18 + <string name="editrow">Veld bewerken</string>
  19 + <string name="removerow">Veld verwijderen</string>
  20 + <string name="uprow">Op</string>
  21 + <string name="downrow">Neer</string>
  22 + <string name="newrow">nieuwe veld</string>
  23 + <string name="foreigncreate">Maak relatie</string>
  24 + <string name="foreignpending">Click op doeltabel</string>
  25 + <string name="foreignconnect">Verbind relatie</string>
  26 + <string name="foreignconnectpending">Click op doelveld</string>
  27 + <string name="foreigndisconnect">Verwijder relatie</string>
  28 + <string name="confirmtable">Tabel verwijderen?</string>
  29 + <string name="confirmrow">Veld verwijderen?</string>
  30 +
  31 + <!-- row edit -->
  32 + <string name="name">Naam</string>
  33 + <string name="type">Type</string>
  34 + <string name="size">Omvang</string>
  35 + <string name="def">Standaard</string>
  36 + <string name="notnull">NOT NULL</string>
  37 + <string name="null">NULL</string>
  38 + <string name="ai">Autoincrement</string>
  39 + <string name="comment">Bewerk opmerkingen</string>
  40 + <string name="commenttext">Geef opmerkingen voor dit veld</string>
  41 +
  42 + <!-- windows & options -->
  43 + <string name="windowok">OK</string>
  44 + <string name="windowcancel">Annuleer</string>
  45 + <string name="throbber">Even geduld...</string>
  46 + <string name="options">Opties</string>
  47 + <string name="language">Taal</string>
  48 + <string name="db">Database voor nieuwe ontwerpen</string>
  49 + <string name="optionsnotice">Sommige opties worden pas geldig na het volledig opnieuw laden van de pagina. Cookies moeten zijn toegestaan voor een juiste werking.</string>
  50 + <string name="snap">Tabel snap afstand</string>
  51 + <string name="optionsnapnotice">In pixels, 0 = uitzetten snap</string>
  52 + <string name="pattern">Patroon voor relatie velden</string>
  53 + <string name="optionpatternnotice">%T = primaire tabel, %R = primaire sleutel, %t = verwezen tabel.</string>
  54 + <string name="hide">Verberg relaties tijdens verplaatsen van de tabel?</string>
  55 + <string name="vector">Teken gekromde relaties (als de browser dit ondersteund)?</string>
  56 + <string name="showsize">Toon veld omvang in tabelontwerp?</string>
  57 + <string name="showtype">Toon veld type in tabelontwerp?</string>
  58 +
  59 + <!-- keys -->
  60 + <string name="tablekeys">Sleutels</string>
  61 + <string name="keyslistlabel">Sleutels in tabel "%s"</string>
  62 + <string name="keytypelabel">Type:</string>
  63 + <string name="keynamelabel">Naam:</string>
  64 + <string name="keyfieldslabel">Velden in sleutel</string>
  65 + <string name="keyavaillabel">Beschikbare velden</string>
  66 + <string name="keyedit">Bewerk sleutel</string>
  67 + <string name="keyadd">Voeg sleutel toe</string>
  68 + <string name="keyremove">Verwijder sleutel</string>
  69 +
  70 + <!-- io -->
  71 + <string name="saveload">Opslaan / laden</string>
  72 + <string name="empty">Please paste XML data into the text area below and try again.</string>
  73 + <string name="client">Lokaal</string>
  74 + <string name="server">Server</string>
  75 + <string name="output">Input / Output</string>
  76 + <string name="clientsave">XML Opslaan</string>
  77 + <string name="clientload">XML Laden</string>
  78 + <string name="clientlocalsave">Opslaan in Browser</string>
  79 + <string name="clientlocalload">Laden uit Browser</string>
  80 + <string name="clientsql">Genereer SQL</string>
  81 + <string name="backendlabel">Server:</string>
  82 + <string name="serversave">Opslaan</string>
  83 + <string name="quicksave">Snel opslaan</string>
  84 + <string name="serverload">Laden</string>
  85 + <string name="serverlist">Toon lijst</string>
  86 + <string name="serverimport">Import uit DB</string>
  87 + <string name="serverloadprompt">Enter keyword under which your design was saved:</string>
  88 + <string name="serversaveprompt">Enter keyword under which your design will be saved:</string>
  89 + <string name="serverimportprompt">Enter name of database to be imported:</string>
  90 + <string name="httpresponse">Reactie van server</string>
  91 + <string name="http201">Opgeslagen</string>
  92 + <string name="http404">Niet gevonden</string>
  93 + <string name="http500">Interne Server Fout</string>
  94 + <string name="http501">Niet geimplementeerd</string>
  95 + <string name="http503">Niet beschikbaar</string>
  96 +
  97 + <!-- misc -->
  98 + <string name="xmlerror">XML fout</string>
  99 + <string name="docs">Documentatie</string>
  100 +
  101 +</locale>
... ...
resources/js/hayamiki_designer/locale/pl.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<locale>
  3 + <!-- table management -->
  4 + <string name="addtable">Dodaj tabelę</string>
  5 + <string name="edittable">Edytuj tabelę</string>
  6 + <string name="removetable">Usuń tabelę</string>
  7 + <string name="removetables">Usuń tabele</string>
  8 + <string name="aligntables">Wyrównaj tabele</string>
  9 + <string name="cleartables">Wyczyść tabele</string>
  10 + <string name="confirmall">Czy na pewno usunąć wszystkie tabele</string>
  11 + <string name="newtable">nowa tabela</string>
  12 + <string name="addpending">miejsce tabeli</string>
  13 + <string name="tablenamelabel">Nazwa</string>
  14 + <string name="tablecommentlabel">Opis</string>
  15 +
  16 + <!-- row management -->
  17 + <string name="addrow">Dodaj pole</string>
  18 + <string name="editrow">Edytuj pole</string>
  19 + <string name="removerow">Usuń pole</string>
  20 + <string name="uprow">W górę</string>
  21 + <string name="downrow">W dół</string>
  22 + <string name="newrow">nowe pole</string>
  23 + <string name="foreigncreate">Utwórz klucz zewnętrzny</string>
  24 + <string name="foreignpending">kliknij w docelową tabelę</string>
  25 + <string name="foreignconnect">Utwórz klucz zewnętrzny</string>
  26 + <string name="foreignconnectpending">kliknij w docelową tabelę</string>
  27 + <string name="foreigndisconnect">Smazat cizí klíč</string>
  28 + <string name="confirmtable">Czy na pewno usunąć tabelę</string>
  29 + <string name="confirmrow">Czy na pewno usunąć pole</string>
  30 +
  31 + <!-- row edit -->
  32 + <string name="name">Nazwa</string>
  33 + <string name="type">Typ</string>
  34 + <string name="size">Rozmiar</string>
  35 + <string name="def">Domyślnie</string>
  36 + <string name="notnull">Niepuste</string>
  37 + <string name="null">Zerowy</string>
  38 + <string name="ai">Automatyczne zwiększanie o 1</string>
  39 + <string name="comment">Edytuj komentarz</string>
  40 + <string name="commenttext">Wpisz komentarz dla tego pola</string>
  41 +
  42 + <!-- windows & options -->
  43 + <string name="windowok">OK</string>
  44 + <string name="windowcancel">Anuluj</string>
  45 + <string name="throbber">Proszę czekać...</string>
  46 + <string name="options">Opcje</string>
  47 + <string name="language">Język</string>
  48 + <string name="db">Bazy danych dla nowych projektów</string>
  49 + <string name="optionsnotice">Niektóre opcje są zatwierdzane wyłącznie po kompletnym przeładowaniu strony. Ciasteczka muszą być akceptowane dla działania opcji.</string>
  50 + <string name="snap">Ustalana odległość tabel</string>
  51 + <string name="optionsnapnotice">W pikselach, 0 = wyłącznie ustalania</string>
  52 + <string name="pattern">Wzorzec dla zewnętrznych nazw</string>
  53 + <string name="optionpatternnotice">%T = główna tabela, %R = klucz główny, %t = zewnętrzna tabela</string>
  54 + <string name="hide">Ukryć złącza w tabeli podczas przeciągania?</string>
  55 + <string name="vector">Rysuj pływające złącza (jesli wsperane jest przez przeglądarkę)?</string>
  56 + <string name="showsize">Show field size in table design?</string>
  57 + <string name="showtype">Show field datatype in table design?</string>
  58 +
  59 + <!-- keys -->
  60 + <string name="tablekeys">Klucze</string>
  61 + <string name="keyslistlabel">Klucze w tabeli "%s"</string>
  62 + <string name="keytypelabel">Typ:</string>
  63 + <string name="keynamelabel">Nazwa:</string>
  64 + <string name="keyfieldslabel">Pola w kluczu</string>
  65 + <string name="keyavaillabel">Dostępne pola</string>
  66 + <string name="keyedit">Edytuj klucz</string>
  67 + <string name="keyadd">Dodaj klucz</string>
  68 + <string name="keyremove">Usuń klucz</string>
  69 +
  70 + <!-- io -->
  71 + <string name="saveload">Zapisz / Otwórz</string>
  72 + <string name="empty">Proszę wklej kod XML w poniższe pole tekstowe i spróbuj ponownie.</string>
  73 + <string name="client">Klient</string>
  74 + <string name="server">Serwer</string>
  75 + <string name="output">Wejście / Wyjście</string>
  76 + <string name="clientsave">Zapisz XML</string>
  77 + <string name="clientload">Załaduj XML</string>
  78 + <string name="clientsql">Generuj SQL</string>
  79 + <string name="backendlabel">Serwer wejściowy:</string>
  80 + <string name="serversave">Zapisz</string>
  81 + <string name="quicksave">Quicksave</string>
  82 + <string name="serverload">Otwórz</string>
  83 + <string name="serverlist">Lista pozycji</string>
  84 + <string name="serverimport">Importuj z DB</string>
  85 + <string name="serverloadprompt">Wpisz słowo kluczowe pod którym twój projekt został zapisany:</string>
  86 + <string name="serversaveprompt">Wpisz słowo kluczowe pod którym twój projekt ma zostać zapisany:</string>
  87 + <string name="serverimportprompt">Wpisz nazwę bazy danych do zaimportowania:</string>
  88 + <string name="httpresponse">Odpowiedź serwera</string>
  89 + <string name="http201">Zapisano</string>
  90 + <string name="http404">Nie znaleziono</string>
  91 + <string name="http500">Wewnętrzny błąd serwera</string>
  92 + <string name="http501">Niezaimplementowane</string>
  93 + <string name="http503">Serwer niedostępny</string>
  94 +
  95 + <!-- misc -->
  96 + <string name="xmlerror">Błąd XML</string>
  97 + <string name="docs">Dokumentacja</string>
  98 +
  99 +</locale>
... ...
resources/js/hayamiki_designer/locale/pt_BR.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<locale>
  3 + <!-- table management -->
  4 + <string name="addtable">Adicionar tabela</string>
  5 + <string name="edittable">Editar tabela</string>
  6 + <string name="removetable">Remover tabela</string>
  7 + <string name="removetables">Remover tabelas</string>
  8 + <string name="aligntables">Alinhar tabelas</string>
  9 + <string name="cleartables">Limpar tabelas</string>
  10 + <string name="confirmall">Realmente excluir todas as tabelas</string>
  11 + <string name="newtable">Nova tabela</string>
  12 + <string name="addpending">Clique p/ adicionar</string>
  13 + <string name="tablenamelabel">Nome</string>
  14 + <string name="tablecommentlabel">Comentário</string>
  15 +
  16 + <!-- row management -->
  17 + <string name="addrow">Adicionar campo</string>
  18 + <string name="editrow">Editar campo</string>
  19 + <string name="removerow">Remover campo</string>
  20 + <string name="uprow">Para cima</string>
  21 + <string name="downrow">Para baixo</string>
  22 + <string name="newrow">Novo campo</string>
  23 + <string name="foreigncreate">Criar chave estrangeira</string>
  24 + <string name="foreignpending">Selecione a tabela alvo(destino)</string>
  25 + <string name="foreignconnect">Conectar chave estrangeira</string>
  26 + <string name="foreignconnectpending">Clique na linha alvo</string>
  27 + <string name="foreigndisconnect">Remover chave estrangeira</string>
  28 + <string name="confirmtable">Deseja realmente deletar a tabela</string>
  29 + <string name="confirmrow">Deseja realmente deletar o campo</string>
  30 +
  31 + <!-- row edit -->
  32 + <string name="name">Nome</string>
  33 + <string name="type">Tipo</string>
  34 + <string name="size">Tamanho</string>
  35 + <string name="def">Default</string>
  36 + <string name="notnull">NOT NULL</string>
  37 + <string name="null">NULL</string>
  38 + <string name="ai">Auto incrementar</string>
  39 + <string name="comment">Editar comentário</string>
  40 + <string name="commenttext">Digite o comentário para este campo</string>
  41 +
  42 + <!-- windows & options -->
  43 + <string name="windowok">OK</string>
  44 + <string name="windowcancel">Cancelar</string>
  45 + <string name="throbber">Por favor espere...</string>
  46 + <string name="options">Opções</string>
  47 + <string name="language">Linguagem</string>
  48 + <string name="db">Base de Dados para os novos designs</string>
  49 + <string name="optionsnotice">Algumas opções serão aplicadas somente depois da página totalmente regarrecada. Cookies devem ser ativados para as opções funcionarem.</string>
  50 + <string name="snap">Distância entre as tabelas</string>
  51 + <string name="optionsnapnotice">Em pixels, 0 = desativar snapping</string>
  52 + <string name="pattern">Padrão p/ nomes estrangeiros</string>
  53 + <string name="optionpatternnotice">%T = tabela primária, %R = chave primária, %t = tabela estrangeira</string>
  54 + <string name="hide">Esconder connectores na tela?</string>
  55 + <string name="vector">Desenhar conectores suaves (se suportado pelo navegador)?</string>
  56 +
  57 +
  58 + <!-- keys -->
  59 + <string name="tablekeys">Chaves</string>
  60 + <string name="keyslistlabel">Chaves na tabela "%s"</string>
  61 + <string name="keytypelabel">Tipo:</string>
  62 + <string name="keynamelabel">Nome:</string>
  63 + <string name="keyfieldslabel">Campos na chave</string>
  64 + <string name="keyavaillabel">Campos disponíveis</string>
  65 + <string name="keyedit">Editar chave</string>
  66 + <string name="keyadd">Adicionar chave</string>
  67 + <string name="keyremove">Remover chave</string>
  68 +
  69 + <!-- io -->
  70 + <string name="saveload">Salvar / Carregar</string>
  71 + <string name="empty">Por favor cole os dados XML na área de texto abaixo e tente novamente.</string>
  72 + <string name="client">Cliente</string>
  73 + <string name="server">Servidor</string>
  74 + <string name="output">Entrada / Saída</string>
  75 + <string name="clientsave">Salvar XML</string>
  76 + <string name="clientload">Carregar XML</string>
  77 + <string name="clientsql">Gerar SQL</string>
  78 + <string name="backendlabel"> Parâmetros do Servidor:</string>
  79 + <string name="serversave">Salvar</string>
  80 + <string name="serverload">Carregar</string>
  81 + <string name="serverlist">Listar itens</string>
  82 + <string name="serverimport">Importar do BD</string>
  83 + <string name="serverloadprompt">Digite o nome o qual seu design foi salvo:</string>
  84 + <string name="serversaveprompt">Digite o nome com qual seu design será salvo:</string>
  85 + <string name="serverimportprompt">Digite o nome da base de dados à ser importada:</string>
  86 + <string name="httpresponse"> Resposta do servidor</string>
  87 + <string name="http201">Salvo</string>
  88 + <string name="http404">Não Encontrado</string>
  89 + <string name="http500">Erro Interno do Servidor</string>
  90 + <string name="http501">Não Implementado</string>
  91 + <string name="http503">Serviço Indisponível</string>
  92 +
  93 + <!-- misc -->
  94 + <string name="xmlerror">Erro de XML</string>
  95 + <string name="docs">Documentação</string>
  96 +
  97 +</locale>
... ...
resources/js/hayamiki_designer/locale/ro.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<locale>
  3 + <!-- table management -->
  4 + <string name="addtable">Adauga tabela</string>
  5 + <string name="edittable">Editeaza tabela</string>
  6 + <string name="removetable">Sterge tabela</string>
  7 + <string name="removetables">Sterge tabelele</string>
  8 + <string name="aligntables">Aliniaza tabelele</string>
  9 + <string name="cleartables">Sterge tabelele</string>
  10 + <string name="confirmall">Sterge toate tabelele</string>
  11 + <string name="newtable">(nume tabela)</string>
  12 + <string name="addpending">plaseaza tabela</string>
  13 + <string name="tablenamelabel">Nume</string>
  14 + <string name="tablecommentlabel">Comentariu</string>
  15 +
  16 + <!-- row management -->
  17 + <string name="addrow">Adauga coloana</string>
  18 + <string name="editrow">Editeaza coloana</string>
  19 + <string name="removerow">Sterge coloana</string>
  20 + <string name="uprow">Sus</string>
  21 + <string name="downrow">Jos</string>
  22 + <string name="newrow">coloana noua</string>
  23 + <string name="foreigncreate">Creaza FK</string>
  24 + <string name="foreignpending">alege destinatie</string>
  25 + <string name="foreignconnect">Conexiune FK</string>
  26 + <string name="foreignconnectpending">alege destinatie</string>
  27 + <string name="foreigndisconnect">Sterge FK</string>
  28 + <string name="confirmtable">Sterge tabela</string>
  29 + <string name="confirmrow">Sterge coloana</string>
  30 +
  31 + <!-- editare rand -->
  32 + <string name="name">Nume</string>
  33 + <string name="type">Tip</string>
  34 + <string name="size">Dimensiune</string>
  35 + <string name="def">Valoare default</string>
  36 + <string name="notnull">NOT NULL</string>
  37 + <string name="null">NULL</string>
  38 + <string name="ai">Auto increment</string>
  39 + <string name="comment">Editare comentariu</string>
  40 + <string name="commenttext">Introduceti comentariul pentru aceasta coloana:</string>
  41 +
  42 + <!-- windows & options -->
  43 + <string name="windowok">OK</string>
  44 + <string name="windowcancel">Anuleaza</string>
  45 + <string name="throbber">Asteptati va rog...</string>
  46 + <string name="options">Optiuni</string>
  47 + <string name="language">Limbaj</string>
  48 + <string name="db">Baza de date pentru design</string>
  49 + <string name="optionsnotice">Anumite optiuni devin active numai dupa o reincarcare completa a paginii. Cookies trebuie sa fie activate pentru browser.</string>
  50 + <string name="snap">Distanta automata intre tabele</string>
  51 + <string name="optionsnapnotice">In pixeli, 0 = dezactiveaza asezarea automata</string>
  52 + <string name="pattern">Modelul pentru nume de Foreign Keys</string>
  53 + <string name="optionpatternnotice">%T = Tabela primara, %R = Primary key, %t = Tabela cu Foreign key</string>
  54 + <string name="hide">Ascunde conexiunile la mutarea tabelei?</string>
  55 + <string name="vector">Deseneaza folosind "smooth connectors" (daca browserul suporta)?</string>
  56 +
  57 +
  58 + <!-- keys -->
  59 + <string name="tablekeys">Keys / Indexes</string>
  60 + <string name="keyslistlabel">Keys / Indexes in tabela "%s"</string>
  61 + <string name="keytypelabel">Tip:</string>
  62 + <string name="keynamelabel">Nume:</string>
  63 + <string name="keyfieldslabel">Campuri selectate</string>
  64 + <string name="keyavaillabel">Campuri disponibile</string>
  65 + <string name="keyedit">Editeaza</string>
  66 + <string name="keyadd">Adauga</string>
  67 + <string name="keyremove">Sterge</string>
  68 +
  69 + <!-- io -->
  70 + <string name="saveload">Salveaza / Incarca</string>
  71 + <string name="empty">Introduceti codul XML si re-incercati.</string>
  72 + <string name="client">Client</string>
  73 + <string name="server">Server</string>
  74 + <string name="output">Input / Output</string>
  75 + <string name="clientsave">Genereaza XML</string>
  76 + <string name="clientload">Incarca din XML</string>
  77 + <string name="clientsql">Genereaza SQL</string>
  78 + <string name="backendlabel">Server backend:</string>
  79 + <string name="serversave">Salveaza</string>
  80 + <string name="serverload">Incarca</string>
  81 + <string name="serverlist">Lista de salvari</string>
  82 + <string name="serverimport">Import tabele din baza de date</string>
  83 + <string name="serverloadprompt">Introduceti numele sub care a fost salvat design-ul:</string>
  84 + <string name="serversaveprompt">Introduceti numele sub care va fi salvat design-ul:</string>
  85 + <string name="serverimportprompt">Introduceti numele bazei de date care va fi importata:</string>
  86 + <string name="httpresponse">Server response</string>
  87 + <string name="http201">Salvare efectuata</string>
  88 + <string name="http404">Not Found</string>
  89 + <string name="http500">Internal Server Error</string>
  90 + <string name="http501">Not Implemented</string>
  91 + <string name="http503">Service Unavailable</string>
  92 +
  93 + <!-- diverse -->
  94 + <string name="xmlerror">Eroare XML</string>
  95 + <string name="docs">Documentatie</string>
  96 +
  97 +</locale>
... ...
resources/js/hayamiki_designer/locale/ru.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<locale>
  3 + <!-- table management -->
  4 + <string name="addtable">Добавить таблицу</string>
  5 + <string name="edittable">Редактировать таблицу</string>
  6 + <string name="removetable">Удалить таблицу</string>
  7 + <string name="removetables">Удалить таблицы</string>
  8 + <string name="aligntables">Выровнять таблицы</string>
  9 + <string name="cleartables">Очистить таблицы</string>
  10 + <string name="confirmall">Действительно удалить все таблицы</string>
  11 + <string name="newtable">новая таблица</string>
  12 + <string name="addpending">расположите таблицу</string>
  13 + <string name="tablenamelabel">Имя</string>
  14 + <string name="tablecommentlabel">Коментарий</string>
  15 +
  16 + <!-- row management -->
  17 + <string name="addrow">Добавить поле</string>
  18 + <string name="editrow">Редактировать поле</string>
  19 + <string name="removerow">Удалить поле</string>
  20 + <string name="uprow">Вверх</string>
  21 + <string name="downrow">Вниз</string>
  22 + <string name="newrow">новое поле</string>
  23 + <string name="foreigncreate">Создать внешний ключь</string>
  24 + <string name="foreignpending">щелкните по целевой таблице</string>
  25 + <string name="foreignconnect">?</string>
  26 + <string name="foreignconnectpending">?</string>
  27 + <string name="foreigndisconnect">?</string>
  28 + <string name="confirmtable">Действительно удалить таблицу</string>
  29 + <string name="confirmrow">Действительно удалить поле</string>
  30 +
  31 + <!-- row edit -->
  32 + <string name="name">Имя</string>
  33 + <string name="type">Тип</string>
  34 + <string name="size">Размер</string>
  35 + <string name="def">По умолчанию</string>
  36 + <string name="notnull">NOT NULL</string>
  37 + <string name="null">NULL</string>
  38 + <string name="ai">Autoincrement</string>
  39 + <string name="comment">Изменить коментарий</string>
  40 + <string name="commenttext">Введите коментарий для этого поля</string>
  41 +
  42 + <!-- windows & options -->
  43 + <string name="windowok">OK</string>
  44 + <string name="windowcancel">Отменить</string>
  45 + <string name="throbber">Пожалуйста подождите...</string>
  46 + <string name="options">Опции</string>
  47 + <string name="language">Язык</string>
  48 + <string name="db">База данных для новых дизайнов</string>
  49 + <string name="optionsnotice">Некоторые опции заработают только после полной перезагрузки страницы. Cookie должны быть включены.</string>
  50 + <string name="snap">Table snap distance</string>
  51 + <string name="optionsnapnotice">В пикселях, 0 = disable snapping</string>
  52 + <string name="pattern">Pattern for foreign names</string>
  53 + <string name="optionpatternnotice">%T = primary table, %R = primary key, %t = foreign table</string>
  54 + <string name="hide">Прятать связи при перетаскивании таблиц?</string>
  55 + <string name="vector">Рисовать сглаженные связи (если поддерживается браузером)?</string>
  56 +
  57 +
  58 + <!-- keys -->
  59 + <string name="tablekeys">Ключи</string>
  60 + <string name="keyslistlabel">Ключи в таблице "%s"</string>
  61 + <string name="keytypelabel">Тип:</string>
  62 + <string name="keynamelabel">Имя:</string>
  63 + <string name="keyfieldslabel">Поля в ключе</string>
  64 + <string name="keyavaillabel">Доступные поля</string>
  65 + <string name="keyedit">Редактировать ключь</string>
  66 + <string name="keyadd">Добавить ключь</string>
  67 + <string name="keyremove">Удалить ключь</string>
  68 +
  69 + <!-- io -->
  70 + <string name="saveload">Сохранить / Загрузить</string>
  71 + <string name="empty">Пожалуйста, вставьте XML данные в поле ниже и попробуйте ещё раз.</string>
  72 + <string name="client">Клиент</string>
  73 + <string name="server">Сервер</string>
  74 + <string name="output">Ввод / Вывод</string>
  75 + <string name="clientsave">Сохранить XML</string>
  76 + <string name="clientload">Загрузить XML</string>
  77 + <string name="clientsql">Генерировать SQL</string>
  78 + <string name="backendlabel">Использовать для сохранения сервис:</string>
  79 + <string name="serversave">Сохранить</string>
  80 + <string name="serverload">Загрузить</string>
  81 + <string name="serverlist">Список items</string>
  82 + <string name="serverimport">Импортировать из БД</string>
  83 + <string name="serverloadprompt">Введите ключевое слово под которым ваш дизайн сохранен:</string>
  84 + <string name="serversaveprompt">Введите ключевое слово под которым ваш дизайн будет сохранен:</string>
  85 + <string name="serverimportprompt">Введите имя импортируемой базы данных:</string>
  86 + <string name="httpresponse">Ответ сервера</string>
  87 + <string name="http201">Saved</string>
  88 + <string name="http404">Not Found</string>
  89 + <string name="http500">Internal Server Error</string>
  90 + <string name="http501">Not Implemented</string>
  91 + <string name="http503">Service Unavailable</string>
  92 +
  93 + <!-- misc -->
  94 + <string name="xmlerror">Ошибка XML</string>
  95 + <string name="docs">Документация</string>
  96 +
  97 +</locale>
... ...
resources/js/hayamiki_designer/locale/sv.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<locale>
  3 + <!-- tabell management -->
  4 + <string name="addtable">Skapa tabell</string>
  5 + <string name="edittable">Redigera tabell</string>
  6 + <string name="removetable">Ta bort tabell</string>
  7 + <string name="removetables">Ta bort tabeller</string>
  8 + <string name="aligntables">Räta upp tabeller</string>
  9 + <string name="cleartables">Ta bort alla tabeller</string>
  10 + <string name="confirmall">Vill du verkligen ta bort alla tabeller</string>
  11 + <string name="newtable">Ny tabell</string>
  12 + <string name="addpending">Placera tabell</string>
  13 + <string name="tablenamelabel">Namn</string>
  14 + <string name="tablecommentlabel">Kommentar</string>
  15 +
  16 + <!-- row management -->
  17 + <string name="addrow">Lägg till fält</string>
  18 + <string name="editrow">Redigera fält</string>
  19 + <string name="removerow">Ta bort field</string>
  20 + <string name="uprow">Upp</string>
  21 + <string name="downrow">Ner</string>
  22 + <string name="newrow">Ny field</string>
  23 + <string name="foreigncreate">Skapa främmande nyckel</string>
  24 + <string name="foreignpending">Klicka på motsvarande tabell</string>
  25 + <string name="foreignconnect">Anslut främmande nycke</string>
  26 + <string name="foreignconnectpending">Välj motsvarande rad</string>
  27 + <string name="foreigndisconnect">Ta bort främmande nyckel</string>
  28 + <string name="confirmtable">Vill du verkligen ta bort denna tabell?</string>
  29 + <string name="confirmrow">Vill du verkligen ta bort detta fält?</string>
  30 +
  31 + <!-- row edit -->
  32 + <string name="name">Namn</string>
  33 + <string name="type">Typ</string>
  34 + <string name="size">Storlek</string>
  35 + <string name="def">Standard</string>
  36 + <string name="notnull">NOT NULL</string>
  37 + <string name="null">NULL</string>
  38 + <string name="ai">Autoincrement</string>
  39 + <string name="comment">Redigera kommentar</string>
  40 + <string name="commenttext">Ange kommentar för detta fält</string>
  41 +
  42 + <!-- windows & options -->
  43 + <string name="windowok">OK</string>
  44 + <string name="windowcancel">Avbryt</string>
  45 + <string name="throbber">Var god vänta...</string>
  46 + <string name="options">Alternativ</string>
  47 + <string name="language">Språk</string>
  48 + <string name="db">Databas for nya designer</string>
  49 + <string name="optionsnotice">Vissa alternativ ändras bara efter att du laddat om sidan. Cookies krävs för att alternativ ska fungera.</string>
  50 + <string name="snap">Tabellers fästavstånd</string>
  51 + <string name="optionsnapnotice">Ange pixlar, 0 = stäng av fästning</string>
  52 + <string name="pattern">Mönster för främmande namn</string>
  53 + <string name="optionpatternnotice">%T = primär tabell, %R = primär nycke, %t = främmande tabell</string>
  54 + <string name="hide">Dölj anslutningar när du drar i tabellen?</string>
  55 + <string name="vector">Rita mjuka anslutningar (om din webbläsare stöder det)?</string>
  56 +
  57 +
  58 + <!-- keys -->
  59 + <string name="tablekeys">Nycklar</string>
  60 + <string name="keyslistlabel">Nycklar i tabellen "%s"</string>
  61 + <string name="keytypelabel">Typ:</string>
  62 + <string name="keynamelabel">Namn:</string>
  63 + <string name="keyfieldslabel">Fields in nyckel</string>
  64 + <string name="keyavaillabel">Available fields</string>
  65 + <string name="keyedit">Edit nyckel</string>
  66 + <string name="keyadd">Add key</string>
  67 + <string name="keyremove">Ta bort key</string>
  68 +
  69 + <!-- io -->
  70 + <string name="saveload">Spara / Ladda</string>
  71 + <string name="empty">Vänligen klistra in XML i textrutan nedan och försök igen.</string>
  72 + <string name="client">Klient</string>
  73 + <string name="server">Server</string>
  74 + <string name="output">Input / Output</string>
  75 + <string name="clientsave">Spara XML</string>
  76 + <string name="clientload">Ladda XML</string>
  77 + <string name="clientsql">Generera SQL</string>
  78 + <string name="backendlabel">Server backend:</string>
  79 + <string name="serversave">Spara</string>
  80 + <string name="serverload">Ladda</string>
  81 + <string name="serverlist">Lista innehåll</string>
  82 + <string name="serverimport">Importera från DB</string>
  83 + <string name="serverloadprompt">Ange vilket nyckelord din design sparades under:</string>
  84 + <string name="serversaveprompt">Ange vilket nyckelord din design ska sparas under:</string>
  85 + <string name="serverimportprompt">Ange namnet på databasen som ska importeras:</string>
  86 + <string name="httpresponse">Serversvar</string>
  87 + <string name="http201">Sparad</string>
  88 + <string name="http404">Ej funnen</string>
  89 + <string name="http500">Intert serverfel</string>
  90 + <string name="http501">Ej implementerat</string>
  91 + <string name="http503">Service Unavailable</string>
  92 +
  93 + <!-- misc -->
  94 + <string name="xmlerror">XML error</string>
  95 + <string name="docs">Dokumentation</string>
  96 +
  97 +</locale>
... ...
resources/js/hayamiki_designer/locale/zh.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<locale>
  3 + <!-- table management -->
  4 + <string name="addtable">添加表</string>
  5 + <string name="edittable">修改表</string>
  6 + <string name="removetable">移除表</string>
  7 + <string name="aligntables">重组表格位置</string>
  8 + <string name="cleartables">删除所有表</string>
  9 + <string name="confirmall">真的要删除所有表么</string>
  10 + <string name="newtable">表名称</string>
  11 + <string name="addpending">放置表格……</string>
  12 + <string name="tablenamelabel">表名</string>
  13 + <string name="tablecommentlabel">注释</string>
  14 +
  15 + <!-- row management -->
  16 + <string name="addrow">添加列</string>
  17 + <string name="editrow">修改列</string>
  18 + <string name="removerow">删除列</string>
  19 + <string name="uprow">上移</string>
  20 + <string name="downrow">下移</string>
  21 + <string name="newrow">newfield</string>
  22 + <string name="foreigncreate">创建外连表格列</string>
  23 + <string name="foreignpending">点击选择目标表</string>
  24 + <string name="foreignconnect">连接到外部列</string>
  25 + <string name="foreignconnectpending">点击选择目标列</string>
  26 + <string name="foreigndisconnect">断开外部连接</string>
  27 + <string name="confirmtable">真的删除表么</string>
  28 + <string name="confirmrow">真的删除列么</string>
  29 +
  30 + <!-- row edit -->
  31 + <string name="name">列名</string>
  32 + <string name="type">类型</string>
  33 + <string name="size">大小</string>
  34 + <string name="def">默认</string>
  35 + <string name="notnull">不能为空</string>
  36 + <string name="null">可留空</string>
  37 + <string name="ai">自增长</string>
  38 + <string name="comment">改备注</string>
  39 + <string name="commenttext">输入此列备注</string>
  40 +
  41 + <!-- windows & options -->
  42 + <string name="windowok">搞定</string>
  43 + <string name="windowcancel">不要了</string>
  44 + <string name="throbber">请等待...</string>
  45 + <string name="options">选项设置</string>
  46 + <string name="language">语言</string>
  47 + <string name="db">新建的数据库设为:</string>
  48 + <string name="optionsnotice">有些属性需要刷新页面后才能起作用,所以,浏览器的Cookies必须启用。</string>
  49 + <string name="snap">表格捕捉距离</string>
  50 + <string name="optionsnapnotice">像素, 0 = 关闭捕捉</string>
  51 + <string name="pattern">外连名称规则</string>
  52 + <string name="optionpatternnotice">%T = 主表, %R = 主键, %t = 外连表</string>
  53 + <string name="hide">在表格移动时不显示连接?</string>
  54 + <string name="vector">绘制平滑的连接 (如果浏览器支持)?</string>
  55 + <string name="showsize">设计表格时显示字段大小?</string>
  56 + <string name="showtype">设计表格时显示字段数据类型?</string>
  57 +
  58 +
  59 + <!-- keys -->
  60 + <string name="tablekeys">设置表键</string>
  61 + <string name="keyslistlabel">在 "%s" 表中可用列属性</string>
  62 + <string name="keytypelabel">类型:</string>
  63 + <string name="keynamelabel">属性名称:</string>
  64 + <string name="keyfieldslabel">此属性中的列</string>
  65 + <string name="keyavaillabel">可用列</string>
  66 + <string name="keyedit">修改属性</string>
  67 + <string name="keyadd">添加属性</string>
  68 + <string name="keyremove">删除属性</string>
  69 +
  70 + <!-- io -->
  71 + <string name="login">登录</string>
  72 + <string name="logout">注销</string>
  73 + <string name="saveload">保存 / 载入</string>
  74 + <string name="empty">请先粘帖一个XML文件内容到文本框中,然后再导入。</string>
  75 + <string name="client">客户端</string>
  76 + <string name="server">服务端</string>
  77 + <string name="output">输入 / 输出</string>
  78 + <string name="clientsave">保存为XML</string>
  79 + <string name="clientload">载入XML</string>
  80 + <string name="clientsql">传化为数据库脚本</string>
  81 + <string name="backendlabel">服务后台:</string>
  82 + <string name="serversave">保存</string>
  83 + <string name="serverload">载入</string>
  84 + <string name="serverlist">显示清单</string>
  85 + <string name="quicksave">快速保存</string>
  86 + <string name="serverimport">从数据库中导入</string>
  87 + <string name="serverloadprompt">输入你所保存的名字:</string>
  88 + <string name="serversaveprompt">输入所要保存的名字:</string>
  89 + <string name="serverimportprompt">输入所要导入的数据库名称:</string>
  90 + <string name="httpresponse">服务器反馈</string>
  91 + <string name="http201">已存</string>
  92 + <string name="http404">找不到</string>
  93 + <string name="http500">网络服务错误</string>
  94 + <string name="http501">未执行</string>
  95 + <string name="http503">服务暂不可用</string>
  96 +
  97 + <!-- misc -->
  98 + <string name="xmlerror">XML 错误</string>
  99 + <string name="docs">文档</string>
  100 +
  101 +</locale>
... ...