Package org.apache.rave.portal.model

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


    }           
   
    // 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

   
    // 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

    }           
   
    // 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

   
    // 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

    }           
   
    // 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

        widgetTagService = new DefaultWidgetTagService(widgetTagRepository);
    }

    @Test
    public void getWidgetTag() {
        WidgetTag tag = new WidgetTag();
        tag.setEntityId(1L);
        expect(widgetTagRepository.get(1L)).andReturn(tag);
        replay(widgetTagRepository);

        assertEquals(tag, widgetTagService.getWidgetTag(1L));
        verify(widgetTagRepository);
View Full Code Here

    @Test
    public void saveWidgetTag() {
        try {

            WidgetTag wtag = new WidgetTag();
            wtag.setEntityId(3L);
            Tag tag = new Tag(4L, "test");
            wtag.setTag(tag);
            expect(widgetTagRepository.save(wtag)).andReturn(wtag);
            replay(widgetTagRepository);

            widgetTagService.saveWidgetTag(wtag);
            verify(widgetTagRepository);
View Full Code Here

TOP

Related Classes of org.apache.rave.portal.model.WidgetTag

Copyright © 2018 www.massapicom. 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.