Changeset 17849

Show
Ignore:
Timestamp:
08/07/08 12:21:40 (3 weeks ago)
Author:
avinash
Message:

blog :
- Added new Tapestry component to show toolbar buttons in left side action box
- Added new dao method
- Modified blog page as per new UI

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/core/src/net/project/hibernate/dao/IPnTaskDAO.java

    r17252 r17849  
    3131         */      
    3232        public List<PnTask> getProjectMilestones(Integer projectId, boolean onlyWithoutPhases); 
     33         
     34        /** 
     35         * Method to get project id of the task which resides in that project 
     36         * @param taskId   task identifier   
     37         * @return project identifier 
     38         */ 
     39        public Integer getProjectByTaskId(Integer taskId); 
    3340} 
  • trunk/core/src/net/project/hibernate/dao/impl/PnTaskDAOImpl.java

    r17252 r17849  
    9292 
    9393         
     94        /* (non-Javadoc) 
     95         * @see net.project.hibernate.dao.IPnTaskDAO#getProjectByTaskId(java.lang.Integer) 
     96         */ 
     97        public Integer getProjectByTaskId(Integer taskId) { 
     98                Integer projectId = null; 
     99                 
     100                String sql = " SELECT ps.projectId FROM PnPlan pp, PnPlanHasTask pht, PnProjectSpace ps, PnSpaceHasPlan shp "+ 
     101                                         " WHERE pp.planId = pht.comp_id.planId AND shp.comp_id.planId = pht.comp_id.planId "+ 
     102                                         " AND shp.comp_id.spaceId = ps.projectId AND pht.comp_id.taskId = :taskId "; 
     103         
     104                try { 
     105                        Query query = getHibernateTemplate().getSessionFactory().getCurrentSession().createQuery(sql); 
     106                        query.setInteger("taskId", taskId); 
     107                        projectId = (Integer) query.uniqueResult(); 
     108                } catch (Exception e) { 
     109                        log.error("Error occurred while getting project id by task id : " + e.getMessage()); 
     110                        e.printStackTrace(); 
     111                } 
     112                return projectId; 
     113        }        
    94114         
    95115} 
  • trunk/core/src/net/project/hibernate/service/IPnTaskService.java

    r17252 r17849  
    3030        public List<PnTask> getProjectMilestones(Integer projectId, boolean onlyWithoutPhases);  
    3131         
     32        public Integer getProjectByTaskId(Integer taskId); 
    3233} 
  • trunk/core/src/net/project/hibernate/service/impl/PnTaskServiceImpl.java

    r17252 r17849  
    4747        } 
    4848         
     49        /* (non-Javadoc) 
     50         * @see net.project.hibernate.service.IPnTaskService#getProjectByTaskId(java.lang.Integer) 
     51         */ 
     52        public Integer getProjectByTaskId(Integer taskId) { 
     53                return pnTaskDAO.getProjectByTaskId(taskId); 
     54        } 
    4955         
    5056} 
  • trunk/core/src/net/project/view/components/PersonalMenu.java

    r17829 r17849  
    5757        private boolean displayConfigurationSpace; 
    5858         
     59        private boolean isBlogPage; 
     60         
    5961        private String dashboard; 
    6062         
     
    9698         
    9799        private String toolbar; 
     100         
     101        private Integer moduleId; 
    98102         
    99103        @InjectPage 
    100104        private ViewBlog blog; 
    101          
     105 
    102106        @SetupRender 
    103107        void setValues() { 
     
    108112                        log = Logger.getLogger(ProjectMenu.class); 
    109113                        JSPRootURL = SessionManager.getJSPRootURL(); 
     114                        if(blog != null){ 
     115                                isBlogPage = true; 
     116                                moduleId = blog.getModuleId(); 
     117                        } 
    110118                        user = SessionManager.getUser(); 
     119                        // conditions for showing links on menu 
    111120                        dashboardIsenabled = getBooleanValue(PropertyProvider.get("prm.personal.dashboard.isenabled")); 
    112121                        calendarIsenabled = getBooleanValue(PropertyProvider.get("prm.personal.calendar.isenabled")); 
     
    117126                        methodologyIsenabled = getBooleanValue(PropertyProvider.get("prm.personal.methodology.isenabled")); 
    118127                        setupIsenabled = getBooleanValue(PropertyProvider.get("prm.personal.setup.isenabled")); 
    119                         masterPropertiesExist = MasterProperties.masterPropertiesExist(); 
    120                         isLicenseRequiredAtLogin = LicenseProperties.getInstance().isLicenseRequiredAtLogin(); 
    121                          
     128                                                 
    122129                        // Determine whether or not the application space will be displayed. 
    123130                        displayApplicationSpace = ApplicationSpace.DEFAULT_APPLICATION_SPACE.isUserSpaceMember(user); 
     
    146153                        applicationSpaceModule = Module.APPLICATION_SPACE; 
    147154                        configurationSpaceModule = Module.CONFIGURATION_SPACE; 
    148                         userCurrentSpaceId = SessionManager.getUser().getCurrentSpace().getID();                         
    149                         userId = SessionManager.getUser().getID(); 
    150                         setToolbar("standard"); 
     155                        userCurrentSpaceId = user.getCurrentSpace().getID();                     
     156                        userId = user.getID(); 
     157                         
     158                        masterPropertiesExist = MasterProperties.masterPropertiesExist(); 
     159                        isLicenseRequiredAtLogin = LicenseProperties.getInstance().isLicenseRequiredAtLogin(); 
    151160                } catch (Exception e) { 
    152161                        log.error("Error occured while getting property tokens for project menu : " + e.getMessage()); 
    153162                }                
    154         } 
    155          
    156         /** 
    157          * @param toolbar the toolbar to set 
    158          */ 
    159         public void setToolbar(String name) { 
    160                 Toolbar toolbar = new Toolbar(); 
    161                 try { 
    162                         toolbar.setStyle("tooltitle"); 
    163                         toolbar.setShowAll(false); 
    164                         toolbar.setGroupTitle("Blog: "+blog.getUserWeblog().getName()); 
    165                         Band toolBand = toolbar.addBand(name); 
    166                         toolBand.addButton("help"); 
    167                         toolBand.addButton("blogit"); 
    168                         toolBand.addButton("refresh"); 
    169                         this.toolbar = toolbar.getPresentation(); 
    170                 } catch (ToolbarException pnetEx) { 
    171                         pnetEx.printStackTrace(); 
    172                 } 
    173         } 
     163        }                
    174164         
    175165        boolean getBooleanValue(String stringValue){ 
     
    399389        public String getAssignment() { 
    400390                return assignment; 
     391        } 
     392 
     393        /** 
     394         * @return the moduleId 
     395         */ 
     396        public Integer getModuleId() { 
     397                return moduleId; 
     398        } 
     399 
     400        /** 
     401         * @return the isBlogPage 
     402         */ 
     403        public boolean getIsBlogPage() { 
     404                return isBlogPage; 
    401405        }        
    402406                 
  • trunk/core/src/net/project/view/components/ProjectMenu.java

    r17829 r17849  
    5454        private boolean setupIsenabled; 
    5555         
     56        private boolean isBlogPage; 
     57         
    5658        private String directory; 
    5759 
     
    109111         
    110112        private String toolbar; 
     113         
     114        private Integer moduleId; 
    111115         
    112116        @InjectPage 
     
    121125                        log = Logger.getLogger(ProjectMenu.class); 
    122126                        JSPRootURL = SessionManager.getJSPRootURL(); 
     127                        if(blog != null){ 
     128                                isBlogPage = true; 
     129                                moduleId = blog.getModuleId(); 
     130                        } 
    123131                        // conditions for showing links on menu 
    124132                        contactIsenabled = getBooleanValue(PropertyProvider.get("prm.project.contact.isenabled")); 
     
    165173                        userCurrentSpaceId = SessionManager.getUser().getCurrentSpace().getID();                         
    166174                        userId = SessionManager.getUser().getID(); 
    167                         setToolbar("standard"); 
    168175                } catch (Exception e) { 
    169176                        log.error("Error occured while getting property tokens for project menu : " + e.getMessage()); 
     
    171178        } 
    172179         
    173         /** 
    174          * @param toolbar the toolbar to set 
    175          */ 
    176         public void setToolbar(String name) { 
    177                 Toolbar toolbar = new Toolbar();                 
    178                 try { 
    179                         toolbar.setStyle("tooltitle"); 
    180                         toolbar.setShowAll(false); 
    181                         toolbar.setGroupTitle("Blog: "+blog.getUserWeblog().getName()); 
    182                         Band toolBand = toolbar.addBand(name); 
    183                         toolBand.addButton("help"); 
    184                         toolBand.addButton("blogit");                    
    185                         toolBand.addButton("refresh"); 
    186                         this.toolbar = toolbar.getPresentation(); 
    187                 } catch (ToolbarException pnetEx) { 
    188                         pnetEx.printStackTrace(); 
    189                 } 
    190         } 
    191          
    192180        boolean getBooleanValue(String stringValue){ 
    193181                return stringValue.equals("1") || stringValue.equals("true") ? true : false; 
     
    487475                return directoryIsenabled; 
    488476        } 
     477 
     478        /** 
     479         * @return the moduleId 
     480         */ 
     481        public Integer getModuleId() { 
     482                return moduleId; 
     483        } 
     484 
     485        /** 
     486         * @return the isBlogPage 
     487         */ 
     488        public boolean getIsBlogPage() { 
     489                return isBlogPage; 
     490        } 
    489491                 
    490492} 
  • trunk/core/src/net/project/view/pages/blog/AddWebLogEntry.java

    r17767 r17849  
    362362                Integer blogEntryId = null; 
    363363                try { 
    364                         if(objectId != null && objectId != 0){ 
     364                        if(objectId != null && objectId != 0){                          
    365365                                getObjectDetails(objectId);                              
    366366                        } 
     
    368368                                setWeblog(blogProvider.getWeblogBySpaceId(objectId)); 
    369369                        } else { 
     370                                if(getObjectDetails()[0].equalsIgnoreCase("taskId")){ 
     371                                        try { 
     372                                                IPnTaskService taskService = ServiceFactory.getInstance().getPnTaskService(); 
     373                                                spaceId = taskService.getProjectByTaskId(objectId); 
     374                                        } catch (Exception e) { 
     375                                                log.error("Error occurred while getting project id by task id " + e.getMessage()); 
     376                                        } 
     377                                } 
    370378                                setWeblog(blogProvider.getWeblogBySpaceId(spaceId)); 
    371379                        } 
  • trunk/core/web/html/blog/ViewBlog.html

    r17806 r17849  
    88                </t:parameter> 
    99        </t:if> 
    10         <div id="filtersDiv"  style="position: absolute; left: 300px; top: 100px; z-index: 1;" /> 
     10         
     11        <t:ActionBox groupTitle="Blog: ${userWeblog.name}" buttons="blogit,help,refresh" /> 
     12         
     13        <div style="position: absolute; top: 90px; left: 245px; color: #FF9900; font-family: Arial; font-weight: bold; font-size: 3;">${date}</div> 
     14 
     15        <div id="filtersDiv"  style="position: absolute; left: 235px; top: 110px; z-index: 1;" /> 
     16         
    1117        <!-- Left Side Div Starts --> 
    12         <div style="left: 5px; top: 86px; position: absolute; width: 25%; height: 100%;">  
    13                 <div style="left: 8px; position: absolute; color: #FF9900; font-family: Arial; font-weight: bold; font-size: 3;">${date}</div> 
    14                 <br /> 
     18        <div style="left: 5px; top: 86px; position: absolute; width: 25%; height: 100%; display: none;">  
    1519                <table width="100%" height="100%"> 
    1620                        <tr height="100%"> 
    1721                                <td width="99%" valign="top"> 
    1822                                        <table width="100%"> 
    19                                                 <!-- Blog Details --> 
     23                                                <!-- Blog Details 
    2024                                                <tr valign="top"><td> 
    2125                                                        <div id="blogDetails" style="height: 80px; width: 240px; overflow-Y: auto; overflow-X: hidden; background: #CCCCCC;"> 
     
    3539                                                                                        </t:parameter> 
    3640                                                                                </t:if> 
    37                                                                         </tr> 
     41                                                                        </tr>  --> 
    3842                                                                        <!-- tr><td height="5"></td></tr> 
    3943                                                                        <tr valign="top"> 
    4044                                                                                <td align="left" width="60%" style="font-family:Arial;font-size:3;font-weight:bold;">Description: &nbsp;&nbsp;${userWeblog.description}</td>                                                                             
    4145                                                                        </tr-->                                  
    42                                                                 </table>       
     46                                                                <!-- /table>   
    4347                                                        </div> 
    4448                                                </td></tr> 
     
    4953                                                </tr> 
    5054                                                 
    51                                                 <tr><td height="20"></td></tr
     55                                                <tr><td height="20"></td></tr --
    5256                                                 
    5357                                                <!-- tr valign="top"><td align="left"><h2>Search Project Blog </h2></td></tr> 
     
    6973                                                <tr><td height="10"></td></tr --> 
    7074                                                 
    71                                                 <t:if test="fullView"> 
     75                                                <!-- t:if test="fullView"> 
    7276                                                        <tr valign="top"> 
    7377                                                                <td align="left"> 
     
    8690                                                                </tr> 
    8791                                                        </t:parameter> 
    88                                                 </t:if
     92                                                </t:if --
    8993                                                         
    9094                                                 
     
    158162                                        </table> 
    159163                                </td> 
    160                                 <t:if test="linkToPersonSpace"> 
     164                                <!-- t:if test="linkToPersonSpace"> 
    161165                                        <td width="1%" bgcolor="#FFCC33" /> 
    162166                                        <t:parameter name="else"> 
    163167                                                <td width="1%" bgcolor="#CCCCFF" /> 
    164168                                        </t:parameter> 
    165                                 </t:if
     169                                </t:if --
    166170                        </tr> 
    167171                </table> 
     
    169173 
    170174        <!-- Blog content starts here --> 
    171         <div id="blog-content" style="height: 75%; width: 758px; position: absolute; left: 265px; top: 115px; overflow-Y: scroll; overflow-X: hidden;"
     175        <div id="blog-content" style="height: auto; width: 72%; position: absolute; left: 180px; top: 125px;"> <!-- left: 265px; overflow-Y: scroll; overflow-X: hidden; --
    172176         
    173177        <!-- Middle content Div Starts --> 
    174         <div id="middleDiv" style="height: 100%; position: absolute; left: 80px; top: 15px; bottom: 10px;"> 
     178        <div id="middleDiv" style="height: 100%; width: 100%; position: absolute; left: 80px; top: 15px;"> 
    175179                <div style="font-family: Arial; font-weight: bold; color: red;"> ${message}</div> 
    176                 <table width="600px" height="100%" align="left"> 
     180                <table width="100%" height="100%" align="left"> 
    177181                        <tr height="100%"> 
    178182                                <td width="0%"><!-- Space for photos --></td> 
    179183                                <td valign="top"> 
    180                                         <table width="550px">                                          
     184                                        <table width="100%">                                           
    181185                                                <tr> 
    182186                                                        <td> 
     
    310314                                                        </td>                                                    
    311315                                                </tr> 
    312                                                 <tr><td colspan="2"><t:Footer /></td></tr
     316                                                <!-- tr><td colspan="2"><t:Footer /></td></tr --
    313317                                        </table> 
    314318                                </td> 
  • trunk/core/web/html/resource/management/components/BlogLayout.html

    r17829 r17849  
    109109<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
    110110</head> 
    111 <body onload="main_toolbar_setup();" class="main" id="tBodyWithFixedAreasSupport"> 
     111<body onload="main_toolbar_setup();" class="main" id="bodyWithFixedAreasSupport"> 
    112112        <t:body /> 
    113113</body> 
  • trunk/core/web/html/resource/management/components/PersonalMenu.html

    r17829 r17849  
    1212var methodologyIsenabled = '${methodologyIsenabled}'; 
    1313var setupIsenabled = '${setupIsenabled}'; 
    14 var masterPropertiesExist = ${masterPropertiesExist}; 
    15 var isLicenseRequiredAtLogin = ${isLicenseRequiredAtLogin}; 
     14 
    1615var displayApplicationSpace = '${displayApplicationSpace}' 
    1716var displayConfigurationSpace = '${displayConfigurationSpace}'; 
     
    4241var index = 0; 
    4342var personalMenu = new Array(); 
     43 
     44var masterPropertiesExist = ${masterPropertiesExist}; 
     45var isLicenseRequiredAtLogin = ${isLicenseRequiredAtLogin}; 
    4446</script> 
    4547 
     
    5961<t:if test="assignmentsIsenabled"> 
    6062        <span><a href="${jSPRootURL}/servlet/AssignmentController/PersonalAssignments?module=${personalModule}">${assignment}</a></span> 
     63        <span><a href="${jSPRootURL}/assignments/My?module=${personalModule}">Assignments (Beta)</a></span> 
    6164</t:if> 
    6265 
     
    100103 
    101104<div class="menu-subpersonal-end">&nbsp;</div> 
     105</div> 
    102106 
     107<!-- div style='clear: both'></div> 
    103108<t:OutputRaw value="toolbar" /> 
     109 
     110<t:if test="isBlogPage"> 
     111        <div style='clear: both'></div> 
     112        <div class="left_column_bottom"> 
     113                <div class="left_column_top" style="margin-top: 25px;"> 
     114                        <div id="actionbox-item" class="actionbox-item"> 
     115                                <span><a href="${jSPRootURL}/blog/view/get_titles_only?module=${moduleId}"> Titles only </a></span>&nbsp;<br /> 
     116                                <span><a href="${jSPRootURL}/blog/view/get_full_entries?module=${moduleId}"> Full entries </a></span>&nbsp;<br /> 
     117                        </div> 
     118                </div> 
     119        </div>&nbsp; 
     120</t:if --> 
    104121 
    105122<!-- table border="0" width="100%" cellpadding="0" cellspacing="0"> 
     
    110127        </tr> 
    111128</table --> 
    112 </div> 
    113  
    114129<!-- script type="text/javascript" src="${JSPRootURL}/src/PersonalMenu.js" /> 
    115130<div style="left: 0px; top: 60px; position: absolute; width: 100%;"> 
  • trunk/core/web/html/resource/management/components/ProjectMenu.html

    r17829 r17849  
    124124<div class="menu-subprojects-end">&nbsp;</div> 
    125125 
     126</div> 
     127 
     128<!--div style='clear: both'></div> 
     129 
    126130<t:OutputRaw value="toolbar" /> 
     131 
     132<t:if test="isBlogPage"> 
     133        <div style='clear: both'></div> 
     134        <div class="left_column_bottom"> 
     135                <div class="left_column_top" style="margin-top: 25px;"> 
     136                        <div id="actionbox-item" class="actionbox-item"> 
     137                                <span><a href="${jSPRootURL}/blog/view/get_titles_only?module=${moduleId}"> Titles only </a></span>&nbsp;<br /> 
     138                                <span><a href="${jSPRootURL}/blog/view/get_full_entries?module=${moduleId}"> Full entries </a></span>&nbsp;<br /> 
     139                        </div> 
     140                </div> 
     141        </div>&nbsp; 
     142</t:if --> 
    127143 
    128144<!-- table border="0" width="100%" cellpadding="0" cellspacing="0"> 
     
    133149        </tr> 
    134150</table --> 
    135 </div> 
    136151 
    137152<!-- script type="text/javascript" src="${JSPRootURL}/src/ProjectMenu.js" />