rxcms-dbms_plugin 0.3.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dbabedea576f72195e76c547edb12f7c194c0328
|
4
|
+
data.tar.gz: 16086598ff3c6fb482ea0e00bd3e96c8411ecf7a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ceed5163a57f11c3e7fb5db9eda654e6b5f2a9037ac066087b50694e98a0fc6cc0dc5a830739e34386c9bec86e25992f29e0c8d60e166e734a8bcae2165c3b5
|
7
|
+
data.tar.gz: e44001f960e722807798476136b2331b4d608326e1583aed12df99652c776aa259361bfa29c53d5ed3242bec5c0ea2357b4c03291073124ea621a8aa872bf7bc
|
@@ -200,6 +200,10 @@ class DbmsConnectionController < ApplicationController
|
|
200
200
|
# raise "key is duplicated"
|
201
201
|
# end
|
202
202
|
|
203
|
+
if (!Metadata.first({ :conditions => ['key = ?', params[:key]]}).nil?)
|
204
|
+
raise "key is duplicated"
|
205
|
+
end
|
206
|
+
|
203
207
|
# Check for value duplications
|
204
208
|
storedQueryValues = Metadata.all(:conditions => ["cat = ? and sites_id = ?", APP_CONFIG[:DBMS_CAT_STORED_QUERY], session[:accessible_appid]])
|
205
209
|
storedQueryValues.each do |t|
|
@@ -2,6 +2,7 @@ module DbmsEngineHelper
|
|
2
2
|
|
3
3
|
def persist_connection
|
4
4
|
SymmetricEncryption.load!
|
5
|
+
dbms_config = HashWithIndifferentAccess.new(YAML.load(File.read(File.expand_path('../../../config/dbms/dbms_config.yml', __FILE__))))
|
5
6
|
|
6
7
|
if (ActiveRecord::Base.connection == Database.connection)
|
7
8
|
adapter = !Metadata.first({ :conditions => ['key = ? and sites_id = ?', dbms_config[:DBMS_CURRENT_ADAPTER], session[:accessible_appid]] }).nil? ? Metadata.first({ :conditions => ['key = ? and sites_id = ?', dbms_config[:DBMS_CURRENT_ADAPTER], session[:accessible_appid]] }).value : nil
|
@@ -13,18 +13,18 @@ module RxcmsDbmsPlugin
|
|
13
13
|
if attrs['configs']['type'] == 'stored-query'
|
14
14
|
|
15
15
|
if (ActiveRecord::Base.connection == Database.connection)
|
16
|
-
if (!Metadata.first({ :conditions => ['key = ? and sites_id = ?', dbms_config[:DBMS_CURRENT_HOST],
|
17
|
-
!Metadata.first({ :conditions => ['key = ? and sites_id = ?', dbms_config[:DBMS_CURRENT_PORT],
|
18
|
-
!Metadata.first({ :conditions => ['key = ? and sites_id = ?', dbms_config[:DBMS_CURRENT_DATABASE],
|
19
|
-
!Metadata.first({ :conditions => ['key = ? and sites_id = ?', dbms_config[:DBMS_CURRENT_USER],
|
20
|
-
!Metadata.first({ :conditions => ['key = ? and sites_id = ?', dbms_config[:DBMS_CURRENT_PASSWORD],
|
21
|
-
|
22
|
-
connectionResult = Database.connect_sql(Metadata.first({ :conditions => ['key = ? and sites_id = ?', dbms_config[:DBMS_CURRENT_ADAPTER],
|
23
|
-
Metadata.first({ :conditions => ['key = ? and sites_id = ?', dbms_config[:DBMS_CURRENT_HOST],
|
24
|
-
Metadata.first({ :conditions => ['key = ? and sites_id = ?', dbms_config[:DBMS_CURRENT_PORT],
|
25
|
-
Metadata.first({ :conditions => ['key = ? and sites_id = ?', dbms_config[:DBMS_CURRENT_USER],
|
26
|
-
Metadata.first({ :conditions => ['key = ? and sites_id = ?', dbms_config[:DBMS_CURRENT_PASSWORD],
|
27
|
-
Metadata.first({ :conditions => ['key = ? and sites_id = ?', dbms_config[:DBMS_CURRENT_DATABASE],
|
16
|
+
if (!Metadata.first({ :conditions => ['key = ? and sites_id = ?', dbms_config[:DBMS_CURRENT_HOST], exts[:appid]] }).nil? &&
|
17
|
+
!Metadata.first({ :conditions => ['key = ? and sites_id = ?', dbms_config[:DBMS_CURRENT_PORT], exts[:appid]] }).nil? &&
|
18
|
+
!Metadata.first({ :conditions => ['key = ? and sites_id = ?', dbms_config[:DBMS_CURRENT_DATABASE], exts[:appid]] }).nil? &&
|
19
|
+
!Metadata.first({ :conditions => ['key = ? and sites_id = ?', dbms_config[:DBMS_CURRENT_USER], exts[:appid]] }).nil? &&
|
20
|
+
!Metadata.first({ :conditions => ['key = ? and sites_id = ?', dbms_config[:DBMS_CURRENT_PASSWORD], exts[:appid]] }).nil?)
|
21
|
+
|
22
|
+
connectionResult = Database.connect_sql(Metadata.first({ :conditions => ['key = ? and sites_id = ?', dbms_config[:DBMS_CURRENT_ADAPTER], exts[:appid]] }).value,
|
23
|
+
Metadata.first({ :conditions => ['key = ? and sites_id = ?', dbms_config[:DBMS_CURRENT_HOST], exts[:appid]] }).value,
|
24
|
+
Metadata.first({ :conditions => ['key = ? and sites_id = ?', dbms_config[:DBMS_CURRENT_PORT], exts[:appid]] }).value,
|
25
|
+
Metadata.first({ :conditions => ['key = ? and sites_id = ?', dbms_config[:DBMS_CURRENT_USER], exts[:appid]] }).value,
|
26
|
+
Metadata.first({ :conditions => ['key = ? and sites_id = ?', dbms_config[:DBMS_CURRENT_PASSWORD], exts[:appid]] }).value,
|
27
|
+
Metadata.first({ :conditions => ['key = ? and sites_id = ?', dbms_config[:DBMS_CURRENT_DATABASE], exts[:appid]] }).value)
|
28
28
|
if (!connectionResult)
|
29
29
|
return "{{[alliance_dbms - #{placeholder.key}] Unable to establish connection to database}}"
|
30
30
|
end
|
@@ -34,8 +34,8 @@ module RxcmsDbmsPlugin
|
|
34
34
|
end
|
35
35
|
|
36
36
|
if attrs['configs'].has_key?('data')
|
37
|
-
tQueryItem = Metadata.all({ :conditions => ['key = ? and sites_id = ?', attrs['configs']['data'],
|
38
|
-
languageSwitchable = Metadata.first({ :conditions => ['key = ? and sites_id = ?', 'autoLanguageSwitch'
|
37
|
+
tQueryItem = Metadata.all({ :conditions => ['key = ? and sites_id = ?', attrs['configs']['data'], exts[:appid]] })
|
38
|
+
languageSwitchable = Metadata.first({ :conditions => ['key = ? and sites_id = ?', 'autoLanguageSwitch', exts[:appid]] })
|
39
39
|
queryItem = nil
|
40
40
|
|
41
41
|
tQueryItem.each do |query|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rxcms-dbms_plugin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anh Nguyen
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-10-
|
12
|
+
date: 2013-10-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|