Because of the way that Java is designed the programmer does not have easy access to the system’s environment variables.
Because of the way that the Java Development Kit (JDK) is set up, it is necessary to use multiple tokens to invoke a program, which does not mesh very well with the standard HTML forms/CGI manner of operations.
There are ways around these limitations, and I have implemented one of them.
Read further for details.
به دلیل روشنی کهJava طراحی می شود، برنامه نویس دسترسی آسان به متغیرهای محیط سیستم ندارد.
به دلیل روشی که جعبه توسعه (JDK) تنظیم می شود، استفاده از نشانه های چندگانه در استنتاج یک برنامه جدید ضروری است که به خوبی با قالب های استاندارد HTML روش CGI عملیات ها مطابقت ندارد.
راه هایی در این محدودیت ها وجود دارد، یکی از آنها را پیاده سازی کردم.
بعداً جزئیات را مطالعه کنید.
Since I wrote the previous paragraph in 1996 , there have been many changes in the Java technology.
It is likely that a better solution to running server – side Java programs is now available – perhaps your should take a look at servlets.
از آنجا که پاراگراف قبلی را در 1996 نوشتم، تکنولوژیJava تغییرات زیادی یافته است.
احتمالاً روش بهتری برای اجرای سرور وجود دارد، اکنون برنامه های جانبی جاوا در دسترس می باشد، شاید به سروست ها نظری اندازید.
1.1.
Prior Knowledge 1-1- آگاهی قبلی
I am assuming that you have a general knowledge of HTML and CGI concepts and at least a minimal knowledge of your HTTP server.
You should also know how to program in Java, or a lot of this will not make sense.
فرض می کنیم که آگاهی عمومی و کلی از مفاهیم HTML, CGI و حداقل، معلومات اندکی از سرورHTTP خود دارید.
همچنین باید چگونگی برنامه نویسی به زبانJava را بدانید با مقدار زیادی از اینها معقولانه به نظر نمی رسد.
1.2 This Document 2-1- این مدرک
The latest version of this document can be read at http://www.orbits.com/software/Java_CGI.html.
آخرین نسخه این مدرک را می توان در سایت
http://www.orbits.com/software/ Java-CGI.html خواند.
1.3 The Package 3-1- بسته بندی
The latest version of the package described here can be accessed via anonymous FTP at ftp://ftp.orbits.com/pub/software/java_cgi-0.5.tgz.
The package distribution includes SGML source for this document.
می توان با FTP بی نام در سایت ftp://ftp.orbits.com/pub/soft ware/Java- Cgi-0.5.tgz به آخرین نسخه بسته شرح داده شده در اینجا دسترسی یافت.
توزیع بسته بندی شامل منبع SGML این مدرک می شود.
The package is distributed under the terms of the GNU Library General Public License.
This document can be distributed under the terms of the Linux HOWTO copyright notice.
بسته تحت شرایط گواهینامه عمومی کلی کتابخانه GNU توزیع می شود.
این مدرک را می توان تحت شرایط نکته کپی رایت Linux HowTo منتشر کرد.
If you use this software, please make some reference to http://www.orbits.com/software/Java _ CGI.html, so that others will be able to find the Java CGI classes.
اگر از این نرم افزار استفاده می کنید، لطفاً به سایت
http://www.orbits.com/software/ Java-CGI.html رجوع کنید بنابراین، دیگران قادر بوده تا کلاس های Java CGI را بیابند.
I have run out of time to mainatain and support this package, so this will probably be its final release.
If anyone out there is sufficiently enamoured of this software that they wish to take over the maintenace of it, please contact me at javacgi_document@orbits.com.
برای حفظ و پشتیبانی این بسته زمان زیادی را صرف کردم، بنابراین احتمالاً این نسخه محصول نهایی آن خواهد بود.
اگر فردی به حد کافی بر این نرم افزار علاقه مند باشد که بخواهد حفظ و نگهداری آن را بر عهده بگیرد، لطفاً با ایمیل javaCgi-dacument@ orbits .com با من تماس بگیرد.
Java CGI HOWTOJava CGI HowBy David H.
Silber javacgi-document@orbits.comنوشته: دیوید اچ.
سیلبر javacgi-document@orbits.comV0.5,1 December 19985/0، اول دسامبر 1998This HOWTO document explains how to set up your server to allow CGI programs written in Java and how to use Java to write CGI programs.
Although HOWTO documents are targetted towards use with the Linux operating system, this particular one is not dependant on the particular version of unix uses.این مدارک How To چگونگی تنظیم سرور برای میسر ساختن برنامه های CGI نوشته شده به زبان جاوا و چگونگی استفاده ازJava در نوشتن برنامه هایJava را شرح میدهد.
اگرچه هدف مستندات How To، اسفاده آن با سیستم عملLinux است، این مورد خاص به نسخه خاصی از unix مورد استفاده وابستگی ندارد.1.
Introduction1- مقدمه1.1.
Prior Knowledge1-1- دانش قبلی1.2.
This Document2-1- این مدارک1.3.
The Package3-1- بسته بندی1.4.
The Mailing List4-1- لیست میل2.
Setting Up Your Server to Run Java CGI Programs (With Explanations)2- تنظیم سرور برای اجرای برنامه های Java CGI (با توضیح)2.1.
System Requirements1-2- ملزومات سیستم2.2.
Java CGI Add-On software2-2- نرم افزار افزایشی JavaCGI2.3.
Unpacking the Source3-2- غیر بسته بندی منبع2.4.
Decide On Your Local Path Policies4-2- تصمیم گیری در مورد سیاست های مسیر محلی2.5.
Testing your installation5-2- تست نصب3.
Setting Up Your Server to Run Java CGI Programs (the short form)3- تنظیم سرور برای اجرای برنامه های Java CGI (خلاصه)4.
Executing a Java CGI Program4- اجرای یک برنامه Java CGI4.1.
Obstacles to Running Java – Programs Under the CGI Model1-4- موانعی در اجرای برنامه های Java تحت مدلCGI4.2.
Overcoming Problesm in Running Java CGI Programs2-4- حل مشکلات در اجرای برنامه های Java CGI5.
Using the Java CGI Classes5- استفاده از کلاس های Java CGI5.1 CGI1-5- CGI5.2.
CGI _ Test2-5- تست CHI5.3.
Email3-5- ایمیل5.4.
Emal_ Test4-5- تست- ایمیل5.5.
HTML5-5- HTML5.6.
HTML _ Test6-5- HTML- Test5.7.
Text7-5- متن6.
Future Plans6- طرح های بعدی7.
Changes7- تغییرات7.1.
Changes from 0.4 to 0.51-7- تغییرات 4/0 تا 5/07.2 Changes from 0.3.
to 042-7- تغییرات 3/0 تا 4/07.3 Changes from 0.2.
to 033-7- تغییرات 2/0 تا 3/07.4 Changes from 0.1.
to 024-7- تغییرات 1/0 تا 2/01.
Introcuction1- مقدمهBecause of the way that Java is designed the programmer does not have easy access to the system’s environment variables.
Read further for details.به دلیل روشنی کهJava طراحی می شود، برنامه نویس دسترسی آسان به متغیرهای محیط سیستم ندارد.
بعداً جزئیات را مطالعه کنید.Since I wrote the previous paragraph in 1996 , there have been many changes in the Java technology.
It is likely that a better solution to running server – side Java programs is now available – perhaps your should take a look at servlets.از آنجا که پاراگراف قبلی را در 1996 نوشتم، تکنولوژیJava تغییرات زیادی یافته است.
احتمالاً روش بهتری برای اجرای سرور وجود دارد، اکنون برنامه های جانبی جاوا در دسترس می باشد، شاید به سروست ها نظری اندازید.1.1.
Prior Knowledge1-1- آگاهی قبلیI am assuming that you have a general knowledge of HTML and CGI concepts and at least a minimal knowledge of your HTTP server.
You should also know how to program in Java, or a lot of this will not make sense.فرض می کنیم که آگاهی عمومی و کلی از مفاهیم HTML, CGI و حداقل، معلومات اندکی از سرورHTTP خود دارید.
همچنین باید چگونگی برنامه نویسی به زبانJava را بدانید با مقدار زیادی از اینها معقولانه به نظر نمی رسد.1.2 This Document2-1- این مدرکThe latest version of this document can be read at http://www.orbits.com/software/Java_CGI.html.آخرین نسخه این مدرک را می توان در سایت http://www.orbits.com/software/ Java-CGI.html خواند.1.3 The Package3-1- بسته بندیThe latest version of the package described here can be accessed via anonymous FTP at ftp://ftp.orbits.com/pub/software/java_cgi-0.5.tgz.
The package distribution includes SGML source for this document.می توان با FTP بی نام در سایت ftp://ftp.orbits.com/pub/soft ware/Java- Cgi-0.5.tgz به آخرین نسخه بسته شرح داده شده در اینجا دسترسی یافت.
توزیع بسته بندی شامل منبع SGML این مدرک می شود.The package is distributed under the terms of the GNU Library General Public License.
This document can be distributed under the terms of the Linux HOWTO copyright notice.بسته تحت شرایط گواهینامه عمومی کلی کتابخانه GNU توزیع می شود.
این مدرک را می توان تحت شرایط نکته کپی رایت Linux HowTo منتشر کرد.If you use this software, please make some reference to http://www.orbits.com/software/Java _ CGI.html, so that others will be able to find the Java CGI classes.اگر از این نرم افزار استفاده می کنید، لطفاً به سایت http://www.orbits.com/software/ Java-CGI.html رجوع کنید بنابراین، دیگران قادر بوده تا کلاس های Java CGI را بیابند.I have run out of time to mainatain and support this package, so this will probably be its final release.
If anyone out there is sufficiently enamoured of this software that they wish to take over the maintenace of it, please contact me at javacgi_document@orbits.com.برای حفظ و پشتیبانی این بسته زمان زیادی را صرف کردم، بنابراین احتمالاً این نسخه محصول نهایی آن خواهد بود.
اگر فردی به حد کافی بر این نرم افزار علاقه مند باشد که بخواهد حفظ و نگهداری آن را بر عهده بگیرد، لطفاً با ایمیل javaCgi-dacument@ orbits .com با من تماس بگیرد.1.4 The Mailing List4-1- لیست میلI have created a majordomo list to allow people to help each-other work through their mutual problems in installing and using this software.
Send a message to javacgi-request@orbits.com, containing the word subscribe.لیست برگی ساختم که به مردم اجازه دهد در طول مشکلات متقابل خود در نصب و استفاده این نرم افزار به یکدیگر کمک کنند.
پیامی حاوی واژه اشتراک به ایمل java Cgi request@orbits.com ارسال نمائید.2.
Setting Up Your Server to Run Java CGI Programs (With Explanations)2- تنظیم سرور برای برنامه های Java CGI (با توضیح)This section will lead you through installing my Java CGI package with copious explanations so that you know what the effects of your actions will be.
If you just want to install the programs and don’t care about the whys & wherefores, skip to Setting Up Your Server to Run Java CGI Programs ( the short Form).این قسمت شما را از طریق نصب بسته Java CGI من با توضیحات فراوان راهنمایی میکند.
اگر صرفاً می خواهید برنامه ها را نصب کرده و در مورد چراها و به چه علت ها نگران نباشید، به تنظیم سرور برای اجرای برنامه های Java CGI (به طور خلاصه) بروید.2.1 System Requirements1-2- ملزومات سیستمThis software should work on any unix-like web server that has the Java Development Kit installed.
I am using it on a Debian Linux system running apache as the HTTP damon.
If you find that it does not run on your server, please contact the mailing list.
See The Mailing List for details.این نرم افزار باید در هر سرور وبunix مانندی کار کند که جعبه توسعه جاوای نصب شده دارد.
از این نرم افزار در یک سیستم Debian Linux اجرا کننده apacho به عنوان دائمون HTTP استفاده می کنم.
اگر فهمیدید که روی سرور شما کار نمی کند، لطفاً با لیست میل تماس بگیرید، برای جزئیات، لیست میل را ببینید.Unfortunatly, the Java run – time interpreter seems to be something of a memory hog – you may want to throw another few megabytes of RAM onto your server if you will be using Java CGI programs a lot.متأسفانه، مفسر زمان اجرای جاوا چیزی از هاگ حافظه به نظر می رسد.
اگر از برنامههای Java CGI زیاد استفاده می کنید، شما بخواهید مگابایت های کم دیگری از RAM را به سرور خود اضافه کنید.2.2 Java CGI Add – On Software2-2- نرم افزار اضافه شده Java CGIThe software that I wrote to aid in this is called Java CGI.
You can get it from ftp: ftp.orbits.
com/upb/software/java_cgi-0.5.tgz.
(the version number may have changed.)نرم افزاری که برای کمک به آن نوشتم Java CGIنامیده می شود، می توانید آن را از سایت ftp://ftp.orbits.com/pub/soft ware/Java- Cgi-0.5.tgz به دست آورید.
(شماره نسخه می تواند تغییر کند).2.3 Unpacking the source3-2- غیر بسته ای کردن منبعFind a convenient directory to unpack this package into.
(If you don’t already have a standard place to put packages, I suggest that you use/usr/local/src.
Unpack the distribution with this command:دایرکتوری مناسبی بیابید تا این بسته را در آن باز کنید (اگر جای استانداردی برای قراردادن بسته ها ندارید، به شما پیشنهاد می کنم از /user/local/src استفاده کنید) بسته توزیع را با این فرمان باز کنید.Gzip-dc java – cgi – 0.5 tgz | tar – xvfGzip-dc java – cgi – 0.5 tgz | tar – xvfThis will creat a directory called java _ cgi – 0.5 In there you will find the files referenced in the rest of this document.
(If the version number has changed, use the instruction from within that distribution from this point ont).این، دایرکتوریی به نام Java- Cgi-0.5.tgz را می سازد.
در این دایرکتوری، فایل های ارجاع یافته به بقیه این مدارک را می یابید.
(اگر شماره نسخه تغییر یافته است، دستور العمل های از داخل آن توزیع اینجا به بعد را به کار ببرید).2.4 Decide On Your Local Path Policies4-2- تصمیم گیری در مورد سیاست های مسیر محلیYou need to decide where you want your Java CGI programs to live.
Generally, you will want to put them in a directory in parallel with you cgi – bin directory.
My apache serve came configured to use /var/www/cgi-bin as the cgi-bin directory, so I use/var/www/javacgi as the directory to put Java CGI programs in.
You probably do not want to put your Java CGI programs into one of the existing CLASSPATH directories Edit the Makdfile to reflect your system configuration.
Make sure that you are logged in as the root user and run make install.
This will compile the Java programs, modify the java .
cgi script to fit in with your system and install the programs in the appropriate places.
If you want the HTML version of this documentation and an HTML test document in additon, run make all instead.تصمیم گیری در مورد مکان قرارگیری و اجرای برنامه های Java-CGI ضروری است.
عموماً می خواهید برنامه های Java-CGI را در یک دایرکتوری موازی با دایرکتوری Cgi-bin خود قرار دهید.
سرورapache من پیکربندی شده تا از دایرکتوری /Var/www/java cgi را به عنوان دایرکتوری قرار گیری برنامه های Java-CGI به کار می گیریم.
احتمالاً نمی خواهید برنامه های Java CGI را در یکی از دایرکتوری های CLASSPATH موجود قرار دهید.
Make file را برای انعکاس پیکربندی سیستم خود ویرایش کنید.
اطمینان یابید که به عنوان کاربر ریشه وارد شده Make install را اجرا کنید.
این برنامه های Java را کامپایل می کند، فایل اسکریپت java.Cgi را متناسب با سیستم خود اصلاح نمایید و برنامه ها را در مکان مناسب نصب کنید.
اگر نسخه HTML این پرونده و به علاوه پرونده تست HTML را می خواهید، فرمان make all را اجرا نمایید.2.5 Testing your installation.5-2- تست نصبInstalled from the distribution are HTML documents called javacgitest.html, javaemailtest.html and javahtmltest.
Html.
If you installed all in the previous section, it will be in the directiory you specified for WEBDIR in the Makefile.
If you didn’t, you can run make test to build them from javacgitest.
Html-dist, javaemailtest.html-dist and javahtmltest.html – dist.آنچه از طریق ارسال از شبکه نصب می شود پرونده هایHTML است که javacgitest.html , javahtml.html , javamail.html خوانده می شود.
اگر همه (all) را در قسمت قبلی نصب کردید، در دایرکتوری قرار دارد که برای WEBDIR در Makefile مشخص کردید.
اگر این کار را انجام ندادید،make test را اجرا کرده تا آنها را از javacgitest.html , javahtml.html , javamail.html بسازد.When you are sure that your installation is woriking correctly, you may wish to remove CGI _ Test.
Class, Email_Test.
Class and HTML _ Test.
Class from your JAVACGI directory and javacgitest.
Html, javaemailtest .
html and javahtmltest.html from your WEBDIR directory as they show the user information that is normally only available to the server.وقتی مطمئن شدید که نصب شما به درستی کار می کند، ممکن است بخواهید HTMl- Test.Class,Email-Test.class,CGI-Test.Class را از دایرکتوری javacgitest.html, javahtml.html , javamail.html را از دایرکتوری WEBDIR حذف کنید.
زیرا اطلاعات کاربری را نشان می دهند که به طور نرمال صرفاً در دسترس سرور است.3.
Setting Up Your Server to Run Java CGI Programs (The Short Form).3- تنظیم سرور برای اجرای برنامه Java CGI (به طور خلاصه)Get the Java CGI package from ftp://ftp.orbits.com/upb/software/java_cgi-0.5 tgz.
(The version number may have changed).بسته Java CGI را از سایت ftp://ftp.orbits.com/pub/software/Java- Cgi-0.5.tgz (ممکن است شماره نسخه تغییر کرده باشد).Unpack the distribution with this command:بسته ارسالی از طریق شبکه راه با این فرمان باز کنید:Gzip-dc java – cgi – 0.5.
tgz | tar – vxfGzip-dc java – cgi – 0.5.
tgz | tar – vxf(If the version number has changed, use the instructions from within that distribution from this point on.)(اگر شماره نسخه تغییر کرده است، از دستور العمل های داخل آن توزیع ارسال از شبکه استفاده کنید).Edit the Makefile you will find in the newly created directory java_ cgi_ 0.5 as appropriate to your system.با ویراش Java-Cgi-0.5, Makefile را در دایرکتوری اخیراً ساخته شده مناسب سیستم خواهید یافت.As root, run make install.
This will compile the Java programs, apply your system – specific information and install the various files.
If you want the HTML version of this documentation and an HTML test document, run make all instead.به عنوان ریشه، فرمان make install را اجرا کنید.
این، برنامه های Java را کامپایل کرده، اطلاعات خاص سیستم شما را به کار برده و فایل های مختلف را نصب می کند.
اگر نسخهHTML این پرونده و پرونده تست HTML را می خواهید، در مقابل make all را اجرا کنید.You should be ready to go.- باید برای جلو رفتن آماده باشید.4.
Executing a Java CGI Program4- اجرای یک برنامه Java CGI4.1 Obstacles to Running Java Programs Under the CGI Model1-4- موانعی در اجرای برنامه های Java تحت مدل CGIThere are two main problems in running a Java program from a web server:دو مسئله عمده در اجرای برنامه جاوا از سرور وب وجود دارد:You can’t run Java programs like ordinary executables.- نمی توانید برنامه های جاوا را مثل برنامه های قابل اجرای عادی، اجرا کنید.You need to run the Java run – time interpreter and provide the initial class (program to run) on the command – line.
With an HTML form, there is no provision for sending a command – line to the web server.لازم بوده مفسر زمان اجرای Java را اجرا کرده و کلاس اولیه (برنامه اجرا) را در خط فرمان ارائه دهید، با یک قالب HTML، هیچ وسیله ای برای ارسال خط فرمان به سرور وب وجود ندارد.Java does not have general access to the environment.- جاوا دسترسی عمومی به محیط ندارد.Every environment variable that will be needed by the Java program must be explicitly passed in.
There is no method similar to the Cgetenv ( ) function.هر متغیر محیطی مورد نیاز برنامه جاوا را باید صریحاً عبور داد.
هیچ روشی مشابه تابع Cgetenr () وجود ندارد.4.2 Overcoming Problems in Running Java CGI Programs2-4- حل مسائل و مشکلات برنامه های Java CGITo deal with these obstacles, I wrote a shell CGI program that provides the information needed by the Java interpreter.برای برخورد به این موانع، یک برنامه پیوسته CGI را نوشتم که اطلاعات مورد نیاز مفسر جاوا را ارائه می نماید.The java.cgi script.اسکریپت java.CgiThis shell script manages the interaction between the HTTP damon and the Java CGI program that you wish to use.
It extracts the name of the program that you want to run from the server – provided data.
It collects all of the environment data into a temporary file.
Then, it runs the Java run-time interpreter with the name of the file of environment information and the program name added to the command – line.این فایل اسکریپتshell، رابطه متقابل بین دائمونHTTP و برنامه Java CGI را مدیریت می کند که می خواهید از آن استفاده نمایید.
این فایل نام برنامه ای را استخراج می کند که می خواهید آن را از دیتای ارائه شده سرور اجرا نمایید.
اسکریپت همه دیتاهای محیطی را در یک فایل موقت جمع می کند و سپس، مفسر زمان اجرای Java را با نام فایل اطالعات محیط و نام برنامه اضافه شده به خط فرمان را اجرا می کند.The java.cgi script was configured and installed in Decide On Your I Path Policies.فایل اسکریپت java.Cgi در قسمت تصمیم گیری در مورد سیاست های مسیر محلی پیکربندی و نصب می شود.Invoking java.cgi from an HTML form.تقاضای java.Cgi از یک قالب HTMLMy forms that use Java CGI programs specify a form action as follows:قالب های استفاده کننده از برنامه های java.cgi عمل قالب را بدین شرح مشخص میکند:Where / cgi-bin/is your local CGI binary directory , java .
cgi is the Java front – end that allows us to run Java programs over the web and CGI _ Test is an example of the name of the Java program to run.که /cgi-bin/ دایرکتوری بنیادی CGI محلی شماست.
Java-cgi نرم افزار نهایی جاوا بوده که به ما اجازه می دهد تا برنامه های java را در سراسر وب اجرا کنیم و CGI-Test مثالی از نام اجرای برنامه Java می باشد.5.
Using the Java CGI Classes.5- استفاده از کلاس های Java CGIThere are currently three main classes supported – CGI, Email and HTML.
I am considering adding classes to deal with MIME –formatted input and output – MIME in & Eout, respectively.در حال حاضر، سه کلاس عمده پشتیبانی می شود: HTML,Email, CGI.
کلاس های اضافی را بررسی کرده تا به ترتیب به ورودی و خروجی قالب بندی شده MIMEin & MIMOut, MIME بپردازم.There are also a few support and test classes.
CGI Test, Email_ Test and HTML _ Test are intended to be used to test your installation.
They can also be used as a starting – point for your own Java programs which use this class library.
The Text class is the superclass for both the Email and the HTML classes.بعلاوه، کلاس های تست و پشتیبانی اندکی وجود دارد.
هدفHTML-Test, Email.Test,CGI,Test این است که در قسمت نصب شما به کار برود.
آنها را همچنین می توان به عنوان یک نقطه شروع در برنامه های جاوایی به کار برد که از این کتابخانه کلاس استفاده می کند.
کلاس Text، سوپرکلاس هر دو کلاس هایEmail,HTML میباشد.5.1 CGI1-5- CGIclass Syntaxترکیب کلاسpublic class CGIpublic class CGIClass Descriptionشرح کلاسThe CGI class holds the “CGI Information” – Environment variables set by the web server and the name/value sent from a form when its submit action is selected.
All information is stored in a properties class object.کلاس CGI “اطلاعاتCGI”- متغیرهای محیطی تنظیم شده با سرور وب و مقدار/ نام ارسال شده از قالب وقتی عمل پیشنهادی (Submit) آن انتخاب می شود- را دربر میگیرد.
همه اطلاعات از یک شیء کلاسProperties ذخیره می شود.This class is in the “ Orbits.net” package.این کلاس در بسته "Orbits,net" قرار دارد.Member Summary CGI ( ) // Constructor.
GetNames ( ) // Get the list of names.
Getvalue ( ) // Get from value by specifying name.خلاصه اعضاء CGI ( ) // Constructor.
Getvalue ( ) // Get from value by specifying name.See Also CGI _ Testهمچنین ببینید CGI _ TestCGI ( )CGI ()Purpose Constructs an object which contains the available CGI data.
Syntax Public CGI ( ) Descriptionهدف CGI () شئیی را می سازد که دیتای موجود CGI را دربر دارد.
ترکیب Public CGI ( ) شرحWhen a CGI object is constructed, all available CGI information is sucked – up into storage local to the new object.وقتی یک شیء CGI ساخته می شود، همه اطلاعات موجودCGI در انبار محلی شیء جدید پشته می شود.GetNames ( )GetNames ( )PurposeهدفList the names which are defined to have corresponding values.فهرست نام هایی که برای برخورداری از مقادیر مشابه تعریف می شوند.SyntaxترکیبPublic Enumeration getKeys ( )Public Enumeration getKeys ( )DescriptionشرحProvides the full list of names for which coresponding values are defined.لیست کام نام هایی را ارائه می دهد که مقادیر متناظر برای آن نام ها تعریف می شود.ReturnsبازگشتAn Enumeration of all the names defined.Enumeration همه نام های تعریف شده.GetValue ( )getvaluer ()PurposeهدفRetrieves the value associated with the name specified.مقدار مرتبط با نام مشخص شده را برگشت می دهد.SyntaxترکیبPublic string getvalue (string name)Public string getvalue (string name)DescriptionشرحThis method provides the corespondence between the names and values sent from an HTML form.این روش تشابه و تناظر بین value,names ارسالی از یک قالبHTML را ارائه میدهد.ParameterپارامترNameNameThe key by which values are selected.کلیدی که به وسیله آن مقادیر انتخاب می شود.ReturnsنشانهA String containing the value.یکstring حاوی مقدار.5.2 CGI _ Test2-5- CGI-TestThis class provides both an example of how to use the CGI class and a test program which can be used to confirm that the Java CGI package is functioning correctly.این کلاس هم مثالی از چگونگی به کار گیری کلاس CGI و هم برنامه تستی را ارائه میدهد که می توان آن را در تائید عملکرد صحیح بسته Java CGI استفاده نمود.Member Summaryخلاصه اعضاءMain ( ) // Program main ( ).Main ( ) // Program main ( ).See Alsoهمچنین ببینیدCGICGIMain ( )Main ()PurposeهدفProvide a main ( ) methodارائه یک متد main ()GetValue ( )getvalue ()SyntaxترکیبPublic static void main (string argv [ ])Public static void main (string argv [ ])DescriptionشرحThis is the entry point for a CGI program which does nothing but return a list of the available name/value and their current values.این نقطه ورودی یک برنامهCGI بوده که هیچ کالی غیر از برگشت دادن لیستی از جفتهای موجود نام/ مقدار (name/value) و مقادیر فعالی آنان انجام نمی دهند.ParameterپارامترArgv [ ]argv []Arguments passed to the program by the java.cgi script.
Currently unused.آرگومان های ارسال شده به برنامه توسط اسکریپتjava.cgi فعلاً استفاده نمی شود.5.3 Email3-5- EmailClass Syntaxترکیب کلاسPublic class Email extends TextPublic class Email extends TextClass Descriptionشرح کلاسMessages are built up with the Text class add* ( ) methods and the e-mail-specific methods added by this class.
When complete, the message is sent to its destination.پیام ها با متدهای add*()کلاسText و متدهای خاصemail اضافه شده توسط این کلاس ساخته می شود.
وقتی پیام کامل شد، به مقصد ارسال می شود.This class is in the “Orbits.net” package.این کلاس در بسته "Orbits.net" قرار دارد.Member Summaryخلاصه اعضاءEmail ( ) // Constructor.
Send ( ) // send the e-mail message.Email ( ) // Constructor.
Send ( ) // send the e-mail message.See Alsoهمچنین ببینیدEmail_Test, TextEmail-Text,TextEmail ( )Email ()PurposeهدفConstructs an object which will contain an email message.شیءای را می سازد که پیام یک ایمیل را دربر دارد.SyntaxترکیبPublic Email ( )Public Email ( )DescriptionشرحSet up an empy message to be completed by the Email methods.یک پیام خالی را ساخته تا به وسیله متدهایEmail کامل گردد.See Alsoهمچنین ببینیدText..TextSend ( )Send ()PurposeهدفSend the e-mail message.ارسال یک پیام email.getvalue( )Getvalue ()SyntaxترکیبPublic void send ( )Public void send ( )DescriptionشرحThis formats and sends the message.
If no destination address has been set, there is no action taken.پیام را قالب بندی و ارسال می کند.
اگر هیچ آدرس مقصدی تنظیم نشود، هیچ عملی صورت نمی گیرد.SendTo( )SendTo( )PurposeهدفAdd a destination for this message.افزودن مقصد به این پیامSyntaxترکیبPublic string sendTo (string address)Public string sendTo (string address)DescriptionشرحAdd address to the list of destinations for this method.
There is no set limit to the number of destination an e-mail message may have.
I’m sure that if you build up the list large enough, you can exceed the size of the parameter list that Mail Transport Agent can accept or use up your memory.به این روش، address را به لیست مقصد اضافه می کند.
هیچ محدودیت دسته ای در تعداد مقصدهایی وجود ندارد که یک پیام email دارد.
مطمئنم که اگر لیست به حد کالی بزرگی بسازید، می توانید از سایز لیست پارامتری فراتر روید که Mail TransPort Agent (برنامه ارسال ایمیل) می توان آن را قبول کرده یا از حافظه شما استفاده کند.Parameter/پارامتر/AddressAddressA destination to sen this message to.مقصدی برای ارسال پیامSubject ( )Subject ()PurposeهدفSet the subject for this message.تنظیم موضوعی برای این پیامSyntaxترکیبPublic void subject (string subject)Public void subject (string subject)DescriptionشرحThis method sets the text for the e-mail’s subject : line If called more than once, the latest subject set is the one that is used.این متد، متن را برای خط Subject ایمیل تنظیم می کند.
اگر بیش از یک دفعه فراخوانی شود، آخرین مجموعه موضوع، همانی است که استفاده می شود.ParameterپارامترSubjectSubjectGetValue ( )Getvalue ()The text of this message’s subject : line.متن خط Subject این پیام.5.4 Email _ Test4-5- Email- TestThis class provides both an example of how to use the Email class and a test program which can be used to confirm that the Java CGI package is functioning correctly.این کلاس هم مثالی از چگونگی استفاده کلاس Email و هم برنامه تستی را ارائه مینماید که می توان آن را در تائید عملکرد صحیح بسته JavaCGI به کار برد.Member Summaryخلاصه اعضاءMain ( ) // Program main ( )Main ( ) // Program main ( )See Alsoهمچنین ببینیدEmail.EmailMain ( )Main ()PurposeهدفProvide a main ( ) methodارائه یک متدل main ()SyntaxترکیبPublic static void main (string argv [ ] )Public static void main (string argv [ ] )DescriptionشرحThis is the entry point for a CGI program which returns a list of the available name/value and their current values.
It will also send this list to the address specified in the Email variable.این نقطه ورودی یک برنامه CGI بوده که لیست جفت های موجود name/value (نام/ مقدار) و مقادیر فعلی آنان می باشد.
همچنین، این لیست را به آدرس مشخص شده د متغیر Email ارسال می کند.ParameterپارامترArgv [ ]Argv [ ]Arguments passed to the program by the java.
Cgi script.
Currently unused.آرگومان های فرستاده شده به برنامه توسط فایل اسکریپت java.cgi فعلاً کاربردی ندارد.5.5 HTML5-5- HTMLclass syntaxترکیب کلاسpublic class HTML extend Textpublic class HTML extend TextClass Descriptionشرح کلاسMessages are built up with the Text class add* ( ) methods and the HTML – specific methods added by this class.
When complete, the message is sent to its destination.
Currently, there is no error checking to confirm that the list – building methods are being used in a correct order, so the programmer mus t take pains not to violate HTML syntax.
This class is in the “Orbitsn.net” package.پیام ها با روش های add*() کلاس Text و متدهای مشخص HTML اضافه شده توسط این کلاس ساخته می شود.
وقتی پیام کامر شد، به مقصد خود ارسال می شود.
در حال حاضر، هیچ بررسی خطایی وجود نداشته تا تأئید کند که متدهای ساخت لیست به یک ترکیب صحیح استفاده می شوند.
بنابراین، برنامه نویس باید توجه کرده که ترکیب HTML را نقض نکند.
این کلاس در بسته "Orbits.net" قرار دارد.Member Summaryخلاصه اجزاءHTML ( ) // constructor.
Author ( ) //setHTML ( ) // constructor.
Author ( ) //setSee Alsoهمچنین ببینیدHTML _ Test, Text.HTML-Text,TextPurposeهدفHTML ( )HTML ()Constructs an object which will contain an HTML message.شیءای را می سازد که پیام HTML را دربر خواهد داشت.GetValue ( )GetValue ( )SyntaxترکیبPublic HTML ( )Public HTML ( )DescriptionشرحSets up an empy message to be completed by the HTML methods.یک پیام خالی را تنظیم نموده تا با روش هایHTML کامل شود.See Alsoهمچنین ببینید.Text..TextAuthor ( )Author ()PurposeهدفSet the name of the document author.تنظیم نام نویسنده پروندهSyntaxترکیبpublic void author (string author)public void author (string author)DescriptionشرحSet the name of the document author to author.تنظیم نام نویسنده پروندهParameter/پارامترAuthorAuthorThe text to use as the author of this message.متن مورد استفاده به عنوان نویسنده این پیامSee Alsoهمچنین ببینیدTitle ( )..title ()Definition List ( )definition List ()PurposeهدفStart a defintion listشروع یک لیست تعریفSyntaxترکیبPublic void definitionlist ( )Public void definitionlist ( )DescriptionشرحStart a definition list.
A definition list is a list specialized so that each entry in the list is a term followed by the definition text for that term (The start of a definition list should be followd by the creation of (at least) one term/ text/text pair and a call to the endlist ( ) method .
Note that, get value ( ) Currently, lists cannot be nested.شروع یک لیست تعریف، یک definition List (لیست تعریف) یک لیست مشخص شده می باشد.
بنابراین، هر ورودی در لیست یک term (واژه ای) بوده که text (متن) تعریف آن واژه بعد از آن می آید.
باید خلق حداقل یک واژه/جفت متن و فراخوانی متد end List () بعد از شروع تعریف بیاید.
توجه کنید که، در حال حاضر لیست ها را نمیتوان درج کرد.See Alsoهمچنین ببینیدDefinitionListTerm ( ), endList ( ), listItem( ).DefinitionListTerm ( ), endList ( ), listItem( ).DefinitionListTerm ( )definition List ()PurposeهدفAdd a term to a definition list.افزودن لغتی به لیست تعریفSyntaxترکیبPublic void definitionListTerm ( )Public void definitionListTerm ( )DescriptionشرحAdd a term to a definition list.
The text for the term part of the current list entry should be appended to the message after this method is called and before a corresponding listItem method is called.کلمه ای را به لیست تعریف اضافه کنید.
متن قسمت کلمه مدخل لیست فعلی را باید بعد از فراخوانی این متد و قبل از فراخوانی متد متناظر List Item به پیام الحاق کرد.See Alsoهمچنین ببینیدDefinitionList ( ) , listItem( )definition List (), List Item ().EndList ( )End List ()PurposeهدفEnd a listپایان بخشیدن به یک لیستSyntaxترکیبPublic void endList ( )Public void endList ( )DescriptionشرحEnd a list.
This method closes out a list.
Note that , currently , lists cannot be nested.پایان بخشیدن به یک لیست، این متد لیست را می بندد.
دقت کنید که در حال حاضر لیست ها را نمی توان درج کرد.See Alsoهمچنین ببینیدDefinitionList ( )definition List ()Listitem ( )List Item ()PurposeهدفAdd an entry to a listافزودن مدخلی به لیستSyntaxترکیبPublic void listItem ( )Public void listItem ( )GetValue ( )Getvalue ( )DescriptionشرحPublic void listItem ( string item)Public void listItem ( string item)Public boolean listItem (String term, string item)Public boolean listItem (String term, string item)DescriptionشرحAdd an entry to a list.
If the first form is used, the text for the current list item should be appended to the message after this method is called and before any other list methods are called.
In the second and third forms, the item text is specified as a parameter to the method instead of (or in addition to) being appended to the message.
The third form is specific to definition lists and provides both the term and the definition of the list entry.افزودن مدخلی به لیست، اگر از قالب اول استفاده شود، متن آیتم لیست فعلی را باید بعد از فراخوانی این متد و قبل از هر متد لیست دیگری به پیام الحاق شود.
در قالب های دوم و سوم، متنitem به عنوان پارامتری برای متد و به جای (یا علاوه بر) الحاق به پیام مشخص می شود.
قالب سوم، خاص لیست های تعریف بوده و هم واژه و هم تعریف مدخل لیست را ارائه می دهد.ParametersپارامترهاItemItemThe text of this list entryمتن این ورودی لیستTermTermThe text of this definition list entry’s term part.متن قسمت واژه مدخل این لیست تعریفSee Alsoهمچنین ببینیدDefinitionList( ), definitionListTerm ( ), endList( ).definition List (),definition List Term (), end List ()Send ( )Send ()PurposeهدفSend the HTML message.ارسال پیام HTML.SyntaxترکیبPublic void send ( )Public void send ( )DescriptionشرحSend the HTML messageارسال پیامHTMLTitle ( )title ()PurposeهدفSet the text for the document title.تنظیم متن برای عنوان پرونده.SyntaxترکیبPublic void title (String title)Public void title (String title)getValue ( )getValue ( )DescriptionشرحSet the text for document title.تنظیم متن برای عنوان پروندهParameterپارامترTitleTitleThe text of this messag’s title.متن عنوان این پیام.See Alsoهمچنین ببینیدauthor ( ).author ()5.6 HTML _ Test6-5- HTML-TestThis class provides both an example of how to use the HTML class and a test program which can be used to confirm that the Java CGI package is functioning correctly.این کلاس هم مثالی از چگونگی استفاده از کلاس HTML و هم برنامه تستی را ارائه می دهد که می توان آن را در تأئید عملکرد صحیح بسته JavaCGI به کار برد.Member Summaryخلاصه اجزاءMain // Program main ( ).Main // Program main ( ).See Alsoهمچنین ببینیدMain ( )Main ( )PurposeهدفProvide a main ( ) methodارائه یک روش main ()SyntaxترکیبPublic static void main ( string argv [ ])Public static void main ( string argv [ ])DescriptionشرحThis is the entry point for a CGI program which returns a list of the available name/value in an HTML document, with each name/ value pair displayed in a definition list element.این نقطه ورودی برنامه CGI بوده که لیستی از جفت های موجود name/value پرونده HTML با هر جفت name/value نمایش داده شده در عنصر لیست تعریف می باشد.Parameterپارامترargv [ ]argv []Arguments passed to the program by the java.cgi script.
Currently unused.آرگومان های فرستاده شده به برنامه به وسیله اسکریپت java.cgi در حال حاضر کاربردی ندارد.5.7 Text7-5- Textclass syntaxترکیب کلاسpublic abstract class textpublic abstract class textClass Descriptionشرح کلاسThis class is the superclass of the Emai and HTML classes.
Messages are built up with the methods in this class and completed and formatted with the methods in subclasses.این کلاس، سوپر کلاس دسته های Email, HTML می باشد.
پیام ها با روش های این کلاس ساخته شده و با روش های زیر کلاس ها کامل و قالب بندی می شود.GetValue( )GetValue( )This class is in the “Orbits.text” package.این کلاس در بسته "Orbits.net" قرار می گیرد.Member Summaryخلاصه اجزاءText ( ) // constructor.
add ( ) // add text to thisText ( ) //constructor.
add ( ) // add text to thisSee Alsoهمچنین ببینیدEmail, HTML.Email.HTMLadd ( )Add ()PurposeهدفAdd text to this item.افزودن متن بر این آیتم.SyntaxترکیبDescriptionشرحPublic void add (char addition)Public void add (char addition)Public void add (string addition)Public void add (string addition)Public void add (stringBuffer addition)Public void add (stringBuffer addition)DescriptionشرحAdd addition to the contents of this text item.اضافه کردن addition به محتوای آیتم متن.ParameterپارامترAdditionaddition (اضافه)Text to be added to the text item.متن اضافه شده به آیتم متن.See Alsoهمچنین ببینیدAddLineBreak ( ), addparagraph ( ).add Line Break (), add Paragraph ()AddLineBreak ( )add Line Break ()PurposeهدفForce a line break at this point in the text.اجبار یک قطع خط در این نقطه متن.SyntaxترکیبPublic void addlineBreak ( )Public void addlineBreak ( )DescriptionشرحAdd a line break to the text at the current point.افزودن یک شکست قطع به نقطه کنونی متن.See Alsoهمچنین ببینیدGetValue ( )GetValue ( )Add ( ), addparagraph ( )add (), add Paragraph ()addparagraph ( )add Paragraph ()PurposeهدفStart a new paragraph.شروع یک پاراگراف جدید.SyntaxترکیبPublic void add ( )Public void add ( )DescriptionشرحStart a new paragraph at this point in the text flow.شروع یک پاراگراف جدید.See Also.همچنین ببینیدadd ( ), addLineBreak ( ).add ( ), addLineBreak ( ).6.
Future Plans6- طرح های بعدیadd to the Email class:اضافه بر کلاس Email:Email (int capacity)Email (int Capacity)Used when we know how much space the message will need to have allocated.هنگامی استفاده می شود که می دانیم پیام برای تخصیص یافتن به چه مقدار فضا نیاز دارد.SentTo (string [ ] address)SentTo (string [ ] address)Add a list of primary destinations to the e-mail message.افزودن لیستی از مقصدهای اولیه به پیام ایمیل.Send Cc (String address)Send Cc (String address)Add a Carbon-Copy destination to the e-mail message.افزودن یک مقصد Carbon-Copy به پیام ایمیل.Send Cc(string [ ] address)Send Cc (String [] address)Add a list of carbon – copy destinations to the e-mail message.افزودن لیستی از مقصدهای Carbon-Copy به پیام ایمیل.sendbcc (String address)Send Bcc (Stering address)Add a Blind carbon – copy destination to the e-mail message.افزودن یک مقصد Carbon-Copy کور به پیام ایمیل.SendBcc (string [ ] address)Send Bcc (String [] adderess)Add a list of blind carbon – copy destinations to the e-mail message.افزودن لیستی از مقصدهای Carbon-Copy کور به پیام ایمیل.Add to the HTML class.اضافه کردن به کلاس HTMLHTML (int capacity)HTML (int Capacity)Used when we know how much space the message will need to have allocated.هنگامی استفاده می شود که بدانیم پیام چه مقدار فضا برای تخصیص یافتن نیاز دارد.getValue( )getValue( )public void unorderedList ( )Public void unordered List ()start an unordered list.شروع یک لیست نامرتبPublic void orderedList ( )Public void ordered List ()Start an ordered listشروع یک لیست مرتبPublic void directoryList ( )Public void directory List ()Start a directory list.شروع یک لیست دایرکتوریPublic void menuList ( )Public void menu List ()Start a menu list.شروع لیست منوVoid anchor (String anchor Name)void link (string url,string text)Specify an anchor.مشخص کردن یک انکرVoid link (string url, string text)Void link (String url, Strung alt Text)Specify a link.مشخص کردن یک لینکVoid applet (string url, string altText)Void anchor (String url, Strung alt Text)Specify an applet link.مشخص کردن یک لینک appletAllow HTML lists to be nested.میسر ساختن لیست های HTML برای درج شدن.Add error checking code to enforce correct ordering of HTML list formatting codes.- افزودن که بررسی خطا برای انجام ترتیب بندی صحیح کدهای قالب بندی لیست HTML.The location of the file of environment data should be configurable from the Makefile.- موقعیت فایل دیتای محیط باید از Make file قابل پیکربندی باشد.Get rid of the spurious empty name/ value pair that appears in the list when we are dealing with the Get method of data trnsfer.تسلط جفت خالی ساختگی name/value که وقتی با متد GET انتقال دیتا سر وکار داریم در لیست آشکار می گردد.Consider having CGI implement the java.
Util.
Enumeration interface to successively provide variable names.بررسی برخورداری از CGI که رابط محیط java.util را پیکربندی کرده تا نام متغیرها را با موفقیت ارائه دهد.Add a Test class, which would use every method in this package.افزودن یک کلاس Test که از هر متدی در این بسته استفاده می کند.Document how CGI _ Test, Email_Test build on each other to provide incremental tests for debugging purposes.مستند سازی چگونگی ساختن HTML-Test, Email-Test, HTML.Test در یکدیگر تا تست های اضافی را برای اهداف اشکال زدایی (debug) ارائه دهد.Document how test uses every feature available in this package.مستند سازی چگونگی استفاده تست از هر ویژگی موجود در این بسته.7.
Changes7- تغییرات7.1 Changes from 0.4 to 0.51-7- تغییرات 4/0 تا 5/0changed documentation and comments to reflect the final nature of this release.تغییر مستندات و توضیحات برای منعکس کردن ماهیت نهایی این محصول.7.2 changes from 0.3 to 0.42-7- تغییرات 3/0 تا 4/0Fleashed out the HTML class to provide minimal functionality.افزودن جزئیات کلاس HTML برای ارائه حداقل عاملیت.Wrote the HTML _ Test class and javahtmltest.html-dist.نوشتن کلاس jav html test.html-dist, HTML-TestAdded the HTML methods to deal with a definition list.افزودن متدهای HTML برای سر وکار داشتن با لیست تعریف.7.3 changes from 0.2 to 0.33-7- تغییرات 2/0 تا 3/0Added the Text and Email classes.
HTML was also added, but it is merely a stub at this point.- افزودن کلاس های HTML.Email, Text هم اضافه شد اما در این نکته صرفاً یک تابع کوتاه می باید.Put the various classes into packages.
The main classes are in Orbits.net.
*, the support class Text is in Orbits.text.
text.- بسته بندی کلاس های مختلف، کلاس های اصلی در Text, Orbits.net* کلاس پشتیبانی در Orbits.text.text قرار دارد.
- فایل های متنی اصلاح شده توسط نصب make با نام هایی ارائه می گردد که با –dist خاتمه می یابد.GetValue ( )GetValue ( )Changed CGItest to CGI _ Testتغییر CGI trest به CGI-TestAdded the Email_Test class.- افزودن کلاس Email-Test7.4 changes from 0.1 to 0.24-7- تغییرات 1/0 تا 2/0The environment variables are put into a temportary file instead of being crammed into the Java inperpreter command-line.
The CGI class and java .
cgi had to be modified.- متغیرهای محیط به جای پرکردن خط فرمان مفسرJava، در یک فایل موقتی قرار میگیرند.
کلاس java,cgi, CGI باید تغییر کند.The javacgitest.html cocument is made part of the distribution.- پرونده java cgi test.html به بخشی از ارسال از شبکه تبدیل می شود.The text files which are modified by make upon installation are provided with names that end with –dist.- فایل های متنی اصلاح شده توسط نصب make با نام هایی ارائه می گردد که با –dist خاتمه می یابد.