
WebSite : http://www.alilg.com/software/free-php-ajax-chat/
AliTalk_1.9.1.1.zipAliTalk_1.9.1.1 Download

AliTalk_1.9.1.1.zipAliTalk_1.9.1.1 Download

new Ajax.Request('/some_url',
{
method:'get',
parameter:'param1=value1¶m2=value2',//or $('form').serialize()
onSuccess: function(transport){
var response = transport.responseText || "no response text";
alert("Success! \n\n" + response);
},
onFailure: function(){ alert('Something went wrong...') }
});
The links in the "Element" column point to more information about each specific element.
| Element | Description |
|---|---|
| <category> | Optional. Defines one or more categories for the feed |
| <cloud> | Optional. Register processes to be notified immediately of updates of the feed |
| <copyright> | Optional. Notifies about copyrighted material |
| <description> | Required. Describes the channel |
| <docs> | Optional. Specifies an URL to the documentation of the format used in the feed |
| <generator> | Optional. Specifies the program used to generate the feed |
| <image> | Optional. Allows an image to be displayed when aggregators present a feed |
| <language> | Optional. Specifies the language the feed is written in |
| <lastBuildDate> | Optional. Defines the last-modified date of the content of the feed |
| <link> | Required. Defines the hyperlink to the channel |
| <managingEditor> | Optional. Defines the e-mail address to the editor of the content of the feed |
| <pubDate> | Optional. Defines the last publication date for the content of the feed |
| <rating> | Optional. The PICS rating of the feed |
| <skipDays> | Optional. Specifies the days where aggregators should skip updating the feed |
| <skipHours> | Optional. Specifies the hours where aggregators should skip updating the feed |
| <textInput> | Optional. Specifies a text input field that should be displayed with the feed |
| <title> | Required. Defines the title of the channel |
| <ttl> | Optional. Specifies the number of minutes the feed can stay cached before refreshing it from the source |
| <webMaster> | Optional. Defines the e-mail address to the webmaster of the feed |
| Element | Description |
|---|---|
| <author> | Optional. Specifies the e-mail address to the author of the item |
| <category> | Optional. Defines one or more categories the item belongs to |
| <comments> | Optional. Allows an item to link to comments about that item |
| <description> | Required. Describes the item |
| <enclosure> | Optional. Allows a media file to be included with the item |
| <guid> | Optional. Defines a unique identifier for the item |
| <link> | Required. Defines the hyperlink to the item |
| <pubDate> | Optional. Defines the last-publication date for the item |
| <source> | Optional. Specifies a third-party source for the item |
| <title> | Required. Defines the title of the item |
<?xml version="1.0" encoding="ISO-8859-1" ?>주석 처리는 HTML 코드에서 사용 되는 주석태그 <!-- This is an RSS comment --> 를 사용하면된다.
<rss version="2.0">
<channel>
<title>W3Schools Home Page</title>
<link>http://www.w3schools.com</link>
<description>Free web building tutorials</description>
<item>
<title>RSS Tutorial</title>
<link>http://www.w3schools.com/rss</link>
<description>New RSS tutorial on W3Schools</description>
</item>
<item>
<title>XML Tutorial</title>
<link>http://www.w3schools.com/xml</link>
<description>New XML tutorial on W3Schools</description>
</item>
</channel>
</rss>
scheme://host[:port]/path[?query]JSON has taken the award for the easiest method for transporting data when using Ajax. JSON is great to get data from the server side to the client side. What what about when you need to send data to the server side? Sure you can use JSON then - but the advantage of using JSON is lost. So I propose using another format for it - UED or URL Encoded Data. Its a very simple concept - and it has been in use for a long time - all I have done is create a function that will encode the data into this format. The basic concept behind this is that the most used data structures can be easily encoded into a URL. You can create variables, numerical arrays, associative arrays, multi-level arrays etc. using existing syntax. The best part is all the server side languages are capable of handling this format - so no parsing is needed.
ued_encode() will take an array as its argument and return the data encoded in UED format - as a string. You can use that string to send the data via POST or GET in the query part of the URL.
scheme://host[:port]/path[?query]
http://www.google.com:80/search?q=hello
The syntax for the data part is given below
name=Binny
year=2007
quote=Hello%2C+World%21 - That is "Hello, World!" in a 'url encoded' format.
os[]=Windows
os[]=Linux
os[]=Mac
software[editor]=vi
software[audio]=xmms
software[video]=vlc
All these will be joined using '&' - that will be the final string. Note: Line wrapped at '?'
name=Binny&year=2007"e=Hello%2C+World%21&os[]=Windows&os[]=Linux&os[]=Mac ?
&software[editor]=vi&software[audio]=xmms&software[video]=vlc
No, it is not readable - it is not designed to be readable. But it is a very compact format. You can send this data to the server side by appending it to a url as the query(using the get method)
But if you are a web developer, you already know that. You use it every day. Sometime you don't see it - the browser will automatically format the data from a form into this format and send it. In other occasions you have to create such URL by hand to send data to the server side in your Ajax(or non-Ajax) app.
So I have created a function that will encode the given data to this format.
//The JS Array format of the example given above
var arr = {
'name':"Binny",
'year':2007,
'quote':"Hello, World!",
'os':['Windows','Linux','Mac'],
'software':{
'editor':"vi",
'audio':"xmms",
'video':"vlc"
}
}
var data = ued_encode(arr);
ued_encode.js - <1 KB
//ued_encode() will take an array as its argument and return the data encoded in UED format - as a string.
//http://www.openjs.com/scripts/data/ued_url_encoded_data/
function ued_encode(arr,current_index) {
var query = ""
if(typeof current_index=='undefined') current_index = '';
if(typeof(arr) == 'object') {
var params = new Array();
for(key in arr) {
var data = arr[key];
var key_value = key;
if(current_index) {
key_value = current_index+"["+key+"]"
}
if(typeof(data) == 'object') {
if(data.length) { //List
for(var i=0;i<data.length; i++) {
params.push(key_value+"[]="+ued_encode(data[i],key_value)); //:RECURSION:
}
} else { //Associative array
params.push(ued_encode(data,key_value)); //:RECURSION:
}
} else { //String or Number
params.push(key_value+"="+encodeURIComponent(data));
}
}
query = params.join("&");
} else {
query = encodeURIComponent(arr);
}
return query;
}
BSD License

| * 외국 사이트의 XML-RPC Ping 서비스 주소 |
웹 2.0 시대의 블로그는 아주 중요한 개인미디어로의 역할을 수행한다. 이들 블로그를 세상 바깥으로 가져다 주는 서비스가 바로 이들 메타블로그들과 같은 서비스이다. 우리의서비스를 대외적으로 알리고 새롭게 나올 서비스들과의 연동을 원한다면 블로그 서비스업체와 개발업체 모두 이런 표준 부분을 고민을해 주었으면 하는 바램이다. AllBlog America가 나온다고 상상해보라! 정말 흥미 있지 않은가? 컴퓨터와 컴퓨터간의자동 대화의 시작으로도 볼 수 있는 OpenAPI를 지원하는 블로그 서비스를 앞으로는 많이 보았으면 한다. 국내의 블로그소프트웨어 개발 업체들의 분발을 기대해본다.
(작성자 : 네오비스)
원문 : http://blogs.missiondata.com/?p=28
AJAX file upload progress for Java using commons fileupload and prototype
This has been done before with PHP (AJAX upload progress meter for PHP) etc but I needed something a little different because I wanted to upload a file and then have it loaded into a database. I looked around and found that someone had already made something that used the commons file upload package to do the upload part (AJAX Upload progress monitor for Commons-FileUpload Example). It wasn’t exactly what I was looking for but it a good start.
To understand the way this works I think it is easiest to break it down into parts:
This was taken from the example listed above. It extends and wraps parts of the commons File Upload classes so that you can count the bytes as they are uploaded to the server. You can download the source with build file or the binary. You will also need the commons file upload, commons io and commons logging. If you download the source put the commons jars in the lib directory before building.
The code is fairly simple to follow. MonitoredDiskFileItemFactory replaces DiskFileItemFactory and the construction of a MonitoredDiskFileItemFactory takes a OutputStreamListener that will be passed on down the chain. The new factory creates MonitoredDiskFileItems instead of DiskFileItems for each file uploaded. When the file needs to be written to disk a MonitoredOutputStream is given back instead of a normal OutputStream. The MonitoredOutputStream calls the OutputStreamListener methods as the bytes are written and with that you now have a way to monitor the byte count as the file is created on the server.
Now to test this all out we can just have an OutputStreamListener that writes its progress out to a logfile or something.
public class FileUploadListener implements OutputStreamListener{ private long totalFileSize; private long currentFileRead; public FileUploadListener(long totalFileSize) { this.totalFileSize = totalFileSize; this.currentFileRead = 0; } public void start() { log.debug("Upload started. Total file size: " + totalFileSize); } public void bytesRead(int byteCount) { log.debug("Read bytes. Currently " + byteCount + " out of " + totalFileSize + " bytes."); currentFileRead+=byteCount; } public void error(String error) { log.debug("Hit an error: " + error); } public void done() { log.debug("Upload done."); } public long getTotalRead() { return currentFileRead; } public long getTotalSize() { return totalFileSize; }}Now we try it out. You can put this in a servlet or jsp so I’m only going to list the parts that matter.
FileUploadListener listener = new FileUploadListener(request.getContentLength()); session.setAttribute("LISTENER", listener); FileItemFactory factory = new MonitoredDiskFileItemFactory(listener); ServletFileUpload upload = new ServletFileUpload(factory); List items = upload.parseRequest(request); for (Iterator i = items.iterator(); i.hasNext();) { FileItem fileItem = (FileItem) i.next(); if (!fileItem.isFormField()) { // code here to process the file } }I’m going to assume you can find the correct way to do the actual form upload part.
Note: One issue that you will face at some point is where the upload post goes to becuase when you get to the AJAXy part of things you want the post to stay on the same page. You can use a hidden iframe and the form’s “target” parameter to do this (I have an example later). This is one thing the Java examples I found didn’t have but the PHP examples did and I’m not sure exactly how the Java examples work without it.
The next step is to monitor the progress of the upload on the server. What you are monitoring on the server doesn’t even need to be the upload. For the work I was doing the upload goes fairly quickly but what happens to the file after the upload takes a little longer. I wanted to monitor both and that is one reason I think it helps to break this up into parts because you aren’t limited to just monitoring file uploads.
The main thing to keep in mind here is that the application server is multithreaded and you can make more than one request to the server at the same time. You probably know that you can open a tab in firefox or another window in ie and use the same session from the current webapp you are using. Knowing that you can create a page that monitors the status of things as they are running on the server.
From the example above you could toss the listener into the users session. Then insead of logging you just add a couple variables to keep track of the number of bytes that have been uploaded. Then create a simple jsp that pulls the Listener out of the session and dumps its data to a page. Open two windows, one to the upload page and another one to the status page. Start the upload and then start refreshing the status. You should see that the values change as the file is uploaded.
<%@page%><% FileUploadListener listener = (FileUploadListener)session.getAttribute("LISTENER");%>Total size: <%=listener.getTotalSize()%><br/>Read count: <%=listener.getTotalRead()%><br/>Of course you will probably want more than just the total size and bytes read as well as more formating like a little progress bar or something but I’ll leave that up to you.
You have the major parts to the upload progress done and now all you need is the AJAX part. To do this I chose to use prototype because it cuts right to what you want to do. One call is all you need to use: Ajax.PeriodicalUpdater.
The Ajax.PeriodicalUpdater call will update a container (in my case a div) on a set interval. Here is an example of how to have it update a div with an id of “status” every second.
new Ajax.PeriodicalUpdater( 'status', 'status.jsp', {asynchronous:true, frequency:1, method:'get'});The first argument is the id of the div, the second is the jsp that contains the data to stick into the div every second and the 3rd arguement is a set of options. There are more options availabe if you need them.
You would want to kick the update off whenever the form is posted. When the post is complete the iframe used as a place to post to will load with the results of the servlet or jsp that you posted to. If you return some javascript as a result for the iframe you will be able to create a final “finished” message on the page to let the user know the upload has completed and stop the processing of the AJAX updater.
So there you have it. The basics of setting up an upload progress bar using java and AJAX. I have left out a good bit but you should have enough to at least get you started.
By request I have created a simple example that pulls everything together. The source contains everything you need to create a war file including all source and an ant build file.
GUID and ProgID Information 항목 참조
사용자 컴퓨터에 설치된 XML Paser가 없거나 버전이 낮아서 생기는 현상이므로.
M$의 다운로드 센터에서 최신버전을 다운로드/설치 하시면 됩니다.
http://www.microsoft.com/downloads/details.aspx?FamilyID=28494391-052b-42ff-9674-f752bdca9582&DisplayLang=ko
※ MSXML Reference
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnanchor/html/anch_xmlprod.asp