4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan/*
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan * The contents of this file are subject to the terms of the Common Development and
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan * Distribution License (the License). You may not use this file except in compliance with the
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan * License.
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan *
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan * specific language governing permission and limitations under the License.
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan *
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan * When distributing Covered Software, include this CDDL Header Notice in each file and include
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan * Header, with the fields enclosed by brackets [] replaced by your own identifying
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan * information: "Portions Copyrighted [year] [name of copyright owner]".
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan *
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan * Copyright 2014-2015 ForgeRock AS.
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan */
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan/*
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan * Portions Copyrighted 2015 Nomura Research Institute, Ltd.
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan */
4cc414596f330cc595f62252d964ef97b3795056Dirk Hoganpackage com.sun.identity.console.sts;
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan
4cc414596f330cc595f62252d964ef97b3795056Dirk Hoganimport com.sun.identity.console.base.model.AMAdminConstants;
4cc414596f330cc595f62252d964ef97b3795056Dirk Hoganimport com.sun.identity.console.base.model.AMAdminUtils;
4cc414596f330cc595f62252d964ef97b3795056Dirk Hoganimport com.sun.identity.console.base.model.AMPropertySheetModel;
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan
4cc414596f330cc595f62252d964ef97b3795056Dirk Hoganimport static com.sun.identity.console.sts.model.STSInstanceModel.STSType;
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan/**
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan * The ViewBean used to create new Rest STS instances. Extends the AMServiceProfileViewBeanBase class as this class
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan * provides for automatic constitution of propertySheet values based on model state.
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan */
4cc414596f330cc595f62252d964ef97b3795056Dirk Hoganpublic class RestSTSAddViewBean extends STSAddViewBeanBase {
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan public static final String DEFAULT_DISPLAY_URL = "/console/sts/RestSTSAdd.jsp";
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan private static final String PROPERTY_MODEL_XML_FILE_LOCATION = "com/sun/identity/console/propertyRestSecurityTokenService.xml";
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan public RestSTSAddViewBean() {
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan super("RestSTSAdd", DEFAULT_DISPLAY_URL, AMAdminConstants.REST_STS_SERVICE, STSType.REST);
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan }
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan /*
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan This method is called from the AMServiceProfileViewBeanBase ctor, so the xml file location cannot be passed to the
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan super ctor, as this field is not initialized until after the super ctor is called. So this method must be over-ridden
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan here.
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan */
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan @Override
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan protected void createPropertyModel() {
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan String xml = AMAdminUtils.getStringFromInputStream(
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan getClass().getClassLoader().getResourceAsStream(PROPERTY_MODEL_XML_FILE_LOCATION));
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan propertySheetModel = new AMPropertySheetModel(xml);
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan propertySheetModel.clear();
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan }
4cc414596f330cc595f62252d964ef97b3795056Dirk Hogan}