Post request on show() method - aqualogic.bpm.modeling(Archived)

Hi,
I am using "show(WebPage, url, values)" to show an external JSP (because our customer don´t want to use screenflow). This method using a "GET" http request, but the external JSP needs a "POST" request.
Does anybody know how can I do that?
Thanks, 

The proper way is to create a one node screenflow with a JSP invocation inside it, if the JSPs are part of the project.
The JSP component is deprecated, it blocks the transaction and does not work in J2EE engines.
Mariano 

The JSPs we need to invoke are external (existing application), not part of the project.<br>
Our customer doesn`t want to import the JSPs. So, I need a method like "Fuego.Net.WebPage.show(WebPage, url, values)", but that uses a HTTP POST method request, (security requirements), instead of GET.<br>
How can I do that?

Related

How to set a new attribute in th Servlet Context from an external app.

Hi,
I need to do an external application that can access to the servlet context to recover/modify some attributes. Anybody know how can I do it?.
I've revised some mBeans thinking that they can serve me the servlet context, but I have not viewed anything related.
Best Regards
Antonio 
I'd say your best bet is adding another servlet and mapping to your application that presents a REST interface to this information. You could return application-scope data in a small XML document, and you could send attribute names and values with request parameters.
It's not practical to dynamically change the actual init-params of the servlet context.

RunAs()....

Hi,
I am trying to figure out a way to have my servlet be able to run a URL as a
specific user.
We are using jsps to generate emails and I am generating a "forgot password"
email and the url that is called from within the servlet is
/login/findpasswordemail.ar?personId=1 problem is I don't want anyone except
my sevlet to be able to call this url.
So I was thinking in the web.xml I would add a constraint for a role like
System or Service but then how would I get my servlet to "runAs() System or
call the URL.openStream() as System....?? The Servlet then sends an email to
the email address from a form field it was passed when it was called. So the
outer servlet can be run by anyone.
Thanks,
Jerry
Hmmm, my brief forray into the world of WLS security has left me with mental scars. What I've found
is that the security context is set on a thread only once - you can't over-ride it. The security
context is a by-product of doing an InitialContext and if a thread already has a security context it
is left in place on subsequent InitialContext calls. So the first InitialContext on the path the
thread takes through the code has to be done with the user you want the thread to run as all the way
through. A caveat is that it seems that sometimes the thread can loose it's security context... but
I'll leave that to you to play with ;-)
I tried runAs() and runAsPrivileged() on WLS5.1.0 but that didn't really help. Give it a go though -
maybe you'll get lucky!
Good luck,
Dave
Jerry Rodhers wrote:
>
Hi,
I am trying to figure out a way to have my servlet be able to run a URL as a
specific user.
We are using jsps to generate emails and I am generating a "forgot password"
email and the url that is called from within the servlet is
/login/findpasswordemail.ar?personId=1 problem is I don't want anyone except
my sevlet to be able to call this url.
So I was thinking in the web.xml I would add a constraint for a role like
System or Service but then how would I get my servlet to "runAs() System or
call the URL.openStream() as System....?? The Servlet then sends an email to
the email address from a form field it was passed when it was called. So the
outer servlet can be run by anyone.
Thanks,
Jerry

External Tasks

I'm trying to use the implementation type "External" of interactive activities, but I'm having some difficulties. I don't understand how I make the client, also I don't know how the BPM engine knows whom to call.
Does anyone have any sample project that can send me?
Rodrigo Zuchetto 
Hi Rodrigo
You can follow the following steps
In BPM
1. Under External Resource, create a new resource of type 'Server Configuration'. Specify your host, port and the servlet/jsp path.
2. For the main task of interactive activity, choose implementaion type as 'External'.
3. Create a prepare and commit method. Prepare method will be called from your servlet, and you can define arguments (as output args) that will be passed from BPM to your external java app
4. Commit method will be called from your java app, once you are done with the processing. You can define args (as input) here. These args will be set from java app when it calls this commit method.
In JavaApp
1. For the servlet you define in step 1 above, define a default handler and initialize a papi session here.
2. Call activityPrepare on this papisession, and get hold of the variables passed from step 3 above
3. Do your processing
4. Call activityCommit on the papisession and pass back the parameters
HTH 
Hi Satinder,
Thanks for your answer.
I followed your step-by-step and it worked partially. I invoked my external task and returned arguments to the commit method, but the task was not completed. Do you have any idea what could have happened?
Rodrigo Zuchetto 
You have to performed a prepare to blosck the instance and exchange the arguments and after call the commit, a prepare has to be performed before the commit.
Hope it helps 
I was trying this strategy to add a "file upload" servlet, and noticed that the process Id, participant, instanceId and TaskId are passed as parameters in a GET request. I was wondering how was i going to pass to the servlet this data.
Yet, that means that the whole URL of the request is exposed to the user and that is a direct security risk since it makes so much easier to forge another similar request.
¿Is there any way to make the request via POST instead of GET from OBPM?
If someone wants to see the full servlet code or the project that calls it, it is still a small enough proyect to share at large.
Edited by: Daniel Sol on 05/11/2009 14:35

Hardcoded pathnames in pageflow controller class in weblogic portal

Hi,
I have a question regarding the annotations which are used while working with pageflows in weblogic workshop. When we use the forward annoation
to forward from a particular action method or even say the begin method, i feel the path to the resource, typically,JSP page is hardcoded. I would like to know
if there is a way to avoid hardcoding the names of the resources inside the pageflow controller class. Basically, i would like the forward resource to be configurable. If i want to change to a different forward jsp i don't want to change the controller source which will result in building the class again. So, is there way we can avoid hardcoding the name of the forward inside the controller class. 
You'd have to use the Forward constructor which accepts a URI (and not use the annotation). How you map a name to a URI is upto your code
or
You'd have to use struts where this mapping is in the XML file.
However you are really over engineering. Are you looking to avoid building the pageflow (if so why?). if you really are interested in avoiding deployment (in turn to avoid down time) use weblogic server features. Also how many JSP's do you have that are drop in replacements for other JSP's which you already know off at development time (which means they have the same request attribute requirements and a subset of the pageflow actions and the same HTML render requirements) ? 
Hi,
Thanks for your reply. I am sure using struts would be right choice. But, I am looking to see if there is a better way to achieve that when using pageflows with weblogic portal. Since, i am more used to struts, i wanted to know if i can get a similar feature while working with beehive pageflows in weblogic portal and not using struts. Also, i see that while using the pageflows struts-config-xml file is being generated in the classes folder. But, i am not able to change that xml file directly as the controller code overrides my changes in the xml file. So, i believe that there is no direct way to accomplish my requirement using pageflows. So, i need to create a struts pageflow or import a create a pageflow based on a existing struts module or applicaition only.

Backing file init method always called for proxy portlets

Hello,
We are currently using Weblogic Portal 10 MP1. Deployed within our Portal EAR is a local proxy portlet and attached to this proxy portlet is a backing file, which currently implements the init() and prerender() methods from the backing interface.
When this is placed in a page that is within a desktop, the init() method is always invoked no matter which page you access within the desktop. As I understand it from the documentation, if you have "tree optimization" turned on, then the init() method will only be called when rendering the actual page the proxy portlet is in. But this doesn't seem to be the case. However, if I define a standard Java portlet within the EAR and attach a backing file, then the init() follows the rules when tree optimization is turned on or off.
Does anyone know if this is a defect within the portal framework, or is this expected and proxy portlets do not follow this rule?
And I guess, if it is a defect or known limitation, is there a possible workaround? I assume the simplest workaround will be to move the logic into the prerender() method.
Regards,
Jonathan 
Hello Jonathan,
Tree optimization is a tricky thing- some portlets may still be initialized even when the page they are on isn't visible. The rules for which get initialized and which don't are very complicated and depend on a number of things, so it is just best to not rely on the init() method not getting called.
By far the best option for your use-case is to have the proxy portlet listen to the "onRefresh" event, and move the logic from the backing file's init() method into an event-handling method in the backing file, then have this method called when the refresh event is received. Here's a sample portion of the .portlet file for doing this:
<netuix:handlePortalEvent event="onRefresh" eventLabel="onRefreshEvent">
    <netuix:invokeBackingFileMethod method="handleRefreshEvent"/>
</netuix:handlePortalEvent>The "onRefresh" event is sent to the portlet only when it is visible on the page, so it should work perfectly for your use-case.
Kevin 
Hi Kevin,
Thank you for your reply. Much appreciated! I get the feeling we're not the only ones who have experienced this issue, generating a number of different ways to get around it!
We'll have a look at the refresh event, but I do have one question. I assume this is only called once within the same session and if the page is rendered multiple times?
Also, we have raised a Support case to look at this specifically and Oracle have confirmed they can replicate the issue. So I'll let you know if anything useful comes back from this.
Regards,
Jonathan 
Hello Jonathan,
The refresh event is sent to the portlet every time it is about to be rendered-- every time the page it is on gets rendered, which is usually more than once per session.
Kevin 
Hi Kevin,
I've finally got an answer from Oracle support about this issue and apparently this is by design. This happens when Weblogic cannot detect any existing session and so initialises the whole control tree. However, it can be disabled by setting optimize-first-request flag to true which can be in two ways:
- To enable optimize-first-request please set following tags in netuix-config.xml at consumer side:
<tree-optimization-config>
<optimize-first-request>
true
</optimize-first-request>
</tree-optimization-config>
OR
- To turn optimize-first-request on without changing code, use the following flag in startup scripts at consumer domain:
-Dwlp.optimizeFirstRequest=true
Hope this makes sense.
Regards,
Jonathan

Categories

Resources