001    /*
002     * Licensed to the Apache Software Foundation (ASF) under one
003     * or more contributor license agreements.  See the NOTICE file
004     * distributed with this work for additional information
005     * regarding copyright ownership.  The ASF licenses this file
006     * to you under the Apache License, Version 2.0 (the
007     * "License"); you may not use this file except in compliance
008     * with the License.  You may obtain a copy of the License at
009     *
010     *   http://www.apache.org/licenses/LICENSE-2.0
011     *
012     * Unless required by applicable law or agreed to in writing,
013     * software distributed under the License is distributed on an
014     * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015     * KIND, either express or implied.  See the License for the
016     * specific language governing permissions and limitations
017     * under the License.
018     */
019    
020    package org.apache.myfaces.tobago.taglib.component;
021    
022    import org.apache.myfaces.tobago.apt.annotation.BodyContent;
023    import org.apache.myfaces.tobago.apt.annotation.Tag;
024    import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
025    import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
026    import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
027    import org.apache.myfaces.tobago.component.UIMessages;
028    import org.apache.myfaces.tobago.taglib.decl.HasFor;
029    import org.apache.myfaces.tobago.taglib.decl.HasIdBindingAndRendered;
030    
031    /*
032     * Date: 02.04.2006
033     * Time: 15:53:45
034     */
035    
036    /**
037     * Renders error/validation messages.
038     */
039    @Tag(name = "messages", bodyContent = BodyContent.EMPTY)
040    @UIComponentTag(
041        uiComponent = "org.apache.myfaces.tobago.component.UIMessages",
042        rendererType = "Messages")
043    
044    public interface MessagesTagDeclaration extends TobagoTagDeclaration, HasIdBindingAndRendered, HasFor {
045    
046      /**
047       * Flag indicating that only messages that are not associated to any
048       * particular UIComponent should be displayed. That are messages without clientId.
049       */
050      @TagAttribute
051      @UIComponentTagAttribute(defaultValue = "false")
052      void setGlobalOnly(String globalOnly);
053    
054      /**
055       * Flag indicating whether the detail should be included
056       */
057      @TagAttribute
058      @UIComponentTagAttribute(type = "java.lang.Boolean", defaultValue = "false")
059      void setShowDetail(String showDetail);
060    
061      /**
062       * Flag indicating whether the summary should be included
063       */
064      @TagAttribute
065      @UIComponentTagAttribute(type = "java.lang.Boolean", defaultValue = "true")
066      void setShowSummary(String showSummary);
067    
068       /**
069       * Sets the mininum severity to be shown. E. g. "warn" shows only "warn", "error" and "fatal".
070       */
071      @TagAttribute
072      @UIComponentTagAttribute(type = "javax.faces.application.FacesMessage.Severity", defaultValue = "info")
073      void setMinSeverity(String minSeverity);
074    
075       /**
076       * Sets the maximum severity to be shown. E. g. "warn" shows only "warn" and "info".
077        * When setting this attribute you usually shoud take care, that you have a second message tag to show the
078        * higher severity levels.
079       */
080      @TagAttribute
081      @UIComponentTagAttribute(type = "javax.faces.application.FacesMessage.Severity", defaultValue = "fatal")
082      void setMaxSeverity(String maxSeverity);
083    
084       /**
085       * Sets the maximum number of messages to show.
086       */
087      @TagAttribute
088      @UIComponentTagAttribute(type = "java.lang.Integer", defaultValue = "2147483647")
089      void setMaxNumber(String maxNumber);
090    
091       /**
092       * Sets the order of the messages.
093       */
094      @TagAttribute
095      @UIComponentTagAttribute(
096              allowedValues = {
097                  UIMessages.OrderBy.OCCURRENCE_STRING, 
098                  UIMessages.OrderBy.SEVERITY_STRING, 
099                  UIMessages.OrderBy.OCCURENCE_STRING},
100              defaultValue = UIMessages.OrderBy.OCCURRENCE_STRING)
101      void setOrderBy(String orderBy);
102    
103      /**
104      * Should the user confirm the message explicitly.
105      */
106     @TagAttribute
107     @UIComponentTagAttribute(type = "java.lang.Boolean", defaultValue = "false")
108     void setConfirmation(String confirmation);
109    
110    }