Package com.philip.journal.home.service.util

Examples of com.philip.journal.home.service.util.BeanToMapConverter


    public void execute() throws ServletException, IOException {

        final long locEntryId = parseId(this.entryId);
        try {
            final Entry entry = getServiceProxy().getEntryDetail(locEntryId);
            final BeanToMapConverter entryConverter = getResponseHandler().getConverterFactoryMap().get(
                    Constant.BeanConverter.ENTRY_TO_JSON);
            final Map<String, Object> converted = entryConverter.convert(entry);
            converted.put("branchId", "b-" + entry.getBranch().getBranchId());
            getResponseHandler().respondSuccess(getHttpServletResponse(), converted, DATA);
        } catch (final JournalException e) {
            getLogger().debug(e.getMessage(), e);
            getResponseHandler().respondFail(getHttpServletResponse(), e.getMessage());
View Full Code Here


        final long branchId = parseId(node);
        try {
            final List<Branch> children = getServiceProxy().getChildren(branchId);
            final List<Entry> entries = getServiceProxy().getEntries(branchId);

            final BeanToMapConverter branchConverter = getResponseHandler().getConverterFactoryMap().get(
                    Constant.BeanConverter.BRANCH_TO_JSON);
            final BeanToMapConverter entryConverter = getResponseHandler().getConverterFactoryMap().get(
                    Constant.BeanConverter.ENTRY_TO_JSONNODE);

            final List<Map<String, Object>> convertedBranches = branchConverter.convert(children);
            final List<Map<String, Object>> convertedEntries = entryConverter.convert(entries);

            final List<Map<String, Object>> converted = new ArrayList<Map<String, Object>>();
            converted.addAll(convertedBranches);
            converted.addAll(convertedEntries);
            patchId(converted);
View Full Code Here

        try {

            final String nodeId = getHttpServletRequest().getParameter(NODE_ID);
            if ("b-0".equals(nodeId)) {
                final List<Map<String, Object>> preferences = getServiceProxy().getPreferences();
                final BeanToMapConverter mapConverter = getResponseHandler().getConverterFactoryMap().get(
                        Constant.BeanConverter.CFGITEM_TO_JSON);
                for (final Map<String, Object> map : preferences) {
                    map.put("leaf", true);
                }
                getResponseHandler().respondList(getHttpServletResponse(), preferences, mapConverter);
View Full Code Here

TOP

Related Classes of com.philip.journal.home.service.util.BeanToMapConverter

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.