禅道项目管理系统中,测试视图的缺陷管理里面,当前指派选择出了所有的公司人员,这个功能在我们公司不是很符合,我希望是仅指派当前项目组成员,如果用到其他项目组的成员,可以在团队里面修改。
Read the rest of this entry »
Archive for category 软件开发技术
相片处理文章收集
三 10
说明所连接的用户帐号没有远程连接的权限,只能在本机(localhost)登录。
需更改 mysql 数据库里的 user表里的 host项
把localhost改称%
首先按下面的步骤登录Mysql服务器
登录mysql需要切换到dos下的mysql的bin目录,进行如下操作:
mysql>use mysql;
mysql>update user set host = ‘%’ where user =’root’;
mysql>flush privileges;
mysql>select ‘host’,'user’ from user where user=’root’;
mysql>quit
OK。远程连接成功!
$(function () {
if (!$.browser.msie)
$("input:text").each(function () {
var input_id = $(this).attr('id');
document.getElementById(input_id).addEventListener("keyup", function () {
document.getElementById(input_id).setAttribute("value", document.getElementById(input_id).value);
}, false);
});
});
要用脚本手动的设属性到input中去,而这个过程在ie下是自动完成的,chrome却不是。
在上传文件的时候,需要限制指定的文件类型,accept这个属性,只在FF和chrome中有效。那么accept能限制哪些文件呢?见下表。
| 扩展名 | MIME | 描述 |
|---|---|---|
| *.3gpp | audio/3gpp, video/3gpp | 3GPP Audio/Video |
| *.ac3 | audio/ac3 | AC3 Audio |
| *.asf | allpication/vnd.ms-asf | Advanced Streaming Format |
| *.au | audio/basic | AU Audio |
| *.css | text/css | Cascading Style Sheets |
| *.csv | text/csv | Comma Separated Values |
| *.doc | application/msword | MS Word Document |
| *.dot | application/msword | MS Word Template |
| *.dtd | application/xml-dtd | Document Type Definition |
| *.dwg | image/vnd.dwg | AutoCAD Drawing Database |
| *.dxf | image/vnd.dxf | AutoCAD Drawing Interchange Format |
| *.gif | image/gif | Graphic Interchange Format |
| *.htm | text/html | HyperText Markup Language |
| *.html | text/html | HyperText Markup Language |
| *.jp2 | image/jp2 | JPEG-2000 |
| *.jpe | image/jpeg | JPEG |
| *.jpeg | image/jpeg | JPEG |
| *.jpg | image/jpeg | JPEG |
| *.js | text/javascript, application/javascript | JavaScript |
| *.json | application/json | JavaScript Object Notation |
| *.mp2 | audio/mpeg, video/mpeg | MPEG Audio/Video Stream, Layer II |
| *.mp3 | audio/mpeg | MPEG Audio Stream, Layer III |
| *.mp4 | audio/mp4, video/mp4 | MPEG-4 Audio/Video |
| *.mpeg | video/mpeg | MPEG Video Stream, Layer II |
| *.mpg | video/mpeg | MPEG Video Stream, Layer II |
| *.mpp | application/vnd.ms-project | MS Project Project |
| *.ogg | application/ogg, audio/ogg | Ogg Vorbis |
| application/pdf | Portable Document Format | |
| *.png | image/png | Portable Network Graphics |
| *.pot | application/vnd.ms-powerpoint | MS PowerPoint Template |
| *.pps | application/vnd.ms-powerpoint | MS PowerPoint Slideshow |
| *.ppt | application/vnd.ms-powerpoint | MS PowerPoint Presentation |
| *.rtf | application/rtf, text/rtf | Rich Text Format |
| *.svf | image/vnd.svf | Simple Vector Format |
| *.tif | image/tiff | Tagged Image Format File |
| *.tiff | image/tiff | Tagged Image Format File |
| *.txt | text/plain | Plain Text |
| *.wdb | application/vnd.ms-works | MS Works Database |
| *.wps | application/vnd.ms-works | Works Text Document |
| *.xhtml | application/xhtml+xml | Extensible HyperText Markup Language |
| *.xlc | application/vnd.ms-excel | MS Excel Chart |
| *.xlm | application/vnd.ms-excel | MS Excel Macro |
| *.xls | application/vnd.ms-excel | MS Excel Spreadsheet |
| *.xlt | application/vnd.ms-excel | MS Excel Template |
| *.xlw | application/vnd.ms-excel | MS Excel Workspace |
| *.xml | text/xml, application/xml | Extensible Markup Language |
| *.zip | aplication/zip | Compressed Archive |
今天碰到了一个非常小的问题,checkbox选中之后,提交到服务器端之后,仍然为false。真是找遍了各种解决方法。类似ispostback等等,我这个问题有些怪的,原来是好的,但不知道为什么不行了。
最后,把 CssClass去掉了,就好了。三个小时时间就这样过去了。哎
服务器端的WebService类,同时也是客户端类(因为有main方法以及测试的代码)
package webservice;
import javax.xml.namespace.QName;
import javax.xml.soap.Name;
import javax.xml.soap.SOAPElement;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;
import org.apache.axis.message.SOAPHeader;
import org.apache.axis.message.SOAPHeaderElement;
public class Power
{
public static String GetMessage()
{
return "调用成功!";
}
public static void main(String... a) throws Exception
{
String endpoint = "http://localhost:9000/hg/services/Power";
SOAPHeaderElement headerElement = new SOAPHeaderElement("http://schemas.xmlsoap.org/soap/envelope/", "sessionInfo");
headerElement.setMustUnderstand(false);
headerElement.addNamespaceDeclaration("soap", "http://schemas.xmlsoap.org/soap/envelope/");
SOAPElement sid = headerElement.addChildElement("sessionId");
sid.addTextNode("1234567890ABCDEF1234567890ABCDEF");
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL(endpoint));
call.setOperationName(new QName("GetMessage", "GetMessage"));
// call.addParameter(new QName("http://cn.zuoguodang.service", "name"),
// org.apache.axis.encoding.XMLType.XSD_STRING, ParameterMode.IN);
call.setReturnType(XMLType.SOAP_STRING);
// 设定 Header
call.addHeader(headerElement);
System.out.println(call.invoke(new Object[] {}));
}
}
服务器端的SoapHeader类
package webservice;
import java.util.Iterator;
import javax.xml.namespace.QName;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPHeader;
import org.apache.axis.AxisFault;
import org.apache.axis.Message;
import org.apache.axis.MessageContext;
import org.apache.axis.message.MessageElement;
import org.apache.axis.message.SOAPEnvelope;
import org.apache.axis.message.SOAPHeaderElement;
public class Soapheader extends org.apache.axis.handlers.BasicHandler
{
private String sessionId;
@Override
public void invoke(MessageContext msgContext) throws AxisFault
{
boolean processedHeader = false;
String headerName = null;
try
{
// 取得 Request 的 SOAP 信息
Message msg = msgContext.getRequestMessage();
SOAPEnvelope envelope = msg.getSOAPEnvelope();
SOAPHeader header = envelope.getHeader();
Iterator it = header.examineAllHeaderElements();
SOAPHeaderElement hel;
while (it.hasNext())
{
hel = (SOAPHeaderElement) it.next();
headerName = hel.getNodeName();
if (headerName.equals("sessionInfo"))
{
// 对于 mustUnderstand 设为 true 的 Header,必须
// 利用下列的方式把它设为"已经处理",否则 service
// 会回传 Did not understand "MustUnderstand"
hel.setProcessed(true);
checkUser(hel);
processedHeader = true;
}
}
}
catch (SOAPException e)
{
throw new AxisFault("无法处理 SOAP Header.", e);
}
if (!processedHeader) { throw new AxisFault("接收 SOAP Header 失败"+headerName); }
}
private void checkUser(SOAPHeaderElement hel) throws AxisFault
{
MessageElement fele = hel.getChildElement(new QName("", "sessionId"));
if (fele == null) { throw new AxisFault("找不到 sessionId 标签."); }
sessionId = fele.getValue();
if (!"12345".equals(sessionId)) { throw new AxisFault("认证失败"); }
}
}
因为是使用axis2 webservice,所以要修改server-config.wsdd,增加SoapHeader作为handler,放在根节点下面
<handler name="Authenticate" type="java:webservice.Soapheader" />
并在globalConfiguration/requestFlow下面再增加节点:
<handler type="Authenticate"/>
c# 来调用这个服务的话,先生成代理类,然后在生成的代理类里面增加一个属性:
public CredentialSoapHeader SoapHeaderValue;
然后在需要调用的webserice方法上加注释:
[System.Web.Services.Protocols.SoapHeaderAttribute("SoapHeaderValue")]
CredentialSoapHeader类代码如下:
[System.Xml.Serialization.XmlTypeAttribute(Namespace = "")]
[System.Xml.Serialization.XmlRootAttribute("sessionInfo", Namespace = "", IsNullable = false)]
public class CredentialSoapHeader : System.Web.Services.Protocols.SoapHeader
{
public string sessionId;
}
调用webservice并使用soapheader的代码如下:
PowerService sps = new PowerService();
CredentialSoapHeader cs = new CredentialSoapHeader();
cs.sessionId = "12345";
sps.SoapHeaderValue = cs;
Response.Write(sps.GetMessage());
VBA:批量保存visio中的页为图片
五 26
在做好VISIO后,需要另存为JPEG格式,如果一页一页的导,很麻烦,用VBA实现是最快的,另存为的JPEG文件名称为页名称。
Sub AutoSave2JPG()
Dim fileName
Set reg = CreateObject("vbscript.regexp")
reg.Pattern = "\/|\\|:|\*|\?|\""|<|>|\|"
For i = 1 To Application.ActiveDocument.Pages.Count Step 1
fileName = Application.ActiveDocument.Pages(i).Name
fileName = reg.Replace(fileName, "")
fileName = Application.ActiveDocument.Path & "\" & fileName & ".jpg"
Application.ActiveDocument.Pages(i).Export fileName
On Error Resume Next
Next
End Sub
重新安装:msxml6.msi,
下载地址:http://download.microsoft.com/download/b/7/1/b71d5305-618d-4b82-858b-386db3cc4453/msxml6.msi