JDAPI change form reference within menus
Hello selfless helpers of Oracle,
We are trying to migrate our web forms from a windows 2003 server to a linux server.
I posted a similar issue sometime back , but that was with regards to getting the JDAPI to start working. The JDAPI has started working , i was able to successfully convert the form-references to lowercase from uppercase within a form , using the sample code ChangeCase from "Note 403582.1 Sample Code JDAPI: switch Case For FormName in OPEN_FORM /CALL_FORM /NEW_FORM " .
But i also have numerous references to other forms within my Menu files i.e my mmb. I did the basic changes like search and replace all Form with menu etc etc.. i got my code compiled and running.
Problem is :-
If i have the CALL_FORM made within the Menu item code, it doesn't seem to pick it up. However i had another menu file where the CALL_FORM was made within a program unit ( i.e a procedure) and it picked up the reference and even converted it to lower case.
I wanted to know how to manipulate the code , to pick up form-references when made from menu item code as well... I am posting the code i used for changing the case of menus ...
thanks in advance.....
K
import java.io.BufferedReader;
import java.io.InputStreamReader;
import oracle.forms.jdapi.MenuModule;
import oracle.forms.jdapi.Jdapi;
import oracle.forms.jdapi.JdapiIterator;
import oracle.forms.jdapi.JdapiMetaObject;
import oracle.forms.jdapi.JdapiMetaProperty;
import oracle.forms.jdapi.JdapiObject;
import oracle.forms.jdapi.JdapiTypes;
import oracle.forms.jdapi.ProgramUnit;
import oracle.forms.jdapi.Trigger;
import oracle.forms.jdapi.MenuItem;
public class ChangeCase_Menu {
private static boolean uppercase =
false; /* change this boolean to what is required (for uppercase set true)*/
private static int changed =
0; /*variable indicating if any changes were accepted in the menu*/
public static void setInteger(int value) {
changed = value;
public static int getInteger() {
return changed;
private static int resetIter = 0; /*iterator for looping through objects*/
public ChangeCase_Menu() {
public static void main(String[] args) {
String text;
MenuModule mmd;
// Open the Menu
if (args.length < 1) {
System.out.println("Usage java ChangeCase_Menu Menuname.mmb");
System.exit(0);
else if (!args[0].toUpperCase().endsWith("MMB")) {
System.out.println("Works Only For Menus i.e only MMB ");
System.out.println("Usage java ChangeCase_Menu Menuname.mmb");
System.exit(0);
try {
mmd = MenuModule.open(args[0]); /*open the Menu*/
System.out.println("Open Menu " + mmd.getName());
loopObjects(mmd);
if (getInteger() ==
1) { /*save the menu only if something is changed in the triggers*/
System.out.println("Saving the menu to " +
mmd.getAbsolutePath());
mmd.save(mmd.getAbsolutePath());
System.out.println("Menu saved");
mmd.destroy();
} catch (Exception e) {
if (e.toString().endsWith("not found"))
System.out.println("Menu Does not exist");
Jdapi.shutdown();
private static void loopString(JdapiObject obj, String Text,
String finalText) {
boolean beenthere = false, setX = false, setZ = false;
int x = -1, y = -1, z = -1;
int t = -1;
String tempText = Text;
t = Text.indexOf("CALL_FORM"); /* search in trigger for a call_form **/
if (t == -1) {
x = Text.indexOf("OPEN_FORM");
t = x;
if (x != -1)
setX = true;
/* if call_frm is not found, then search for open_form*/
if (t == -1) {
z = Text.indexOf("NEW_FORM");
t = z;
if (z != -1)
setZ = true;
if (t != -1) {
System.out.println("\nThis is the current code for " +
obj.getName());
System.out.println("-------------------------------------------------------");
System.out.println(Text);
while (t !=
-1) /* loop if there are multiple call_form/open_form/new_form*/
beenthere = true;
finalText = changeText(obj, finalText, t);
y = t + 10;
tempText = finalText.substring(y, Text.length());
if (setX == false && setZ == false) {
t = tempText.indexOf("CALL_FORM");
} /* search in trigger for a call_form **/
if (t == -1 || setX == true || setZ == true) {
if (x == -1 && setZ == false) {
tempText = finalText;
y = 0;
setX = true;
if (setZ == false) {
x = tempText.indexOf("OPEN_FORM");
t = x;
/* if call_form is not found, then search for open_form*/
if (x == -1 || setZ == true) {
if (z == -1) {
tempText = finalText;
y = 0;
setZ = true;
z = tempText.indexOf("NEW_FORM");
t = z;
if (t != -1) {
t = y + t;
setX = false;
setZ = false;
if (beenthere == true) {
System.out.println("\nProposed change of code " + obj.getName() +
" to");
System.out.println("-------------------------------------------------------");
System.out.println(finalText);
System.out.println("\nDo you want to change this Text? (Y/N) ");
/* In this codepart I first question if you would like to make the change
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
Hard coding for batch process , uncomment if you want user interaction
try {
//String answer = br.readLine();
String answer = "Y";
while (answer.toUpperCase().compareTo("Y") != 0 &
answer.toUpperCase().compareTo("N") != 0) {
//answer = br.readLine();
answer = "Y";
if (answer.toUpperCase().compareTo("Y") == 0) {
System.out.println("changing the code");
if (obj instanceof Trigger) {
Trigger obj3 = (Trigger)obj;
obj3.setTriggerText(finalText);
} else if (obj instanceof ProgramUnit) {
ProgramUnit obj3 = (ProgramUnit)obj;
obj3.setProgramUnitText(finalText);
}else if (obj instanceof MenuItem) {
MenuItem obj3 = (MenuItem)obj;
obj3.setMenuItemCode(finalText);
setInteger(1);
System.out.println("changed the code");
if (answer.toUpperCase().compareTo("N") == 0) {
System.out.println("not changed");
} catch (Exception e) {
System.out.println(e);
private static String changeText(JdapiObject obj, String Text, int t) { /*In this code I search first for the substring of CALL_FORM or OPEN_FORM
*When this is found I search first for the first quote, then for the second quote
*This string returned I will put in uppercase, if you need lowercase, then
*change here Text2.substring(firstquote,secondquote).toUpperCase() to
*Text2.substring(firstquote,secondquote).toLowerCase()
String Text1 = Text.substring(0, t);
String Text2 = Text.substring(t, Text.length());
String finalText = Text;
int firstquote = Text2.indexOf("'", 0);
int secondquote = Text2.indexOf("'", firstquote + 1);
if (uppercase == true) {
finalText =
Text1 + Text2.substring(0, firstquote) + Text2.substring(firstquote,
secondquote).toUpperCase() +
Text2.substring(secondquote, Text2.length());
} else {
finalText =
Text1 + Text2.substring(0, firstquote) + Text2.substring(firstquote,
secondquote).toLowerCase() +
Text2.substring(secondquote, Text2.length());
return (finalText);
private static void loopObjects(JdapiObject obj) { /*this function will loop through all objects in the menu*/
JdapiMetaObject meta = obj.getJdapiMetaObject();
JdapiIterator iter = meta.getChildObjectMetaProperties();
while (iter.hasNext()) {
JdapiMetaProperty cprop = (JdapiMetaProperty)iter.next();
JdapiIterator kids =
obj.getChildObjectProperty(cprop.getPropertyId());
while (kids != null && kids.hasNext()) {
if (resetIter > 0) {
kids = obj.getChildObjectProperty(cprop.getPropertyId());
loopObjects((JdapiObject)kids.next());
resetIter = 0;
} else {
loopObjects((JdapiObject)kids.next());
if (obj instanceof Trigger) {
if (!(obj.isSubclassed())) {
// Get the trigger text make sure it exists.
String theText =
obj.getStringProperty(JdapiTypes.TRIGGER_TEXT_PTID);
if (theText != null) {
Trigger obj3 = (Trigger)obj;
String Text = obj3.getTriggerText();
String finalText = Text;
loopString(obj3, Text, finalText);
} else {
System.out.println("Error: This object " + obj.getName() +
"doesn't have any trigger text");
if (obj instanceof ProgramUnit) {
System.out.println("Found PU" + obj.getOwner().getName() + "." +
obj.getName());
if (!(obj.isSubclassed())) {
String theText =
obj.getStringProperty(JdapiTypes.PROGRAMUNIT_TEXT_PTID);
if (theText != null) {
ProgramUnit obj3 = (ProgramUnit)obj;
String Text = obj3.getProgramUnitText();
String finalText = Text;
loopString(obj3, Text, finalText);
} else {
System.out.println("Error: This object " + obj.getName() +
"doesn't have any PU text");
if (obj instanceof MenuItem) {
System.out.println("Found Menu Item Code " + obj.getOwner().getName() + "." +
obj.getName());
if (!(obj.isSubclassed())) {
String theText =
obj.getStringProperty(JdapiTypes.MENU_ITEM_CODE_PTID);
if (theText != null) {
MenuItem obj3 = (MenuItem)obj;
String Text = obj3.getMenuItemCode();
String finalText = Text;
loopString(obj3, Text, finalText);
} else {
System.out.println("Error: This object " + obj.getName() +
"doesn't have any Menu item code text");
}
Similar Messages
-
Changing cross-reference formats - what do my options mean?
Hi all, using TCS2 on Win 7 64 bit.
I have a question about changing a cross-reference format. I have one that is "<paratext>" right now - the " included. So my xref says (for example):
For more information, please see "Appendix 1".
I want to change this to that it doesn't show quotation marks anymore. I know the HOW of doing this, my question is once I have made the change, a dialogue box appears asking me which cross-references this change should apply to. My options are:
Internal Cross-References
References to All Open Documents
References to All Documents
I don't know which one I should chose. I am working in a book structure that has a bunch of FM files imported to form chapters. Each file file uses this old style xref so I need to update the xref format in each file (I think I need to do this one by one) and in some instances my xrefs are within the same doc, sometimes they are to other files within the FM book. So I think I need to pick 'References to All Documents' but it says there is no undo so I'm seeking advice first!
Many thanks in advance,
Adrianaadrianaharper wrote:
Hi all, using TCS2 on Win 7 64 bit.
I have a question about changing a cross-reference format. I have one that is "<paratext>" right now - the " included. So my xref says (for example):
For more information, please see "Appendix 1".
I want to change this to that it doesn't show quotation marks anymore. I know the HOW of doing this, my question is once I have made the change, a dialogue box appears asking me which cross-references this change should apply to. My options are:
Internal Cross-References
References to All Open Documents
References to All Documents
I don't know which one I should chose. I am working in a book structure that has a bunch of FM files imported to form chapters. Each file file uses this old style xref so I need to update the xref format in each file (I think I need to do this one by one) and in some instances my xrefs are within the same doc, sometimes they are to other files within the FM book. So I think I need to pick 'References to All Documents' but it says there is no undo so I'm seeking advice first!
Many thanks in advance,
Adriana
Internal means only within the current document. All open, and all, are self-explanatory.
Your question shows that you're not sure what will happen when all instances of the cross-references that use the format are changed, either because you can't remember what you created in your own book, or because you're working on a book created by someone else, or that you collaborate on with others.
Don't let "no undo" scare you off. You can undo the result by saving all the files, before you do the changes. From within the book window, hold Shift while clicking the File menu - Save changes to Save All Files in Book. Or, from within any open file, hold Shift while clicking the File menu - Save changes to Save All Open Files. After you save the files, performing any non-undoable operation like changing the cross-reference format only makes the changes, but doesn't save the affected files. These actions are undoable by holding Shift while clicking the File menu again; from within a book window, Close becomes Close All Files in Book, and from with an open file, Close becomes Close all open files. When prompted to save, click Don't Save. Alternatively, from within each open and changed file, File > Revert prompts for confirmation, and if you choose to continue, the last-saved version of the file reopens.
If you want yet another safety layer, copy the whole file structure that will be affected to a safe location. If the set of assets is sprinkled all around the system, Bruce Foster's inexpensive FM plug-in "archive" will copy the whole collection into one place: http://home.comcast.net/~bruce.foster/products.htm.
HTH
Regards,
Peter Gold
KnowHow ProServices -
While using data pump (impdp) how to rename references within objects?
using 10g;
what i want to accomplish is to change schema & tablespace ownership using the data pump method via the command line; i have had success using the command line for expdp / impdp. Problem is that there are objects that reference the old schemas that DO NOT get updated (e.g. procedure may reference usr1.table1 in the PL/SQL statement) and this is where i have been UN-successfull). Anyone know of a way to change references from old schema to new schama name in objects(procedures, views, etc) via the command line?
this is what i currently use that works to change schema, tablespace, but will not change references within my objects;
expdp system/<pass> schemas=usr1,usr2 DIRECTORY=dp_dir DUMPFILE=dataPump_BothSchemas.dmp LOGFILE=expdpAllSchema.log parallel=2
impdp system/<pass> DIRECTORY=dp_dir DUMPFILE=dataPump_BothSchemas.dmp LOGFILE=impbothSchToEE.log remap_schema=usr1:newUsr1,usr2:newUsr2 remap_tablespace=old_ts_tables:new_ts_tables full=y
Thanks!
p.s. I have acomplished this using the enterprise manager.(e.g. procedure may reference usr1.table1 in the PL/SQL statement) If you hard coded such reference in stored procedure, you have to manually correct them. Consider use synonym if your storage procedure referencing other schema's objects.
-
Accessing form elements within a Spry region.
Since nested Spry regions isn't yet support, can someone tell
me how to access and modify form elements within a existing region?
For example, I have a region that displays a form based on
data I defined in a javascript array. On of the form elements is a
select with some options. I want to added and remove options to
this select depending on the number of objects in the data array.
The select is not defined when I try to access it after spry
has finished rendering the form, eg
document.forms[0].selOrder1.options.length = 0;
How are Spry regions attached to the browser's DOM? Does Spry
create it's own DOM subordinate to the main DOM?
Is it possible to make changes to a Spry region without using
Spry?
thx
pwpActually, there are a couple of ways to get access to the DOM
underneath a region container. If you have a region, you can put an
ID attribute on the region container node, or if you are using a
region observer, the data passed into the observer has a regionNode
property. So if you want access to the region DOM anytime the
region is re-generated, do something like this:
function myRegionObserver(notificationType, notifier, data)
// We only want to do something after the region is
re-generated,
// for all other notifications, do nothing.
if (notificationType != "onPostUpdate")
return;
// If your region container element has an ID on it, just
use
// getElementByID. This is useful in the case where your
observer
// is only ever registered with one region.
var rgnElement1 = document.getElementById("headerRegion");
alert(rgnElement1.innerHTML);
// Or you can simply use the regionNode property of the data
// that is passed in. This is useful if you've registered
the same
// observer on multiple regions. The regionNode property
will
// contain the region container node for the region that is
currently
// being updated.
var rgnElement2 = data.regionNode;
alert(rgnElement2.innerHTML);
Spry.Data.Region.addObserver("headerRegion",
myRegionObserver);
<div id="headerRegion" spry:region="ds1">
</div>
--== Kin ==-- -
Function to change all form_specification within call_form
Dear all,
I am trying to find a solution to change all form_specification within call_form for an entire application, is there any possibility to create a function or what..it not efficient to do it by hand.
Thank you!
Micro
LE: the puropse of this is to move my aplication from Win to Linux server
Edited by: user10423661 on Aug 4, 2011 11:47 PMI came back wit the solution i used, i dev a function in order to call the form path..and call this function in every form. The same works with rdf and bmp.
CREATE OR REPLACE FUNCTION x.s_forms(name varchar2)
RETURN varchar2 IS
vhost_name_actual varchar2(200);
vbase_name s.base_name%type;
vrute_name s.rute_name%type;
str varchar2(100);
BEGIN
select SYS_CONTEXT('USERENV','HOST') into vhost_name_actual from dual;
select s.base_name, s.rute_name into vbase_name, vrute_name
from s
where vhost_name_actual=s.host_name
and s.activ='Y';
str:=vroute_name||'fmx/'||name;
return str;
exception
when others then
return null;
END s_forms; -
Creating an executable from forms,reports,libraries,menus etc.
Dear All,
How do I create an executable from the complied forms,reports,menus,libraries which I have developed.
How do I incorporate the runtime for forms & reports within this executable.
Regards,
Murtuza M Rangwala
For ALIF Management Services Pvt Ltd.
(Customer Support)To create an executable you will need to generate the form and report. CTRL +T does this. First compile and then control T and you'll be ready to go.
-
Change XSD reference from Local to MDS in existing application
Hi
I have tired MDS upload and delete for XSD and WSDL files using ant scripts. It got uploaded without errors.
But i need to know if there is a BPEL application already having multiple XSD (within project - local) and have the reference of those XSD across multiple WSDL. If i upload the XSDs alone on to MDS and delete them from the project (ie., from local), I am ending up with compile time error saying reference not found in the WSDL.
Is there any way that we can change the reference of the XSD files from local on to MDS path in the existing WSDL automatically once we upload things on to MDS.
Thanks,SeshaI doubt you can get this done automatically. If your wsdl 's has xsd import from local file system, you will have to manually change the location to mds oramds://...format.
So the best way to do this is to maintain the same structure in mds in the local file system ,use the oramds import in all wsdl's and specify the mapping to the actual file system location in adf-config. -
Can I change Filename from within Lightroom?
I am in the Trial Period with Lightroom, having just used it for two days. I assume that one must be able to change a photo's filename from within Lightroom, but I surely can't see how to do it, having looked in the Help file and through all the menus.
Here's what I'm trying to do. When I take photos, I create a descriptive filename that tells me what's in the image. Then I import a big batch. What I want to do is to create slideshows from those images in a different order from the importing order: maybe it's slide 23, then 15, then 10, etc. I was hoping to do this by sticking sort numbers on the front of the filenames (changing the filenames), and then sorting on the filenames to create the desired slideshow sequence.
But, I can't find a way to change the filename within LR. If I do it outside LR, then I lose whatever work I've already done on the images.
Am I overlooking some obvious better way to do this?
Thanks
Bob Chapman
I'm running LR 1.2, Windows XP, 2 GB RAM, big disks.Even easier, select the image or images and press F2 to rename.<br /><br /><[email protected]> wrote in message <br />news:[email protected]..<br />> Hi Bob,<br />><br />> To change the filename for an individual file select the file from grid <br />> view and look over at the Metadata panel on the right side of the screen. <br />> Click on the filename in the metadata panel and it should change <br />> appearance to show that it can now be edited. Type Away!<br />><br />> BTW, If you are planning to make the slideshow using the LR Slideshow <br />> module, the easiest way (for me at least) is to put the slides that are <br />> going into the ss into a Collection. (Yep, time to read up on collections <br />> :) Then you can manually order the slides however you want, select them <br />> all, and use the ss Module to create the ss.<br />><br />> Enjoy!
-
Cross Reference within external Database using XREF API
Hi Experts,
Can we do Cross Reference within external Database using XREF API uses JDBC to access the Oracle Database Stored Procedures in SAP PI? How to use a JNDI Data source to access the DB and how to do the Connection Pooling will be done by the SAP J2EE server? Kindly let me know step by step proceedings.
Regards
ArchanaHello Archana,
It can be done with a Lookup call in a mapping.
Here's a little article about the topic in the SAP wiki:
http://wiki.sdn.sap.com/wiki/display/XI/HowtouseCrossReferencewithinexternal+Database
With kind regards
Sebastian -
Crystal report open instead of PLD with same form reference.
Dear All,
I configured crystel reports to open in preview insted of PLD for documents,
but it is asking parameters of the documents to be opened coz i have created parameteries crystal report,
Means it is open whatever i have created in crystal report.
But i want to open my crystel reports on preview directly insted of PLD
with the same form reference.
Means like PLD is opening preview directly whatever number form is open.
Suppose in Sales Oreder form is open in that 5 no's Sales Order is there and then
when i click on Preview that time only 5 no's PLD Preview is open.
Like that i want to open Crystal Report.
How to get that no's reference to crystal report ?
Thnks
HarishClose this thread as 2 same threads are opened with the same topic..
-
How to get the form reference in .js page from .jsp page
hi
i have written one form in jsp page omething like:-
<html:form action="/shopping" onsubmit="return false;">
can anybody tell me,how to get the form reference in .js page from .jsp page ,
i have tried:-
var formRef = document.forms[0];
butits not working.
Thanks.Its very simple......y cant u prefer google...Bad
c this example...
function submit()
alert("textbox"+ document.forms[0].name.value);//to get textbox value in js
document.forms[0].submit();//to submit jsp page using js
<html:html>
<html:form action="/shopping" onsubmit="submit()">
<html:text property=name>
learn to search in google..
</html:form>
</html:html> -
How can I change the font within a chart in an ibook
I need to change the font size in a chart that is in an iBook because it is so small I can't read any of it. When I try pressing the larger/smaller font buttons, the text outside the chart changes but not within the chart.
Use the SeriesCollection(1).Name function. In LV, wire up the following:
_Chart into Method SeriesCollection (index = 1 to 4)
Cascade into Variant to Data (wire type Excel.Series)
Wire Series into Property Name, Write the string
Michael Munroe
www.abcdefirm.com
Michael Munroe, ABCDEF
Certified LabVIEW Developer, MCP
Find and fix bad VI Properties with Property Inspector -
How to deploy my forms application within OAS 10.1.3.2.0
Dear all,
I cannot find the web service in OAS 10g release 10.1.3.2.0, so how to deploy those oracle forms application within OAS 10.1.3.2.0.
Thanks for anyone help to give the answer!Hi Grant,
I have been hearing since quite some time now that slowly Oracle is shifting its focus towards J2EE and Java based technologies and there are plans also to make Forms obsolete in future.
What is your comment on this?
Thanks and Regards
Amit Trivedi -
How do I change text attributes within one text box in Motion 3?
I am trying to change text attributes within one text box in Motion 3, but am only able to change the font/size for the entire box. Is there a way to change the attributes to individual lines of text within a text box without creating an entirely new one or using the "Lower Third" text effect?
How do I create (two different) multiple colors, fonts, bold, italic, underline in one text box within Final Cut Studio Motion (FCP, FCS)Thank you! You saved me hours of tinkering around with multiple text boxes. It seemed like it should be something pretty elementary. It didn't help that I am not familiar with proper terminology, so thank you for defining glyph.
Cheers,
Owfownugi -
LOVE Firefox! I have just launched a website: www.animalhealingandhumans.com. My web designer told me it takes 7-10 days for any changes to appear. Why? I have cleared caches and cookies etc. I need to be more responsive than 7-1o days. I need changes to appear within 24hrs. How can I achieve a much better response time to good feedback?
Hello binbingogoABC,
Shopping on BestBuy.com should be easy and fun and not fraught with the kind of trouble that you describe. I regret very much that this has been your experience.
Using the information you provided when you signed up for Best Buy Unboxed I was able to locate your cancelled orders. I have requested more information from my back-office partners. As soon as I have additional details about your situation, I will reply again to this message. In the interim, I'm sorry that I must impose upon your patience.
I'm very grateful that you wrote to us with your concerns.
Sincerely,
Maybe you are looking for
-
Question 1 / Plan A : When i finished making my movie project in iMovie 11 on Mac, i tried sharing it at all ways such as youtube, export, etc... it kept popping up: "sharing requires more memory to be available". I searched up all day on the interne
-
Multiple Problems - Hardware or Software?
I've been having a lot of problems lately with my MacBook Pro and I have absolutely no idea why. I called one Apple store and was told I should reinstall Leopard, do an Erase and Install, and not restore from my Time Machine backup because my file st
-
Help can't uninstall or reinstall firefox, it worked yesterday
Woke up and for some reason when I turned on my computer firefox wouldn't work. windows said "The application has failed because its side-by-side configuration is incorrect. So I tried to unistall and reinstall the program and it wont uninstall the p
-
I know how to manage privacy using the tools tab at the top of the address bar, or so I thought. I want to choose "Never Remember History". When I do that, and click "OK", the next time I check the privacy settings, the history is right back to "Use
-
Combo Box doesn't persist data insertion settings
Hi, I'm simply trying to setup a combo box that places the selected label into a destination table cell. I've tried about every combination possible to simply add a data insertion series. Please note, I AM clicking the plus button to add it to the li