Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id DFA60200D4B for ; Mon, 27 Nov 2017 10:58:55 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id DE02E160C13; Mon, 27 Nov 2017 09:58:55 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 2E6AC160C02 for ; Mon, 27 Nov 2017 10:58:55 +0100 (CET) Received: (qmail 69202 invoked by uid 500); 27 Nov 2017 09:58:54 -0000 Mailing-List: contact users-help@isis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@isis.apache.org Delivered-To: mailing list users@isis.apache.org Received: (qmail 69165 invoked by uid 99); 27 Nov 2017 09:58:54 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Nov 2017 09:58:54 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 4E85C1A11B9 for ; Mon, 27 Nov 2017 09:58:53 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.049 X-Spam-Level: * X-Spam-Status: No, score=1.049 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, HTML_MESSAGE=2, KAM_LINEPADDING=1.2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-2.8, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id OFDZSwLCC9OB for ; Mon, 27 Nov 2017 09:58:51 +0000 (UTC) Received: from mail-oi0-f47.google.com (mail-oi0-f47.google.com [209.85.218.47]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 326A95F244 for ; Mon, 27 Nov 2017 09:58:51 +0000 (UTC) Received: by mail-oi0-f47.google.com with SMTP id a75so18969493oib.1 for ; Mon, 27 Nov 2017 01:58:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=zfyprt7Wl0Lmtb535eKRHXgexwjmAdavElZOOEESJQU=; b=Ecc21rbP6c3YktUHc5WwrtHB/n4rTVzYG4gLEAD5CSrrmvyANwmvxGefrsSMWdvKvg rFqwUBubreRX4XeeyS+W/7ZTltix/xQLw9/61P1JyllRqrg249ufUvm4ApAHEa1vfffs vOFiVwReTottdFUlkFlc5SbZp3n6k+82oqga4XAnvo1EVyI36obms4L8FwZ/1AsUIiaY Y1MfHIzV9F4bMkICn1OaikH+uCxfePlc6cnY8RTqTg0J+Ey/HQCbyaSLxuisCatPMEU9 7Eoa3qiKmAe7wZ13cldlbGLcdotK/GDx5Y7qZNBhC2I7+9AFpyybaIDiY+rhkEIVjcJj IzMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=zfyprt7Wl0Lmtb535eKRHXgexwjmAdavElZOOEESJQU=; b=kzY6E7shN/6HjxBY2KKpBMoH1C9E4oWe3b8YItiWoF+zeo6gSsMGh1JzNVePGpBv9b 46sjIz9I531U0GaMXk+4Anfw97Vs7/P7tH5yPntq0DwRwJk4v8zWixc2p+xVk0uVng70 b+pGI9tZzJI6JBiEkBeI5rfG3vJcI1aGYXYgLPPJr6b/MjrtErN8+o2J7GyNWfzwTE3X lFcPgadsYg5QU1DeO5rI1xmmusdGUe+CR8Be3QljctmFbK7Aw+QtUbluaSPeLmHVNKBf 05PAeMJXyLp3+C6nm2Poa8eB3vPYg22yJ32dkoCkpeurdpDU7ahzRr9nDrEoKE4j/4CS 2oJQ== X-Gm-Message-State: AJaThX4G+jYutZ+cYOThqKZoSSMQYhkjjHac6RX/WE9Quom3WN75LgFQ xjsiHiJWpnsGEFOQR8ug37f/x8pgguiI/CtkYLN3Ag== X-Google-Smtp-Source: AGs4zMabYuYs1krii5C9wjjdyUbUfp4tScMwOgwlOloaf5Gq0FemhxKrL8jpscoVrkt8bn4BtVxxTEMvIcIFiFB5XVs= X-Received: by 10.202.230.18 with SMTP id d18mr15140975oih.61.1511776730420; Mon, 27 Nov 2017 01:58:50 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.47.105 with HTTP; Mon, 27 Nov 2017 01:58:49 -0800 (PST) In-Reply-To: References: From: SE Song Date: Mon, 27 Nov 2017 16:58:49 +0700 Message-ID: Subject: Re: Customize UI behavior To: users@isis.apache.org Content-Type: multipart/alternative; boundary="001a1141b72eff1c2e055ef3f228" archived-at: Mon, 27 Nov 2017 09:58:56 -0000 --001a1141b72eff1c2e055ef3f228 Content-Type: text/plain; charset="UTF-8" Andi Huber You're the person I'm looking for, You save my life finally. Thank you so much, I will follow your guide On Mon, Nov 27, 2017 at 3:18 PM, Andi Huber wrote: > I'd like to share my experience with customized UI, ZK and Isis: > > We had to develop a simple questionnaire form, but we did not see an > easy way of implementing it in Isis such that it would not confuse the > arbitrary user, that has never seen Isis before. So we resorted to using > the ZK framework. > > * domain-war: web-archive where all the business logic domain objects > reside > * frontend-war: web-archive packaged with ZK that makes up the UI as > presented to the user > > On the domain side we define boundary classes like ... > > @DomainService(nature = NatureOfService.VIEW_REST_ONLY) > public class FormBoundary { > > @Inject private RepositoryService repository; > > @Action > public List listPersons(){ > return repository.allInstances(Person.class); > } > > ... > > } > > On the frontend side we access these boundaries with the jax-rs 2.x > client API. > > // home brew jax-rs client helper class, injected by JEE's CDI > @Inject private JaxRSManager jax; > > public List listPersons(){ > Response response = > > jax.request("services/domainapp.dom.boundary.FormBoundary/actions/ > listPersons/invoke") > .post(Entity.json("{}")); > > return jax.digestList(response, Person.class) > .onFailure(this::onError) > .getOrElseGet(cause->null); > } > > We then utilize ZK's facility of binding zul templates to java > controllers, as explained here [1]. > > Though I'm happy with the end-result (we can customize the look and feel > however we want to), there is no longer the benefit of automated UI > generation. You have to do every little piece by hand. This dramatically > increases development time, which needs to be considered especially on > larger projects. > > In retrospect, we could have saved some time by not separating domain > from frontend, but instead putting Isis and ZK on the same web-app and > access the boundary services from within ZK controllers directly via > > public class MyZKController { > > // wraps the request in a transaction > > public List listPersons(){ > > return IsisContext.getSessionFactory().doInSession(new > Callable>() { > @Override > public List call() { > > final FormBoundary formBoundary = > IsisContext.getSessionFactory() > .getServicesInjector().lookupService(FormBoundary.class); > > return formBoundary.listPersons(); > } > }); > > } > > } > > Note: FormBoundary is managed (life-cycled) by Isis and MyZKController > is managed by ZK (ultimatively a servlet). > > However, I'm curious, what path you will take finally. ^^ > > Regards, Andi. > > [1] http://books.zkoss.org/zk-mvvm-book/8.0/data_binding/index.html > > > > > > > > > > > --001a1141b72eff1c2e055ef3f228--