/** * Returns all document templates for the specified {@link DocumentType} and exact application tenancy, ordered by date (desc). */ @Programmatic public List<DocumentTemplate> findByTypeAndAtPath(final DocumentType documentType, final String atPath) { return repositoryService.allMatches( new QueryDefault<>(DocumentTemplate.class, "findByTypeAndAtPath", "type", documentType, "atPath", atPath)); }
/** * Returns all templates for a type, ordered by application tenancy and date desc. */ @Programmatic public List<DocumentTemplate> findByType(final DocumentType documentType) { return repositoryService.allMatches( new QueryDefault<>(DocumentTemplate.class, "findByType", "type", documentType)); }
@Programmatic @SuppressWarnings({ "unchecked", "rawtypes" }) public List<UserSetting> listAll() { return (List)repositoryService.allMatches( new QueryDefault<>(UserSettingJdo.class, "findAll")); }
@Programmatic public List<Paperclip> findByDocument(final DocumentAbstract document) { return repositoryService.allMatches( new QueryDefault<>(Paperclip.class, "findByDocument", "document", document)); } //endregion
@Programmatic public List<Paperclip> findByDocument(final DocumentAbstract document) { return repositoryService.allMatches( new QueryDefault<>(Paperclip.class, "findByDocument", "document", document)); } //endregion
@Programmatic @SuppressWarnings({ "unchecked", "rawtypes" }) public List<UserSetting> listAllFor( final String user) { return (List)repositoryService.allMatches( new QueryDefault<>(UserSettingJdo.class, "findByUser", "user", user)); }
/** * Returns all document templates, ordered by most specific to provided application tenancy first, and then by date (desc). */ public List<DocumentTemplate> findByApplicableToAtPath(final String atPath) { final List<DocumentTemplate> templates = repositoryService.allMatches( new QueryDefault<>(DocumentTemplate.class, "findByApplicableToAtPath", "atPath", atPath)); removeTemplatesWithSameDocumentType(templates); return templates; }
/** * Returns all document templates for the specified {@link DocumentType} and exact application tenancy, ordered by date (desc). */ @Programmatic public List<DocumentTemplate> findByTypeAndAtPath(final DocumentType documentType, final String atPath) { return repositoryService.allMatches( new QueryDefault<>(DocumentTemplate.class, "findByTypeAndAtPath", "type", documentType, "atPath", atPath)); }
/** * Returns all document templates, ordered by most specific to provided application tenancy first, and then by date (desc). */ public List<DocumentTemplate> findByApplicableToAtPath(final String atPath) { final List<DocumentTemplate> templates = repositoryService.allMatches( new QueryDefault<>(DocumentTemplate.class, "findByApplicableToAtPath", "atPath", atPath)); removeTemplatesWithSameDocumentType(templates); return templates; }
@Programmatic @SuppressWarnings({ "rawtypes", "unchecked" }) public List<ApplicationSetting> listAll() { return (List)repositoryService.allMatches( new QueryDefault<>(ApplicationSettingJdo.class, "findAll")); } //endregion
/** * Returns all document templates for the specified {@link DocumentType}, ordered by type, then most specific to * provided application tenancy, and then by date (desc). */ @Programmatic public List<DocumentTemplate> findByTypeAndApplicableToAtPath(final DocumentType documentType, final String atPath) { return repositoryService.allMatches( new QueryDefault<>(DocumentTemplate.class, "findByTypeAndApplicableToAtPath", "type", documentType, "atPath", atPath)); }
/** * Returns all document templates for the specified {@link DocumentType}, ordered by type, then most specific to * provided application tenancy, and then by date (desc). */ @Programmatic public List<DocumentTemplate> findByTypeAndApplicableToAtPath(final DocumentType documentType, final String atPath) { return repositoryService.allMatches( new QueryDefault<>(DocumentTemplate.class, "findByTypeAndApplicableToAtPath", "type", documentType, "atPath", atPath)); }
/** * Returns all templates for a type, ordered by application tenancy and date desc. */ @Programmatic public List<DocumentTemplate> findByType(final DocumentType documentType) { return repositoryService.allMatches( new QueryDefault<>(DocumentTemplate.class, "findByType", "type", documentType)); }
@Programmatic public List<Document> findWithNoPaperclips() { return repositoryService.allMatches(new QueryDefault<>(Document.class, "findWithNoPaperclips")); }
@Programmatic public List<Document> findWithNoPaperclips() { return repositoryService.allMatches(new QueryDefault<>(Document.class, "findWithNoPaperclips")); }
/** * Returns all templates available for a particular application tenancy, ordered by most specific tenancy first and * then within that the most recent first. */ @Programmatic public List<DocumentTemplate> findByApplicableToAtPathAndCurrent(final String atPath) { final LocalDate now = clockService.now(); return repositoryService.allMatches( new QueryDefault<>(DocumentTemplate.class, "findByApplicableToAtPathAndCurrent", "atPath", atPath, "now", now)); } //endregion
/** * Returns all templates available for a particular application tenancy, ordered by most specific tenancy first and * then within that the most recent first. */ @Programmatic public List<DocumentTemplate> findByApplicableToAtPathAndCurrent(final String atPath) { final LocalDate now = clockService.now(); return repositoryService.allMatches( new QueryDefault<>(DocumentTemplate.class, "findByApplicableToAtPathAndCurrent", "atPath", atPath, "now", now)); } //endregion
/** * As {@link #findByTypeAndApplicableToAtPath(DocumentType, String)}, but excludes any templates in the future. Those returned * are ordered by most specific application tenancy first, and then by most recent first; so the first template returned * is usually the one to be used. */ @Programmatic public List<DocumentTemplate> findByTypeAndApplicableToAtPathAndCurrent(final DocumentType documentType, final String atPath) { final LocalDate now = clockService.now(); return repositoryService.allMatches( new QueryDefault<>(DocumentTemplate.class, "findByTypeAndApplicableToAtPathAndCurrent", "type", documentType, "atPath", atPath, "now", now)); }
/** * As {@link #findByTypeAndApplicableToAtPath(DocumentType, String)}, but excludes any templates in the future. Those returned * are ordered by most specific application tenancy first, and then by most recent first; so the first template returned * is usually the one to be used. */ @Programmatic public List<DocumentTemplate> findByTypeAndApplicableToAtPathAndCurrent(final DocumentType documentType, final String atPath) { final LocalDate now = clockService.now(); return repositoryService.allMatches( new QueryDefault<>(DocumentTemplate.class, "findByTypeAndApplicableToAtPathAndCurrent", "type", documentType, "atPath", atPath, "now", now)); }
@Programmatic public List<Paperclip> findByAttachedTo(final Object attachedTo) { if(attachedTo == null) { return null; } final Bookmark bookmark = bookmarkService.bookmarkFor(attachedTo); if(bookmark == null) { return null; } final String attachedToStr = bookmark.toString(); return repositoryService.allMatches( new QueryDefault<>(Paperclip.class, "findByAttachedTo", "attachedToStr", attachedToStr)); } //endregion