if (!ParameterValidation.existsAndIsNotEmpty(portletContexts) || WSRPUtils.isSingletonListWithNullOrEmptyElement(portletContexts))
{
throw WSRP2ExceptionFactory.createWSException(MissingParameters.class, "Missing required portletContext in CopyPortlets.", null);
}
Registration fromRegistration = producer.getRegistrationOrFailIfInvalid(copyPortlets.getFromRegistrationContext());
RegistrationContext toRegistationContext = copyPortlets.getToRegistrationContext();
//if toRegistrationCotnext is null, then we use the fromRegistrationContext (from spec).
//NOTE: this means we can't move between a PortletContext on a registered consumer to a non-registered consumer
// between two non-registered consumers will still be ok.
if (toRegistationContext == null)
{
toRegistationContext = copyPortlets.getFromRegistrationContext();
}
Registration toRegistration = producer.getRegistrationOrFailIfInvalid(toRegistationContext);
UserContext fromUserContext = copyPortlets.getFromUserContext();
checkUserAuthorization(fromUserContext);
UserContext toUserContext = copyPortlets.getToUserContext();
checkUserAuthorization(toUserContext);