/** Initializes a page after execution is activated.
* It setup the identifier and title, and adds it to desktop.
*/
public void init(final Page page, final boolean evalHeaders) {
final PageCtrl pageCtrl = (PageCtrl)page;
pageCtrl.init(
new PageConfig() {
public String getId() {return _id;}
public String getUuid() {return null;}
public String getTitle() {return _title;}
public String getStyle() {return _style;}
public String getHeaders(boolean before) {
return evalHeaders ?
PageDefinition.this.getHeaders(page, before): "";
}
public String getHeaders() {
return evalHeaders ?
PageDefinition.this.getHeaders(page): "";
}
public Collection getResponseHeaders() {
return evalHeaders ?
PageDefinition.this.getResponseHeaders(page):
Collections.EMPTY_LIST;
}
});
String s = getRootAttributes(page);
if (s != null) pageCtrl.setRootAttributes(s);
s = getContentType(page);
if (s != null) pageCtrl.setContentType(s);
s = getDocType(page);
if (s != null) pageCtrl.setDocType(s);
s = getFirstLine(page);
if (s != null) pageCtrl.setFirstLine(s);
if (_cacheable != null) pageCtrl.setCacheable(_cacheable);
if (_autoTimeout != null) pageCtrl.setAutomaticTimeout(_autoTimeout);
if (_expfcls != null) page.setExpressionFactoryClass(_expfcls);
page.setComplete(_complete);
}