-
Notifications
You must be signed in to change notification settings - Fork 34
/
README.html
213 lines (168 loc) · 16.5 KB
/
README.html
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<!DOCTYPE html><html><head><title>README</title><link href="http://static.jboss.org/ffe/0/www/vendor/redhat/documentation.css" rel="stylesheet"></link><link href="http://static.jboss.org/ffe/0/www/vendor/redhat/pygments.css" rel="stylesheet"></link></head><body><!--~ Do not edit this derived file! See jboss-portal-quickstarts/src/main/freemarker/page-composition-api-portlet/README.html.ftl ~-->
<h1><a id="pagecompositionapiportlet-page-composition-api-portlet" class="anchor" href="#pagecompositionapiportlet-page-composition-api-portlet"><span class="anchor-icon"></span></a>page-composition-api-portlet: Page Composition API Portlet</h1>
<p>Author: Juraci Paixão Kröhling<br/>
Level: Intermediate<br/>
Technologies: Portlet<br/>
Summary: A Portlet using the Page Composition API to compose Portal Pages.<br/>
Target Product: Portal<br/>
Source: <a href="https://github.com/jboss-developer/jboss-portal-quickstarts.git">https://github.com/jboss-developer/jboss-portal-quickstarts.git</a> </p>
<h2><a id="what-is-it" class="anchor" href="#what-is-it"><span class="anchor-icon"></span></a>What is it?</h2>
<p>This project demonstrates how to use the Page Composition API, that allows portlet developers to create and update
Portal pages on-demand.</p>
<p>An introduction and some background information to this quickstart can be found in the following chapters
of Red Hat JBoss Portal Developer Guide:</p>
<ul>
<li><a href="https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Portal/6.2/html/Development_Guide/part-Portal_API.html">Portal API</a></li>
<li><a href="https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Portal/6.2/html/Development_Guide/chap-Portlet_Development.html#sect-Starting_a_Portlet_Project">Starting a Portlet Project</a></li>
<li><a href="https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Portal/6.2/html/Development_Guide/chap-Portlet_Development.html#sect-Standard_Portlet_Development_JSR-286">Standard Portlet Development (JSR-286)</a></li>
</ul>
<!--~ Included from gatein-portal-quickstarts-parent/src/main/freemarker/include/portlet-general.md.ftl ~-->
<!--~ Included from gatein-portal-quickstarts-parent/src/main/freemarker/include/system-requirements.md.ftl ~-->
<h2><a id="system-requirements" class="anchor" href="#system-requirements"><span class="anchor-icon"></span></a>System Requirements</h2>
<p>All you need to build this example project is Java 6.0 (Java SDK 1.6) or newer and Maven 3.0 or newer.</p>
<p>The project is designed to be deployed on Red Hat JBoss Portal 6.2 running on JBoss EAP.</p>
<!--~ Included from gatein-portal-quickstarts-parent/src/main/freemarker/include/configure-maven.md.ftl ~-->
<h2><a id="configure-maven" class="anchor" href="#configure-maven"><span class="anchor-icon"></span></a>Configure Maven</h2>
<p>You have two options how you can configure Maven: A. Use hosted Maven repository or B. Download & setup zipped Maven repository.</p>
<h3><a id="a-use-hosted-maven-repository" class="anchor" href="#a-use-hosted-maven-repository"><span class="anchor-icon"></span></a>A. Use hosted Maven repository</h3>
<p>This is the easier and thus recommended option. You need to configure the Maven user settings as follows:</p>
<ul>
<li><p>Look for the <code>settings.xml</code> file in the <code>${user.home}/.m2/</code> directory. For example:</p>
<div class="highlight"><pre><span class="vg">For</span><span class="w"> </span><span class="vg">Linux</span><span class="w"> </span><span class="vg">or</span><span class="w"> </span><span class="nl">Mac:</span><span class="w"> </span><span class="o">~/.</span><span class="vg">m2</span><span class="o">/</span><span class="vg">settings</span><span class="o">.</span><span class="vg">xml</span>
<span class="vg">For</span><span class="w"> </span><span class="nl">Windows:</span><span class="w"> </span><span class="o">\</span><span class="vg">Users</span><span class="o">\</span><span class="vg">USER_NAME</span><span class="o">\.</span><span class="vg">m2</span><span class="o">\</span><span class="vg">settings</span><span class="o">.</span><span class="vg">xml</span><span class="w"> </span><span class="vg">or</span><span class="w"> </span><span class="o">\</span><span class="vg">Documents</span><span class="w"> </span><span class="vg">and</span><span class="w"> </span><span class="vg">Settings</span><span class="o">\</span><span class="vg">USER_NAME</span><span class="o">\.</span><span class="vg">m2</span><span class="o">\</span><span class="vg">settings</span><span class="o">.</span><span class="vg">xml</span>
</pre></div></li>
<li><p>If you have an existing <code>settings.xml</code> file, modify it with the configuration information from the <code>settings-hosted-repo.xml</code>
file located in the root folder of Red Hat JBoss Portal quickstarts. This effectivelly results in
adding <code>http://maven.repository.redhat.com/techpreview/all</code> as <code><repository></code> and <code><pluginRepository></code> to your <code>settings.xml</code>.</p></li>
<li><p>If there is no <code>settings.xml</code> file, copy the <code>settings-hosted-repo.xml</code> file to the <code>.m2</code> directory for your
operating system and rename it to <code>settings.xml</code>.</p></li>
</ul>
<h3><a id="b-download-amp-setup-zipped-maven-repositories" class="anchor" href="#b-download-amp-setup-zipped-maven-repositories"><span class="anchor-icon"></span></a>B. Download & setup zipped Maven repositories</h3>
<ol>
<li><p>Download the following zipped Maven repositories from <a href="https://access.redhat.com/">Red Hat Customer Portal</a>,
Downloads > JBoss Enterprise Middleware:</p>
<ul>
<li>Red Hat JBoss Portal 6.2.0 Maven Repository</li>
<li>Red Hat JBoss Portal 6.1.1 Maven Repository</li>
<li>JBoss Portal Platform 6.1.0 Maven Repository</li>
<li>JBoss Enterprise Portal Platform (EPP) 6.0.0 Maven Repository</li>
<li>Web Framework Kit 2.4.0 Maven Repository</li>
<li>Web Framework Kit 2.3.0 Maven Repository</li>
<li>Web Framework Kit 2.2.0 Maven Repository</li>
<li>Web Framework Kit 2.1.0 Maven Repository</li>
<li>Web Framework Kit 2.0.0 Maven Repository</li>
<li>Application Platform 6.4.0 Maven Repository</li>
<li>Application Platform 6.2.0 Maven Repository</li>
<li>Application Platform 6.1.0 Maven Repository</li>
<li>Application Platform 6.0.1 Maven Repository</li>
<li>Application Platform 6.0.0 Maven Repository</li>
</ul>
<p>Unpack each of these files to a separate directory.</p></li>
<li><p>Modify the <code>settings-zipped-repos.xml</code> file located in the root directory of Red Hat JBoss Portal
quickstarts:</p>
<ul>
<li>For each zipped repository unpacked in the previous step, replace <code>/path/to/repo/</code> within <code>file:///path/to/repo/...</code>
with the fully qualified path of the directory where you unpacked the given zipped Maven repository in the previous
step.</li>
<li>Note that path to each repository needs tobe set twice: one within <code><repository></code> tag and one within
<code><pluginRepository></code> tag.</li>
<li><p>Be sure to use 3 forward slashes after <code>file:</code>. Two slashes are there for the protocol and one for the fully qualified
path. For example:</p>
<div class="highlight"><pre><span class="nl">file:</span><span class="o">///</span><span class="vg">home</span><span class="o">/</span><span class="vg">joedoe</span><span class="o">/</span><span class="vg">Quickstarts</span><span class="o">/</span><span class="vg">jpp</span><span class="mf">-6.2</span><span class="o">-</span><span class="vg">quickstarts</span>
</pre></div></li>
</ul></li>
<li><p>Configure the Maven user settings.</p>
<ul>
<li><p>Look for the <code>settings.xml</code> file in the <code>${user.home}/.m2/</code> directory. For example:</p>
<div class="highlight"><pre><span class="vg">For</span><span class="w"> </span><span class="vg">Linux</span><span class="w"> </span><span class="vg">or</span><span class="w"> </span><span class="nl">Mac:</span><span class="w"> </span><span class="o">~/.</span><span class="vg">m2</span><span class="o">/</span><span class="vg">settings</span><span class="o">.</span><span class="vg">xml</span>
<span class="vg">For</span><span class="w"> </span><span class="nl">Windows:</span><span class="w"> </span><span class="o">\</span><span class="vg">Users</span><span class="o">\</span><span class="vg">USER_NAME</span><span class="o">\.</span><span class="vg">m2</span><span class="o">\</span><span class="vg">settings</span><span class="o">.</span><span class="vg">xml</span><span class="w"> </span><span class="vg">or</span><span class="w"> </span><span class="o">\</span><span class="vg">Documents</span><span class="w"> </span><span class="vg">and</span><span class="w"> </span><span class="vg">Settings</span><span class="o">\</span><span class="vg">USER_NAME</span><span class="o">\.</span><span class="vg">m2</span><span class="o">\</span><span class="vg">settings</span><span class="o">.</span><span class="vg">xml</span>
</pre></div></li>
<li><p>If you have an existing <code>settings.xml</code> file, modify it with the configuration information from the <code>example-settings.xml</code>
file.</p></li>
<li><p>If there is no <code>settings.xml</code> file, copy the modified <code>example-settings.xml</code> file to the <code>.m2</code> directory for your
operating system and rename it to <code>settings.xml</code>.</p></li>
</ul></li>
</ol>
<!--~ Included from gatein-portal-quickstarts-parent/src/main/freemarker/include/start-the-portal.md.ftl ~-->
<h2><a id="start-the-portal" class="anchor" href="#start-the-portal"><span class="anchor-icon"></span></a>Start the Portal</h2>
<ol>
<li>Open a command line and navigate to the root of the JBoss server directory.</li>
<li><p>The following shows the command line to start the server with the web profile:</p>
<div class="highlight"><pre><span class="vg">For</span><span class="w"> </span><span class="nl">Linux:</span><span class="w"> </span><span class="vg">JBOSS_HOME</span><span class="o">/</span><span class="vg">bin</span><span class="o">/</span><span class="vg">standalone</span><span class="o">.</span><span class="vg">sh</span>
<span class="vg">For</span><span class="w"> </span><span class="nl">Windows:</span><span class="w"> </span><span class="vg">JBOSS_HOME</span><span class="o">\</span><span class="vg">bin</span><span class="o">\</span><span class="vg">standalone</span><span class="o">.</span><span class="vg">bat</span>
</pre></div></li>
</ol>
<h2><a id="build-and-deploy-the-quickstart" class="anchor" href="#build-and-deploy-the-quickstart"><span class="anchor-icon"></span></a>Build and Deploy the Quickstart</h2>
<ol>
<li>Make sure you have started the Portal as described above.</li>
<li>Open a command line and navigate to the root directory of this quickstart.</li>
<li><p>Type this command to build and deploy the archive:</p>
<div class="highlight"><pre><span class="vg">mvn</span><span class="w"> </span><span class="vg">clean</span><span class="w"> </span><span class="vg">package</span><span class="w"> </span><span class="vg">jboss</span><span class="o">-</span><span class="nl">as:</span><span class="vg">deploy</span>
</pre></div></li>
</ol>
<p>To deploy to other than default localhost:9999 JBoss instance, copy the following configuration
just after <code><artifactId>jboss-as-maven-plugin</artifactId></code> in the pom.xml file and adjust it to suit your needs.
<code>username</code> and <code>password</code> elements can be omitted sometimes, depending on your JBoss security settings.</p>
<div class="highlight"><pre> <span class="nt"><configuration></span>
<span class="nt"><hostname></span>127.0.0.1<span class="nt"></hostname></span>
<span class="nt"><port></span>9999<span class="nt"></port></span>
<span class="nt"><username></span>admin<span class="nt"></username></span>
<span class="nt"><password></span>secret<span class="nt"></password></span>
<span class="nt"></configuration></span>
</pre></div>
<p>This will deploy <code>target/page-composition-api-portlet.war</code> to the running instance of the portal.</p>
<h2><a id="access-the-deployed-portlet" class="anchor" href="#access-the-deployed-portlet"><span class="anchor-icon"></span></a>Access the deployed Portlet</h2>
<p>To ensure that the example portlet has been deployed successfully, do the following:</p>
<ul>
<li>Point your web browser at the base URL of your portal (URL of a default local Red Hat JBoss Portal installation is
<a href="http://127.0.0.1:8080/portal/classic">http://127.0.0.1:8080/portal/classic</a>).</li>
<li>Sign in as root or other user with manager:/platform/administrators permissions.</li>
<li>Go to Top Menu > Group > Administration > Application Registry and hit Import Applications. After that, you should
see the newly imported Page Composition API Portlet under the Quickstarts Category.</li>
<li>Then you can add the example portlet to a page of your choice: either (a) to a new page or (b) to an existing page.
<ul>
<li>If you have chosen (a) to add the portlet to a new page:
<ul>
<li>Go to Top Menu > Group Editor > Add New Page</li>
<li>In the Page Creation Wizard, fill in:
<ul>
<li>Node Name: page-composition-api-portlet</li>
<li>Display Name: Page Composition API Portlet</li>
</ul></li>
<li>Click Next</li>
<li>Leave Empty Layout as it is and hit Next</li>
<li>Drag-and-Drop Page Composition API Portlet from the Page Editor dialog to the middle of the Page Creation Wizard</li>
<li>Click the Diskette-like Finish button in the header of the Page Editor dialog and see the newly added portlet in action.</li>
</ul></li>
<li>If you have chosen (b) to add the portlet to an existing page:
<ul>
<li>Navigate to the page where you want to add the portlet and go to Top Menu > Group Editor > Edit Page</li>
<li>Drag-and-Drop Page Composition API Portlet from the Page Editor dialog to a place of your choice within the page.</li>
<li>Click the Diskette-like Finish button in the header of the Page Editor dialog and see the newly added portlet in action.</li>
</ul></li>
</ul></li>
</ul>
<h2><a id="undeploy-the-archive" class="anchor" href="#undeploy-the-archive"><span class="anchor-icon"></span></a>Undeploy the Archive</h2>
<ol>
<li>Make sure you have started the JBoss Server as described above.</li>
<li>Open a command line and navigate to the root directory of this quickstart.</li>
<li><p>When you are finished testing, type this command to undeploy the archive:</p>
<div class="highlight"><pre><span class="vg">mvn</span><span class="w"> </span><span class="vg">jboss</span><span class="o">-</span><span class="nl">as:</span><span class="vg">undeploy</span>
</pre></div></li>
</ol>
<h2><a id="use-jboss-developer-studio-or-eclipse-with-jboss-tools-to-run-this-quickstart" class="anchor" href="#use-jboss-developer-studio-or-eclipse-with-jboss-tools-to-run-this-quickstart"><span class="anchor-icon"></span></a>Use JBoss Developer Studio or Eclipse with JBoss Tools to Run this Quickstart</h2>
<p>You can also deploy the quickstarts from Eclipse using JBoss Tools. For more information on how to set up Maven and JBoss Tools,
refer to the
<a href="https://access.redhat.com/knowledge/docs/JBoss_Enterprise_Application_Platform/">JBoss Enterprise Application Platform 6 Development Guide</a>
or <a href="http://www.jboss.org/jdf/quickstarts/jboss-as-quickstart/guide/Introduction/" title="Get Started Developing Applications">Get Started Developing Applications</a>.</p>
<!--~ Included from gatein-portal-quickstarts-parent/src/main/freemarker/include/debug.md.ftl ~-->
<h2><a id="debug-the-application" class="anchor" href="#debug-the-application"><span class="anchor-icon"></span></a>Debug the Application</h2>
<p>If you want to debug the source code or look at the Javadocs of any library in the project, run either of the following
commands to pull them into your local repository. The IDE should then detect them.</p>
<div class="highlight"><pre><span class="vg">mvn</span><span class="w"> </span><span class="nl">dependency:</span><span class="vg">sources</span>
<span class="vg">mvn</span><span class="w"> </span><span class="nl">dependency:</span><span class="vg">resolve</span><span class="w"> </span><span class="o">-</span><span class="vg">Dclassifier</span><span class="o">=</span><span class="vg">javadoc</span>
</pre></div>
<!--~ Included from gatein-portal-quickstarts-parent/src/main/freemarker/include/feedback.md.ftl ~-->
<h2><a id="feedback" class="anchor" href="#feedback"><span class="anchor-icon"></span></a>Feedback</h2>
<p>Please post feedback on this quickstart or Red Hat JBoss Portal on <a href="https://access.redhat.com/discussions?title=&product=8&category=All&tags=All">Online User Group</a>.</p>
</body></html>