SharePoint开发总结

时间:2024.4.7

SharePoint的体系结构

将SharePoint安装到web应用程序称为扩展该web应用程序。

3 SharePoint用户体验

3.2 内容存储在网站集中

网站集是用于包含网站中其他所有页面的顶层网站,它是所有将来可以被创建的子网站的父网站。

3.3 使用SharePoint列表和库

SharePoint是由内容和数据组成。SharePoint中的内容是存储在Web部件中的用户界面和信息,而数据是SharePoint存储在数据库中并可以版本化的信息。

列表时一组数据,用于列出对用户有帮助的信息。

文档库是某种类型的列表。

文档模板是在文档库中创建的所有新文件的默认文件类型。

自定义列表中的栏是向存储在SharePoint中的数据添加更多含义和值的快速方法。

版本化

很多用户都有经常改动的数据,他们需要一种方法来跟踪这些改动。SharePoint通过使用版本化提供这种功能。版本化功能将原有数据的副本保存在存储位置中,而将新的数据显示在列表中。使用SharePoint,你能够维护数据的多个版本,而且能够还原和比较该数据的不同版本。

3.6 内容类型说明

SharePoint提供了通过使用内容类型组织和存储数据的功能。使用内容类型可以在相同的列表或文档库中存储不同类型的内容。从根本上说,内容类型是可以定义并应用于数据的设置集合。

5 Windows SharePoint Services编程

WSS不只是可以再其中存储文档和列表的一组奇特的网页,也不只是自定义应用程序和Web

部件的主机。WSS自身实际上是一个功能丰富的应用程序开发平台,包括丰富对象模型(OM)和Web服务层。


第二篇:ChatLogs插件开发总结


ChatLogs插件开发总结

一、需求

针对web客户端的用户,如果是长期联系的用户,则需要将他与客服的聊天记录保存到数据库中。当其需要查看他与客服的聊天信息时,可很方便的获取。当删除用户是,将他的聊天信息也一起删除。如果用户的聊天记录大于一定时间(如:一个月),需要将此用户指定时间之前的聊天信息删除,前提是此用户还存在。

二、功能描述

添加聊天记录:客户端发送的信息是以XML包的形式发送的,服务器会自动监听此文件包。服务器段获取到客户的信息包后,对其进行解析(解析出来的信息就是客户发送的具体信息)。然后,将信息保存到数据库中。获取聊天记录:当客户需要获取聊天记录时,会发送一个请求到服务器端(此请求包含了用户名和一个时间点)。服务器接收到请求后,根据此用户名和时间,查询此用户在此时间点之前的最新的十条聊天信息。删除聊天记录:有两种情况会删除聊天记录:一种是:删除用户时,将其聊天记录一同删除;第二中是:定时删除用户聊天记录,通过一个定时器完成定时操作。

三、sql语句

创建聊天记录表:

DROP TABLE IF EXISTS ofchatlogs;

CREATE TABLE ofchatlogs(

MESSAGEID int(11) NOT NULL auto_increment,

SESSIONJID varchar(80) default NULL,

SENDER varchar(80) default NULL,

RECEIVER varchar(80) default NULL,

CREATEDATE varchar(30) default NULL,

LENGTH int(11) default NULL,

CONTENT varchar(20xx) default NULL,

DETAIL varchar(4000) default NULL,

STATE int(11) default NULL,

PRIMARY KEY (MESSAGEID),

KEY senderPK (SENDER),

CONSTRAINT senderPK FOREIGN KEY (SENDER) REFERENCES ofuser (username)

) ENGINE=InnoDB DEFAULT CHARSET=utf8;

添加聊天记录:INSERT INTO ofChatLogs(sessionJID, sender, receiver, createDate, length, content, detail, state) VALUES(?,?,?,?,?,?,?,?)

获取聊天记录:SELECT sender, receiver, createDate, content FROM ofChatLogs where state = 0 and (sender=? or receiver=?) and createDate<? ORDER BY createDate DESC LIMIT 10 删除聊天记录:

根据用户删除的聊天记录:DELETE from ofchatlogs where sender=?

定时删除用户的聊天记录:DELETE from ofchatlogs where

(UNIX_TIMESTAMP(SYSDATE())-createDate/1000)/(24*60*60)>30 四、Plugin.xml文件 <?xml version="1.0" encoding="UTF-8"?> <plugin>

<!-- Main plugin class -->

<class>org.jivesoftware.openfire.plugin.ChatLogsPlugin</class>

<!-- Plugin meta-data -->

<name>chatlogs</name>

<description>chatlogs insert,delete,select and so on.</description>

<author>WangluShen</author>

<version>1.0.0</version>

<date>29/6/20xx</date>

<minServerVersion>3.8.2</minServerVersion>

<!-- 协议 -->

<licenseType>gpl</licenseType>

<!-- Admin console entries -->

<adminconsole>

</adminconsole>

</plugin>

五、编写自己的数据交互类,插件类,计时器类以及所需的工具类。

数据交互类:DbChatLogsManager.Java,一些数据库操作的方法。

插件类:ChatLogsPlugin.java,该类实现了PacketInterceptor.java接口类,这个借口可实 现监听用户发送的信息。通过实现该接口的interceptPacket方法,获取用户的聊天信息 数据包。

计时器类:ChatLogsDelTimer.java,实现定时删除用户聊天记录的功能。

聊天记录实体类:Chatlog.java

Servlet类:ChatLogsServlet.java,接收请求,处理请求。

其他类:如日期工具类DateUtil.java等。

六、用ant工具打Jar包

首先要写build.xml文件

<?xml version="1.0" encoding="UTF-8"?> <project name="Webapp Precompilation" default="" basedir=".">

<property file="build.properties" />

<!-- java servlet相关文件编译jar存放位置 -->

<property name="java.jar.dir" value="${webapp.path}/java-dist"/>

<!-- jsp servlet编译后jar存放位置 -->

<property name="jsp.jar.dir" value="${webapp.path}/jsp-dist/lib"/> <!-- 定义java servlet和jsp servlet的jar包名称 -->

<property name="java.jar"

value="${java.jar.dir}/plugin-${plugin.name}.jar"/> value="${jsp.jar.dir}/plugin-${plugin.name}-jsp.jar"/> <property name="jsp.jar"

<!-- jsp servlet配置到web.xml中 -->

<property name="plugin.web.xml" value="${webapp.path}/jsp-dist/web.xml"/> <!-- 编译jsp 并生成相关jar、xml文件 -->

<target name="jspc">

<taskdef classname="org.apache.jasper.JspC" name="jasper2">

<classpath id="jspc.classpath">

<pathelement location="${java.home}/../lib/tools.jar" /> <fileset dir="${tomcat.home}/bin">

<include name="*.jar" />

</fileset>

<fileset dir="${tomcat.home}/lib">

<include name="*.jar" />

</fileset>

<fileset dir="${tomcat.home}/lib">

<include name="*.jar" />

</fileset>

</classpath>

</taskdef>

<!-- 编译jsp->servlet class -->

<jasper2 javaEncoding="UTF-8" validateXml="false"

uriroot="${plugin.path.src}/web"

outputDir="${webapp.path}/jsp-dist/src"

package="org.jivesoftware.openfire.plugin.${plugin.name}" /> <!-- 编译后的servlet class 配置到web.xml文件中 -->

<jasper2

validateXml="false"

uriroot="${plugin.path.src}/web"

outputDir="${webapp.path}/jsp-dist/src"

package="org.jivesoftware.openfire.plugin.${plugin.name}"

webXml="${plugin.web.xml}"/>

</target>

<!-- 编译jsp 并将其打jar包 -->

<target name="compile">

<mkdir dir="${webapp.path}/jsp-dist/classes" />

<mkdir dir="${webapp.path}/jsp-dist/lib" />

<mkdir dir="${webapp.path}/jsp-dist/src" />

<javac destdir="${webapp.path}/jsp-dist/classes" optimize="off" encoding="UTF-8" debug="on" failonerror="false"

srcdir="${webapp.path}/jsp-dist/src" excludes="**/*.smap">

<classpath>

<pathelement location="${webapp.path}/jsp-dist/classes" /> <fileset dir="${webapp.path}/jsp-dist/lib">

<include name="*.jar" />

</fileset>

<pathelement location="${tomcat.home}/common/classes" /> <fileset dir="${tomcat.home}/lib">

<include name="*.jar" />

</fileset>

<pathelement location="${tomcat.home}/shared/classes" /> <fileset dir="${tomcat.home}/lib">

<include name="*.jar" />

</fileset>

<fileset dir="${tomcat.home}/bin">

<include name="*.jar" />

</fileset>

</classpath>

<include name="**" />

<exclude name="tags/**" />

</javac>

<jar jarfile="${jsp.jar}" basedir="${webapp.path}/jsp-dist/classes" /> </target>

<!-- 将java servlet打包成jar -->

<target name="java-jar">

<mkdir dir="${java.jar.dir}"/>

<jar jarfile="${java.jar}">

<fileset dir="${webapp.path}/bin" includes="**/*.class"/>

</jar>

</target>

<!-- 生成可部署的插件包 -->

<target name="plug-jar">

<!-- 插件插件包相关lib、 web目录 -->

<mkdir dir="${webapp.path}/${plugin.name}/lib"/>

<mkdir dir="${webapp.path}/${plugin.name}/web/WEB-INF"/>

<!-- 复制jsp servlet的jar和java servlet的相关jar包到插件包的lib目录下 --> <copy file="${java.jar}" todir="${webapp.path}/${plugin.name}/lib"/> <!-- 将相关的图片、帮助文档、修改日志等文件复制到插件目录下 -->

<copy todir="${webapp.path}/${plugin.name}">

<fileset dir="${plugin.path}" includes="*.*"/>

</copy>

<copy todir="${webapp.path}/${plugin.name}/web">

<fileset dir="${plugin.path.src}/web">

<include name="*"/>

<include name="**/*.*"/>

<exclude name="**/*.xml"/>

<exclude name="**/*.jsp"/>

</fileset>

</copy>

<!-- jsp servlet的web复制到插件目录下 -->

<copy todir="${webapp.path}/${plugin.name}/web">

<fileset dir="${plugin.path.src}/web" includes="**/*.xml"/> </copy>

<!-- 产生可部署插件包 -->

<jar jarfile="${webapp.path}/${plugin.name}.jar">

<fileset dir="${webapp.path}/${plugin.name}" includes="**/**"/>

</jar>

</target>

<!-- 生成没有Web资源的可部署插件包 -->

<target name="java-plug-jar">

<!-- 插件插件包相关lib、 web目录 -->

<mkdir dir="${webapp.path}/${plugin.name}/lib"/>

<!-- 复制java servlet的相关jar包到插件包的lib目录下 -->

<copy file="${java.jar}" todir="${webapp.path}/${plugin.name}/lib"/> <!-- 将相关的图片、帮助文档、修改日志等文件复制到插件目录下 -->

<copy todir="${webapp.path}/${plugin.name}">

<fileset dir="${plugin.path}" includes="*.*"/>

</copy>

<!-- 产生可部署插件包 -->

<jar jarfile="${webapp.path}/${plugin.name}.jar">

<fileset dir="${webapp.path}/${plugin.name}" includes="**/**"/> </jar>

</target>

<!-- 清理生成的文件 -->

<target name="clean">

<delete file="${webapp.path}/${plugin.name}.jar"/>

<delete dir="${webapp.path}/${plugin.name}"/>

<delete dir="${webapp.path}/jsp-dist"/>

<delete dir="${webapp.path}/java-dist"/>

</target>

<target name="all" depends="clean,jspc,compile"/>

<target name="Openfire-Plugin" depends="jspc,java-jar"/>

<target name="OpenfirePlugin-java"

depends="clean,java-jar,java-plug-jar"/> </project>

其次,build.xml文件的配置文件,build.properties

java.home=D:\Program Files\Java\jdk1.7.0_09 tomcat.home=E:/Program Files/Apache Software Foundation/Tomcat 7.0 webapp.path=E:/workspace/ChatLogsPlugin plugin.name=chatlogs plugin.path=E:/workspace/ChatLogsPlugin/src/plugins/chatlogs plugin.path.src=E:/workspace/ChatLogsPlugin/src/plugins/chatlogs/src

最后,没问题了,运行。根据提示调试。如果出现:BUILD SUCCESSFUL表示成功。

七、发布,测试

将打包好的delofflineusers.jar复制到openfire安装目录的plugins文件中,启动openfire服务器。如果启动窗口显示了运行信息,表示此插件发布正常。然后进行测试。根据结果调试到需要的结果。

八、遇到的问题和注意事项

此次插件开发中,遇到的主要问题是用户的聊天信息实时如何实现监听,将听到后如何解析,包装成ChatLog 对象?经过查阅资料,发现PacketInterceptor接口具有这样的功

能。让插件类实现此接口。然后,在重写的interceptPacket方法中实现相应的功能。 注意事项:开发中一定要了解清楚功能需求,方可下手。否则,如果盲目的去实现功能,结果却不是客户所需的,就会白白浪费时间和精力。

更多相关推荐:
The Ultimate Trainers

AfterIreadthisbookIthinkIshouldlearnsomethingusefulandoptimisticfromJakethefirstcharacterinthestoryAlthoughtheultim...

The summary of the ultimate trainers

ThesummaryoftheultimatetrainersThestoryisaboutaboycalledJakeandtheultimatetrainersJakeandAnnaaregoodfriendsOnedayaf...

The ultimate trainers

ByTianyeZhangThisstoryisaboutaboynamedJakewholikedrunningverymuchtooktheperfecttrainershesawontopofacardboxnexttoap...

Treasure Island金银岛读书笔记英文

RobertLouisBalfourStevensonwasaScottishnovelistpoetessayistandtravelwriterHismostfamousworksareTreasureIslandKidnap...

Treasure island金银岛读书报告

TreasureIslandThestoryistoldbyJimHawkinshimselfwhosemotherkepttheAdmiralBenbowInnAnoldseadogcomestothispeacefulinno...

金银岛_英文读后感_treasure_islad

BookReportofTreasureIsland1AbouttheAuthorRobertLouisStevensonwasaScottishnovelistessayistandpoetwhocontributedsever...

Treasure island 读后感

学号20xx09410117专业师范英语姓名刘欢TreasureIslandPlotintroductionJimwasatenyearoldboyHisfamilyhadaBenbowinntoearnthe...

金银岛 英文读后感 treasure islad

BookReportofTreasureIsland1AbouttheAuthorRobertLouisStevensonwasaScottishnovelistessayistandpoetwhocontributedsever...

treasure island

TreasurelandTreasurelandpublishedin1882istheadventurestoryparexcellenceanditmadethewriter39sreputationaso...

Treasure Island读后感

TreasureIslandOnthisNationalDayholidayIreadabookcalledTreasureIslandThisstorydescribestheprocessofatreasureTheprota...

treasure island 英语读书笔记

ReadingGuideHelenZBookTreasureIslandAuthorRobertLouisStevensonIntroductiontotheauthorRobertLouisStevensonwasborninE...

Doc4简爱读后感 英文版

WhatdoIwriteaboutyouJaneWordsfallshortwhenItrytoJaneyouaresomuchapartofmeasIamyoursYouaresomuchapartofwomenwholived...

the ultimate trainers读后感(3篇)