Examples of WidgetTag


Examples of org.apache.rave.model.WidgetTag

    JpaWidgetTagConverter jpaWidgetTagConverter;
   
    @Test
    public void convert_valid_widgetTaq(){
        JpaWidget widget = new JpaWidget(1L, "");
        WidgetTag widgetTag = new WidgetTagImpl(new JpaUser(1L).getId(), new Date(), new JpaTag(1L, "news").getId());
        JpaWidgetTag jpaWidgetTag = jpaWidgetTagConverter.convert(widgetTag, widget.getId());
        assertNotNull(jpaWidgetTag);
        assertEquals(widgetTag.getCreatedDate(), jpaWidgetTag.getCreatedDate());
        assertEquals(widgetTag.getTagId(), jpaWidgetTag.getTagId());
        assertEquals(widgetTag.getUserId(), jpaWidgetTag.getUserId());
        assertEquals(widget.getId(), jpaWidgetTag.getWidgetId());
    }
View Full Code Here

Examples of org.apache.rave.model.WidgetTag

    }

    @Test(expected = NullPointerException.class)
    @Rollback(true)
    public void save_null() {
        WidgetTag widgetTag = null;
        JpaWidgetTag jpaWidgetTag = (JpaWidgetTag)repository.saveWidgetTag("1", widgetTag);
        assertNull(jpaWidgetTag);
    }
View Full Code Here

Examples of org.apache.rave.model.WidgetTag

    @Test
    @Rollback(true)
    public void delete_valid(){
        String id = "1";
        WidgetTag widgetTag = repository.getTagById(id);
        assertNotNull(widgetTag);
        repository.deleteWidgetTag(widgetTag);
        assertNull(repository.getTagById(id));
    }
View Full Code Here

Examples of org.apache.rave.model.WidgetTag

    @Test(expected = NullPointerException.class)
    @Rollback(true)
    public void delete_invalid(){
        String id = "17827873261";
        WidgetTag widgetTag = repository.getTagById(id);
        assertNull(widgetTag);
        repository.deleteWidgetTag(widgetTag);
        assertNull(repository.get(id));
    }
View Full Code Here

Examples of org.apache.rave.portal.model.WidgetTag

   
    // checks to see if the Authentication object principal is the owner of the supplied WidgetTag object
    // if trustedDomainObject is false, pull the entity from the database first to ensure
    // the model object is trusted and hasn't been modified
    private boolean isWidgetTagOwner(Authentication authentication, WidgetTag widgetTag, List<WidgetTag> trustedWidgetTagContainer, boolean trustedDomainObject) {
        WidgetTag trustedWidgetTag = null;
        if (trustedDomainObject) {
            trustedWidgetTag = widgetTag;
        } else {
            trustedWidgetTag = getTrustedWidgetTag(widgetTag.getWidgetId(), widgetTag.getTag().getKeyword(), trustedWidgetTagContainer);
        }                 
       
        return isWidgetTagOwnerByUsername(authentication, trustedWidgetTag.getUser().getUsername());
    }           
View Full Code Here

Examples of org.apache.rave.portal.model.WidgetTag

    }           
   
    // returns a trusted WidgetTag object, either from the WidgetTagRepository, or the
    // cached container list
    private WidgetTag getTrustedWidgetTag(long widgetId, String tagKeyword, List<WidgetTag> trustedWidgetTagContainer) {
        WidgetTag p = null;
        if (trustedWidgetTagContainer.isEmpty()) {
            p = widgetTagRepository.getByWidgetIdAndTag(widgetId, tagKeyword);
            trustedWidgetTagContainer.add(p);
        } else {
            p = trustedWidgetTagContainer.get(0);
View Full Code Here

Examples of org.apache.rave.portal.model.WidgetTag

   
    // checks to see if the Authentication object principal is the owner of the supplied WidgetTag object
    // if trustedDomainObject is false, pull the entity from the database first to ensure
    // the model object is trusted and hasn't been modified
    private boolean isWidgetTagOwner(Authentication authentication, WidgetTag widgetTag, List<WidgetTag> trustedWidgetTagContainer, boolean trustedDomainObject) {
        WidgetTag trustedWidgetTag = null;
        if (trustedDomainObject) {
            trustedWidgetTag = widgetTag;
        } else {
            trustedWidgetTag = getTrustedWidgetTag(widgetTag.getWidgetId(), widgetTag.getTag().getKeyword(), trustedWidgetTagContainer);
        }                 
       
        return isWidgetTagOwnerByUsername(authentication, trustedWidgetTag.getUser().getUsername());
    }           
View Full Code Here

Examples of org.apache.rave.portal.model.WidgetTag

    }           
   
    // returns a trusted WidgetTag object, either from the WidgetTagRepository, or the
    // cached container list
    private WidgetTag getTrustedWidgetTag(long widgetId, String tagKeyword, List<WidgetTag> trustedWidgetTagContainer) {
        WidgetTag p = null;
        if (trustedWidgetTagContainer.isEmpty()) {
            p = widgetTagRepository.getByWidgetIdAndTag(widgetId, tagKeyword);
            trustedWidgetTagContainer.add(p);
        } else {
            p = trustedWidgetTagContainer.get(0);
View Full Code Here

Examples of org.apache.rave.portal.model.WidgetTag

   
    // checks to see if the Authentication object principal is the owner of the supplied WidgetTag object
    // if trustedDomainObject is false, pull the entity from the database first to ensure
    // the model object is trusted and hasn't been modified
    private boolean isWidgetTagOwner(Authentication authentication, WidgetTag widgetTag, List<WidgetTag> trustedWidgetTagContainer, boolean trustedDomainObject) {
        WidgetTag trustedWidgetTag = null;
        if (trustedDomainObject) {
            trustedWidgetTag = widgetTag;
        } else {
            trustedWidgetTag = getTrustedWidgetTag(widgetTag.getEntityId(), trustedWidgetTagContainer);
        }                 
       
        return isWidgetTagOwnerByUsername(authentication, trustedWidgetTag.getUser().getUsername());
    }           
View Full Code Here

Examples of org.apache.rave.portal.model.WidgetTag

    }           
   
    // returns a trusted WidgetTag object, either from the WidgetTagRepository, or the
    // cached container list
    private WidgetTag getTrustedWidgetTag(long widgetTagId, List<WidgetTag> trustedWidgetTagContainer) {
        WidgetTag p = null;
        if (trustedWidgetTagContainer.isEmpty()) {
            p = widgetTagRepository.get(widgetTagId);
            trustedWidgetTagContainer.add(p);
        } else {
            p = trustedWidgetTagContainer.get(0);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.