public Object saveState(FacesContext context) { Object[] state = new Object[5]; // parent fields state saving state[0] = isCacheable(context) ? Boolean.TRUE : Boolean.FALSE; state[1] = getContentType(); state[2] = UIComponentBase.saveAttachedState(context, userData); state[3] = UIComponentBase.saveAttachedState(context, contentProducer); state[4] = fileName; return state; }
public void restoreState(FacesContext context, Object stateObject) { Object[] state = (Object[]) stateObject; setCacheable((Boolean) state[0]); setContentType((String) state[1]); userData = UIComponentBase.restoreAttachedState(context, state[2]); contentProducer = (MethodExpression) UIComponentBase.restoreAttachedState(context, state[3]); fileName = (String) state[4]; }
public void restoreState(FacesContext context, Object stateObject) { Object[] state = (Object[]) stateObject; setCacheable((Boolean) state[0]); setContentType((String) state[1]); userData = UIComponentBase.restoreAttachedState(context, state[2]); contentProducer = (MethodExpression) UIComponentBase.restoreAttachedState(context, state[3]); fileName = (String) state[4]; }
public Object saveState(FacesContext context) { Object[] state = new Object[5]; // parent fields state saving state[0] = isCacheable(context) ? Boolean.TRUE : Boolean.FALSE; state[1] = getContentType(); state[2] = UIComponentBase.saveAttachedState(context, userData); state[3] = UIComponentBase.saveAttachedState(context, contentProducer); state[4] = fileName; return state; }
/** * @param uiMediaOutput */ // TODO use ResourceComponent or exchange object as argument? @PostConstructResource public void initialize() { AbstractMediaOutput uiMediaOutput = (AbstractMediaOutput) UIComponent.getCurrentComponent(FacesContext .getCurrentInstance()); this.setCacheable(uiMediaOutput.isCacheable()); this.setContentType(uiMediaOutput.getMimeType()); this.userData = uiMediaOutput.getValue(); this.contentProducer = uiMediaOutput.getCreateContent(); this.lastModifiedExpression = uiMediaOutput.getValueExpression("lastModfied"); this.expiresExpression = uiMediaOutput.getValueExpression("expires"); this.timeToLiveExpression = uiMediaOutput.getValueExpression("timeToLive"); this.fileName = uiMediaOutput.getFileName(); }
/** * @param uiMediaOutput */ // TODO use ResourceComponent or exchange object as argument? @PostConstructResource public void initialize() { AbstractMediaOutput uiMediaOutput = (AbstractMediaOutput) UIComponent.getCurrentComponent(FacesContext .getCurrentInstance()); this.setCacheable(uiMediaOutput.isCacheable()); this.setContentType(uiMediaOutput.getMimeType()); this.userData = uiMediaOutput.getValue(); this.contentProducer = uiMediaOutput.getCreateContent(); this.lastModifiedExpression = uiMediaOutput.getValueExpression("lastModfied"); this.expiresExpression = uiMediaOutput.getValueExpression("expires"); this.timeToLiveExpression = uiMediaOutput.getValueExpression("timeToLive"); this.fileName = uiMediaOutput.getFileName(); }