Package com.sparc.knappsack.models

Examples of com.sparc.knappsack.models.ImageModel


        List<ApplicationModel> searchResults = new ArrayList<ApplicationModel>();
        try {
            searchResults = searchService.searchApplications(URLDecoder.decode(searchCriteria.toLowerCase(), "UTF-8"), user, userAgentInfo.getApplicationType());
            for (ApplicationModel applicationModel : searchResults) {
                ImageModel imageModel = applicationModel.getIcon();
                if (imageModel != null) {
                    imageModel.setUrl(WebRequest.getInstance().generateURL(imageModel.getUrl()));
                }
            }
        } catch (UnsupportedEncodingException e) {
            log.error("UnsupportedEncodingException caught performing a search with the following criteria: " + searchCriteria);
        }
View Full Code Here


        return "";
    }

    @Override
    public ImageModel createImageModel(AppFile appFile) {
        ImageModel imageModel = null;
        if (appFile != null) {
            imageModel = new ImageModel();
            imageModel.setId(appFile.getId());
            imageModel.setUrl(getImageUrl(appFile));
        }

        return imageModel;
    }
View Full Code Here

        appFileService.add(appFile);

        List<AppFile> appFiles = appFileService.getAll();
        assertTrue(appFiles.size() == 1);

        ImageModel imageModel = appFileService.createImageModel(appFile);
        assertNotNull(imageModel);
        assertTrue(imageModel.getUrl().equals("http://serverName/knappsack/image/" + appFile.getId()));
    }
View Full Code Here

TOP

Related Classes of com.sparc.knappsack.models.ImageModel

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.