public PortletContext unwrapPOP(String wrappedPOPId) throws InvalidPortletIdException { if (wrappedPOPId == null) { throw new IllegalArgumentException(); } return PortletContext.createPortletContext(wrappedPOPId); }
public InternalContext(String portletId) { if (portletId == null) { throw new IllegalArgumentException(); } this.portletId = portletId; this.portletContext = PortletContext.createPortletContext(portletId); }
public static PortletContext convertToPortalPortletContext(String portletHandle, byte[] state) { ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(portletHandle, "portlet handle", "PortletContext"); PortletContext context; context = PortletContext.createPortletContext(portletHandle, state, false); return context; }
protected Portlet getPortlet(String windowId) throws PortletInvokerException { return portletInvoker.getPortlet(PortletContext.createPortletContext(windowId)); }
public PortletContext unwrapCCP(String wrappedCCP) throws InvalidPortletIdException { if (wrappedCCP == null) { throw new IllegalArgumentException(); } if (!wrappedCCP.startsWith(PortletContext.CONSUMER_CLONE_ID_PREFIX)) { throw new InvalidPortletIdException(wrappedCCP); } return PortletContext.createPortletContext(wrappedCCP.substring(PortletContext.CONSUMER_CLONE_ID_PREFIX.length())); }
protected Portlet getPortlet(String windowId) throws PortletInvokerException { return portletInvoker.getPortlet(PortletContext.createPortletContext(windowId)); }
public PortletImpl(PortletContainer container) { this.container = container; this.context = PortletContext.createPortletContext(container.getPortletApplication().getId(), container.getId()); }
public List<DestroyCloneFailure> destroyClones(List<PortletContext> portletContexts) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException { if (portletContexts == null) { throw new IllegalArgumentException("Null portlet id list not accepted"); } if (portletContexts.size() == 0) { return Collections.emptyList(); } // List<PortletContext> dereferencedList = new ArrayList<PortletContext>(portletContexts); for (int i = 0; i < dereferencedList.size(); i++) { PortletContext compoundPortletContext = dereferencedList.get(i); PortletContext portletContext = dereference(compoundPortletContext); dereferencedList.set(i, portletContext); } // List<DestroyCloneFailure> failures = portletInvoker.destroyClones(dereferencedList); for (int i = 0; i < failures.size(); i++) { DestroyCloneFailure failure = failures.get(i); String cloneId = failure.getPortletId(); failure = new DestroyCloneFailure(PortletContext.reference(id, PortletContext.createPortletContext(cloneId)).getId()); failures.set(i, failure); } // return failures; }
public static PortletContext convertToPortalPortletContext(org.oasis.wsrp.v2.PortletContext portletContext) { ParameterValidation.throwIllegalArgExceptionIfNull(portletContext, "PortletContext"); String handle = portletContext.getPortletHandle(); ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(handle, "portlet handle", "PortletContext"); PortletContext context; byte[] state = portletContext.getPortletState(); context = PortletContext.createPortletContext(handle, state, false); return context; }
compoundPortletContext = PortletContext.createPortletContext(compoundPortletId, true); components = compoundPortletContext.getComponents();
public PortletContext createClone(PortletStateType stateType, PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException { ConsumerContext consumerContext = getConsumerContext(portletContext); // PortletContext clonedContext = super.createClone(stateType, consumerContext.producerPortletContext); if (clonedContext instanceof StatefulPortletContext) { StatefulPortletContext statefulClonedContext = (StatefulPortletContext)clonedContext; ConsumerState consumerState = new ConsumerState<Serializable>(clonedContext.getId(), statefulClonedContext.getType(), statefulClonedContext.getState()); String id = persistenceManager.createState(consumerState); return PortletContext.createPortletContext(PortletContext.CONSUMER_CLONE_ID_PREFIX + id); } else { return clonedContext; } }
return PortletContext.createPortletContext(cloneId); return PortletContext.createPortletContext(PortletContext.PRODUCER_CLONE_ID_PREFIX + cloneId);
Portlet delegate = super.getPortlet(PortletContext.createPortletContext(portletState.getPortletId())); return new ProducerPortlet(portletContext, delegate); PortletStateContext stateContext = persistenceManager.loadState(stateId); PortletState state = stateContext.getState(); Portlet delegate = super.getPortlet(PortletContext.createPortletContext(state.getPortletId())); return new ProducerPortlet(portletContext, delegate);
public PortletContext importPortlet(PortletStateType stateType, PortletContext portletContext) throws PortletInvokerException, IllegalArgumentException { ConsumerContext consumerContext = getConsumerContext(portletContext); PortletContext importContext = super.importPortlet(stateType, consumerContext.producerPortletContext); if (importContext instanceof StatefulPortletContext) { StatefulPortletContext statefulimportContext = (StatefulPortletContext)importContext; ConsumerState consumerState = new ConsumerState<Serializable>(importContext.getId(), statefulimportContext.getType(), statefulimportContext.getState()); String id = persistenceManager.createState(consumerState); return PortletContext.createPortletContext(PortletContext.CONSUMER_CLONE_ID_PREFIX + id); } else { return importContext; } }
public RegistrationSPI toModel(RegistrationSPI initial, JCRRegistrationPersistenceManager persistenceManager) { ParameterValidation.throwIllegalArgExceptionIfNull(initial, "RegistrationSPI"); initial.setStatus(getStatus()); initial.setRegistrationHandle(getRegistrationHandle()); initial.setPersistentKey(getPersistentKey()); Collection<PortletContextMapping> pcms = getPortletContexts(); for (PortletContextMapping pcm : pcms) { PortletContext pc = PortletContext.createPortletContext(pcm.getId(), IOTools.safeGetBytes(pcm.getState())); try { initial.addPortletContext(pc, false); // no need to save since we're loading from persistence :) } catch (RegistrationException e) { throw new RuntimeException(e); } } return initial; }
return PortletContext.createPortletContext(cloneId);
return PortletContext.createPortletContext(portletId);
String stateId = persistenceManager.createState(consumerState); String clonedId = PortletContext.CONSUMER_CLONE_ID_PREFIX + stateId; StateEvent event = new StateEvent(PortletContext.createPortletContext(clonedId), StateEvent.Type.PORTLET_CLONED_EVENT); cictx.onStateEvent(event); StateEvent event = new StateEvent(PortletContext.createPortletContext(clonedContext.getId()), StateEvent.Type.PORTLET_CLONED_EVENT); cictx.onStateEvent(event);
PortletContext clonedCtx = PortletContext.createPortletContext(cloneId); StateEvent event = new StateEvent(clonedCtx, StateEvent.Type.PORTLET_CLONED_EVENT); instanceCtx.onStateEvent(event); PortletContext clonedCtx = PortletContext.createPortletContext(cloneId); StateEvent event = new StateEvent(clonedCtx, StateEvent.Type.PORTLET_CLONED_EVENT); instanceCtx.onStateEvent(event);