setViewKey(viewKey); if (VIEW_DELETE.equals(viewKey)) { setMethod(Method.DELETE);
viewKey = VIEW_SHOW; setViewKey(viewKey); } else {
setViewKey(viewKey); setExtension(extension);
view.setViewKey(EntityView.VIEW_DELETE); view.setMethod(EntityView.Method.DELETE); } else if (EntityView.Method.PUT.name().equals(method)) { view.setViewKey(EntityView.VIEW_EDIT); view.setMethod(EntityView.Method.PUT); } else if (EntityView.Method.POST.name().equals(method)) { if (view.getEntityReference().getId() == null) { view.setViewKey(EntityView.VIEW_NEW); } else { view.setViewKey(EntityView.VIEW_EDIT); view.setViewKey(EntityView.VIEW_DELETE); } else if (EntityView.Method.PUT.name().equals(_method)) { if (view.getEntityReference().getId() == null) { view.setViewKey(EntityView.VIEW_NEW); } else { view.setViewKey(EntityView.VIEW_EDIT);
if (viewKey != null && ! "".equals(viewKey)) { ev.setViewKey(viewKey);
if (viewKey != null && ! "".equals(viewKey)) { ev.setViewKey(viewKey);
/** * Reduce code duplication and ensure custom templates are used */ public EntityView makeEntityView(EntityReference ref, String viewKey, String extension) { if (ref == null) { throw new IllegalArgumentException("ref cannot be null"); } EntityView view = new EntityView(); EntityViewUrlCustomizable custom = (EntityViewUrlCustomizable) entityProviderManager .getProviderByPrefixAndCapability(ref.getPrefix(), EntityViewUrlCustomizable.class); if (custom != null) { // use the custom parsing templates view.loadParseTemplates( custom.getParseTemplates() ); } view.setEntityReference(ref); if (viewKey != null) { view.setViewKey(viewKey); } if (extension != null) { view.setExtension(extension); } return view; }
/** * Makes a copy of an EntityView which can be changed independently * @param ev any EntityView * @return the copy * @throws IllegalArgumentException if the input is null OR not completely constructed */ public static EntityView copy(EntityView ev) { if (ev == null) { throw new IllegalArgumentException("input entity view must not be null"); } if (ev.viewKey == null || ev.entityReference == null) { throw new IllegalArgumentException("input entity view must be completely constructed"); } EntityView togo = new EntityView(); EntityReference ref = ev.getEntityReference(); togo.setEntityReference( new EntityReference(ref.getPrefix(), ref.getId() == null ? "" : ref.getId()) ); togo.preloadParseTemplates( ev.getAnazlyzedTemplates() ); togo.setExtension( ev.getExtension() ); togo.setViewKey( ev.getViewKey() ); return togo; }
if (actionReturn.entitiesList.size() > 1) { view.setViewKey(EntityView.VIEW_LIST); view.setViewKey(EntityView.VIEW_SHOW); entityBrokerManager.populateEntityData( new EntityData[] {actionReturn.entityData} ); ref = new EntityReference(ed.getEntityRef().getPrefix(), ""); view.setEntityReference( ref ); view.setViewKey(EntityView.VIEW_LIST); view.setViewKey(EntityView.VIEW_SHOW);
if (actionReturn.entitiesList.size() > 1) { view.setViewKey(EntityView.VIEW_LIST); view.setViewKey(EntityView.VIEW_SHOW); entityBrokerManager.populateEntityData( new EntityData[] {actionReturn.entityData} ); ref = new EntityReference(ed.getEntityRef().getPrefix(), ""); view.setEntityReference( ref ); view.setViewKey(EntityView.VIEW_LIST); view.setViewKey(EntityView.VIEW_SHOW);