Package org.apache.click.service

Examples of org.apache.click.service.LogService


        packageName = StringUtils.replaceChars(packageName, '.', '/');
        packageName = "/" + packageName;
        String controlName = ClassUtils.getShortClassName(controlClass);

        ConfigService configService = getConfigService(servletContext);
        LogService logService = configService.getLogService();
        String descriptorFile = packageName + "/" + controlName + ".files";
        logService.debug("Use deployment descriptor file:" + descriptorFile);

        try {
            InputStream is = getResourceAsStream(descriptorFile, ClickUtils.class);
            List fileList = IOUtils.readLines(is);
            if (fileList == null || fileList.isEmpty()) {
                logService.info("there are no files to deploy for control " + controlClass.getName());
                return;
            }

            // a target dir list is required cause the ClickUtils.deployFile() is too inflexible to autodetect
            // required subdirectories.
            List<String> targetDirList = new ArrayList<String>(fileList.size());
            for (int i = 0; i < fileList.size(); i++) {
                String filePath = (String) fileList.get(i);
                String destination = "";
                int index = filePath.lastIndexOf('/');
                if (index != -1) {
                    destination = filePath.substring(0, index + 1);
                }
                targetDirList.add(i, targetDir + "/" + destination);
                fileList.set(i, packageName + "/" + filePath);
            }

            for (int i = 0; i < fileList.size(); i++) {
                String source = (String) fileList.get(i);
                String targetDirName = targetDirList.get(i);
                ClickUtils.deployFile(servletContext, source, targetDirName);
            }

        } catch (IOException e) {
            String msg = "error occurred getting resource " + descriptorFile + ", error " + e;
            logService.warn(msg);
        }
    }
View Full Code Here


     */
    public static LogService getLogService() {
        Context context = Context.getThreadLocalContext();
        ServletContext servletContext = context.getServletContext();
        ConfigService configService = getConfigService(servletContext);
        LogService logService = configService.getLogService();
        return logService;
    }
View Full Code Here

TOP

Related Classes of org.apache.click.service.LogService

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.