- 浏览: 196382 次
- 性别:
- 来自: 广州
文章分类
最新评论
-
carlosfu:
需要这么多资料。。
广州买房二三事 -
cutesunshineriver:
砺雪凝霜 写道看好喜欢思考的人,加油!前辈~谢谢鼓励!
2015年终盘点 -
砺雪凝霜:
看好喜欢思考的人,加油!前辈~
2015年终盘点 -
MM22:
能问下,为什么,在eclipse ACVTIVE之后,在浏览器 ...
osgi入门 -
icarus11:
我现在用的BPMsuite是11.1.1.7 但开发工具用的是 ...
Oracle BPM Suite和JDeveloper打补丁
想要做的事很简单,就是在Project下加两个菜单,第一个是流程移植,第二个是流程设置。
第一步,实现一个菜单上下文监听器。
代码里面涉及的两个Action稍后再补充说明,Action是指菜单项点击之后系统对应的动作。
第二步,加入流程移植和流程设置的两个Action。
右键选择New Gallery,选择Client Tier下面的Extension Development,分别创建两个Action。
流程移植的控制器代码如下:
流程移植的命令代码如下:
流程设置的控制器代码如下:
流程设置的命令代码如下:
第三步,请修改META-INF目录下的extension.xml,加入<context-menu-listeners>元素,在插件扩展里绑定上下文菜单的监听器。
第四步,发布成插件。
首先,把项目部署成jar包,拷贝出该jar包,在同级目录建立一个META-INF目录,在META-INF目录下,新建一个bundle.xml,代码如下:
<u:update id="bms.processdeploy">,这个id一定要跟extension.xml里的extension的id一致。jar包的名字用id的名称,如bms.processdeploy.jar。
恭喜你,你成功了,赶紧从jdeveloper的check for update里去安装这个本地插件吧!
第一步,实现一个菜单上下文监听器。
package bms.processdeploy; import oracle.ide.Context; import oracle.ide.controller.ContextMenu; import oracle.ide.controller.ContextMenuListener; import oracle.ide.controller.IdeAction; import oracle.ide.model.Element; import oracle.ide.model.Project; public class DeployContextMenuListener implements ContextMenuListener { public void menuWillShow(ContextMenu contextMenu) { Element e = contextMenu.getContext().getElement(); if (e instanceof Project) { IdeAction action = IdeAction.find(ProcessDeployCommand.actionId()); contextMenu.add(contextMenu.createMenuItem(action)); IdeAction _action = IdeAction.find(ProcessPreferenceCommand.actionId()); contextMenu.add(contextMenu.createMenuItem(_action)); } } public void menuWillHide(ContextMenu contextMenu) { } public boolean handleDefaultAction(Context context) { return false; } }
代码里面涉及的两个Action稍后再补充说明,Action是指菜单项点击之后系统对应的动作。
第二步,加入流程移植和流程设置的两个Action。
右键选择New Gallery,选择Client Tier下面的Extension Development,分别创建两个Action。
流程移植的控制器代码如下:
package bms.processdeploy; import oracle.ide.Context; import oracle.ide.Ide; import oracle.ide.controller.Controller; import oracle.ide.controller.IdeAction; import oracle.ide.extension.RegisteredByExtension; import oracle.ide.wizard.WizardManager; /** * Controller for action bms.processdeploy.processdeploy. */ @RegisteredByExtension("bms.processdeploy") public final class ProcessDeployController implements Controller { public boolean update(IdeAction action, Context context) { return true; } public boolean handleEvent(IdeAction action, Context context) { return false; } }
流程移植的命令代码如下:
package bms.processdeploy; import example.TempConvert; import example.TempConvertSoap; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import oracle.ide.Context; import oracle.ide.Ide; import oracle.ide.controller.Command; import oracle.ide.extension.RegisteredByExtension; import oracle.javatools.dialogs.MessageDialog; /** * Command handler for bms.processdeploy.processdeploy. */ @RegisteredByExtension("bms.processdeploy") public final class ProcessDeployCommand extends Command { public ProcessDeployCommand() { super(actionId()); } public int doit() { String msg = ""; String dir = context.getProject().getBaseDirectory(); File processDir = new File(dir + "/processes"); if (processDir.exists()) { for(File processFile : processDir.listFiles()) { msg = processFile.getAbsolutePath(); try { FileInputStream fis = new FileInputStream(processFile); byte[] buf = new byte[1024]; StringBuffer sb=new StringBuffer(); while((fis.read(buf))!=-1) { sb.append(new String(buf)); buf=new byte[1024]; } System.out.println(); System.out.println(sb.toString()); msg += ",流程移植成功!"; } catch (FileNotFoundException e) { msg += ",无法找到该文件!"; } catch (IOException e) { msg += ",读写异常!"; } } } else { msg = "这不是一个流程项目!"; } showMessageBox(msg); return OK; } private void showMessageBox(String msg) { String caption = "流程移植"; TempConvert tempConvert = new TempConvert(); TempConvertSoap tempConvertSoap = tempConvert.getTempConvertSoap(); msg += "\n\nWebservice调用成功,输入0,返回" + tempConvertSoap.celsiusToFahrenheit("0"); Ide.getStatusBar().setText(caption); MessageDialog.information(Ide.getMainWindow(), msg, caption, null); } /** * Returns the id of the action this command is associated with. * * @return the id of the action this command is associated with. * @throws IllegalStateException if the action this command is associated * with is not registered. */ public static int actionId() { final Integer cmdId = Ide.findCmdID("bms.processdeploy.processdeploy"); if (cmdId == null) throw new IllegalStateException("Action bms.processdeploy.processdeploy not found."); return cmdId; } }
流程设置的控制器代码如下:
package bms.processdeploy; import oracle.ide.Context; import oracle.ide.controller.Controller; import oracle.ide.controller.IdeAction; import oracle.ide.extension.RegisteredByExtension; /** * Controller for action bms.processdeploy.processpreference. */ @RegisteredByExtension("bms.processdeploy") public final class ProcessPreferenceController implements Controller { public boolean update(IdeAction action, Context context) { return true; } public boolean handleEvent(IdeAction action, Context context) { return false; } }
流程设置的命令代码如下:
package bms.processdeploy; import java.io.IOException; import oracle.ide.Ide; import oracle.ide.controller.Command; import oracle.ide.extension.RegisteredByExtension; /** * Command handler for bms.processdeploy.processpreference. */ @RegisteredByExtension("bms.processdeploy") public final class ProcessPreferenceCommand extends Command { public ProcessPreferenceCommand() { super(actionId()); } public int doit() { String url ="http://www.bmsoft.com.cn/"; try { Process op = Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url); } catch(IOException ex) { System.out.println(ex); } return OK; } /** * Returns the id of the action this command is associated with. * * @return the id of the action this command is associated with. * @throws IllegalStateException if the action this command is associated * with is not registered. */ public static int actionId() { final Integer cmdId = Ide.findCmdID("bms.processdeploy.processpreference"); if (cmdId == null) throw new IllegalStateException("Action bms.processdeploy.processpreference not found."); return cmdId; } }
第三步,请修改META-INF目录下的extension.xml,加入<context-menu-listeners>元素,在插件扩展里绑定上下文菜单的监听器。
<extension id="bms.processdeploy" version="1.0" esdk-version="1.0" rsbundle-class="bms.processdeploy.Res" xmlns="http://jcp.org/jsr/198/extension-manifest"> <name>BMS Process Deploy</name> <owner>BMS</owner> <dependencies> <import>oracle.ide</import> </dependencies> <hooks> <!-- TODO Declare functionality provided by the bms.processdeploy extension. --> <jdeveloper-hook xmlns="http://xmlns.oracle.com/jdeveloper/1013/extension"> <actions> <action id="bms.processdeploy.processdeploy"> <properties> <property name="Name">流程移植</property> <property name="SmallIcon">${OracleIcons.TO_REF}</property> <property name="LongDescription">Process Deploy</property> </properties> <controller-class>bms.processdeploy.ProcessDeployController</controller-class> <command-class>bms.processdeploy.ProcessDeployCommand</command-class> </action> <action id="bms.processdeploy.processpreference"> <properties> <property name="Name">流程设置</property> <property name="SmallIcon"></property> <property name="LongDescription">ProcessPreference</property> </properties> <controller-class>bms.processdeploy.ProcessPreferenceController</controller-class> <command-class>bms.processdeploy.ProcessPreferenceCommand</command-class> </action> </actions> <!-- Install listeners to the navigator, editor, and structure pane (explorer) context menus so that we can install menu items for our action. --> <context-menu-listeners> <site idref="navigator"> <listener-class>bms.processdeploy.DeployContextMenuListener</listener-class> </site> </context-menu-listeners> </jdeveloper-hook> </hooks> </extension>
第四步,发布成插件。
首先,把项目部署成jar包,拷贝出该jar包,在同级目录建立一个META-INF目录,在META-INF目录下,新建一个bundle.xml,代码如下:
<update-bundle version="1.0" xmlns="http://xmlns.oracle.com/jdeveloper/updatebundle" xmlns:u="http://xmlns.oracle.com/jdeveloper/update"> <!-- The id *MUST* match exactly the id in your extension.xml. --> <u:update id="bms.processdeploy"> <!-- The name of your extension as you want it to appear under the check for update menu --> <u:name>ProcessDeploy</u:name> <!-- The version *MUST* match exactly the version in your extension.xml. --> <u:version>2</u:version> <u:author>Sunny Zhou</u:author> </u:update> </update-bundle>
<u:update id="bms.processdeploy">,这个id一定要跟extension.xml里的extension的id一致。jar包的名字用id的名称,如bms.processdeploy.jar。
恭喜你,你成功了,赶紧从jdeveloper的check for update里去安装这个本地插件吧!
发表评论
-
Joda-Time
2014-04-09 16:28 915有一个需求,要找出当年内所有的节假日。 package ob ... -
OAM Logout
2014-01-14 14:54 1417在用OAM实现单点登录方案之后,发现原有的产品里的应用,如BP ... -
部署Spring3和CXF的web项目到weblogic server 11g
2013-07-10 09:59 4264eclipse里的web项目,用到了spring3和CXF,直 ... -
java解压缩包
2012-08-17 16:12 976import java.io.File; import ja ... -
使用SAX将特定格式的XML转成CSV文件
2012-04-28 10:10 3237直接贴代码 package org.autumn.kettle ... -
同音字查询
2012-04-16 18:25 4653package org.autumn.kettle; i ... -
Hello World on RMI
2011-08-04 09:39 9311、首先定义服务器上要 ... -
舍本逐末
2011-07-29 16:55 1406今天被领导叫过去分配任务,讲了一些学习上的事,触动挺大的。 ... -
观察者模式
2011-05-12 10:26 1082在java的util包下有Observer接口和Observa ... -
最近遇到的几个面试题
2011-02-28 21:51 837一、面向对象的三大特 ... -
Alan Kay总结的OOP特性
2010-11-14 21:48 9771、一切都是对象。 2、计算通过对象间相互通信,请求其他对象执 ...
相关推荐
JDeveloper VCS插件安装及使用
Oracel Jdeveloper 开发手册
jdeveloper11g 开发的 一个简单demo 但对于新手很实在
jdeveloper开发培训指南(1),基于oracle9i的开发工具
oracle JDeveloper 开发工具介绍 繁体中文 pdf格式,分为十个章节,因不能上传大于10M文件,所以分为共五个压缩包。
Oracle Jdeveloper 10g 开发手册电子档
JDeveloper的环境下,制作的关于利用oc4j发布web服务的一个例子,描述非常详细.
oracle JDeveloper 是一个很好的教材,教你如何去很轻松开发javaee,工具很强大,很实用
oracle JDeveloper 开发工具介绍 繁体中文 pdf格式,分为十个章节,因不能上传大于10M文件,所以分为共五个压缩包。
oracle JDeveloper 开发工具介绍 繁体中文 pdf格式,分为十个章节,因不能上传大于10M文件,所以分为共五个压缩包。
Oracle 9i JDeveloper开发手册 构建J2EE应用程序
一个完整的Oracle JDeveloper 工具开的Demo ,官方网站有下,最好结合Developer's Guide.pdf 来看
Oracle产品开发工具JDeveloper的全部图标资源
学习的jdeveloper得好资料
oracle JDeveloper 开发工具介绍 繁体中文 pdf格式,分为十个章节,因不能上传大于10M文件,所以分为共五个压缩包。
JDeveloper开发资源的行业的敌人的容忍他人
JDEVELOPER学习文档资料
很好的 JDeveloper 工具书 JDeveloper JDeveloper JDeveloper JDeveloper JDeveloperJDeveloper
Demo Jdeveloper Demo Jdeveloper Demo Jdeveloper Demo Jdeveloper Demo Jdeveloper Demo Jdeveloper Demo Jdeveloper Demo Jdeveloper Demo Jdeveloper
学习JDeveloper期间,一边学习,一边翻译,也就有了这个东西。希望有助于和我一样的学习者。