private Optional<Project> getProjectFromParameters(StringValue projectParam) { if (projectParam == null || projectParam.isEmpty()) { return Optional.empty(); } try { return Optional.of(projectService.getProject(projectParam.toLong())); } catch (NoResultException e) { return Optional.empty(); } }
private Optional<Project> getProjectFromParameters(StringValue projectParam) { if (projectParam == null || projectParam.isEmpty()) { return Optional.empty(); } try { return Optional.of(projectService.getProject(projectParam.toLong())); } catch (NoResultException e) { return Optional.empty(); } }
private Optional<Project> getProjectFromParameters(StringValue projectParam) { if (projectParam == null || projectParam.isEmpty()) { return Optional.empty(); } try { return Optional.of(projectService.getProject(projectParam.toLong())); } catch (NoResultException e) { return Optional.empty(); } } }
private Project getProjectFromParameters(StringValue projectParam) { Project project = null; if (projectParam != null && !projectParam.isEmpty()) { long projectId = projectParam.toLong(); project = projectService.getProject(projectId); } return project; }
private String getSearchTerm(PageParameters params) { StringValue value = params.get(SEARCH_TERM); if(value.isEmpty()) return null; return value.toString(); }
private String getSearchScope(PageParameters params) { StringValue value = params.get(SCOPE); if(value.isEmpty()) return null; return value.toString(); }
private Project getProjectFromParameters(StringValue projectParam) { Project project = null; if (projectParam != null && !projectParam.isEmpty()) { long projectId = projectParam.toLong(); project = projectService.getProject(projectId); } return project; }
private Project getProjectFromParameters(StringValue projectParam) { Project project = null; if (projectParam != null && !projectParam.isEmpty()) { long projectId = projectParam.toLong(); project = projectService.getProject(projectId); } return project; }
private void addContent(StringValue entryKey) { String id = "content"; if (entryKey == null || entryKey.isEmpty()) { form.add(new WebMarkupContainer(id)); } else { adminEntries.stream().filter(i -> entryKey.toString().equals(i.getKey())).findFirst().ifPresent(i -> { form.add(i.makePanel(id)); }); } }
@Override public Url encodePageParameters(PageParameters pageParameters) { StringValue sv = pageParameters.get(PAGE_IDENTITY); if(!sv.isEmpty()) { pageParameters.remove(PAGE_IDENTITY); } Url ret = super.encodePageParameters(pageParameters); if(!sv.isEmpty()) { pageParameters.add(PAGE_IDENTITY, sv.toString()); } return ret; }
private void addContent(StringValue entryKey) { String id = "content"; if (entryKey == null || entryKey.isEmpty()) { form.add(new WebMarkupContainer(id)); } else { adminEntries.stream().filter(i -> entryKey.toString().equals(i.getKey())).findFirst().ifPresent(i -> { form.add(i.makePanel(id)); }); } }
private void addContent(StringValue entryKey) { String id = "content"; if (entryKey == null || entryKey.isEmpty()) { form.add(new WebMarkupContainer(id)); } else { adminEntries.stream().filter(i -> entryKey.toString().equals(i.getKey())).findFirst().ifPresent(i -> { form.add(i.makePanel(id)); }); } }
public class UserProfilePage extends WebPage { public UserProfilePage(PageParameters pageParameters) { super(pageParameters); StringValue nick = pageParameters.get("nick"); StringValue action = pageParameters.get("action"); // any code String nickName = nick.toString(); boolean defaultAction = action.isEmpty(); // default action } }
private SourceDocument getDocumentFromParameters(Project aProject, StringValue documentParam) { SourceDocument document = null; if (documentParam != null && !documentParam.isEmpty()) { long documentId = documentParam.toLong(); document = documentService.getSourceDocument(aProject.getId(), documentId); } return document; }
@Override protected IModel<String> createModel(PageParameters params) { StringValue value = params.get("uri"); if(value.isEmpty()) return null; return Model.of(value.toString()); }
private SourceDocument getDocumentFromParameters(Project aProject, StringValue documentParam) { SourceDocument document = null; if (documentParam != null && !documentParam.isEmpty()) { long documentId = documentParam.toLong(); document = documentService.getSourceDocument(aProject.getId(), documentId); } return document; }
private SourceDocument getDocumentFromParameters(Project aProject, StringValue documentParam) { SourceDocument document = null; if (documentParam != null && !documentParam.isEmpty()) { long documentId = documentParam.toLong(); document = documentService.getSourceDocument(aProject.getId(), documentId); } return document; }
private void resolveMenuPath() { StringValue pathStringValue = getPageParameters().get("path"); if (pathStringValue.isNull() || pathStringValue.isEmpty()) { menuPath = ""; } else { StringBuilder path = new StringBuilder(pathStringValue.toString()); for (int i = 0; i < getPageParameters().getIndexedCount(); i++) { path.append('/').append(getPageParameters().get(i)); } menuPath = path.toString(); } }
public EmployeeConfigurationPage(PageParameters parameters) { super(parameters, "plugins.eed.config"); if (parameters != null && parameters.get(PARAMETER_KEY_ID).isEmpty() == true) { parameters.add(PARAMETER_KEY_ID, employeeConfigurationService.getSingleEmployeeConfigurationDOId()); } init(); }
@Override protected void onSignInSucceeded() { StringValue destination = getPage().getPageParameters().get("target"); if(!destination.isEmpty()) { throw new RedirectToUrlException(destination.toString()); } super.onSignInSucceeded(); } }