}
private ServiceDescription getUnmanagedServiceDescription(boolean asUnregistered) throws PortletInvokerException, OperationFailed, InvalidRegistration
{
//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>> userProfileItemDescriptions = new Holder<List<ItemDescription>>();
Holder<List<ItemDescription>> windowStateDescriptions = new Holder<List<ItemDescription>>();
Holder<List<ItemDescription>> modeDescriptions = new Holder<List<ItemDescription>>();
Holder<CookieProtocol> initCookie = new Holder<CookieProtocol>();
Holder<ModelDescription> registrationPropertyDescription = new Holder<ModelDescription>();
Holder<List<String>> locales = new Holder<List<String>>();
Holder<ResourceList> resourceList = new Holder<ResourceList>();
// invocation
persistentEndpointInfo.getServiceDescriptionService().getServiceDescription(
asUnregistered ? null : getRegistrationContext(),
WSRPConstants.getDefaultLocales(), // todo: deal with locales better
requiresRegistration,
offeredPortlets,
userCategoryDescriptions,
userProfileItemDescriptions,
windowStateDescriptions,
modeDescriptions,
initCookie,
registrationPropertyDescription,
locales,
resourceList,
new Holder<List<Extension>>());
serviceDescription = WSRPTypeFactory.createServiceDescription(requiresRegistration.value);
serviceDescription.setRegistrationPropertyDescription(registrationPropertyDescription.value);
serviceDescription.setRequiresInitCookie(initCookie.value);
serviceDescription.setResourceList(resourceList.value);
serviceDescription.getCustomModeDescriptions().addAll(modeDescriptions.value);
serviceDescription.getCustomUserProfileItemDescriptions().addAll(userProfileItemDescriptions.value);
serviceDescription.getCustomWindowStateDescriptions().addAll(windowStateDescriptions.value);
serviceDescription.getLocales().addAll(locales.value);
serviceDescription.getOfferedPortlets().addAll(offeredPortlets.value);
serviceDescription.getUserCategoryDescriptions().addAll(userCategoryDescriptions.value);
return serviceDescription;
}
catch (Exception e)
{