Accessing URL parameters in Oracle Forms / OC4J - oracle

How do I access parameters passed into an Oracle Form via a URL.
Eg given the url:
http://example.com/forms90/f90servlet?config=cust&form='a_form'&p1=something&p2=else
This will launch the 'a_form' form, using the 'cust' configuration, but I can't work how (or even if it's possible) to access p1 (with value of 'something') p2 (with value of 'else')
Does anyone know how I can do this? (Or even if it is/isn't possible?
Thanks

Within Forms you can refer to the parameters p1 an p2 as follows:
:PARAMETER.p1
:PARAMETER.p2
e.g.
if :PARAMETER.p1 = 'something' then
do_something;
end if;

Thanks Tony
That was one part of the problem.
The other needed part I eventually found on oracle.com was the url structure. After all the forms90 parameters (config etc), you need to supply an "otherparams" parameter supplying your parameters as a parameter to that. (parameters seperated by '+': eg
http://server.com/forms90/f90servlet?config=test&otherparams=param1=something+param2=else
Thanks

Related

Dialogflow CX $param not showing in agent text

I am getting into CX and have a simple agent going but I cannot get the agent to respond with my filled parameter.
I have a page that asks for #DrinkFrequency and #DrinkChoice, I see both get filled correctly when I test the agent and $page.params.status = FINAL takes me to my next page that says
So you drink $session.params.DrinkFrequency and prefer to drink $session.params.DrinkChoice
But the agent says exactly that, it does not replace $session.params.DrinkFrequency or $session.params.DrinkChoice with the values the user gave. I know it must be a simple issue but I have tried to write $session.params.DrinkFrequency in a few different ways and I looked at the existing tutorial bots and they also have it with just the $ sign. Am I not saving the user given value?
The page that gets the values has the two parameters and they ask for the value in their "Initial prompt fulfillment" field.
You're referring to the entity type, while the display name is the name of your parameter.
If you replace $session.params.DrinkFrequency with $session.params.frequency and $session.params.DrinkChoice with $session.params.preference it should work.

how to pass parameters to joomla module loaded from article

I had previously added Joomla modules from within Joomla articles this way : {loadmodule mod_name} but this time I need to pass parameters from it.
How can I pass parameters from within the article to a Joomla module?
You'll need to modify or clone the Joomla plugin loadmodule because it doesn't handle parameters other than just a module name. It's not particularly difficult to do if you're proficient in PHP (assuming you don't mind getting your hands dirty with a little bit of Regex work) but I'd suggest cloning it and using it this way:
Copy folder \plugins\content\loadmodule to \plugins\content\Myloadmodule (and all it's files)
Within the new folder, rename loadmodule.php and loadmodule.xml to myloadmodule.php and myloadmodule.xml. These are the files you'll do all the work on.
In both files, replace occurrences of loadmodule with myloadmodule, (Case sensitive)
In myloadmodule.php, start at around line 36 with the Regex that strips out what is in the {loadposition xxx} being processed. You'll need to tinker with this Regex to get the parameters that you want to supply when using {myloadmoduel blah-blah-blah} in your article.
Find the database entry in your table '_extensions' for loadposition and create and identical record for myloadposition. (Unless you want to write and installer)
Finally, you'll need to render the modules with your new parameters - I can't begin to help there because I don't know what modules, or parameter work you'll be doing, but this renderModule documentation will be of assistance.
7.
I think I've covered it all, but this should be enough to get most of it done for you. When you're done, use {myloadposition ...} instead of {loadposition ...}.
I will give more details about the previous answer, to be able to pass parameters to a module with a tag as {loadmodule mod_name,param}
The solution given by GDP works fine: it's easy and quick to rewrite a content plugin (e.g. myloadmodule), following the steps 1 to 5 in the previous answer.
The problem, for me, comes with the steps 6: how to put parameters into the module, and ohow to retrieve de parameters within the module.
Step 7 : how to give parameters to the "render" of a module
In the plugin created (base on the loadmodule), you have to find the lines with the following code :
echo $renderer->render($module, $params);
Before this line, you can put parameters into the $params parameter, but "render" of the module retrieves only params with the key 'params', using a json format.
So, to pass parameters to the render function, you can do something like that :
$param = array('param_name' => 'value'); // param_name = value
$params = array('params' => json_encode($param)); // 'params' (String) should be decoded by the render of the module
echo $renderer->render($module, $params);
Step 8 : How to retrieve the parameter within the module
In the helper of your module, you can retrieve the parameter with $params variable :
$value = $params->get('param_name');
To understand a helper, read this tutorial : http://docs.joomla.org/J3.3:Creating_a_simple_module/Developing_a_Basic_Module
I googled the same issue and found your question. I know its old but my find may help someone else. There are now plugins that allow embedding modules and allowing you to pass parameters to it. My choice is Module Plant.

Oracle Forms Builder - change to window in another form

We have two forms so far, and need to switch from window1 in from1 (which is login screen) to windowX in formX using button (trigger code below):
begin
show_window('windowX');
go_block('some_block_in_formX');
end;
This gives error FRM-41052: Cannot find Window: invalid ID
So question is, should I add formX into show_window parameter in certain way or is there another approach? Thank you.
Please note, that forms are in different files.
that forms are in different files.
If the forms are different files, you need to call the other form using open form/call form/newform - whatever suits your needs.
show_window/go_block sequence can be used only when you're moving to different windows/blocks of the same form - and the error message
error FRM-41052: Cannot find Window: invalid ID
is complaining that it can't go to that Window because it's in a different form.
Each form effectively has a private namespace for all its windows, blocks, items, etc - and your code always runs within the context of a single form.
To solve this, you'll need a form parameter, plus some code in the other form, e.g.:
in formX, add a parameter ACTION
in form1, pass the value 'XYZ' to ACTION
in formX, in the WHEN-NEW-FORM-INSTANCE trigger, check if :PARAMETER.ACTION = 'XYZ', and if so, do your show_window and go_block. Copy the same code to your WHEN-WINDOW-ACTIVATED trigger.
Of course, you'll need to think about the name of the parameter (e.g. ACTION) and value ('XYZ') that will make sense to people maintaining your forms in the future.

How to use Html.Partial() method to render partial view with an explicit path

Everyone, I'm using MVC 3 (Razor). I have the following problem:
I have some common contents segregated into a partial view. But rather than to put it in the default location (views/shared or views/controller-name), I need to put it in a different location (views/shared/new-folder or view/controller-name/new-folder).
I tried this : #Html.Partial("views/shared/new-folder/partial-view-name") or even #Html.Partial("views/shared/new-folder/partial-view-name.cshtml"),but it seems that MVC3 only consider the parameter as a view name, and it totally ignored any path information.
Maybe I did something wrong ,can anybody help me with this ?:) Thank you very much!
You need to reference using an application virtual path (notice the ~\ at the beginning of the path):
#Html.Partial("~\\views\\shared\\new-folder\\partial-view-name.cshtml")
If you have also configured an action to return that Partial View, You could also do:
#{ Html.RenderAction("PartialViewAction", "PartialViewCOntroller");}
This is probably better since you shouldn't be hard coding references to Views in your code. Deploying a hard coded reference on a different server could break the application, but calling an action to return a view won't.

Renaming an AD user (CN) VBS

I have tried 2 ways (changing CN parameter and movehere) to rename a user in AD, without success. Everything else works (changing name, surname, alias...)
Help appreciated,
Marius
From the MSDN on IADsContainer::MoveHere:
The IADsContainer::MoveHere method can
be used either to rename an object
within the same container or to move
an object among different containers.
Moving an object retains the object
RDN, whereas renaming an object alters
the RDN.
For example, the following code
example performs the rename action.
set cont = GetObject("LDAP://dc=dom,dc=com")
set newobj = cont.MoveHere("LDAP://cn=Jeff Smith,dc=dom,dc=com", "cn=Denise Smith")

Resources