use of com.sun.identity.sm.SchemaType in project OpenAM by OpenRock.
the class SCUtils method getServiceDisplayURL.
/**
* The display URL for a service is the class that controls the
* presentation of the service information. To get the URL
* requires a <code>ServiceSchema</code> object. It can be
* any of the <code>ServiceSchema</code> defined for the
* service.
*/
public String getServiceDisplayURL() {
String displayURL = null;
try {
Set schemaTypes = manager.getSchemaTypes();
//we need to use any schema, so get the first one
if (schemaTypes != null && !schemaTypes.isEmpty()) {
Iterator iter = schemaTypes.iterator();
SchemaType type = (SchemaType) iter.next();
ServiceSchema schema = manager.getSchema(type);
if (schema != null) {
displayURL = schema.getPropertiesViewBeanURL();
}
}
} catch (SMSException smse) {
AMModelBase.debug.error("SCUtils.getServiceDisplayURL", smse);
}
return displayURL;
}
use of com.sun.identity.sm.SchemaType in project OpenAM by OpenRock.
the class FormatUtils method printServiceNames.
public static String printServiceNames(Set serviceNames, String template, SSOToken ssoToken) throws SMSException, SSOException {
StringBuilder buff = new StringBuilder();
String[] arg = new String[1];
if (serviceNames != null) {
for (Iterator i = serviceNames.iterator(); i.hasNext(); ) {
String serviceName = (String) i.next();
ServiceSchemaManager mgr = new ServiceSchemaManager(serviceName, ssoToken);
Set types = mgr.getSchemaTypes();
if (!types.isEmpty()) {
SchemaType type = (SchemaType) types.iterator().next();
ServiceSchema schema = mgr.getSchema(type);
if (schema != null) {
String i18nKey = schema.getI18NKey();
if ((i18nKey != null) && (i18nKey.length() > 0)) {
arg[0] = serviceName;
buff.append(MessageFormat.format(template, (Object[]) arg)).append("\n");
}
}
}
}
}
return buff.toString();
}
Aggregations