public static SortCriterion[] valueOf(String s) { if (s == null || s.length() == 0) return new SortCriterion[0]; List<SortCriterion> list = new ArrayList<>(); String[] criteria = s.split(","); for (String criterion : criteria) { list.add(new SortCriterion(criterion.trim())); } return list.toArray(new SortCriterion[list.size()]); }
public static String toString(SortCriterion[] criteria) { if (criteria == null) return ""; StringBuilder sb = new StringBuilder(); for (SortCriterion sortCriterion : criteria) { sb.append(sortCriterion.toString()).append(","); } if (sb.toString().endsWith(",")) sb.deleteCharAt(sb.length()-1); return sb.toString(); }
if ( "dc:title".equalsIgnoreCase( sort.getPropertyName() ) ) if ( sort.isAscending() )
orderByCriteria = SortCriterion.valueOf(orderBy); } catch (Exception ex) { throw new ContentDirectoryException(ContentDirectoryErrorCode.UNSUPPORTED_SORT_CRITERIA, ex.toString()); orderByCriteria = SortCriterion.valueOf(orderBy); } catch (Exception ex) { throw new ContentDirectoryException(ContentDirectoryErrorCode.UNSUPPORTED_SORT_CRITERIA, ex.toString());
if ( "dc:title".equalsIgnoreCase( sort.getPropertyName() ) ) else if ( "dc:date".equalsIgnoreCase( sort.getPropertyName() ) ) if ( sort.isAscending() )
orderByCriteria = SortCriterion.valueOf(orderBy); } catch (Exception ex) { throw new ContentDirectoryException(ContentDirectoryErrorCode.UNSUPPORTED_SORT_CRITERIA, ex.toString()); orderByCriteria = SortCriterion.valueOf(orderBy); } catch (Exception ex) { throw new ContentDirectoryException(ContentDirectoryErrorCode.UNSUPPORTED_SORT_CRITERIA, ex.toString());
public ContentBrowseActionCallback(Service service, DefaultTreeModel treeModel, DefaultMutableTreeNode treeNode) { super(service, ((Container) treeNode.getUserObject()).getId(), BrowseFlag.DIRECT_CHILDREN, "*", 0, null, new SortCriterion(true, "dc:title")); this.treeModel = treeModel; this.treeNode = treeNode; }
/** * @param maxResults Can be <code>null</code>, then {@link #getDefaultMaxResults()} is used. */ public Search(Service service, String containerId, String searchCriteria, String filter, long firstResult, Long maxResults, SortCriterion... orderBy) { super(new ActionInvocation(service.getAction("Search"))); log.fine("Creating browse action for container ID: " + containerId); getActionInvocation().setInput("ContainerID", containerId); getActionInvocation().setInput("SearchCriteria", searchCriteria); getActionInvocation().setInput("Filter", filter); getActionInvocation().setInput("StartingIndex", new UnsignedIntegerFourBytes(firstResult)); getActionInvocation().setInput( "RequestedCount", new UnsignedIntegerFourBytes(maxResults == null ? getDefaultMaxResults() : maxResults) ); getActionInvocation().setInput("SortCriteria", SortCriterion.toString(orderBy)); }
if ( "dc:title".equalsIgnoreCase( sort.getPropertyName() ) ) if ( sort.isAscending() )
orderByCriteria = SortCriterion.valueOf(orderBy); } catch (Exception ex) { throw new ContentDirectoryException(ContentDirectoryErrorCode.UNSUPPORTED_SORT_CRITERIA, ex.toString()); orderByCriteria = SortCriterion.valueOf(orderBy); } catch (Exception ex) { throw new ContentDirectoryException(ContentDirectoryErrorCode.UNSUPPORTED_SORT_CRITERIA, ex.toString());
public static SortCriterion[] valueOf(String s) { if (s == null || s.length() == 0) return new SortCriterion[0]; List<SortCriterion> list = new ArrayList(); String[] criteria = s.split(","); for (String criterion : criteria) { list.add(new SortCriterion(criterion.trim())); } return list.toArray(new SortCriterion[list.size()]); }
/** * @param maxResults Can be <code>null</code>, then {@link #getDefaultMaxResults()} is used. */ public Browse(Service service, String objectID, BrowseFlag flag, String filter, long firstResult, Long maxResults, SortCriterion... orderBy) { super(new ActionInvocation(service.getAction("Browse"))); log.fine("Creating browse action for object ID: " + objectID); getActionInvocation().setInput("ObjectID", objectID); getActionInvocation().setInput("BrowseFlag", flag.toString()); getActionInvocation().setInput("Filter", filter); getActionInvocation().setInput("StartingIndex", new UnsignedIntegerFourBytes(firstResult)); getActionInvocation().setInput("RequestedCount", new UnsignedIntegerFourBytes(maxResults == null ? getDefaultMaxResults() : maxResults) ); getActionInvocation().setInput("SortCriteria", SortCriterion.toString(orderBy)); }
if ( "dc:title".equalsIgnoreCase( sort.getPropertyName() ) ) else if ( "dc:date".equalsIgnoreCase( sort.getPropertyName() ) ) if ( sort.isAscending() )
public ContentBrowseActionCallback(Service service, String id, OnReceiveListener listener) { super(service, id, BrowseFlag.DIRECT_CHILDREN, "*", 0, null, new SortCriterion(true, "dc:title")); this.service = service; this.onReceiveListener = listener; }
public static String toString(SortCriterion[] criteria) { if (criteria == null) return ""; StringBuilder sb = new StringBuilder(); for (SortCriterion sortCriterion : criteria) { sb.append(sortCriterion.toString()).append(","); } if (sb.toString().endsWith(",")) sb.deleteCharAt(sb.length()-1); return sb.toString(); }
if ( "dc:title".equalsIgnoreCase( sort.getPropertyName() ) ) else if ( "dc:date".equalsIgnoreCase( sort.getPropertyName() ) ) if ( sort.isAscending() )
public static SortCriterion[] valueOf(String s) { if (s == null || s.length() == 0) return new SortCriterion[0]; List<SortCriterion> list = new ArrayList<>(); String[] criteria = s.split(","); for (String criterion : criteria) { list.add(new SortCriterion(criterion.trim())); } return list.toArray(new SortCriterion[list.size()]); }
/** * @param maxResults Can be <code>null</code>, then {@link #getDefaultMaxResults()} is used. */ public Search(Service service, String containerId, String searchCriteria, String filter, long firstResult, Long maxResults, SortCriterion... orderBy) { super(new ActionInvocation(service.getAction("Search"))); log.fine("Creating browse action for container ID: " + containerId); getActionInvocation().setInput("ContainerID", containerId); getActionInvocation().setInput("SearchCriteria", searchCriteria); getActionInvocation().setInput("Filter", filter); getActionInvocation().setInput("StartingIndex", new UnsignedIntegerFourBytes(firstResult)); getActionInvocation().setInput( "RequestedCount", new UnsignedIntegerFourBytes(maxResults == null ? getDefaultMaxResults() : maxResults) ); getActionInvocation().setInput("SortCriteria", SortCriterion.toString(orderBy)); }
public ContentBrowseActionCallback(Service service, Container container, OnReceiveListener listener) { super(service, container.getId(), BrowseFlag.DIRECT_CHILDREN, "*", 0, null, new SortCriterion(true, "dc:title")); this.service = service; this.onReceiveListener = listener; }
/** * @param maxResults Can be <code>null</code>, then {@link #getDefaultMaxResults()} is used. */ public Browse(Service service, String objectID, BrowseFlag flag, String filter, long firstResult, Long maxResults, SortCriterion... orderBy) { super(new ActionInvocation(service.getAction("Browse"))); log.fine("Creating browse action for object ID: " + objectID); getActionInvocation().setInput("ObjectID", objectID); getActionInvocation().setInput("BrowseFlag", flag.toString()); getActionInvocation().setInput("Filter", filter); getActionInvocation().setInput("StartingIndex", new UnsignedIntegerFourBytes(firstResult)); getActionInvocation().setInput("RequestedCount", new UnsignedIntegerFourBytes(maxResults == null ? getDefaultMaxResults() : maxResults) ); getActionInvocation().setInput("SortCriteria", SortCriterion.toString(orderBy)); }