}
private ServiceDescription getUnmanagedServiceDescription(boolean asUnregistered) throws PortletInvokerException, OperationFailed, InvalidRegistration, ModifyRegistrationRequired
{
//todo: might need to implement customization of default service description
ServiceDescription serviceDescription;
try
{
Holder<Boolean> requiresRegistration = new Holder<Boolean>();
Holder<List<PortletDescription>> offeredPortlets = new Holder<List<PortletDescription>>();
Holder<List<ItemDescription>> userCategoryDescriptions = new Holder<List<ItemDescription>>();
Holder<List<ItemDescription>> windowStateDescriptions = new Holder<List<ItemDescription>>();
Holder<List<ItemDescription>> modeDescriptions = new Holder<List<ItemDescription>>();
Holder<CookieProtocol> requiresInitCookie = new Holder<CookieProtocol>();
Holder<ModelDescription> registrationPropertyDescription = new Holder<ModelDescription>();
Holder<List<String>> locales = new Holder<List<String>>();
Holder<ResourceList> resourceList = new Holder<ResourceList>();
Holder<List<EventDescription>> eventDescriptions = new Holder<List<EventDescription>>();
Holder<ModelTypes> schemaTypes = new Holder<ModelTypes>();
Holder<List<String>> supportedOptions = new Holder<List<String>>();
Holder<ExportDescription> exportDescription = new Holder<ExportDescription>();
Holder<Boolean> mayReturnRegistrationState = new Holder<Boolean>();
final Holder<List<ExtensionDescription>> extensionDescriptions = new Holder<List<ExtensionDescription>>();
final Holder<List<Extension>> extensions = new Holder<List<Extension>>();
// invocation
persistentEndpointInfo.getServiceDescriptionService().getServiceDescription(
asUnregistered ? null : getRegistrationContext(),
WSRPConstants.getDefaultLocales(), // todo: deal with locales better
null, // todo: provide a way to only request info on some portlets?
UserAccess.getUserContext(),
requiresRegistration,
offeredPortlets,
userCategoryDescriptions,
extensionDescriptions,
windowStateDescriptions,
modeDescriptions,
requiresInitCookie,
registrationPropertyDescription,
locales,
resourceList,
eventDescriptions,
schemaTypes,
supportedOptions,
exportDescription,
mayReturnRegistrationState,
extensions);
// TODO: fix-me
serviceDescription = WSRPTypeFactory.createServiceDescription(requiresRegistration.value);
serviceDescription.setRegistrationPropertyDescription(registrationPropertyDescription.value);
serviceDescription.setRequiresInitCookie(requiresInitCookie.value);
serviceDescription.setResourceList(resourceList.value);
serviceDescription.setSchemaType(schemaTypes.value);
serviceDescription.setExportDescription(exportDescription.value);
serviceDescription.setMayReturnRegistrationState(mayReturnRegistrationState.value);
if (ParameterValidation.existsAndIsNotEmpty(modeDescriptions.value))
{
serviceDescription.getCustomModeDescriptions().addAll(modeDescriptions.value);
}
if (ParameterValidation.existsAndIsNotEmpty(windowStateDescriptions.value))
{
serviceDescription.getCustomWindowStateDescriptions().addAll(windowStateDescriptions.value);
}
if (ParameterValidation.existsAndIsNotEmpty(locales.value))
{
serviceDescription.getLocales().addAll(locales.value);
}
if (ParameterValidation.existsAndIsNotEmpty(offeredPortlets.value))
{
serviceDescription.getOfferedPortlets().addAll(offeredPortlets.value);
}
if (ParameterValidation.existsAndIsNotEmpty(userCategoryDescriptions.value))
{
serviceDescription.getUserCategoryDescriptions().addAll(userCategoryDescriptions.value);
}
if (ParameterValidation.existsAndIsNotEmpty(eventDescriptions.value))
{
serviceDescription.getEventDescriptions().addAll(eventDescriptions.value);
}
if (ParameterValidation.existsAndIsNotEmpty(extensionDescriptions.value))
{
serviceDescription.getExtensionDescriptions().addAll(extensionDescriptions.value);
}
if (ParameterValidation.existsAndIsNotEmpty(extensions.value))
{
serviceDescription.getExtensions().addAll(extensions.value);
}
if (ParameterValidation.existsAndIsNotEmpty(supportedOptions.value))
{
serviceDescription.getSupportedOptions().addAll(supportedOptions.value);
}
return serviceDescription;
}
catch (Exception e)