-
2004年07月26日
IntelliJ IDEA最佳中文字型设定
- IDE Settings/Appearance/Font改成"dialog.plain"Size:"12" (还可以解决界面的一些乱码问题,如打开文件对话框中的乱码)
- IDE Settings/Colors & Fonts/Editor Font改成"DialogInput"Size:"14"(在1024*768下面)
-
2004年07月23日
Programmatically interacting with Shark
主要是讲如何以corba的方式与shark server服务器,思路很清楚,值得特别保留。
- From: "Sasa Bojanic" <s.bojanic@xxxxxxxxxxxxxx>
As you've probably seen, the Shark has an admin and worklist handler applications that use Shark API to access it.
The clients access Shark server through the CORBA interface, which is defined in idl files that can be found within modules/SharkCORBA/idl.
These idl files are used to generate java classes that are put into shakcorba.jar. This jar is used by the server (to really implement the methods for importing XPDL, starting processes, ...), and by Java clients to call these methods to perform wanted operations on server.
If you like to write the custom Java application, you have to include library sharkcorba.jar in your project, and use its interfaces to access Shark server.
First thing you have to do is to get the Shark server main object registered at the CORBA name server - you have to know the name server host name and port, as well as the name that Shark server uses to register itself (default settings are host=localhost, port=10123, workflowServerName=SharkServer) -
look at the findWorkflowServer() method in the file SharkClient.java.
This WorkflowServer object is the one defined in the idl interface WorkflowService.idl.
The only method you can call on this object is
getWorkflowClientServiceObject() - so you should call it and retrieve this object.
Then you have to call the connect method of the WorlfowClientService object, and pass it login and password parameters, and if it is OK, you will be
connected to the Shark server, and be able to use all of the methods defined in WorkflowClientService interface (the methods for uploading and loading
XPDLs, getting all process definitions and the instantiated processes, ...).
This interface is the "key to the shark server". To load the package, you can use _openPackage() method, when you do that, you can get all process definitions by calling get_iterator_processmgr() method, and then you can select some process definition object and call its method createProcess(),etc...
The Shark API is not well documented, but you should look at the classes SharkServer, SharkClientService, SharkEngineManager and all WfXXXImpl classes. Also, read the OMG document http://www.omg.org/docs/formal/00-05-02.pdf - this file describes the interface implemented by Shark server (plus Shark server upgrades it, the
upgrades are defined in the WorkflowService.idl file).
Also, look at the way of how the Shark clients are written.
Greetings,
Sasa. - From: "Sasa Bojanic" <s.bojanic@xxxxxxxxxxxxxx>
-
2004年07月22日
技巧:利用AVT技术简化HTML元素属性的写法
AVT是attribute Value Template的缩写,例如在XSL里这样的写法:
<xsl:element name="input">
<xsl:attribute name="Name">
<xsl:value-of select="@Name" />
</xsl:attribute>
<xsl:attribute name="value">
<xsl:value-of select="Value"/>
</xsl:attribute>
</xsl:element>可以简写为:
<input name="{@Name}" value="{Value}" />奥妙在于:写属性时,如果要引用XML里面的值,像通常一样通过XPath引用,再在外面加上{}。
-
2004年07月21日
《java & xslt》是本好书
Oreilly出品。今天边调试程序边看,居然就看了四十多页,加上昨天看的二十多页,基本上就掌握了XSLT技术了。当然不能靠这本书掌握Java。 -
2004年07月14日
Framework Vs Library
一段关于Framework与Library的区别的很好的解释。
Additionally, a framework and library differ in the sense that the former is the latter turned inside out. What I mean is that if you use a library, the calling is done by the client. The callsare distinct and they do what they claim to be doing.In a framework, there are callbacks. Because there are callbacks,one should expect some kind of function pointers, virtual functions or interfaces. In fact, a framework uses polymorphism to let you add your object to the system already in place. A framework, then,is nothing but a structure with most of the plumbing already provided.Since a framework does not know what instance of objects will beadded, it relies on the client objects adhering to certain interfaces.Because J2EE consists of callbacks (servlets -> service(Request, Response)),EJBs (ejbLoad, ejbStore, all container callbacks) it is a framework. On the other hand C consists of libraries because the client calls and the library function/method just does its stuff (e.g. atoi or printf in C).In a framework the call sequence is not in your control while in a library, it is. A good example other than above is Swing where you provide certainmethods (e.g. getPreferredSize(), getMinimumSize() etc) and you wait to be called.Also, libraries don't maintain state. Frameworks do.Because a framework is a structure (while libraries are building blocks)and because a structure is difficult to change, bad design of the frameworkcan quickly become difficult to use. An example is MFC framework which while working through callbacks, has a top heavy (meaning the base class consists of most methods) class and this makes it cumbersome to use.HTH,Regards,Kamesh







