Changeset 14080

Show
Ignore:
Timestamp:
04/19/05 18:59:17 (4 years ago)
Author:
dixon
Message:

bfd-2928: Introduce a "isGlobal" flag to templates allowing the template owner to specify whether a template can be used globally. Currently, a template can only be used if it is owned by a workspace (business or personal) that the user is a member of.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/optional/database/CreateScripts/versions/8.2.0/prm_db_patch_8.2.0.sql

    r14012 r14080  
    2525@versions/8.2.0/schedule/cr_task_cycle_worker.sql 
    2626COMMIT; 
     27@versions/8.2.0/tables/alter_pn_methodology_space.sql 
     28COMMIT; 
     29@versions/8.2.0/views/pn_methodology_view.sql 
     30COMMIT; 
     31@versions/8.2.0/views/pn_methodology_by_user_view.sql 
     32COMMIT; 
    2733 
    2834-------------------------------------------------------------------------------- 
     
    3440COMMIT; 
    3541@versions/8.2.0/packages/pkg_util.sql 
     42COMMIT; 
     43@versions/8.2.0/packages/pkg_methodology.sql 
    3644COMMIT; 
    3745 
  • trunk/prm/Java/net/project/methodology/DomainListBean.java

    r10492 r14080  
    1 /*----------------------------------------------------------------------+ 
    2 | 
    3 |    $RCSfile$ 
    4 |    $Revision$ 
    5 |    $Date$ 
    6 |    $Author$ 
    7 | 
    8 +----------------------------------------------------------------------*/ 
    91package net.project.methodology; 
    102 
  • trunk/prm/Java/net/project/methodology/MethodologyProvider.java

    r14058 r14080  
    8686        String qstrGetMethodologyOptionList = "select m.methodology_id, m.methodology_name, s.space_name " + 
    8787                "from pn_methodology_by_user_view m, pn_space_has_space shs, pn_space_view s " + 
    88                 " where m.person_id = ? " + 
    89                 " and shs.child_space_id = m.methodology_id and s.space_id = shs.parent_space_id and s.record_status = 'A' " + 
     88                " where (m.person_id = ? or m.is_global = 1) " + 
     89                " and shs.child_space_id = m.methodology_id " + 
     90                " and s.space_id = shs.parent_space_id and s.record_status = 'A' " + 
    9091                " and m.record_status='A' order by s.space_name, m.methodology_name asc"; 
    9192 
  • trunk/prm/Java/net/project/methodology/MethodologySpace.java

    r13408 r14080  
    5050    private String keywords = null; 
    5151 
     52    private boolean isGlobal = false; 
     53 
    5254    private int[] selectedModules = null; 
    5355 
     
    216218    } 
    217219 
     220 
     221    public boolean isGlobal() { 
     222        return this.isGlobal; 
     223    } 
     224 
     225    public void setGlobal(String isGlobal) { 
     226        this.isGlobal = Conversion.toBoolean(isGlobal); 
     227    } 
     228 
     229 
    218230    public void setSelectedModulesStringArray(String[] modules) { 
    219231 
     
    243255        query.append("select methodology_id, parent_space_id, methodology_name, "); 
    244256        query.append("methodology_desc, use_scenario_clob, created_by_id, created_by, modified_by_id, modified_by, "); 
    245         query.append("created_date, modified_date, record_status, crc "); 
     257        query.append("created_date, modified_date, record_status, is_global, crc "); 
    246258        query.append("from pn_methodology_view "); 
    247259        query.append("where methodology_id = ? "); 
     
    265277                setModifiedByID(db.result.getString("modified_by_id")); 
    266278                setModifiedDate(db.result.getTimestamp("modified_date")); 
     279                setGlobal(db.result.getString("is_global")); 
    267280                setCrc(db.result.getTimestamp("crc")); 
    268281                setRecordStatus(db.result.getString("record_status")); 
     
    340353        int methodologyIDIndex = 0; 
    341354 
    342         db.prepareCall("{call METHODOLOGY.CREATE_METHODOLOGY(?,?,?,?,?,?,?, ?,?)}"); 
     355        db.prepareCall("{call METHODOLOGY.CREATE_METHODOLOGY(?,?,?,?,?,?,?, ?,?, ?)}"); 
    343356        db.cstmt.setString(++index, getName()); 
    344357        db.cstmt.setString(++index, getDescription()); 
     
    347360        db.cstmt.setString(++index, this.industryID); 
    348361        db.cstmt.setString(++index, this.categoryID); 
     362        db.cstmt.setInt(++index, Conversion.booleanToInt(this.isGlobal)); 
    349363        db.cstmt.setInt(++index, (this.useScenario == null ? 1 : 0)); 
    350364        db.cstmt.registerOutParameter((useScenarioClobIndex = ++index), java.sql.Types.CLOB); 
     
    369383        int useScenarioClobIndex = 0; 
    370384 
    371         db.prepareCall("{call METHODOLOGY.MODIFY_METHODOLOGY(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}"); 
     385        db.prepareCall("{call METHODOLOGY.MODIFY_METHODOLOGY(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}"); 
    372386        db.cstmt.setString(++index, getID()); 
    373387        db.cstmt.setString(++index, getName()); 
     
    377391        db.cstmt.setString(++index, this.industryID); 
    378392        db.cstmt.setString(++index, this.categoryID); 
     393        db.cstmt.setInt(++index, Conversion.booleanToInt(this.isGlobal)); 
    379394        if (this.crc == null) { 
    380395            db.cstmt.setNull(++index, java.sql.Types.TIMESTAMP); 
     
    454469        xml.append("<modified_by_id>" + XMLUtils.escape(this.modifiedByID) + "</modified_by_id>"); 
    455470        xml.append("<modified_by>" + XMLUtils.escape(this.modifiedBy) + "</modified_by>"); 
     471        xml.append("<is_global>" + XMLUtils.escape(Conversion.booleanToString(isGlobal())) + "</is_global>"); 
    456472        xml.append("<crc>" + XMLUtils.escape("" + this.crc) + "</crc>"); 
    457473        xml.append("<record_status>" + XMLUtils.escape(this.recordStatus) + "</record_status>"); 
     
    484500        industryID = null; 
    485501        categoryID = null; 
     502        isGlobal=false; 
    486503        keywords = null; 
    487504        selectedModules = null; 
  • trunk/prm/Java/net/project/util/Conversion.java

    r14010 r14080  
    5555     */ 
    5656    public static boolean toBoolean(String s) { 
    57         if (s != null && (s.equals("1") || s.equals("Y") || s.equals("true"))) 
     57        if (s != null && (s.equals("1") || s.equals("Y") || s.equals("true") || s.equals("on"))) 
    5858            return true; 
    5959        else 
  • trunk/prm/Jsp/pnet/methodology/PropertiesEdit.jsp

    r13914 r14080  
    1111            net.project.security.User,  
    1212            net.project.security.SessionManager, 
    13                         net.project.project.DomainListBean"  
     13                        net.project.project.DomainListBean, 
     14            net.project.util.Conversion" 
    1415%> 
    1516<%@ include file="/base/taglibInclude.jsp" %> 
     
    5657   theForm = self.document.forms["main"]; 
    5758   isLoaded = true; 
     59 
     60   setIsGlobal ('<%=Conversion.booleanToString(methodologySpace.isGlobal())%>'); 
    5861} 
    5962 
     
    7679   theForm.submit(); 
    7780} 
     81 
     82function setIsGlobal(isGlobal) { 
     83    if (isGlobal == 'true') { 
     84        theForm.isGlobal.checked = true; 
     85    } else { 
     86        theForm.isGlobal.checked = false; 
     87    } 
     88} 
     89 
    7890 
    7991</script> 
     
    133145          <td>&nbsp;</td> 
    134146    </tr> 
     147    <tr align="left"> 
     148        <td nowrap>&nbsp;</td> 
     149    <td nowrap class="fieldNonRequired"><display:get name="prm.methodology.global.label" />&nbsp;</td> 
     150    <td nowrap> 
     151      <input type="checkbox" name="isGlobal"> 
     152    </td> 
     153        <td nowrap>&nbsp;</td> 
     154  </tr> 
    135155    <tr align="left">  
    136156      <td nowrap colspan="5">&nbsp;</td> 
  • trunk/prm/Jsp/pnet/methodology/PropertiesEditProcessing.jsp

    r10578 r14080  
    1 <%-------------------------------------------------------------------- 
    2 | 
    3 |    $RCSfile$ 
    4 |   $Revision$ 
    5 |       $Date$ 
    6 |     $Author$ 
    7 | 
    8 |--------------------------------------------------------------------%> 
    91<%@ page 
    102    contentType="text/html; charset=UTF-8" 
     
    3123<jsp:setProperty name="methodologySpace" property="parentSpaceID" /> 
    3224<jsp:setProperty name="methodologySpace" property="useScenario" /> 
     25 
     26<% 
     27    methodologySpace.setGlobal(request.getParameter("isGlobal")); 
     28%> 
    3329<%-- Not supported yet 
    3430<jsp:setProperty name="methodologySpace" property="industryID" /> 
  • trunk/prm/Jsp/pnet/methodology/TemplifySpace.jsp

    r13804 r14080  
    158158        <td nowrap>&nbsp;</td> 
    159159  </tr> 
     160    <tr align="left"> 
     161        <td nowrap>&nbsp;</td> 
     162    <td nowrap class="fieldNonRequired"><display:get name="prm.methodology.global.label" />&nbsp;</td> 
     163    <td nowrap> 
     164      <input type="checkbox" name="isGlobal"> 
     165    </td> 
     166        <td nowrap>&nbsp;</td> 
     167  </tr> 
    160168  <tr align="left"> 
    161169    <td nowrap colspan="4">&nbsp;</td> 
  • trunk/prm/Jsp/pnet/methodology/TemplifySpaceProcessing.jsp

    r13805 r14080  
    2727      methodologySpace.setUseScenario (request.getParameter("useScenario")); 
    2828      methodologySpace.setParentSpaceID (request.getParameter("parentSpaceID")); 
     29      methodologySpace.setGlobal(request.getParameter("isGlobal")); 
    2930 
    3031/* Not implemented yet