Search in sources :

Example 6 with PropertyXMLBuilder

use of com.sun.identity.console.property.PropertyXMLBuilder in project OpenAM by OpenRock.

the class MAPDeviceProfileModelImpl method getProfilePropertyXML.

/**
     * Returns the property XML for profile view.
     *
     * @param clientType Client Type.
     * @param classification Device attribute classification.
     * @throws AMConsoleException if there are no attribute to display.
     * @return the property XML for profile view.
     */
public String getProfilePropertyXML(String clientType, String classification) throws AMConsoleException {
    String xml = "";
    Set attributeNames = getAttributeNames(clientType, classification);
    Set attributeSchemas = getAttributeSchemas(attributeNames);
    try {
        PropertyXMLBuilder builder = new PropertyXMLBuilder(mapServiceName, this, attributeSchemas);
        xml = builder.getXML(getReadOnlyAttributeNames(clientType, attributeNames));
    } catch (SMSException e) {
        throw new AMConsoleException(getErrorString(e));
    } catch (SSOException e) {
        throw new AMConsoleException(getErrorString(e));
    }
    return xml;
}
Also used : Set(java.util.Set) HashSet(java.util.HashSet) SMSException(com.sun.identity.sm.SMSException) SSOException(com.iplanet.sso.SSOException) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) PropertyXMLBuilder(com.sun.identity.console.property.PropertyXMLBuilder)

Example 7 with PropertyXMLBuilder

use of com.sun.identity.console.property.PropertyXMLBuilder in project OpenAM by OpenRock.

the class EntitiesModelImpl method getServicePropertySheetXML.

/**
     * Returns the XML for property sheet view component.
     *
     * @param realmName Name of Realm.
     * @param serviceName Name of service.
     * @param idType type of Identity.
     * @param bCreate true if the property sheet is for identity creation.
     * @param viewbeanClassName Class Name of View Bean.
     * @return the XML for property sheet view component.
     * @throws AMConsoleException if XML cannot be created.
     */
public String getServicePropertySheetXML(String realmName, String serviceName, IdType idType, boolean bCreate, String viewbeanClassName) throws AMConsoleException {
    setLocationDN(realmName);
    DelegationConfig dConfig = DelegationConfig.getInstance();
    try {
        ServiceSchema serviceSchema = AMAdminUtils.getSchemaSchema(serviceName, idType);
        Set set = new HashSet(2);
        set.add(serviceSchema.getServiceType());
        PropertyXMLBuilder xmlBuilder = new PropertyXMLBuilder(serviceName, set, this);
        if (!bCreate) {
            boolean canModify = dConfig.hasPermission(realmName, serviceName, AMAdminConstants.PERMISSION_MODIFY, this, viewbeanClassName);
            if (!canModify) {
                xmlBuilder.setAllAttributeReadOnly(true);
            }
        }
        String xml = xmlBuilder.getXML();
        if (idType.equals(IdType.ROLE)) {
            String cosPriority = AMAdminUtils.getStringFromInputStream(getClass().getClassLoader().getResourceAsStream("com/sun/identity/console/propertyEntitiesCOSPriority.xml"));
            if (xml != null) {
                xml = PropertyXMLBuilder.appendXMLProperty(xml, cosPriority);
            } else {
                xml = PropertyXMLBuilder.formPropertySheetXML(cosPriority, true);
            }
        }
        return xml;
    } catch (SMSException e) {
        throw new AMConsoleException(getErrorString(e));
    } catch (SSOException e) {
        throw new AMConsoleException(getErrorString(e));
    }
}
Also used : ServiceSchema(com.sun.identity.sm.ServiceSchema) Set(java.util.Set) HashSet(java.util.HashSet) SMSException(com.sun.identity.sm.SMSException) DelegationConfig(com.sun.identity.console.delegation.model.DelegationConfig) SSOException(com.iplanet.sso.SSOException) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) PropertyXMLBuilder(com.sun.identity.console.property.PropertyXMLBuilder) HashSet(java.util.HashSet)

Aggregations

SSOException (com.iplanet.sso.SSOException)7 PropertyXMLBuilder (com.sun.identity.console.property.PropertyXMLBuilder)7 SMSException (com.sun.identity.sm.SMSException)7 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)6 DelegationConfig (com.sun.identity.console.delegation.model.DelegationConfig)4 ServiceSchema (com.sun.identity.sm.ServiceSchema)4 Set (java.util.Set)4 HashSet (java.util.HashSet)3 IdRepoException (com.sun.identity.idm.IdRepoException)1 ServiceSchemaManager (com.sun.identity.sm.ServiceSchemaManager)1