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

Commit 78d4641

Browse files
committed
Allow template name to be specified when creating a site.
1 parent 3147cd4 commit 78d4641

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

src/main/java/org/gatein/api/Portal.java

+16-2
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,11 @@ public interface Portal {
5151
* @throws ApiException if something prevented this operation to succeed
5252
*/
5353
Site getSite(SiteId siteId);
54-
54+
5555
/**
5656
* Creates a a site given the <code>SiteId</code>. This site is not saved until
57-
* {@link Portal#saveSite(org.gatein.api.site.Site)} is called.
57+
* {@link Portal#saveSite(org.gatein.api.site.Site)} is called. Will use the default site template configured by
58+
* the portal.
5859
*
5960
* @param siteId the site id
6061
* @return the new site which has not been saved yet.
@@ -64,6 +65,19 @@ public interface Portal {
6465
*/
6566
Site createSite(SiteId siteId);
6667

68+
/**
69+
* Creates a a site given the <code>SiteId</code>. This site is not saved until
70+
* {@link Portal#saveSite(org.gatein.api.site.Site)} is called.
71+
*
72+
* @param siteId the site id
73+
* @param templateName the name of the template to use to create the site
74+
* @return the new site which has not been saved yet.
75+
* @throws IllegalArgumentException if siteId is null
76+
* @throws EntityAlreadyExistsException if the site already exists
77+
* @throws ApiException if something prevented this operation to succeed
78+
*/
79+
Site createSite(SiteId siteId, String templateName);
80+
6781
/**
6882
* Finds sites given the <code>SiteQuery</code>
6983
*

src/main/java/org/gatein/api/site/Site.java

+5-6
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,14 @@ public interface Site extends Displayable, Describable, Comparable<Site>, Serial
129129
*/
130130
public static final class AttributeKeys {
131131
/**
132-
* The site attribute that sets if a session is kept alive or not
132+
* The site attribute that sets if a session is kept alive or not. Valid values are 'onDemand', 'always',
133+
* and 'never' with the default being 'onDemand'.
133134
*/
134-
public static final Attributes.Key<String> SESSION_BEHAVIOR = Attributes.key("org.gatein.api.portal.session_behavior",
135-
String.class);
135+
public static final Attributes.Key<String> SESSION_BEHAVIOR = Attributes.key("sessionAlive", String.class);
136136
/**
137-
* The site attribute that sets if the info bar is shown by default
137+
* The site attribute that sets if the info bar is shown by default when adding applications to pages, default 'false'
138138
*/
139-
public static final Attributes.Key<Boolean> SHOW_PORTLET_INFO_BAR = Attributes.key(
140-
"org.gatein.api.portal.show_info_bar", Boolean.class);
139+
public static final Attributes.Key<Boolean> SHOW_PORTLET_INFO_BAR = Attributes.key("showPortletInfo", Boolean.class);
141140

142141
private AttributeKeys() {
143142
}

0 commit comments

Comments
 (0)