STSHomeViewBean.java revision 4cc414596f330cc595f62252d964ef97b3795056
/*
* The contents of this file are subject to the terms of the Common Development and
* Distribution License (the License). You may not use this file except in compliance with the
* License.
*
* You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
* specific language governing permission and limitations under the License.
*
* When distributing Covered Software, include this CDDL Header Notice in each file and include
* the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions Copyrighted [year] [name of copyright owner]".
*
* Copyright 2014-2015 ForgeRock AS.
*/
public class STSHomeViewBean extends RealmPropertiesBase {
/*
Used to set a session attribute
*/
/*
These values below must correspond to tblRestSTSInstances.xml/tblSoapSTSInstances.xml, and also correspond to the handleTbl* method
names below. The first block corresponds to the table displaying the rest-sts instances, and the second to the
table displaying the soap-sts instances.
*/
private static final String TBL_REST_STS_INSTANCES_BUTTON_DELETE = "tblRestSTSInstancesButtonDelete";
private static final String TBL_REST_STS_INSTANCES_DATA_ACTION_HREF = "tblRestSTSInstancesDataActionHref";
private static final String REST_STS_PUBLISHED_INSTANCES_CACHE_KEY = "restSTSPublishedInstancesCache";
private static final String TBL_SOAP_STS_INSTANCES_BUTTON_DELETE = "tblSoapSTSInstancesButtonDelete";
private static final String TBL_SOAP_STS_INSTANCES_DATA_ACTION_HREF = "tblSoapSTSInstancesDataActionHref";
private static final String SOAP_STS_PUBLISHED_INSTANCES_CACHE_KEY = "soapSTSPublishedInstancesCache";
public STSHomeViewBean() {
/*
must be class name minus 'ViewBean', and the .jsp in the REST_DEFAULT_DISPLAY_URL must match this pattern as well,
as does the url in the entry in amConsoleConfig.xml
*/
super("STSHome");
}
protected void registerChildren() {
super.registerChildren();
ptModel.registerChildren(this);
}
Set<String> publishedInstances = getPublishedInstancesFromCache(REST_STS_PUBLISHED_INSTANCES_CACHE_KEY);
} else {
}
Set<String> publishedInstances = getPublishedInstancesFromCache(SOAP_STS_PUBLISHED_INSTANCES_CACHE_KEY);
} else {
}
} else {
}
return view;
}
if (instancesCache != null) {
} else {
return Collections.emptySet();
}
}
throws ModelControlException {
super.beginDisplay(event);
}
protected AMModel getModelInternal() {
try {
} catch (AMConsoleException e) {
throw new IllegalStateException("Exception getting model in STSHomeViewBean: " + e.getMessage(), e);
}
}
private void createPageTitleModel() {
ptModel = new CCPageTitleModel(
}
private void createTableModel() {
tblModelRestSTSInstances.setActionValue(TBL_REST_STS_INSTANCES_BUTTON_ADD, "rest.sts.home.instances.table.button.new");
"rest.sts.home.instances.table.button.delete");
"rest.sts.home.instances.table.column.name");
"rest.sts.home.instances.table.action.column.name");
tblModelSoapSTSInstances.setActionValue(TBL_SOAP_STS_INSTANCES_BUTTON_ADD, "soap.sts.home.instances.table.button.new");
"soap.sts.home.instances.table.button.delete");
"soap.sts.home.instances.table.column.name");
"soap.sts.home.instances.table.action.column.name");
}
private void setRestSTSInstanceNamesInTable() {
try {
} catch (AMConsoleException e) {
e.getMessage());
}
}
private void setSoapSTSInstanceNamesInTable() {
try {
} catch (AMConsoleException e) {
e.getMessage());
}
}
}
boolean firstEntry = true;
if (firstEntry) {
firstEntry = false;
} else {
}
}
} else {
}
}
}
boolean firstEntry = true;
if (firstEntry) {
firstEntry = false;
} else {
}
}
} else {
}
}
/**
* Forwards request to creation view bean.
*
* @param event Request Invocation Event.
*/
}
/**
* Forwards request to creation view bean.
*
* @param event Request Invocation Event.
*/
}
/**
* Forwards request to ViewBean to edit Rest STS instance
*/
RestSTSEditViewBean.class);
}
/**
* Forwards request to ViewBean to edit Soap STS instance
*/
SoapSTSEditViewBean.class);
}
public void handleTblRestSTSInstancesButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
}
try {
"rest.sts.home.instance.deleted");
} else {
"rest.sts.home.instances.deleted");
}
} catch (AMConsoleException e) {
e.getMessage());
}
forwardTo();
}
public void handleTblSoapSTSInstancesButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
}
try {
"rest.sts.home.instance.deleted");
} else {
"rest.sts.home.instances.deleted");
}
} catch (AMConsoleException e) {
e.getMessage());
}
forwardTo();
}
/**
* Handles "back to" page request.
*
* @param event Request invocation event
*/
backTrail();
}
}