Package com.canoo.dolphin.core.comm

Examples of com.canoo.dolphin.core.comm.DataCommand


            public void handleCommand(Command command, List response) {
                for (int i = 0; i < 10; i++) {
                    String pmid = "First " + i;
                    Map data = new HashMap();
                    data.put(TEXT, pmid);
                    response.add(new DataCommand(data));
                }
            }
        });
        registry.register(SECOND_FILL_CMD, new CommandHandler() {
            public void handleCommand(Command command, List response) {
                for (int i = 0; i < 10; i++) {
                    String pmid = "Second " + i;
                    Map data = new HashMap();
                    data.put(TEXT, pmid);
                    response.add(new DataCommand(data));
                }
            }
        });

        registry.register(SEARCH_CMD, new CommandHandler() {
            public void handleCommand(Command command, List response) {
                PresentationModel searchCriteria = modelStore.findPresentationModelById(SEARCH_CRITERIA);
                if (searchCriteria == null) {
                    throw new IllegalStateException("No search criteria known on the server!");
                }
                Attribute attribute = searchCriteria.findAttributeByPropertyName(NAME);
                Object value = (attribute == null) ? null : attribute.getValue();
                String contactName = (value == null) ? "" : value.toString();

                for (int i = 0; i < 10; i++) {
                    String id = contactName + " contact " + i;
                    Map data = new HashMap();
                    data.put("id", id);
                    data.put(CONTACT_NAME, contactName);
                    data.put(CONTACT_DATE, new Date(i * 1000000000).toString());
                    response.add(new DataCommand(data));
                }
            }
        });
    }
View Full Code Here

TOP

Related Classes of com.canoo.dolphin.core.comm.DataCommand

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.