public void tagDataOrderedByName(Callback<TagData> callback) { query( callback, Query.select(TagData.PROPERTIES) .where(Criterion.and(TagData.DELETION_DATE.eq(0), TagData.NAME.isNotNull())) .orderBy(Order.asc(Functions.upper(TagData.NAME)))); }
private static void setShowFeaturedLists() { // Show featured lists if necessary boolean showFeaturedLists = false; TodorooCursor<TagData> featLists = PluginServices.getTagDataService() .query( Query.select(TagData.ID) .where(Functions.bitwiseAnd(TagData.FLAGS, TagData.FLAG_FEATURED).gt(0)) .limit(1)); try { showFeaturedLists = featLists.getCount() > 0; } finally { featLists.close(); } Preferences.setBoolean( FeaturedListFilterExposer.PREF_SHOULD_SHOW_FEATURED_LISTS, showFeaturedLists); }
/** @return tasks that are not hidden at current time */ public static Criterion isVisible() { return Task.HIDE_UNTIL.lt(Functions.now()); }
/** @return tasks that are due within the next 72 hours */ public static Criterion dueSoon() { return Criterion.and( TaskCriteria.activeAndVisible(), Task.DUE_DATE.gt(0), Task.DUE_DATE.lt(Functions.fromNow(3 * DateUtilities.ONE_DAY))); }
/** @return tasks that have not yet been completed or deleted */ public static Criterion activeAndVisible() { return Criterion.and( Task.COMPLETION_DATE.eq(0), Task.DELETION_DATE.eq(0), Task.HIDE_UNTIL.lt(Functions.now())); }
/** @return tasks completed before a given unixtime */ public static Criterion completed() { return Criterion.and(Task.COMPLETION_DATE.gt(0), Task.COMPLETION_DATE.lt(Functions.now())); }
/** @return tasks that are due after a certain unixtime */ public static Criterion dueAfterNow() { return Task.DUE_DATE.gt(Functions.now()); }
/** @return tasks that are due before a certain unixtime */ public static Criterion dueBeforeNow() { return Criterion.and(Task.DUE_DATE.gt(0), Task.DUE_DATE.lt(Functions.now())); }
/** @return tasks that are hidden at the current time */ public static Criterion isHidden() { return Task.HIDE_UNTIL.gt(Functions.now()); }