Changeset 17829

Show
Ignore:
Timestamp:
08/05/08 12:56:56 (1 month ago)
Author:
dpatil
Message:

merged ui-poc-branch [17554]:[17826] to trunk

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/core/src/net/project/css/CSSDbValues.java

    r16593 r17829  
    1515 
    1616import net.project.base.property.PropertyProvider; 
     17import net.project.security.SessionManager; 
    1718 
    1819public class CSSDbValues implements Filter { 
     
    7374                        content = content.replace("$$" + token + "$$", value); 
    7475                } 
     76                content = content.replaceAll("jspRootUrl", SessionManager.getJSPRootURL()); 
    7577                res.setContentLength(content.length()); 
    7678                pw.write(content); 
  • trunk/core/src/net/project/gui/toolbar/Band.java

    r17588 r17829  
    2020import java.util.Iterator; 
    2121 
     22import org.apache.log4j.Logger; 
     23 
    2224import net.project.base.property.PropertyProvider; 
     25import net.project.schedule.Schedule; 
    2326 
    2427/** 
     
    4952    /** Name of band. */ 
    5053    private String name = null; 
     54    /** group heading can be specific to band */ 
     55    private String groupHeading = null; 
    5156    /** Show all buttons. */ 
    5257    private boolean showAll = false; 
    5358    /** Show all button labels. */ 
    5459    private boolean showLabels = false; 
     60    /** Show all button images. */ 
     61    private boolean showImages = true; 
    5562    /** Enable all buttons. */ 
    5663    private boolean enableAll = false; 
     
    7885        setButtons(); 
    7986    } 
    80  
     87     
     88    public void setGroupHeading(String groupHeading) throws ToolbarException { 
     89        this.groupHeading = groupHeading; 
     90    }     
     91     
     92    public String getGroupHeading() { 
     93        return this.groupHeading; 
     94    }   
    8195    /** 
    8296     * Set the showAll property.  This sets each button's show property. 
     
    101115    } 
    102116 
     117    public void setShowImages(boolean showImages) { 
     118        this.showImages = showImages; 
     119        Iterator it = buttons.values().iterator(); 
     120        while (it.hasNext()) { 
     121            ((Button)it.next()).setShowImage(showImages); 
     122        } 
     123    } 
     124     
    103125    public void setEnableAll(boolean enableAll) { 
    104126        this.enableAll = enableAll; 
     
    119141        } 
    120142        button.setShowLabel(this.showLabels); 
     143        button.setShowImage(this.showImages); 
    121144        button.setEnable(true); 
    122145        button.setShow(true); 
     
    138161        addButton(button); 
    139162        button.setShowLabel(this.showLabels); 
     163        button.setShowImage(this.showImages); 
    140164        button.setEnable(true); 
    141165        button.setShow(true); 
     
    167191        addButton(button); 
    168192        button.setShowLabel(this.showLabels); 
     193        button.setShowImage(this.showImages); 
    169194        button.setEnable(true); 
    170195        button.setShow(true); 
  • trunk/core/src/net/project/gui/toolbar/Button.java

    r15790 r17829  
    5555    private String function = null; 
    5656    private boolean isShowLabel = false; 
     57    private boolean isShowImage = true; 
    5758    private boolean isShow = false; 
    5859    private boolean isEnable = false; 
     
    294295    } 
    295296 
     297    public void setShowImage(boolean isShowImage) { 
     298        this.isShowImage = isShowImage; 
     299    } 
     300 
     301    boolean isShowImage() { 
     302        return this.isShowImage; 
     303    } 
     304     
    296305    public void setShow(boolean isShow) { 
    297306        this.isShow = isShow; 
     
    415424        xml.append("<is_enable>" + Conversion.booleanToInteger(isEnable()) + "</is_enable>"); 
    416425        xml.append("<is_show_label>" + Conversion.booleanToInteger(isShowLabel()) + "</is_show_label>"); 
     426        xml.append("<is_show_image>" + Conversion.booleanToInteger(isShowImage()) + "</is_show_image>"); 
    417427        xml.append("<target>" + getTarget() + "</target>"); 
    418428        xml.append("</button>"); 
  • trunk/core/src/net/project/gui/toolbar/Toolbar.java

    r17754 r17829  
    5252 
    5353    /** Show all button labels */ 
    54     private boolean showLabels = false; 
    55  
     54    private boolean showLabels = true; 
     55 
     56    private boolean showImages = false; 
     57     
     58    private boolean showVertical = true; 
     59     
    5660    /** Enable all buttons */ 
    5761    private boolean enableAll = false; 
     
    6771 
    6872    /** Right Title token */ 
    69     private String rightTitleToken = null; 
    70  
     73    private String rightTitleToken = null;  
     74 
     75    private String groupTitle = null;  
     76     
    7177    /** Escape the title text on output */ 
    7278    private boolean escapeTitle = false; 
     
    112118    } 
    113119 
     120    public void setShowImages(boolean showImages) { 
     121        this.showImages = showImages; 
     122    } 
     123     
     124    public void setShowVertical(boolean showVertical) { 
     125        this.showVertical = showVertical; 
     126    } 
     127     
    114128    public void setEnableAll(boolean enableAll) { 
    115129        this.enableAll = enableAll; 
     
    127141        this.rightTitle = rightTitle; 
    128142    } 
    129  
     143     
     144    public void setGroupTitle(String groupTitle) { 
     145        this.groupTitle = groupTitle; 
     146    } 
     147     
    130148    public void setRightTitleToken(String rightTitleToken) { 
    131149        this.rightTitleToken = rightTitleToken; 
     
    180198        band.setShowAll(this.showAll); 
    181199        band.setShowLabels(this.showLabels); 
     200        band.setShowImages(this.showImages); 
    182201        band.setEnableAll(this.enableAll); 
    183202        bands.put(name, band); 
     
    336355        /* Get band elements and display buttons for each */ 
    337356        it = bandOrder.iterator(); 
     357         
     358        if(groupTitle != null){ 
     359                buffer.append("<div id='leftheading-" + SessionManager.getUser().getCurrentSpace().getType() + "'>" + groupTitle + "</div>"); 
     360                buffer.append("<div style='clear: both'></div>"); 
     361        } 
     362         
     363        if(showVertical){ 
     364                buffer.append("<div class='left_column_bottom'>\n"); 
     365                buffer.append("<div class='left_column_top'>\n"); 
     366        } 
    338367        while (it.hasNext()) { 
    339368            band = ((Band) bands.get(it.next())); 
     369 
     370            if(band.getGroupHeading() == null) 
     371                buffer.append("<div id='actionbox-item' class='actionbox-item' >"); 
     372            else { 
     373                buffer.append("<div id='group_heading' class='group_heading' >"); 
     374                buffer.append( band.getGroupHeading() + "<br />"); 
     375            } 
    340376 
    341377            /* Get button elements from band and display them */ 
     
    343379            while (buttonIt.hasNext()) { 
    344380                button = ((Button) buttonIt.next()); 
    345  
     381                if ( button.getType() == ButtonType.REFRESH ) // hide refresh from all locations 
     382                        continue; 
    346383                //Don't display sharing toolbar buttons if they aren't necessary 
    347384                if (!PropertyProvider.getBoolean("prm.crossspace.isenabled", false)) { 
     
    353390                if (button.isShow()) { 
    354391                    // Insert spacer on left side if button will have left label 
    355                     if (button.isShowLabel() && button.getLabelPos().equals(Button.LABEL_POS_LEFT)) { 
    356                         buffer.append("&nbsp;"); 
    357                    
     392                    //if (button.isShowLabel() && button.getLabelPos().equals(Button.LABEL_POS_LEFT)) { 
     393                       // buffer.append("&nbsp;"); 
     394                    //
    358395 
    359396                    // Insert hyper link if button is enabled 
    360397                    if (button.isEnable()) { 
    361                         buffer.append("<a href=\"" + button.getFunction() + "\" "); 
     398                        buffer.append("<span><a href=\"" + button.getFunction() + "\" "); 
     399                        if(showVertical) 
     400                                //buffer.append(" class=\"verticalActionBarLink\""); 
    362401                        if (button.getTarget() != null) { 
    363402                            buffer.append("target=\"").append(button.getTarget()).append("\" "); 
    364403                        } 
    365                         buffer.append("onmouseout=\" document.img" + button.getName() + ".src = '" + SessionManager.getJSPRootURL()+button.getResolvedImageEnabled() + "'\" "); 
    366                         buffer.append("onmouseover=\" document.img" + button.getName() + ".src = '" + SessionManager.getJSPRootURL()+button.getResolvedImageOver() +"'\">"); 
    367                         useImage = button.getResolvedImageEnabled(); 
     404                        if(showImages) { 
     405                                buffer.append("onmouseout=\" document.img" + button.getName() + ".src = '" + SessionManager.getJSPRootURL()+button.getResolvedImageEnabled() + "'\" "); 
     406                                buffer.append("onmouseover=\" document.img" + button.getName() + ".src = '" + SessionManager.getJSPRootURL()+button.getResolvedImageOver() +"'\">"); 
     407                                useImage = button.getResolvedImageEnabled(); 
     408                        } 
     409                        buffer.append(">"); 
    368410                    } else { 
    369                         useImage = button.getResolvedImageDisabled(); 
     411                        if(showImages)  
     412                                useImage = button.getResolvedImageDisabled(); 
    370413                    } 
    371414 
     
    375418                    } 
    376419 
    377                     // Insert image 
    378                     buffer.append("<img "); 
    379  
    380                     // Use the alt as the title, since the original (although misguided) 
    381                     // usage of alt was as a tooltip 
    382                     // Netscape 7.x doesn't display alts as tooltips; only titles 
    383                     buffer.append("alt=\"").append(button.getResolvedAlt()).append("\" "); 
    384                     buffer.append("title=\"").append(button.getResolvedAlt()).append("\" "); 
    385                     buffer.append("border=0 hspace=0 src=\"" + SessionManager.getJSPRootURL()+useImage +"\" name=\"img" + button.getName() + "\">"); 
    386  
     420                    if(showImages) { 
     421                            // Insert image 
     422                            buffer.append("<img "); 
     423         
     424                            // Use the alt as the title, since the original (although misguided) 
     425                            // usage of alt was as a tooltip 
     426                            // Netscape 7.x doesn't display alts as tooltips; only titles 
     427                            buffer.append("alt=\"").append(button.getResolvedAlt()).append("\" "); 
     428                            buffer.append("title=\"").append(button.getResolvedAlt()).append("\" "); 
     429                            buffer.append("border=0 hspace=0 src=\"" + SessionManager.getJSPRootURL()+useImage +"\" name=\"img" + button.getName() + "\">"); 
     430                    } 
     431                     
    387432                    // Insert label if right label 
    388433                    if (button.isShowLabel() && button.getLabelPos().equals(Button.LABEL_POS_RIGHT)) { 
     
    392437                    // Close hyperlink if button is enabled 
    393438                    if (button.isEnable()) { 
    394                         buffer.append("</a>"); 
     439                        buffer.append("</a></span>"); 
    395440                    } 
    396441 
     
    400445                    } 
    401446 
    402                     buffer.append("\n"); 
     447                    if(showVertical) 
     448                        buffer.append("<br/>\n"); 
     449                    else 
     450                        buffer.append("\n"); 
    403451                }  //end if button.isShow() 
    404452            } 
     453                buffer.append("</div>\n");             
     454        } 
     455        if(showVertical){ 
     456 
     457                buffer.append("</div>\n"); 
     458                buffer.append("</div>"); 
    405459        } 
    406460        buffer.append("&nbsp;"); 
     
    419473        String rightTitle = null; 
    420474 
     475        //buffer.append("\t<tr><td colspan=\"2\" align=\"" + this.align + "\" valign=\"bottom\">"); 
     476        //buffer.append(getToolbarPresentation()); 
     477        //buffer.append("</td></tr>\n"); 
    421478        buffer.append("<table class=\"fixed\" width=\"" + this.width + "\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n"); 
    422479        buffer.append("\t<tr><td colspan=\"2\" align=\"" + this.align + "\" valign=\"bottom\">"); 
    423         buffer.append(getToolbarPresentation()); 
     480        buffer.append("&nbsp;"); 
    424481        buffer.append("</td></tr>\n"); 
    425482        buffer.append("\t<tr><td align=\"left\" class=\"pageTitle\">"); 
     
    451508        buffer.append("</tr></table>\n"); 
    452509         
    453          
    454510        final String b = buffer.toString(); 
    455511                if (bands != null) { 
    456                         return addFixationForToolbarBlock(b); 
     512                        return getToolbarPresentation() + addFixationForToolbarBlock(b); 
    457513                } 
    458514         
  • trunk/core/src/net/project/taglibs/template/GetSpaceMainMenuTag.java

    r17022 r17829  
    4343        JspWriter out = pageContext.getOut(); 
    4444        try { 
    45             out.println("<div id=\"topframe\" style=\"background-image:url('" + SessionManager.getJSPRootURL()+PropertyProvider.get("prm.global.header.banner.image") + "');\">\n"); 
     45            out.println("<div id=\"topframe\">\n"); 
    4646             
    4747            //check for custom menu 
  • trunk/core/src/net/project/taglibs/template/GetSpaceNavBarTag.java

    r17754 r17829  
    2626import net.project.security.User; 
    2727import net.project.space.ISpaceTypes; 
     28import net.project.util.Conversion; 
    2829 
    2930 
     
    3233    private static final String INCLUDE_PATH_SUFFIX = "/include/NavBar.jsp"; 
    3334    private String _space; 
    34  
     35    private boolean showVertical = false; 
     36     
    3537    /* -------------------------------  Constructors  ------------------------------- */ 
    3638 
     
    4446    } 
    4547 
     48    public void setShowVertical(String showVertical) { 
     49        this.showVertical = Conversion.toBoolean(showVertical); 
     50        } 
     51     
    4652    /* -------------------------------  Overriding TagSupport methods  ------------------------------- */ 
    4753 
    48     public int doStartTag() throws JspTagException { 
     54       public int doStartTag() throws JspTagException { 
    4955        final JspWriter out = pageContext.getOut(); 
    5056        try { 
    51             out.println("<div id=\"leftframe\">"); 
     57                if(showVertical) // if vertifal? then include menu rendering within leftframe div 
     58                        out.println("<div id=\"leftframe\">"); 
    5259             
    5360            final String path = _space == null ? getIncludePathPrefix() : getIncludePathUsingSuppliedSpace(); 
    5461                        pageContext.include("/" + (path) + INCLUDE_PATH_SUFFIX); 
    55              
    56                         out.println("</div>"); 
     62                        if(showVertical) 
     63                               out.println("</div>"); 
    5764        } catch (IOException ioe) { 
    5865            throw new JspTagException("I/O exception: " + ioe); 
  • trunk/core/src/net/project/taglibs/toolbar/BandTag.java

    r16593 r17829  
    4545    /** name attribute */ 
    4646    private String name = null; 
     47     
     48    /** group heading if any for this band */ 
     49    private String groupHeading = null; 
    4750    /** showAll attribute */ 
    4851    private boolean showAll = false; 
     
    7275            band = toolbar.addBand(name); 
    7376            if (isShowAllSet) { 
    74                 band.setShowAll(showAll); 
     77                //band.setShowAll(showAll); 
    7578            } 
    7679            if (isShowLabelsSet) { 
     
    8083                band.setEnableAll(enableAll); 
    8184            } 
    82          
     85            band.setGroupHeading(groupHeading); 
    8386        } catch (ToolbarException te) { 
    8487            throw new JspTagException("Error in band tag: error adding band to toolbar: " + te); 
     
    98101        this.name = name; 
    99102    } 
     103    public void setGroupHeading(String groupHeading) { 
     104        this.groupHeading = groupHeading; 
     105    } 
    100106    public void setShowAll(String showAll) { 
    101         this.showAll = Conversion.toBoolean(showAll); 
     107        //this.showAll = Conversion.toBoolean(showAll); 
    102108        this.isShowAllSet = true; 
    103109    } 
     
    123129        band = null; 
    124130        name = null; 
     131        groupHeading = null; 
    125132        showAll = false; 
    126133        showLabels = false; 
  • trunk/core/src/net/project/taglibs/toolbar/ToolbarTag.java

    r17754 r17829  
    5959    private String rightTitleToken = null; 
    6060 
     61    /** allows to specify the highlited group title on top of actions **/ 
     62    private String groupTitle = null; 
     63     
    6164    /** stylesheet attribute */ 
    6265    private String stylesheet = null; 
     
    6669 
    6770    /** showLabels attribute */ 
    68     private boolean showLabels = false; 
    69  
     71    private boolean showLabels = true; 
     72 
     73    /** showLabels attribute */ 
     74    private boolean showImages = false; 
     75     
    7076    /** enableAll attribute */ 
    7177    private boolean enableAll = false; 
     
    8894    private boolean isShowAllSet = false; 
    8995    private boolean isShowLabelsSet = false; 
     96    private boolean isShowImagesSet = false; 
    9097    private boolean isEnableAllSet = false; 
    9198    private boolean isEscapeTitleSet = false; 
    9299    private boolean isBottomFixed = false; 
    93100 
     101    private boolean showVertical = true; 
    94102    /** 
    95103      * Start of tag.  Called after the attributes are set. 
     
    148156 
    149157    public void setShowAll(String showAll) { 
    150         this.showAll = Conversion.toBoolean(showAll); 
     158        //this.showAll = Conversion.toBoolean(showAll); // ignore showAll, keep it false        
    151159        this.isShowAllSet = true; 
    152160    } 
     
    157165    } 
    158166 
     167    public void setShowImages(String showImages) { 
     168        this.showImages = Conversion.toBoolean(showImages); 
     169        this.isShowImagesSet = true; 
     170    } 
     171     
    159172    public void setEnableAll(String enableAll) { 
    160173        this.enableAll = Conversion.toBoolean(enableAll); 
     
    177190        this.rightTitleToken = rightTitleToken; 
    178191    } 
    179  
     192     
     193    public void setGroupTitle(String groupTitle) { 
     194        this.groupTitle = groupTitle; 
     195    } 
     196     
    180197    public void setEscapeTitle(String escapeTitle) { 
    181198        this.escapeTitle = Conversion.toBoolean(escapeTitle); 
     
    200217    } 
    201218 
    202     /** 
     219        public void setShowVertical(String showVertical) { 
     220                this.showVertical = Conversion.toBoolean(showVertical); 
     221        } 
     222 
     223        /** 
    203224      * Set an arbitrary attribute.  This is usually called by the 
    204225      * <code>&lt;setAttribute></code> tag nested within the <code>&lt;toolbar></code> tag.<br> 
     
    222243            setLeftTitleToken(value); 
    223244        } else if (name.equals("rightTitle")) { 
    224             setRightTitle(value); 
    225         } else if (name.equals("rightTitleToken")) { 
     245            setRightTitle(value);  
     246        } else if (name.equals("rightTitleToken")) {  
    226247            setRightTitleToken(value); 
     248        } else if (name.equals("groupTitle")) {  
     249            setGroupTitle(value); 
    227250        } else if (name.equals("escapeTitle")) { 
    228251            setEscapeTitle(value); 
     
    259282        /* Set the attributes that must be set prior to adding other elements */ 
    260283        if (isShowAllSet) { 
    261             toolbar.setShowAll(showAll); 
     284            //toolbar.setShowAll(showAll); // ignore showAll, keep it false 
    262285        } 
    263286        if (isShowLabelsSet) { 
    264287            toolbar.setShowLabels(showLabels); 
    265288        } 
     289        if (isShowImagesSet) { 
     290            toolbar.setShowImages(showImages); 
     291        } 
    266292        if (isEnableAllSet) { 
    267293            toolbar.setEnableAll(enableAll); 
     
    282308            toolbar.setRightTitleToken(rightTitleToken); 
    283309        } 
     310        if (groupTitle != null) { 
     311            toolbar.setGroupTitle(groupTitle); 
     312        } 
    284313        if (stylesheet != null) { 
    285314            toolbar.setStylesheet(stylesheet); 
     
    296325        if (isBottomFixed) { 
    297326            toolbar.setBottomFixed(_bottomFixed); 
     327        } 
     328        if (showVertical) { 
     329            toolbar.setShowVertical(showVertical); 
    298330        } 
    299331    } 
     
    309341        rightTitle = null; 
    310342        rightTitleToken = null; 
     343        groupTitle = null; 
    311344        stylesheet = null; 
    312345        width = null; 
    313346        align = null; 
    314347        showAll = false; 
    315         showLabels = false; 
     348        showLabels = true; 
     349        showImages = false; 
    316350        enableAll = false; 
    317351        escapeTitle = false; 
     
    322356        _bottomFixed = false; 
    323357        isBottomFixed = false; 
     358        showVertical = true; 
    324359    } 
    325360} 
  • trunk/core/src/net/project/view/components/PersonalMenu.java

    r17767 r17829  
    1515import net.project.security.SessionManager; 
    1616import net.project.security.User; 
     17import net.project.view.pages.blog.ViewBlog; 
    1718 
    1819import org.apache.log4j.Logger; 
    1920import org.apache.tapestry.annotations.ApplicationState; 
     21import org.apache.tapestry.annotations.InjectPage; 
    2022import org.apache.tapestry.annotations.SetupRender; 
    2123 
     
    3133        private String JSPRootURL; 
    3234 
    33         private String dashboardIsenabled; 
    34          
    35         private String calendarIsenabled; 
     35        private boolean dashboardIsenabled; 
     36         
     37        private boolean calendarIsenabled; 
    3638                  
    37         private String assignmentsIsenabled; 
    38          
    39         private String blogIsenabled; 
    40          
    41         private String documentIsenabled; 
    42          
    43         private String formIsenabled; 
    44  
    45         private String methodologyIsenabled; 
    46  
    47         private String setupIsenabled; 
     39        private boolean assignmentsIsenabled; 
     40         
     41        private boolean blogIsenabled; 
     42         
     43        private boolean documentIsenabled; 
     44         
     45        private boolean formIsenabled; 
     46 
     47        private boolean methodologyIsenabled; 
     48 
     49        private boolean setupIsenabled; 
    4850         
    4951        private boolean masterPropertiesExist; 
     
    5153        private boolean isLicenseRequiredAtLogin; 
    5254         
    53         private String displayApplicationSpace; 
    54  
    55         private String displayConfigurationSpace; 
     55        private boolean displayApplicationSpace; 
     56 
     57        private boolean displayConfigurationSpace; 
    5658         
    5759        private String dashboard; 
     
    9496         
    9597        private String toolbar; 
     98         
     99        @InjectPage 
     100        private ViewBlog blog; 
    96101         
    97102        @SetupRender 
     
    104109                        JSPRootURL = SessionManager.getJSPRootURL(); 
    105110                        user = SessionManager.getUser(); 
    106                         dashboardIsenabled = PropertyProvider.get("prm.personal.dashboard.isenabled"); 
    107                         calendarIsenabled = PropertyProvider.get("prm.personal.calendar.isenabled"); 
    108                         assignmentsIsenabled = PropertyProvider.get("prm.personal.assignments.isenabled"); 
    109                         blogIsenabled = PropertyProvider.get("prm.blog.isenabled"); 
    110                         documentIsenabled = PropertyProvider.get("prm.personal.document.isenabled"); 
    111                         formIsenabled = PropertyProvider.get("prm.personal.form.isenabled"); 
    112                         methodologyIsenabled = PropertyProvider.get("prm.personal.methodology.isenabled"); 
    113                         setupIsenabled = PropertyProvider.get("prm.personal.setup.isenabled"); 
     111                        dashboardIsenabled = getBooleanValue(PropertyProvider.get("prm.personal.dashboard.isenabled")); 
     112                        calendarIsenabled = getBooleanValue(PropertyProvider.get("prm.personal.calendar.isenabled")); 
     113                        assignmentsIsenabled = getBooleanValue(PropertyProvider.get("prm.personal.assignments.isenabled")); 
     114                        blogIsenabled = getBooleanValue(PropertyProvider.get("prm.blog.isenabled")); 
     115                        documentIsenabled = getBooleanValue(PropertyProvider.get("prm.personal.document.isenabled")); 
     116                        formIsenabled = getBooleanValue(PropertyProvider.get("prm.personal.form.isenabled")); 
     117                        methodologyIsenabled = getBooleanValue(PropertyProvider.get("prm.personal.methodology.isenabled")); 
     118                        setupIsenabled = getBooleanValue(PropertyProvider.get("prm.personal.setup.isenabled"));&