forked from ets-berkeley-edu/myberkeley
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.txt
149 lines (99 loc) · 5.23 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
*** WORK IN PROGRESS ***
STRUCTURE
* app : The MyBerkeley project's own OSGi components. Currently this is just a bit of sample code.
* launchpad : A tailored version of the Sakai 3 application, consisting of a selection of standard Sakai 3 components, plus any of our customized components, plus our MyBerkeley-specific components.
* integration : A utility submodule to handle server control, data loading, etc.
===
COOKBOOK - SERVER CONTROL
Although this directory contains the project source code, you do not have to
actually build a new version of the application to run it. If you are on a
shared server environment, it's preferable to use a shared build that has
been stored in our project's Maven respository.
As a convenience, the "runner" profile can be used to download, stop, and
start an existing binary of the MyBerkeley application.
1. To clean out the old server environment including repository:
mvn -P runner -Dsling.clean clean
2) To clean the server of deployed and cached bundles while leaving repository and data intact:
mvn -P runner -Dsling.purge clean
3. To start the test server:
mvn -P runner -Dsling.start verify
4. To stop the test server:
mvn -P runner -Dsling.stop verify
5. To stop the server, reinstall everything except the repository data,
and restart (you'll need to have both myberkeley and 3akai-ux checked out):
./scripts/reinstall.sh source_root sling_password
6. To run the integration test against a fresh clean myberkeley instance:
./scripts/myberkeley_integration.sh
===
COOKBOOK - DEVELOPMENT
1. To build (or rebuild) sample code:
mvn clean install
2. To start loading client-side files from your local copy of
3akai-ux code rather than using the deployed version of 3akai-ux,
copy the "configs/dev/*.cfg" files to your "working/load" directory and
edit them to point to your local copy.
3. To create some test content while the server is running:
curl -u admin:admin -F "sling:resourceType=myberkeley/scriptedsample" \
-F title="Some Title" http://localhost:8080/content/firstscriptedsample
For more on RESTful content management through Sling, see:
http://sling.apache.org/site/manipulating-content-the-slingpostservlet.html
4. To try the Groovy script:
curl http://localhost:8080/content/firstscriptedsample.json
To try the server-side Javascript script:
curl http://localhost:8080/content/firstscriptedsample.html
For more on server-side scripting in Sling, see:
http://cwiki.apache.org/SLING/scripting-variables.html
5. To try the servlet:
curl http://localhost:8080/content/firstscriptedsample.servletized.json
For more on servlets:
http://sling.apache.org/site/servlets.html
For more on URL mapping:
http://sling.apache.org/site/url-decomposition.html
6. To try a normal client-side-only HTML + JavaScript view of some initially loaded content:
curl http://localhost:8080/myberkeley/index.html
For more on initial content loading:
http://sling.apache.org/site/content-loading-jcrcontentloader.html
7. To load sample user data, you will be running ruby scripts via maven.
You will need ruby and ruby gems installed. Ruby 1.8.7 is required.
On windows set thru System Control Panel Advanced tab
Install the json and curb ruby gems
Instructions from Nakamura testscripts README --
In OSX 10.5 I needed to do the following.
sudo gem update
sudo gem install json
sudo gem install curb
If you are running OS X 10.6, the following commands work:
sudo gem update --system
sudo gem update
sudo gem install json
sudo env ARCHFLAGS="-arch x86_64" gem install curb
On Windows do either of the above, depending on whether you're running 64 bit windows
Run a command window as Administrator then
gem update
gem install json
gem install curb
or
gem update --system
gem update
gem install json
set ARCHFLAGS="-arch x86_64"
gem install curb
8. To actually load data, from the myberkeley directory run
mvn -Dsling.loaddata integration-test
this will load data to the default server - http://localhost:8080/, using password - "admin, loading the default number of random users - 32 -
plus the users defined in ./myberkeley/integration/src/main/scripts/json_data.js.
or to load data to another server and/or another number of random users, run
mvn -Dsling.loaddata -Dloaddata.server=${server} -Dloaddata.password=${password} Dloaddata.numusers=${numusers} integration-test
where ${server} should be replaced with a full server URL such as https://portal-dev.berkeley.edu/
and ${numusers} should be replaced with the number you want, e.g. 50.
These choices would user the command line:
mvn -Dsling.loaddata -Dloaddata.server=https://portal-dev.berkeley.edu/ -Dloaddata.password=admin -Dloaddata.numusers=50 integration-test
mvn -Dsling.loaddata -Dloaddata.server=http://localhost:8080/ -Dloaddata.password=admin -Dloaddata.numusers=50 integration-test
NOTE: the trailing slash on the server URL is required
All users will be given the password "testuser".
9. The above user-load includes records keyed to the LDAP UIDs of MyBerkeley project
members, letting us test CAS authentication. When running MyBerkeley on your own
computer, you can log in at:
https://auth-test.berkeley.edu/cas/login?service=http://localhost:8080/dev/index.html
When running at portal-dev, you can use:
https://auth-test.berkeley.edu/cas/login?service=https://portal-dev.berkeley.edu/dev/index.html