Ignore:
Timestamp:
08/11/14 16:07:55 (10 years ago)
Author:
olhsha@mpi.nl
Message:

Added group service. Tested via the tomcat on loclahots (test URI and postman), old unit tests are adjusted and work well. Todo: retest on localhost tomcat, look at run-time exceptions, add new unit tests, adjust front-end

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/persistence/jpa/JpaComponentDao.java

    r4098 r5549  
    2525
    2626    @Query("select c from BaseDescription c where c.ispublic = true and c.deleted = false and c.componentId like ?1 order by upper(c.name) asc")
    27     List<BaseDescription> findPublicItems(String idPrefix);
     27    List<BaseDescription> findPublishedItems(String idPrefix);
    2828
    2929    @Query("select c from BaseDescription c where c.ispublic = false and c.deleted = true and c.dbUserId = ?1 order by upper(c.name), c.id")
     
    3333    List<BaseDescription> findPublicDeletedItems();
    3434   
     35    //compare @Query("select c from BaseDescription c where c.dbUserId = ?1 AND c.deleted = false AND c.ispublic = false AND c.componentId like ?2 order by upper(c.name), c.id")
    3536    @Query("select c from BaseDescription c where c.dbUserId = ?1 AND c.deleted = false AND c.ispublic = false AND c.componentId like ?2 AND not exists (select 1 from Ownership o where o.componentId = c.componentId) order by upper(c.name), c.id")
    3637    List<BaseDescription> findItemsForUserThatAreNotInGroups(Long userId, String idPrefix);
     
    4849    @Query("select c.componentId from BaseDescription c where c.deleted = false and c.componentId like ?1 order by c.id asc")
    4950    List<String> findNonDeletedItemIds(String componentIdPrefix);
     51   
     52    @Query("select c from BaseDescription c where c.deleted = false order by c.id asc")
     53    List<BaseDescription> findNonDeletedDescriptions();
    5054
     55    @Query("select c from BaseDescription c where c.dbUserId = ?1 AND c.deleted = false AND c.ispublic = false AND c.componentId like ?2 order by upper(c.name), c.id")
     56    List<BaseDescription> findNotPublishedUserItems(Long userId, String idPrefix);   
     57   
     58    @Query("select c.componentId from BaseDescription c where c.ispublic = ?1 AND c.componentId like ?2 AND exists (select o from Ownership o where o.componentId = c.componentId AND o.groupId = ?3)")
     59    List<String> findAllItemIdsInGroup(boolean isPublished, String idPrefix, long groupId);
    5160}
Note: See TracChangeset for help on using the changeset viewer.