Changeset 19475

Show
Ignore:
Timestamp:
05/27/07 12:33:53 (1 year ago)
Author:
sfermigier
Message:

Cosmit.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-ui-web/src/main/java/org/nuxeo/ecm/platform/ui/web/auth/CachableUserIdentificationInfo.java

    r19472 r19475  
    4040 
    4141    public CachableUserIdentificationInfo(String userName, String password) { 
    42         this.userInfo = new UserIdentificationInfo(userName,password); 
     42        this.userInfo = new UserIdentificationInfo(userName, password); 
    4343        alreadyAuthenticated = false; 
    4444    } 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-ui-web/src/main/java/org/nuxeo/ecm/platform/ui/web/auth/JBossUserIdentificationInfoCallbackHandler.java

    r19472 r19475  
    2323 
    2424import javax.security.auth.callback.Callback; 
    25 import javax.security.auth.callback.NameCallback; 
    26 import javax.security.auth.callback.PasswordCallback; 
    2725import javax.security.auth.callback.UnsupportedCallbackException; 
    2826 
     
    3533        UserIdentificationInfoCallbackHandler { 
    3634 
    37     public JBossUserIdentificationInfoCallbackHandler(UserIdentificationInfo userIdent) 
    38    
     35    public JBossUserIdentificationInfoCallbackHandler( 
     36            UserIdentificationInfo userIdent)
    3937        super(userIdent); 
    4038    } 
    4139 
     40    @Override 
    4241    public void handle(Callback[] callbacks) throws IOException, 
    43     UnsupportedCallbackException { 
     42            UnsupportedCallbackException { 
    4443 
    4544        for (Callback c : callbacks) { 
     
    4746                ObjectCallback oc = (ObjectCallback) c; 
    4847                oc.setCredential(userIdent); 
    49             } 
    50             else if (c instanceof SecurityAssociationCallback){ 
     48            } else if (c instanceof SecurityAssociationCallback) { 
    5149                SecurityAssociationCallback sac = (SecurityAssociationCallback) c; 
    5250                sac.setPrincipal(null); 
    5351                sac.setCredential(userIdent); 
    54             } 
    55             else 
     52            } else { 
    5653                super.handle(callbacks); 
    5754            } 
     55        } 
    5856    } 
     57 
    5958} 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-ui-web/src/main/java/org/nuxeo/ecm/platform/ui/web/auth/NuxeoAuthenticationFilter.java

    r19472 r19475  
    6161    protected static final String LOGIN_DOMAIN = "nuxeo-ecm"; 
    6262 
    63     protected static final String START_PAGE_SAVE_KEY ="Nuxeo5_Start_Page"; 
    64     protected static final String DEFAULT_START_PAGE="nxstartup.faces"; 
     63    protected static final String START_PAGE_SAVE_KEY = "Nuxeo5_Start_Page"; 
     64 
     65    protected static final String DEFAULT_START_PAGE = "nxstartup.faces"; 
    6566 
    6667    private static final Log log = LogFactory.getLog(NuxeoAuthenticationFilter.class); 
     
    6869    protected Boolean avoidReauthenticate = true; 
    6970 
    70     protected PluggableAuthenticationService service=null; 
    71  
    72     protected List<String> unAuthenticatedURLPrefix=null; 
     71    protected PluggableAuthenticationService service = null; 
     72 
     73    protected List<String> unAuthenticatedURLPrefix = null; 
    7374 
    7475    public void destroy() { 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-ui-web/src/main/java/org/nuxeo/ecm/platform/ui/web/auth/interfaces/NuxeoAuthenticationPlugin.java

    r19472 r19475  
    3232 
    3333    /** 
    34      * Handle the Login Prompt 
     34     * Handles the Login Prompt. 
     35     * 
    3536     * @param httpRequest the request 
    36      * @param httpResponse the respinse 
     37     * @param httpResponse the response 
    3738     * @return true if AuthFilter must stop execution (ie : login prompt generated a redirect), false otherwise 
    3839     */ 
     
    4041 
    4142    /** 
    42      * Retrie user indetification information from the request 
     43     * Retries user indentification information from the request. 
    4344     * 
    4445     * @param httpRequest 
     
    4647     * @return UserIdentificationInfo 
    4748     */ 
    48     UserIdentificationInfo handleRetrieveIdentity (HttpServletRequest httpRequest, HttpServletResponse httpResponse); 
     49    UserIdentificationInfo handleRetrieveIdentity( 
     50            HttpServletRequest httpRequest, HttpServletResponse httpResponse); 
    4951 
    5052    /** 
    51      * Define if the authentication plugin needs to do a login prompt 
     53     * Defines if the authentication plugin needs to do a login prompt. 
     54     * 
    5255     * @return true if LoginPrompt is used 
    5356     */ 
     
    5659 
    5760    /** 
    58      * Initialize the Plugin from parameters set in the XML descriptor 
     61     * Initializes the Plugin from parameters set in the XML descripto. 
     62     * r 
    5963     * @param parameters 
    6064     */ 
    61     void initPlugin(Map<String,String> parameters); 
     65    void initPlugin(Map<String, String> parameters); 
    6266 
    6367    /** 
    64      * returns the list of prefix for unauthenticated URLs 
    65      * Typically the URLs associated to login prompt 
     68     * Returns the list of prefix for unauthenticated URLs, 
     69     * typically the URLs associated to login prompt. 
    6670     * @return 
    6771     */ 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-ui-web/src/main/java/org/nuxeo/ecm/platform/ui/web/auth/service/AuthenticationChainDescriptor.java

    r19472 r19475  
    3232    private static final long serialVersionUID = 276543987313289764L; 
    3333 
    34     @XNodeList(value="plugins/plugin", type=ArrayList.class, componentType=String.class) 
     34    @XNodeList(value = "plugins/plugin", type = ArrayList.class, componentType = String.class) 
    3535    private List<String> pluginsNames; 
    3636 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-ui-web/src/main/java/org/nuxeo/ecm/platform/ui/web/auth/service/AuthenticationPluginDescriptor.java

    r19473 r19475  
    4949 
    5050    @XNodeMap(value = "parameters/parameter", key = "@name", type = HashMap.class, componentType = String.class) 
    51     public Map<String, String> parameters = new HashMap<String, String>(); 
     51    Map<String, String> parameters = new HashMap<String, String>(); 
    5252 
    5353    public Class getClassName() { 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-ui-web/src/main/java/org/nuxeo/ecm/platform/ui/web/directory/ChainSelect.java

    r18884 r19475  
    101101    } 
    102102 
     103    @Override 
    103104    public boolean isRequired() { 
    104105        return required; 
    105106    } 
    106107 
     108    @Override 
    107109    public void setRequired(boolean required) { 
    108110        this.required = required; 
     
    228230                this.componentValue = selections; 
    229231                if (!multiSelect) { 
    230                     this.setSubmittedValue(value[0]); 
     232                    setSubmittedValue(value[0]); 
    231233                } else { 
    232                     this.setSubmittedValue(value); 
     234                    setSubmittedValue(value); 
    233235                } 
    234236            } else { 
    235237                this.componentValue = new Selection[0]; 
    236                 this.setSubmittedValue(null); 
     238                setSubmittedValue(null); 
    237239            } 
    238240        } else { 
    239241            String[] value = encodeValue(componentValue); 
    240             this.setSubmittedValue(value); 
     242            setSubmittedValue(value); 
    241243        } 
    242244        log.debug("submitted value=" + format(getSubmittedValue())); 
     
    412414        Map<String, Object> filter = new HashMap<String, Object>(); 
    413415        filter.put("parent", parentValue); 
    414         if(!displayObsoleteEntries) { 
     416        if (!displayObsoleteEntries) { 
    415417            filter.put("obsolete", 0); 
    416418        } 
     
    595597            filter.put("id", id); 
    596598            filter.put("parent", parentId); 
    597             if(!displayObsoleteEntries) { 
     599            if (!displayObsoleteEntries) { 
    598600                filter.put("obsolete", 0); 
    599601            } 
    600602            List<DirectorySelectItem> items = null; 
    601603            if (directoryName != null) { 
    602                 items = DirectoryHelper.instance() 
    603                         .getSelectItems(directoryName, filter); 
     604                items = DirectoryHelper.instance().getSelectItems( 
     605                        directoryName, filter); 
    604606            } else { 
    605607                items = DirectoryHelper.instance().getSelectItems( 
    606608                        directoryValues, filter); 
    607609            } 
    608             if(items == null || items.size() != 1) { 
     610            if (items == null || items.size() != 1) { 
    609611                throw new RuntimeException("item not found"); 
    610612            } 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-ui-web/src/main/java/org/nuxeo/ecm/platform/ui/web/directory/SelectManyListboxComponent.java

    r18884 r19475  
    7070 
    7171    public SelectManyListboxComponent() { 
    72         this.setRendererType("nxdirectory.selectManyListbox"); 
     72        setRendererType("nxdirectory.selectManyListbox"); 
    7373    } 
    7474 
     
    159159    @SuppressWarnings("unchecked") 
    160160    public Boolean getBooleanProperty(String key, Boolean defaultValue) { 
    161         Map<String, Object> map = this.getAttributes(); 
     161        Map<String, Object> map = getAttributes(); 
    162162        Boolean value = (Boolean) map.get(key); 
    163163        if (value == null) { 
     
    169169    @SuppressWarnings("unchecked") 
    170170    public String getStringProperty(String key, String defaultValue) { 
    171         Map<String, Object> map = this.getAttributes(); 
     171        Map<String, Object> map = getAttributes(); 
    172172        String value = (String) map.get(key); 
    173173        if (value == null) { 
     
    188188 
    189189        options = new HashMap<String, SelectItem>(); 
    190         if(StringUtils.isEmpty(directoryName) && directoryValues == null) { 
     190        if (StringUtils.isEmpty(directoryName) && directoryValues == null) { 
    191191            return options; 
    192             //throw new RuntimeException("directoryName and directoryValues cannot be both null"); 
     192            // throw new RuntimeException("directoryName and directoryValues 
     193            // cannot be both null"); 
    193194        } 
    194195 
     
    196197        Map<String, Object> filter = new HashMap<String, Object>(); 
    197198        filter.put("parent", getFilter()); 
    198         if(!displayObsoleteEntries) { 
     199        if (!displayObsoleteEntries) { 
    199200            filter.put("obsolete", 0); 
    200201        } 
    201202 
    202         if(!StringUtils.isEmpty(directoryName)) { 
    203             optionList = DirectoryHelper.instance().getSelectItems(directoryName, filter); 
    204         } else if(directoryValues != null){ 
    205             optionList = DirectoryHelper.instance().getSelectItems(directoryValues, filter); 
     203        if (!StringUtils.isEmpty(directoryName)) { 
     204            optionList = DirectoryHelper.instance().getSelectItems( 
     205                    directoryName, filter); 
     206        } else if (directoryValues != null) { 
     207            optionList = DirectoryHelper.instance().getSelectItems( 
     208                    directoryValues, filter); 
    206209        } else { 
    207210            optionList = new ArrayList<DirectorySelectItem>(); 
    208211        } 
    209212 
    210         for(DirectorySelectItem item: optionList) { 
     213        for (DirectorySelectItem item : optionList) { 
    211214            options.put((String) item.getValue(), item); 
    212215        } 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-ui-web/src/main/java/org/nuxeo/ecm/platform/ui/web/directory/SelectOneListboxComponent.java

    r18884 r19475  
    6969 
    7070    public SelectOneListboxComponent() { 
    71         this.setRendererType("nxdirectory.selectOneListbox"); 
     71        setRendererType("nxdirectory.selectOneListbox"); 
    7272    } 
    7373 
     
    156156    @SuppressWarnings("unchecked") 
    157157    public Boolean getBooleanProperty(String key, Boolean defaultValue) { 
    158         Map<String, Object> map = this.getAttributes(); 
     158        Map<String, Object> map = getAttributes(); 
    159159        Boolean value = (Boolean) map.get(key); 
    160160        if (value == null) { 
     
    166166    @SuppressWarnings("unchecked") 
    167167    public String getStringProperty(String key, String defaultValue) { 
    168         Map<String, Object> map = this.getAttributes(); 
     168        Map<String, Object> map = getAttributes(); 
    169169        String value = (String) map.get(key); 
    170170        if (value == null) { 
     
    182182 
    183183        if (directoryName == null && directoryValues == null) { 
    184             throw new RuntimeException("directoryName and directoryValues cannot be both null"); 
     184            throw new RuntimeException( 
     185                    "directoryName and directoryValues cannot be both null"); 
    185186        } 
    186187 
     
    190191        Map<String, Object> filter = new HashMap<String, Object>(); 
    191192        filter.put("parent", getFilter()); 
    192         if(!displayObsoleteEntries) { 
     193        if (!displayObsoleteEntries) { 
    193194            filter.put("obsolete", 0); 
    194195        } 
     
    196197            optionList = DirectoryHelper.instance().getSelectItems( 
    197198                    directoryName, filter); 
    198         } else if(directoryValues != null)
     199        } else if (directoryValues != null)
    199200            optionList = DirectoryHelper.instance().getSelectItems( 
    200201                    directoryValues, filter); 
     
    203204        } 
    204205 
    205  
    206         for(DirectorySelectItem item: optionList) { 
     206        for (DirectorySelectItem item : optionList) { 
    207207            options.put((String) item.getValue(), item); 
    208208        } 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-ui-web/src/main/java/org/nuxeo/ecm/platform/ui/web/model/EditableModel.java

    r19474 r19475  
    5353 
    5454    /** 
    55      * {@see DataModel#isRowAvailable()} 
     55     * {@see DataModel#isRowAvailable()}. 
    5656     */ 
    5757    boolean isRowAvailable(); 
     
    7373 
    7474    /** 
    75      * {@see DataModel#getRowCount()} 
     75     * {@see DataModel#getRowCount()}. 
    7676     */ 
    7777    int getRowCount(); 
    7878 
    7979    /** 
    80      * {@see DataModel#getRowData()} 
     80     * {@see DataModel#getRowData()}. 
    8181     */ 
    8282    Object getRowData(); 
     
    8888 
    8989    /** 
    90      * {@see DataModel#getRowIndex()} 
     90     * {@see DataModel#getRowIndex()}. 
    9191     */ 
    9292    int getRowIndex(); 
    9393 
    9494    /** 
    95      * {@see DataModel#setRowIndex(int)} 
     95     * {@see DataModel#setRowIndex(int)}. 
    9696     */ 
    9797    void setRowIndex(int rowIndex); 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-ui-web/src/main/java/org/nuxeo/ecm/platform/ui/web/model/ProtectedEditableModel.java

    r19474 r19475  
    3131 
    3232    /** 
    33      * {@see DataModel#getRowCount()} 
     33     * {@see DataModel#getRowCount()}. 
    3434     */ 
    3535    int getRowCount(); 
    3636 
    3737    /** 
    38      * {@see DataModel#getRowData()} 
     38     * {@see DataModel#getRowData()}. 
    3939     */ 
    4040    Object getRowData(); 
     
    4646 
    4747    /** 
    48      * {@see DataModel#getRowIndex()} 
     48     * {@see DataModel#getRowIndex()}. 
    4949     */ 
    5050    int getRowIndex(); 
    5151 
    5252    /** 
    53      * {@see EditableModel#isRowNew()} 
     53     * {@see EditableModel#isRowNew()}. 
    5454     */ 
    5555    boolean isRowNew(); 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-ui-web/src/main/java/org/nuxeo/ecm/platform/ui/web/pagination/LazyResultsProvider.java

    r19474 r19475  
    2929 * 
    3030 * @author <a href="mailto:dm@nuxeo.com">Dragos Mihalache</a> 
    31  * 
    3231 */ 
    3332public interface LazyResultsProvider extends Serializable { 
     
    3635     * Constant specifying the number of elements in the result is unknown. 
    3736     */ 
    38     static final int UNKNOWN_SIZE = -1; 
     37    int UNKNOWN_SIZE = -1; 
    3938 
    4039    /** 
    41      * Return the current page of results. 
    42      * 
     40     * Returns the current page of results. 
    4341     * <p> 
    4442     * This method is designed to be called from JSF. It therefore ensures 
    4543     * cheapness of repeated calls, rather than data consistency. 
    46      * </p> 
    47      * <p>Calling code has to perform a setCurrentPage to resync the data</p> 
     44     * <p> 
     45     * Calling code has to perform a setCurrentPage to resync the data. 
    4846     * 
    4947     * @return the current page 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-ui-web/src/main/java/org/nuxeo/ecm/platform/ui/web/rest/FancyURLConfig.java

    r19104 r19475  
    2828public final class FancyURLConfig { 
    2929 
    30     // enables Zope Like URL parsing 
     30    // enables Zope-like URL parsing 
    3131    public static Boolean ENABLE_FANCY_URL_PARSING = true; 
    3232 
    33     // rewrite all URLs to Zope Like URL 
     33    // rewrite all URLs to Zope-Like URL 
    3434    public static Boolean ENABLE_FANCY_URL_REDIRECT = true; 
    3535 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-ui-web/src/main/java/org/nuxeo/ecm/platform/ui/web/tag/fn/Functions.java

    r19474 r19475  
    4646    } 
    4747 
    48     public String indentString(Integer level, String text)
     48    public String indentString(Integer level, String text)
    4949        StringBuffer label = new StringBuffer(""); 
    5050        for (int i = 0; i < level; i++) { 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-ui-web/src/main/java/org/nuxeo/ecm/platform/ui/web/tag/jsf/MetaActionSourceRule.java

    r19474 r19475  
    3636import com.sun.facelets.tag.MetadataTarget; 
    3737import com.sun.facelets.tag.TagAttribute; 
    38 import com.sun.facelets.util.FacesAPI; 
    3938 
    4039/** 
     
    4948    public static final Class[] ACTION_SIG = new Class[0]; 
    5049 
     50    public static final MetaActionSourceRule Instance = new MetaActionSourceRule(); 
     51 
    5152    private static final Log log = LogFactory.getLog(MetaActionSourceRule.class); 
    5253 
     
    5960        } 
    6061 
     62        @Override 
    6163        public void applyMetadata(FaceletContext ctx, Object instance) { 
    6264            ActionSource2 as = (ActionSource2) instance; 
     
    7577        } 
    7678 
     79        @Override 
    7780        public void applyMetadata(FaceletContext ctx, Object instance) { 
    7881            ActionSource as = (ActionSource) instance; 
     
    8386    } 
    8487 
    85     public static final MetaActionSourceRule Instance = new MetaActionSourceRule(); 
    86  
    8788    public MetaActionSourceRule() { 
    8889        super(); 
    8990    } 
    9091 
     92    @Override 
    9193    public Metadata applyRule(String name, TagAttribute attribute, 
    9294            MetadataTarget meta) { 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-ui-web/src/main/java/org/nuxeo/ecm/platform/ui/web/util/BaseURL.java

    r19474 r19475  
    3535    } 
    3636 
    37  
    38     public static String getServerURL() 
    39     { 
     37    public static String getServerURL() { 
    4038        return getServerURL(null); 
    4139    } 
     
    4745        String baseURL; 
    4846        final FacesContext facesContext = FacesContext.getCurrentInstance(); 
    49         if ((facesContext != null) || (request!=null )) { 
     47        if ((facesContext != null) || (request != null)) { 
    5048 
    5149            StringBuffer sbaseURL = new StringBuffer(); 
    5250 
    53             if (request==null) 
     51            if (request == null) { 
    5452                request = (ServletRequest) facesContext.getExternalContext().getRequest(); 
     53            } 
    5554 
    5655            if ((request instanceof HttpServletRequest) 
     
    6362                // Detect Nuxeo specific header for VH 
    6463                String nuxeoVH = httpRequest.getHeader(VH_HEADER); 
    65                 if ((nuxeoVH!=null) && (nuxeoVH.contains("http"))) 
     64                if ((nuxeoVH != null) && (nuxeoVH.contains("http"))) { 
    6665                    return nuxeoVH; 
     66                } 
    6767 
    6868                // Detect virtual hosting based in standard header 
     
    102102        } else { 
    103103            baseURL = "http://localhost:8080/"; 
    104              
     104       
    105105        return baseURL; 
    106106    } 
     
    135135    } 
    136136 
    137  
    138  
    139137} 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-ui-web/src/main/java/org/nuxeo/ecm/platform/ui/web/util/DocumentLocator.java

    r19474 r19475  
    4848 
    4949    // Utility class. 
    50     private DocumentLocator() {
     50    private DocumentLocator() {
    5151 
    5252    /** 
     
    5858    public static String getDocumentUrl(RepositoryLocation serverLocation, 
    5959            DocumentRef docRef) { 
    60         if (serverLocation==null)
     60        if (serverLocation == null)
    6161            String nullRepoName = null; 
    6262            return getDocumentUrl(nullRepoName, docRef); 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-ui-web/src/main/java/org/nuxeo/ecm/platform/ui/web/util/DocumentsListsUtils.java

    r19474 r19475  
    4040 
    4141    // Utility class. 
    42     private DocumentsListsUtils() {
     42    private DocumentsListsUtils() {
    4343 
    4444    /** 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-ui-web/src/main/java/org/nuxeo/ecm/platform/ui/web/util/SeamComponentCallHelper.java

    r17969 r19475  
    4040 
    4141    // This is an utility class. 
    42     private SeamComponentCallHelper() {
     42    private SeamComponentCallHelper() {
    4343 
    4444    /**