zoukankan      html  css  js  c++  java
  • MOSS项目开发 周记(第十五周)

    第十五周

    最后一个模块是My Bookmark(个人书签)
    因为,信息目录和服务目录的项目数目不小,但是,大部分员工每天只是固定在几个服务和几个相对固定的信息内容。
    这个模块的目的是提供一个个人书签以标记常用的服务和信息。以方便用户的使用。

    信息和服务目录存放在infocategory List 

    Title

    Single line of text

    URL

    Single line of text

     

    DisplayOrder

    Number

     

    Target

    Single line of text

     

    Hide

    Yes/No

     

    Owner

    Single line of text

     

    Created By

    Person or Group

     

    Modified By

    Person or Group



    个人书签存放在mybookmark List,

    Title

    Single line of text

    InfoCatID

    Number

     

    Created By

    Person or Group

     

    Modified By

    Person or Group

    其中InfoCatID是指向infocategory的ID
    新建一个View名为mybookmark,Filter条件是modified by = [me]

    为此将viewlist.aspx扩展到viewlist2.aspx,新加二个参数view2和List2,输出的xml各市如下
    <List>
     <view>
     </view>
    .............
     <view>
     </view>
     <view2>
     </view2>
    ............
    <view2>
     </view2>
    </List>

    使用sitemap(即显示整个infocategory List)的XSLT加上
    <form action="mybookmark.aspx" method="post">
    </form>
    判断item是否已经被选中,使用如下代码
    <xsl:template name="BookMarkFunction">
      <xsl:param name="infoCatID" />
      <xsl:for-each select="View">
          
         <H5>
          <xsl:variable name="fID" select="ID"></xsl:variable>
          <input type="checkbox" value="{ID}" id="ID{ID}" name="useroptionChkBox">
           <xsl:if test="count(/List/View2[InfoCatID=$fID]) != 0">
            <xsl:attribute name="checked">Checked</xsl:attribute>
           </xsl:if>
          </input>
          <label>
           <xsl:attribute name="for">
           <xsl:value-of select="Title" />
           </xsl:attribute>
           <xsl:value-of select="Title" />
          </label>
         </H5>
       
       
      </xsl:for-each>
    </xsl:template>


    mybookmark.aspx把用户提交的结果存入bookmark List,因为用户使用自己的NETWORK ID存入,myBookmark(View)根据filter条件,只会显示用户的本人的bookmark。

    对应的XSLT代码如下
    <?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions">
     <xsl:template match="List">
      <xsl:variable name="Random"><xsl:value-of select="param/Random"/> </xsl:variable>
      <div class="toolbox" id="mynavi">
       <h3 onclick="javascript:toggle_display('mynavi_div',this);" class='on'>
        <span>My Bookmark</span>
       </h3>
       <ul id="mynavi_div">
        <xsl:for-each select="View">
         <xsl:sort select="LinkTitle" />
         <li>
          <a>
            <xsl:attribute name="href"><xsl:value-of select="URL"/></xsl:attribute>
            <xsl:attribute name="Target"><xsl:value-of select="Target" /></xsl:attribute>
            <xsl:value-of select="LinkTitle"/>
          </a>
          
         </li>
        </xsl:for-each>
       </ul>
       <div align="right">[ <a>
        <xsl:attribute name="href">#</xsl:attribute>
        Edit Bookmark
        </a> ]</div>
      </div>
     </xsl:template>
    </xsl:stylesheet>

    显示如图


    模块虽然不完美,但实施起来方便简洁,编码也只要一个工作日就完成了。







  • 相关阅读:
    Bluetooth篇 开发实例之八 匹配
    Bluetooth篇 开发实例之七 匹配&UUID
    Bluetooth篇 开发实例之六 蓝牙RSSI计算距离
    Bluetooth篇 开发实例之五 为什么无线信号(RSSI)是负值?
    Android Developer -- Bluetooth篇 开发实例之四 API详解
    Android Developer -- Bluetooth篇 开发实例之三 管理连接
    LoadRunner监控Window/Unix系统资源的配置
    性能测试方法对比
    HTTP状态代码含义
    百度输入法
  • 原文地址:https://www.cnblogs.com/by1455/p/990471.html
Copyright © 2011-2022 走看看