/** * Sets the object to null in the {@link MetaDataEntry}. */ public void clear() { getSession().setMetaData(key, null); }
/** * Sets the given object in the {@link MetaDataEntry}. * * @param value * The object to set. */ public void set(final T value) { getSession().setMetaData(key, value); } }
/** * Removes the authentication data from the current web session * * @param session * the current web session */ public static void logOut(final Session session) { Args.notNull(session, "session"); session.setMetaData(KEY, null); ; } }
public static void clear() { if (Session.exists()) { Session.get().setMetaData(key, null); } }
public static void clear() { if (Session.exists()) { Session.get().setMetaData(key, null); } }
private void selectProject(Project aProject) { Session.get().setMetaData(CURRENT_PROJECT, aProject); setResponsePage(ProjectDashboardPage.class); }
private void selectProject(Project aProject) { Session.get().setMetaData(CURRENT_PROJECT, aProject); setResponsePage(ProjectDashboardPage.class); }
/** * Stores the authentication data in the current web session * * @param session * the current web session * @param browserId * the authentication data */ public static void logIn(final Session session, final BrowserId browserId) { Args.notNull(session, "session"); Args.notNull(browserId, "browserId"); session.setMetaData(KEY, browserId); ; }
public CurationPage() { super(); LOG.debug("Setting up curation page without parameters"); commonInit(); Map<String, StringValue> fragmentParameters = Session.get() .getMetaData(SessionMetaData.LOGIN_URL_FRAGMENT_PARAMS); if (fragmentParameters != null) { // Clear the URL fragment parameters - we only use them once! Session.get().setMetaData(SessionMetaData.LOGIN_URL_FRAGMENT_PARAMS, null); StringValue project = fragmentParameters.get(PAGE_PARAM_PROJECT_ID); StringValue document = fragmentParameters.get(PAGE_PARAM_DOCUMENT_ID); StringValue focus = fragmentParameters.get(PAGE_PARAM_FOCUS); handleParameters(null, project, document, focus, false); } }
public CurationPage() { super(); LOG.debug("Setting up curation page without parameters"); commonInit(); Map<String, StringValue> fragmentParameters = Session.get() .getMetaData(SessionMetaData.LOGIN_URL_FRAGMENT_PARAMS); if (fragmentParameters != null) { // Clear the URL fragment parameters - we only use them once! Session.get().setMetaData(SessionMetaData.LOGIN_URL_FRAGMENT_PARAMS, null); StringValue project = fragmentParameters.get(PAGE_PARAM_PROJECT_ID); StringValue document = fragmentParameters.get(PAGE_PARAM_DOCUMENT_ID); StringValue focus = fragmentParameters.get(PAGE_PARAM_FOCUS); handleParameters(null, project, document, focus, false); } }
public AnnotationPage() { super(); LOG.debug("Setting up annotation page without parameters"); commonInit(); Map<String, StringValue> fragmentParameters = Session.get() .getMetaData(SessionMetaData.LOGIN_URL_FRAGMENT_PARAMS); if (fragmentParameters != null) { // Clear the URL fragment parameters - we only use them once! Session.get().setMetaData(SessionMetaData.LOGIN_URL_FRAGMENT_PARAMS, null); StringValue project = fragmentParameters.get(PAGE_PARAM_PROJECT_ID); StringValue document = fragmentParameters.get(PAGE_PARAM_DOCUMENT_ID); StringValue focus = fragmentParameters.get(PAGE_PARAM_FOCUS); handleParameters(null, project, document, focus, false); } }
@Override public void onClick(AjaxRequestTarget target) { // must of been set by #directoryClicked() File dir = getModelObject(); getSession().setMetaData(LAST_VISITED_DIRECTORY, dir); directorySelected(dir, target); } };
@EventListener public void onProjectDeleted(BeforeProjectRemovedEvent aEvent) { Session session = Session.get(); if (session != null) { // If the currently selected project is deleted, clear it from the session. Project project = session.getMetaData(SessionMetaData.CURRENT_PROJECT); if (project != null && Objects.equals(aEvent.getProject().getId(), project.getId())) { session.setMetaData(SessionMetaData.CURRENT_PROJECT, null); } } } }
@EventListener public void onProjectDeleted(BeforeProjectRemovedEvent aEvent) { Session session = Session.get(); if (session != null) { // If the currently selected project is deleted, clear it from the session. Project project = session.getMetaData(SessionMetaData.CURRENT_PROJECT); if (project != null && Objects.equals(aEvent.getProject().getId(), project.getId())) { session.setMetaData(SessionMetaData.CURRENT_PROJECT, null); } } } }
private void setDefaultResponsePageIfNecessary() { // This does not work because it was Spring Security that intercepted the access, not // Wicket continueToOriginalDestination(); String redirectUrl = getRedirectUrl(); if (redirectUrl == null || redirectUrl.contains(".IBehaviorListener.") || redirectUrl.contains("-logoutPanel-")) { log.debug("Redirecting to welcome page"); setResponsePage(getApplication().getHomePage()); } else { log.debug("Redirecting to saved URL: [{}]", redirectUrl); if (isNotBlank(form.urlfragment) && form.urlfragment.startsWith("!")) { Url url = Url.parse("http://dummy?" + form.urlfragment.substring(1)); UrlRequestParametersAdapter adapter = new UrlRequestParametersAdapter(url); LinkedHashMap<String, StringValue> params = new LinkedHashMap<>(); for (String name : adapter.getParameterNames()) { params.put(name, adapter.getParameterValue(name)); } Session.get().setMetaData(SessionMetaData.LOGIN_URL_FRAGMENT_PARAMS, params); } throw new NonResettingRestartException(redirectUrl); } } }
void updateFileBrowser(File file, AjaxRequestTarget target) { if (RepositoryManager.isGeogigDirectory(file)) { geogigDirectoryClicked(file, target); } else { getSession().setMetaData(LAST_VISITED_DIRECTORY, file); directoryClicked(file, target); } }
public static TreeResourceSet get() { TreeResourceSet set = Session.get().getMetaData(KEY); if (set == null) { set = new TreeResourceSet(); Session.get().setMetaData(KEY, set); } return set; } }
@Override public ICrypt newCrypt() { Session session = Session.get(); session.bind(); // retrieve or generate encryption key from session String key = session.getMetaData(KEY); if (key == null) { // generate new key key = session.getId() + "." + UUID.randomUUID().toString(); session.setMetaData(KEY, key); } // build the crypt based on session key ICrypt crypt = createCrypt(); crypt.setKey(key); return crypt; }
@Override public ICrypt newCrypt() { Session session = Session.get(); session.bind(); // retrieve or generate encryption key from session String key = session.getMetaData(KEY); if (key == null) { // generate new key key = session.getId() + "." + UUID.randomUUID().toString(); session.setMetaData(KEY, key); } // build the crypt based on session key ICrypt crypt = createCrypt(); crypt.setKey(key); return crypt; }
/** * @see org.apache.wicket.RequestCycle#newClientInfo() */ protected ClientInfo newClientInfo() { if (getApplication().getRequestCycleSettings().getGatherExtendedBrowserInfo()) { Session session = getSession(); if (session.getMetaData(BROWSER_WAS_POLLED_KEY) == null) { // we haven't done the redirect yet; record that we will be // doing that now and redirect session.setMetaData(BROWSER_WAS_POLLED_KEY, Boolean.TRUE); String url = "/" + getRequest().getURL(); throw new RestartResponseException(new BrowserInfoPage(url)); } // if we get here, the redirect already has been done; clear // the meta data entry; we don't need it any longer is the client // info object will be cached too session.setMetaData(BROWSER_WAS_POLLED_KEY, (Boolean)null); } return new WebClientInfo(this); }