caterpillar 0.9.5 → 0.9.6
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +6 -0
- data/LICENSES.txt +1 -1
- data/db/migrate/20081205000002_lportal_sequences.rb +32 -19
- data/generators/caterpillar/caterpillar_generator.rb +17 -23
- data/lib/caterpillar.rb +1 -1
- data/lib/caterpillar/liferay.rb +0 -5
- data/lib/caterpillar/task.rb +16 -13
- data/lib/caterpillar/usage.rb +5 -9
- data/views/caterpillar/_navigation.html.erb +71 -0
- metadata +3 -9
- data/generators/caterpillar/templates/javascripts/caterpillar/caterpillar.js +0 -15
- data/generators/caterpillar/templates/stylesheets/caterpillar/caterpillar.css +0 -55
data/ChangeLog
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
= 0.9.6
|
2
|
+
- added some tables and a notice to sequence migrations
|
3
|
+
- no longer installs css and javascript files, everything is cramped inline into the view
|
4
|
+
- upgrade lportal dependency to version 1.0.9
|
5
|
+
|
6
|
+
|
1
7
|
= 0.9.5
|
2
8
|
- portlet xml definition to Liferay 5.2.0 standards
|
3
9
|
- liferay xml files are tagged by selection based on the configured version
|
data/LICENSES.txt
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Caterpillar is provided under the terms of the MIT license.
|
4
4
|
|
5
|
-
(c) Copyright 2008 Cel'Amanzi Ltd
|
5
|
+
(c) Copyright 2008,2009 Mikael Lammentausta for Cel'Amanzi Ltd
|
6
6
|
|
7
7
|
Permission is hereby granted, free of charge, to any person
|
8
8
|
obtaining a copy of this software and associated documentation files
|
@@ -14,10 +14,15 @@ class LportalSequences < ActiveRecord::Migration
|
|
14
14
|
Resource,
|
15
15
|
Role,
|
16
16
|
User,
|
17
|
+
MB::Category,
|
18
|
+
MB::Discussion,
|
17
19
|
MB::Message,
|
20
|
+
MB::MessageFlag,
|
21
|
+
MB::StatsUser,
|
18
22
|
MB::Thread,
|
19
|
-
|
20
|
-
|
23
|
+
RatingsStats,
|
24
|
+
SocialActivity,
|
25
|
+
SocialRelation,
|
21
26
|
Tag::Asset,
|
22
27
|
Tag::Entry,
|
23
28
|
Tag::Property,
|
@@ -28,25 +33,33 @@ class LportalSequences < ActiveRecord::Migration
|
|
28
33
|
]
|
29
34
|
|
30
35
|
def self.up
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
#
|
37
|
-
|
38
|
-
|
39
|
-
|
36
|
+
STDOUT.puts 'This migration does not do anything.'
|
37
|
+
STDOUT.puts 'The process is not refined properly yet, and could be quite disastrous if reverted unappropriately.'
|
38
|
+
STDOUT.puts 'If you are sure you need the sequences, copy this file to db/migrate and modify it.'
|
39
|
+
STDOUT.puts __FILE__
|
40
|
+
|
41
|
+
start = 8400000 # bigint = 8^8 bytes = 16 million bits, this is halfway up the possible range, rounded up
|
42
|
+
sql = ""
|
43
|
+
@@tables.each do |model|
|
44
|
+
table = model.table_name
|
45
|
+
primkey = model.primary_key
|
46
|
+
seq = table+'_'+primkey+'_seq'
|
47
|
+
sql += "CREATE SEQUENCE #{seq} START #{start}; ALTER TABLE #{table} ALTER #{primkey} SET default nextval('#{seq}');"
|
48
|
+
end
|
49
|
+
|
50
|
+
# To activate, uncomment this line.
|
51
|
+
#ActiveRecord::Base.connection.execute(sql)
|
40
52
|
end
|
41
53
|
|
54
|
+
# This is VERY DANGEROUS and may lead to breakage.
|
42
55
|
def self.down
|
43
|
-
#
|
44
|
-
#
|
45
|
-
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
#
|
49
|
-
#
|
50
|
-
#
|
56
|
+
# sql = ""
|
57
|
+
# @@tables.each do |model|
|
58
|
+
# table = model.table_name
|
59
|
+
# primkey = model.primary_key
|
60
|
+
# seq = table+'_'+primkey+'_seq'
|
61
|
+
# sql += "ALTER TABLE #{table} ALTER #{primkey} DROP default; DROP SEQUENCE #{seq};"
|
62
|
+
# end
|
63
|
+
# ActiveRecord::Base.connection.execute(sql)
|
51
64
|
end
|
52
65
|
end
|
@@ -8,45 +8,39 @@ class CaterpillarGenerator < Rails::Generator::Base
|
|
8
8
|
this_dir = File.dirname(File.expand_path(file))
|
9
9
|
tmpl = this_dir+'/templates'
|
10
10
|
|
11
|
-
STDOUT.puts ' * Installing config
|
11
|
+
STDOUT.puts ' * Installing config and images'
|
12
12
|
|
13
13
|
record do |m|
|
14
14
|
|
15
|
-
###
|
15
|
+
### config ###
|
16
16
|
m.directory('config')
|
17
17
|
file = 'portlets.rb'
|
18
18
|
m.file('config/'+file, 'config/'+file)
|
19
19
|
####################################
|
20
20
|
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
22
|
+
# these are now cramped inline to the view partial
|
23
|
+
# ### stylesheet ###
|
24
|
+
# target = 'public/stylesheets/caterpillar'
|
25
|
+
# m.directory(target)
|
26
|
+
# file = 'caterpillar.css'
|
27
|
+
# m.file('stylesheets/caterpillar/'+file, target+'/'+file)
|
28
|
+
# ####################################
|
29
|
+
#
|
30
|
+
# ### javascript ###
|
31
|
+
# target = 'public/javascripts/caterpillar'
|
32
|
+
# m.directory(target)
|
33
|
+
# file = 'caterpillar.js'
|
34
|
+
# m.file('javascripts/caterpillar/'+file, target+'/'+file)
|
35
|
+
# ####################################
|
35
36
|
|
36
37
|
### images ###
|
37
|
-
target = 'public/images
|
38
|
+
target = 'public/images'
|
38
39
|
m.directory(target)
|
39
40
|
file = 'caterpillar.gif'
|
40
41
|
m.file('images/caterpillar/'+file, target+'/'+file)
|
41
42
|
####################################
|
42
43
|
|
43
|
-
# ### views ###
|
44
|
-
# target = 'app/views/caterpillar'
|
45
|
-
# m.directory(target)
|
46
|
-
# file = '_navigation.html.erb'
|
47
|
-
# m.file('views/caterpillar/'+file, target+'/'+file)
|
48
|
-
# ####################################
|
49
|
-
#
|
50
44
|
end
|
51
45
|
end
|
52
46
|
end
|
data/lib/caterpillar.rb
CHANGED
data/lib/caterpillar/liferay.rb
CHANGED
@@ -198,8 +198,6 @@ module Caterpillar
|
|
198
198
|
"chat_status",
|
199
199
|
"journalcontentsearch",
|
200
200
|
"mbban",
|
201
|
-
"mbmessageflag",
|
202
|
-
"mbstatsuser",
|
203
201
|
"membershiprequest",
|
204
202
|
"orglabor",
|
205
203
|
"passwordpolicyrel",
|
@@ -221,7 +219,6 @@ module Caterpillar
|
|
221
219
|
"ratingsentry",
|
222
220
|
"ratingsstats",
|
223
221
|
"region",
|
224
|
-
"release_",
|
225
222
|
"scframeworkversion",
|
226
223
|
"scframeworkversi_scproductvers",
|
227
224
|
"schema_migrations",
|
@@ -240,8 +237,6 @@ module Caterpillar
|
|
240
237
|
"shoppingitem",
|
241
238
|
"shoppingorderitem",
|
242
239
|
"shoppingorder",
|
243
|
-
"socialactivity",
|
244
|
-
"socialrelation",
|
245
240
|
"subscription",
|
246
241
|
"tasksproposal",
|
247
242
|
"tasksreview",
|
data/lib/caterpillar/task.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#--
|
2
|
-
# (c) Copyright 2008 Mikael Lammentausta
|
2
|
+
# (c) Copyright 2008,2009 Mikael Lammentausta
|
3
3
|
#
|
4
4
|
# Thanks to Nick Sieger for the rake structure!
|
5
5
|
#
|
@@ -43,10 +43,10 @@ module Caterpillar
|
|
43
43
|
@config = Util.eval_configuration(config)
|
44
44
|
yield self if block_given?
|
45
45
|
@xml_files = []
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
46
|
+
STDOUT.puts 'Caterpillar v.%s (c) Copyright 2008 Mikael Lammentausta' % VERSION
|
47
|
+
#STDOUT.puts 'Caterpillar v.%s' % Caterpillar::VERSION
|
48
|
+
STDOUT.puts 'Provided under the terms of the MIT license.'
|
49
|
+
STDOUT.puts
|
50
50
|
send tasks
|
51
51
|
end
|
52
52
|
|
@@ -84,7 +84,7 @@ module Caterpillar
|
|
84
84
|
tasks << "#{@name}:liferayportletapp"
|
85
85
|
tasks << "#{@name}:liferaydisplay"
|
86
86
|
end
|
87
|
-
|
87
|
+
|
88
88
|
# print produced portlets
|
89
89
|
tasks << :portlets
|
90
90
|
|
@@ -182,6 +182,10 @@ module Caterpillar
|
|
182
182
|
with_namespace_and_config do |name, config|
|
183
183
|
desc 'Create JSR286 portlet XML'
|
184
184
|
task :portlet do
|
185
|
+
info 'Configured to use %s version %s' % [
|
186
|
+
@config.container.class.to_s.sub('Caterpillar::',''), @config.container.version
|
187
|
+
]
|
188
|
+
|
185
189
|
system('touch %s' % file)
|
186
190
|
f=File.open(file,'w')
|
187
191
|
f.write Portlet.xml(@portlets)
|
@@ -389,7 +393,6 @@ module Caterpillar
|
|
389
393
|
info ''
|
390
394
|
info 'Environment variable JRUBY_HOME is not set, exiting -'
|
391
395
|
info 'You should `export JRUBY_HOME="/usr/local/jruby"` and `sudo -E caterpillar %s`' % ARGV[0]
|
392
|
-
info ''
|
393
396
|
exit 1
|
394
397
|
end
|
395
398
|
jruby = File.join(ENV['JRUBY_HOME'],'bin','jruby')
|
@@ -411,10 +414,10 @@ module Caterpillar
|
|
411
414
|
exit 1
|
412
415
|
end
|
413
416
|
info ''
|
414
|
-
info 'Building WAR using Warbler on JRuby (%s)' %
|
417
|
+
info 'Building WAR using Warbler %s on JRuby (%s)' % [
|
418
|
+
Warbler::VERSION, jruby]
|
415
419
|
info ''
|
416
420
|
system(jruby+' -S warble war')
|
417
|
-
|
418
421
|
end
|
419
422
|
end
|
420
423
|
|
@@ -447,8 +450,6 @@ module Caterpillar
|
|
447
450
|
with_namespace_and_config do |name, config|
|
448
451
|
desc 'Deploys the WAR file'
|
449
452
|
task :war do
|
450
|
-
info 'deploying WAR package'
|
451
|
-
|
452
453
|
file = @config.servlet+'.war'
|
453
454
|
unless File.exists?(file)
|
454
455
|
info 'cannot find the WAR file %s, exiting' % file
|
@@ -456,10 +457,12 @@ module Caterpillar
|
|
456
457
|
end
|
457
458
|
|
458
459
|
target = File.join(@config.container.root,'webapps')
|
459
|
-
|
460
|
+
|
461
|
+
info '..removing previous installs..'
|
460
462
|
system('rm -rf %s' % File.join(target,@config.servlet+'*'))
|
463
|
+
|
464
|
+
info 'deploying the WAR package to %s' % target
|
461
465
|
system('cp %s %s' % [file,target])
|
462
|
-
info 'copied %s into %s' % [file,target]
|
463
466
|
|
464
467
|
end
|
465
468
|
end
|
data/lib/caterpillar/usage.rb
CHANGED
@@ -7,15 +7,11 @@
|
|
7
7
|
module Caterpillar
|
8
8
|
class Usage
|
9
9
|
def self.show
|
10
|
-
puts '
|
11
|
-
puts '
|
12
|
-
puts
|
13
|
-
puts '
|
14
|
-
puts
|
15
|
-
puts
|
16
|
-
puts ' cd to Rails root, and run the "%s pluginize" task' % $0
|
17
|
-
# puts ' Run "%s" in Rails root' % $0
|
18
|
-
# puts ' See
|
10
|
+
STDOUT.puts 'Usage:'
|
11
|
+
STDOUT.puts ' See "%s --describe" for an overview of the tasks.' % $0
|
12
|
+
STDOUT.puts
|
13
|
+
STDOUT.puts ' cd to Rails root, and run the "%s pluginize" task' % $0
|
14
|
+
STDOUT.puts
|
19
15
|
end
|
20
16
|
end
|
21
17
|
end
|
@@ -1,3 +1,74 @@
|
|
1
|
+
<%# everything is cramped together to prevent the installation of separate css and js files -%>
|
2
|
+
|
3
|
+
<script type="text/javascript">
|
4
|
+
|
5
|
+
function cp_toggle_category(c,categories) {
|
6
|
+
c_el = document.getElementById(c);
|
7
|
+
p_el = document.getElementById(c+'_portlets');
|
8
|
+
|
9
|
+
if (p_el.style.display=='none') {
|
10
|
+
p_el.style.display='block';
|
11
|
+
c_el.style.background='yellow';
|
12
|
+
}
|
13
|
+
else {
|
14
|
+
p_el.style.display='none';
|
15
|
+
c_el.style.background='white';
|
16
|
+
}
|
17
|
+
}
|
18
|
+
|
19
|
+
</script>
|
20
|
+
|
21
|
+
<style type="text/css">
|
22
|
+
.caterpillar_navigation {
|
23
|
+
background: url('/images/caterpillar.gif') no-repeat;
|
24
|
+
padding: 10px 0 0 50px;
|
25
|
+
margin-left: 10px;
|
26
|
+
min-height: 50px;
|
27
|
+
filter:alpha(opacity=81);-moz-opacity:.81;opacity:.81;
|
28
|
+
/* css3 tags, works on Firefox and Safari */
|
29
|
+
-moz-border-radius: 15px;
|
30
|
+
-webkit-border-radius: 15px;
|
31
|
+
}
|
32
|
+
|
33
|
+
.caterpillar_navigation ul {
|
34
|
+
list-style-type: none;
|
35
|
+
}
|
36
|
+
|
37
|
+
.cp_category {
|
38
|
+
float: left;
|
39
|
+
border: 3px double blue;
|
40
|
+
margin: 0 14px 5px 14px;
|
41
|
+
padding: 5px;
|
42
|
+
-moz-border-radius: 12px;
|
43
|
+
-webkit-border-radius: 12px;
|
44
|
+
background: white;
|
45
|
+
}
|
46
|
+
|
47
|
+
.cp_portlets {
|
48
|
+
float: break;
|
49
|
+
overflow: hidden;
|
50
|
+
margin: 0 40px 10px 40px;
|
51
|
+
border: 3px double green;
|
52
|
+
padding: 5px;
|
53
|
+
}
|
54
|
+
|
55
|
+
.navlink {
|
56
|
+
margin: 5px 14px 5px 14px;
|
57
|
+
padding: 5px;
|
58
|
+
-moz-border-radius: 12px;
|
59
|
+
-webkit-border-radius: 12px;
|
60
|
+
}
|
61
|
+
|
62
|
+
.navlink a {
|
63
|
+
text-decoration: none;
|
64
|
+
}
|
65
|
+
|
66
|
+
.navlink a:hover {
|
67
|
+
-moz-border-radius: 8px;
|
68
|
+
-webkit-border-radius: 8px;
|
69
|
+
}
|
70
|
+
</style>
|
71
|
+
|
1
72
|
<div class="caterpillar_navigation">
|
2
73
|
<%# CATEGORIES -%>
|
3
74
|
<%# categories = @caterpillar_navigation.keys -%>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: caterpillar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mikael Lammentausta
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-02-
|
12
|
+
date: 2009-02-15 00:00:00 +02:00
|
13
13
|
default_executable: caterpillar
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -20,7 +20,7 @@ dependencies:
|
|
20
20
|
requirements:
|
21
21
|
- - ">="
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 1.0.
|
23
|
+
version: 1.0.9
|
24
24
|
version:
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rake
|
@@ -67,17 +67,11 @@ files:
|
|
67
67
|
- lib/web/portlet.rb
|
68
68
|
- generators/caterpillar
|
69
69
|
- generators/caterpillar/templates
|
70
|
-
- generators/caterpillar/templates/stylesheets
|
71
|
-
- generators/caterpillar/templates/stylesheets/caterpillar
|
72
|
-
- generators/caterpillar/templates/stylesheets/caterpillar/caterpillar.css
|
73
70
|
- generators/caterpillar/templates/config
|
74
71
|
- generators/caterpillar/templates/config/portlets.rb
|
75
72
|
- generators/caterpillar/templates/images
|
76
73
|
- generators/caterpillar/templates/images/caterpillar
|
77
74
|
- generators/caterpillar/templates/images/caterpillar/caterpillar.gif
|
78
|
-
- generators/caterpillar/templates/javascripts
|
79
|
-
- generators/caterpillar/templates/javascripts/caterpillar
|
80
|
-
- generators/caterpillar/templates/javascripts/caterpillar/caterpillar.js
|
81
75
|
- generators/caterpillar/caterpillar_generator.rb
|
82
76
|
- generators/caterpillar/USAGE
|
83
77
|
- db/migrate
|
@@ -1,15 +0,0 @@
|
|
1
|
-
function cp_toggle_category(c,categories) {
|
2
|
-
c_el = document.getElementById(c);
|
3
|
-
p_el = document.getElementById(c+'_portlets');
|
4
|
-
|
5
|
-
if (p_el.style.display=='none') {
|
6
|
-
p_el.style.display='block';
|
7
|
-
c_el.style.background='yellow';
|
8
|
-
}
|
9
|
-
else {
|
10
|
-
p_el.style.display='none';
|
11
|
-
c_el.style.background='white';
|
12
|
-
}
|
13
|
-
|
14
|
-
|
15
|
-
}
|
@@ -1,55 +0,0 @@
|
|
1
|
-
.caterpillar_navigation {
|
2
|
-
background: url('/images/caterpillar/caterpillar.gif') no-repeat;
|
3
|
-
padding: 10px 0 0 50px;
|
4
|
-
margin-left: 10px;
|
5
|
-
min-height: 50px;
|
6
|
-
filter:alpha(opacity=81);-moz-opacity:.81;opacity:.81;
|
7
|
-
/* css3 tags, works on Firefox and Safari */
|
8
|
-
-moz-border-radius: 15px;
|
9
|
-
-webkit-border-radius: 15px;
|
10
|
-
}
|
11
|
-
|
12
|
-
.caterpillar_navigation ul {
|
13
|
-
list-style-type: none;
|
14
|
-
margin: 4px;
|
15
|
-
padding: 4px;
|
16
|
-
}
|
17
|
-
|
18
|
-
#caterpillar_categories {
|
19
|
-
width: 100%;
|
20
|
-
overflow: auto;
|
21
|
-
}
|
22
|
-
|
23
|
-
.cp_category {
|
24
|
-
float: left;
|
25
|
-
border: 3px double blue;
|
26
|
-
margin: 0 14px 5px 14px;
|
27
|
-
padding: 5px;
|
28
|
-
-moz-border-radius: 12px;
|
29
|
-
-webkit-border-radius: 12px;
|
30
|
-
background: white;
|
31
|
-
}
|
32
|
-
|
33
|
-
.cp_portlets {
|
34
|
-
float: break;
|
35
|
-
overflow: hidden;
|
36
|
-
margin: 0 40px 10px 0px;
|
37
|
-
border: 3px double green;
|
38
|
-
/* padding: 5px; */
|
39
|
-
}
|
40
|
-
|
41
|
-
.navlink {
|
42
|
-
margin: 5px 14px 5px 14px;
|
43
|
-
padding: 5px;
|
44
|
-
-moz-border-radius: 12px;
|
45
|
-
-webkit-border-radius: 12px;
|
46
|
-
}
|
47
|
-
|
48
|
-
.navlink a {
|
49
|
-
text-decoration: none;
|
50
|
-
}
|
51
|
-
|
52
|
-
.navlink a:hover {
|
53
|
-
-moz-border-radius: 8px;
|
54
|
-
-webkit-border-radius: 8px;
|
55
|
-
}
|