Skip to content
This repository was archived by the owner on Apr 8, 2019. It is now read-only.

Commit 888eac3

Browse files
committed
Initial update to README after API changes for 1.0.0.Alpha01
1 parent 78d4641 commit 888eac3

File tree

2 files changed

+45
-31
lines changed

2 files changed

+45
-31
lines changed

README

-31
This file was deleted.

README.md

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
GateIn API
2+
=============
3+
4+
The GateIn Public API is to be used within [GateIn Portal](http://www.gatein.org) to provide a standard and consistent way to obtain and modify portal entities.
5+
6+
7+
Getting Started
8+
-----------
9+
10+
To build with maven
11+
12+
`mvn clean install`
13+
14+
and include as a dependency in your pom.xml
15+
16+
```xml
17+
<groupId>org.gatein.api</groupId>
18+
<artifactId>gatein-api</artifactId>
19+
<version>1.0.0.Alpha01</version>
20+
```
21+
22+
Usage
23+
-----------
24+
25+
To obtain the `PortalRequest` object from within GateIn simply do the following:
26+
27+
```java
28+
PortalRequest request = PortalRequest.getInstance();
29+
```
30+
31+
The `PortalRequest` object contains information about the current request, for example to retrieve the current navigation node of the request:
32+
33+
```java
34+
Navigation navigation = request.getNavigation();
35+
Node node = navigaiton.getNode(request.getNodePath());
36+
```
37+
38+
The `Portal` interface allows you to do more advanced things create sites, create pages, or check permisisons. For example to check to see if the current user has access to a certain page:
39+
40+
```java
41+
Portal portal = request.getPortal();
42+
User user = request.getUser();
43+
Page homepage = portal.getPage(new PageId("homepage"));
44+
boolean access = portal.hasPermission(user, homepage.getAccessPermission());
45+
```

0 commit comments

Comments
 (0)