Return-Path: X-Original-To: apmail-incubator-deltaspike-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-deltaspike-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 71262D993 for ; Fri, 5 Oct 2012 19:18:49 +0000 (UTC) Received: (qmail 92474 invoked by uid 500); 5 Oct 2012 19:18:49 -0000 Delivered-To: apmail-incubator-deltaspike-dev-archive@incubator.apache.org Received: (qmail 92438 invoked by uid 500); 5 Oct 2012 19:18:49 -0000 Mailing-List: contact deltaspike-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: deltaspike-dev@incubator.apache.org Delivered-To: mailing list deltaspike-dev@incubator.apache.org Received: (qmail 92430 invoked by uid 99); 5 Oct 2012 19:18:49 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Oct 2012 19:18:49 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of gerhard.petracek@gmail.com designates 209.85.223.175 as permitted sender) Received: from [209.85.223.175] (HELO mail-ie0-f175.google.com) (209.85.223.175) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Oct 2012 19:18:43 +0000 Received: by mail-ie0-f175.google.com with SMTP id c13so4936806ieb.6 for ; Fri, 05 Oct 2012 12:18:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=73BNi+GraGHrSLzU+pArqRNrwL71sjV6jBzxott2Yxk=; b=X39/BV33XSHvlLRLiXdhUqnJ4hvcqy9bXel5WE7fpBfoNCXklRWU3OdJOdx7QFnoP8 VfPAtkAVTCwe5hXTbyQYcr0B4HkXCNwjFQlhLGjYZkUfXYLKFmCa6g9/Rqr79i9oqhgh p5ITGY3KsDZOBC4t/d+2JI+6htHT7CtkkA5/RI5CQ61SZpHlkGE9DRpHZy3o7oj5PYu2 nq5e2EzbNtsUeMXleSjxr5Pv4UvyKnIk9F2lZ4ezbYl3Wxul2n3FRZ/LEu1xFhUoHt9h Z2SpLgWSuIvbEGUiM2KFQRiZKUPYtJDJT8MbrO5luTMOt5qY0IbndY42/KyWeQmwdfmL rNOA== Received: by 10.50.53.170 with SMTP id c10mr2136903igp.45.1349464702239; Fri, 05 Oct 2012 12:18:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.43.133.69 with HTTP; Fri, 5 Oct 2012 12:18:02 -0700 (PDT) In-Reply-To: References: <1349457868.27068.YahooMailNeo@web28902.mail.ir2.yahoo.com> From: Gerhard Petracek Date: Fri, 5 Oct 2012 21:18:02 +0200 Message-ID: Subject: Re: proposal for JSF Messages To: deltaspike-dev@incubator.apache.org Content-Type: multipart/alternative; boundary=f46d042f9d6636c37a04cb54bcc9 --f46d042f9d6636c37a04cb54bcc9 Content-Type: text/plain; charset=ISO-8859-1 hi jason, that's for sure just a first idea. e.g. we also need the possibility to add messages for a specific component. regards, gerhard 2012/10/5 Jason Porter > On Fri, Oct 5, 2012 at 11:24 AM, Mark Struberg wrote: > > > Hi folks! > > > > I thought quite some time about how we could do the typesafe messging for > > JSF. Today I had the following idea. > > > > > > Imagine a typesafe message > > > > @MessageBundle > > public interface SimpleMessage > > { > > @MessageTemplate("Welcome to %s") > > Message welcomeTo(String name); > > } > > > > This is nice but it's hard to use it for creating FacesMessages that way. > > > > Now imagine the following > > > > @Inject > > JsfMessage message; > > > > ... > > > > message.addInfo().welcomeTo("DeltaSpike); > > > > > > > > public interface JsfMessage { > > T addInfo(); > > T addWarning(); > > T addError(); > > void clear(); > > } > > > > > > I think it is possible to implement this, right? > > > > Wdyt from a users perspective? > > > > LieGrue, > > strub > > > > > This looks like a great start. In IRC we discovered we need to determine if > the text goes to the summary or detail. We already have the severity with > the methods. I'd suggest having each of those methods take an enum (DETAIL, > SUMMARY, BOTH or similar). One drawback I see about this is you can't > define a different message for the detail and the summary on one line, but > that may not be the end of the world. > > -- > Jason Porter > http://lightguard-jp.blogspot.com > http://twitter.com/lightguardjp > > Software Engineer > Open Source Advocate > Author of Seam Catch - Next Generation Java Exception Handling > > PGP key id: 926CCFF5 > PGP key available at: keyserver.net, pgp.mit.edu > --f46d042f9d6636c37a04cb54bcc9--