Project

General

Profile

DeprecatedBuildAndDeployJVending » History » Version 9

Jim Garrison -, 03/18/2010 07:12 PM

1 1 Aaron Williamson -
= Building JVending =
2
3
== Check out the source ==
4
{{{git clone git://gitorious.org/replicant/jvending.git}}}
5
6
== Set up mvn repo ==
7 5 Aaron Williamson -
Install the jaxb and jaxme libraries into your local maven repo:
8
{{{
9 9 Jim Garrison -
cd jvending/scripts
10 1 Aaron Williamson -
./install.sh
11 9 Jim Garrison -
cd ..
12 5 Aaron Williamson -
}}}
13 1 Aaron Williamson -
14
== Build JVending ==
15
16
Run:
17
{{{
18
  mvn install
19
}}}
20
This will build jvending. You will find the WAR file that you need to deploy to tomcat or jetty at provisioning-portal/target/provisioning.war 
21
22
= Deploying JVending =
23
24
Set up a tomcat server and place the war file in the tomcat/webapps directory.
25
26
Go to http://localhost:8080/provisioning to verify the installation. You should see "Welcome to a J2EE Content Provisioning Portal".
27
28 2 Aaron Williamson -
= Stocking JVending with Android Apps =
29 1 Aaron Williamson -
30 6 Aaron Williamson -
JVending requires that you package your content into a provisioning archive.
31
32
The following would be a valid provisioning.xml file for stocking of OMA OTA content.The descriptor-file references the dd2 file relative to the root of the jar (you may also use an http or https URI).
33
34
{{{
35
<?xml version="1.0" encoding="ISO-8859-1"?>
36
37
<provisioning-archive xmlns="http://java.sun.com/xml/ns/j2ee-cp"
38
                      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
39
                      xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee-cp Provisioning_1_0.xsd">
40
   <client-bundle>
41
      <content-id>
42
         http://code.google.com/pg/jvending:1
43
      </content-id>
44
      <bundle-type>
45
         APPLICATION
46
      </bundle-type>
47
      <descriptor-file mime-type="application/vnd.oma.dd2+xml">
48
         /sample.dd2
49
      </descriptor-file>
50
      <user-descriptions>
51
         <display-name>
52
            Sample game
53
         </display-name>
54
         <description>
55
            My description to display
56
         </description>
57
         <icon>
58
            /app.png
59
         </icon>
60
      </user-descriptions>
61
   </client-bundle>
62
</provisioning-archive>
63
}}}
64
65
The sample.dd2 contains the relative URI of a deliverable object, which in this case references an Android application. The objectURI/server attribute should reference the apk file relative to the root of the par file.
66
67
{{{
68
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
69
<media DDVersion="2.0" xmlns="urn:oma:xml:dl:dd:2.0">
70
   <product>
71
      <mediaObject>
72
         <meta>
73
            <name>Sam Application Manager</name>
74
         </meta>
75
         <size>2226</size>
76
         <type>application/x-android</type>
77
         <objectID>cid:android@jvending.org</objectID>
78
         <objectURI>
79 7 Aaron Williamson -
            <server>sam-1.0.apk</server>
80 6 Aaron Williamson -
         </objectURI>
81
      </mediaObject>
82
   </product>
83
</media>
84
}}}
85
86
The basic structure of the par file (this is just a zipped archive) is
87
88
{{{
89
+ app.png
90
+ sam-1.0.apk
91 8 Aaron Williamson -
+ sam-1.0.dd2
92 6 Aaron Williamson -
+ META-INF/provisioning.xml
93
}}}
94
95
Package this into say, sam.par and submit it to the JVending Server. You should see the content appear under the catalog view.
96
97
== Stocking Android Content ==
98
99
If you want to stock Android content and have it be compatible with the SAM application manager on an Android client, you will need to include more information in the provisioning.xml file. Note that Android apks are delivered over OMA OTA, so will also need to include a dd2 file.
100
101
{{{
102
<?xml version="1.0" encoding="ISO-8859-1"?>
103
104
<provisioning-archive xmlns="http://java.sun.com/xml/ns/j2ee-cp"
105
                      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
106
                      xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee-cp Provisioning_1_0.xsd">
107
    <client-bundle>
108
        <content-id>
109
            google-android:apidemos
110
        </content-id>
111 7 Aaron Williamson -
        <version>1.5_r3</version>
112 6 Aaron Williamson -
        <bundle-type>
113
            APPLICATION
114
        </bundle-type>
115
        <descriptor-file mime-type="application/vnd.oma.dd2+xml">
116
            /apidemos.dd2
117
        </descriptor-file>
118
        <user-descriptions>
119
            <display-name>
120
                Android API Demos
121
            </display-name>
122
            <description>
123
                A demonstration of many of the Android APIs and most of them even work.
124
            </description>
125
            <icon>
126
                /android.png
127
            </icon>
128
        </user-descriptions>
129
        <vendor-info>
130
            <vendor-name>Google</vendor-name>
131
            <vendor-url>http://google.com</vendor-url>
132
            <vendor-description/>
133
        </vendor-info>
134
        <copyright>All Rights Reserved</copyright>
135
        <catalog-property>
136
            <property-name>Price</property-name>
137
            <property-value>Free</property-value>
138
        </catalog-property>
139
        <catalog-property>
140
            <property-name>Category</property-name>
141
            <property-value>Developer</property-value>
142
        </catalog-property>
143
        <catalog-property>
144
            <property-name>Short Description</property-name>
145
            <property-value>A demonstration of many of the Android APIs.</property-value>
146
        </catalog-property>
147
    </client-bundle>
148
</provisioning-archive>
149
}}}