Rendering HTML JSF Component via java code
Hey,
I was wondering,
I want to build sort of HTML generator (for a very specific process),
I thought about taking the advantage of JSF components instead of writing an HTML generator,
Is it possible to render Html JSF Components via simple java class?
For instance, assuming I built an 'HtmlDataTable' object with columns, inputs, etc...
I'd like to render the dataTable as HTML and get the HTML tags via a simple java class,
Thanks.
the sample JAVA codes are provided for sending SPML requests, HTTPClient and one more (i dont remember rite now) within the OIM installation folders itself. It's in the 'SampleHttpClient' folder. Check it once. WSDL, sample XML's and the JAVA codes all are there. You just need to set the classpath and run it.
- oidm.
Similar Messages
-
How to insert a new attachment via java code
Hi everybody,
I need add a new attachment via java code. I found the service EDIT_RENDITIONS on the Add Attachments page. But this service is not documented. Does somebody have a example how to add attachments?
Thank you
MartinMartin,
Try the following code:
final IdcClientManager clientManager = new IdcClientManager();
IdcClient client;
try {
client = clientManager.createClient(IDC_PROTOCOL + RIDC_SERVER + ":" + RIDC_PORT);
final String username = "sysadmin";
final DataBinder dataBinderReq = client.createBinder();
ServiceResponse severiceResponse = null;
dataBinderReq.putLocal("IdcService", "EDIT_RENDITIONS");
dataBinderReq.putLocal("dID", "1560"); // as integer
dataBinderReq.putLocal("dDocName", "DEV2_001509"); // as string
dataBinderReq.putLocal("renditionKeys", "addRendition0"); // as string
dataBinderReq.putLocal("addRendition0.name", "theFileName");
dataBinderReq.putLocal("addRendition0.description", "theFileDescription");
dataBinderReq.putLocal("addRendition0.action", "edit");
final String fileName = "c:\\test.txt";
final File file = new File(fileName);
final TransferFile tf = new TransferFile(file);
dataBinderReq.addFile("addRendition0.file", tf); // as byte
severiceResponse = client.sendRequest(new IdcContext(username), dataBinderReq);
final DataBinder dataBinderResp = severiceResponse.getResponseAsBinder();
// DataBinder resultado = severiceResponse.getResponseAsBinder();
System.out.println(dataBinderResp.toString());
} catch (final IdcClientException e) {
System.out.println(e.getMessage());
e.printStackTrace(System.out);
Jonathan
http://jonathanhult.com -
How i can set the selected item of a dropDown component from java code
Hi
Thank you for reading my post
How i can set the slected item of a DropDown component from backing beans java code ?
it is binded with a database , so one field determine its display and one other field determine its value , I want to set the selected item of this combobox
In back code i have both value and display values to use them .
can some one give me some help ?
Thanks ,See code sample 3 at http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/helloweb.html
See also, the selection components row in the table under http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/helloweb.html
It says
One way to preselect items is to call setSelectedValue(Object[]) or setSelectedValue(Object) from the prerender() method. You pass in the return values of the items that you want preselected. Be sure to verify that getSelected() returns null before setting the default options, or you will overwrite the user's selections on a post-back. -
Access client DOM id of current JSF component via an EL statement
Is it possible to access the client-side DOM id of a JSF component from within an EL statement?
For example:
<a4j:commandLink id="marketNameLink" action="#{testAction.myFunction( 'some how get client DOM id' )} />
I could use rich:clientId('marketNameLink'), except I think that this is a bit wasteful in processing time to search the complete DOM tree to access the id of the current component.
Any ideas?
PhilipEL are evaluted at server side and DOM id are generated for the client side
I advice you to read this article :
[http://balusc.blogspot.com/2009/05/javajspjsf-and-javascript.html|http://balusc.blogspot.com/2009/05/javajspjsf-and-javascript.html]
and also this on :
[http://weblogs.java.net/blog/2009/07/22/say-sayonara-spal|http://weblogs.java.net/blog/2009/07/22/say-sayonara-spal] -
OIM should send spmlv2 requests via java code to service provider
Hi,
We have the situation in which OIM acts as Requesting authority,Spml provider acts as service provider.
Oim should send spml requests from custom java code.Spml2Client is used.We are not using genericc technology connector.
Require sample java code for Search operation.
I had done for modify request.
The request and response is as follows
PSO ID returned after searching: org.openspml.v2.msg.spml.PSOIdentifier@5c32a864
<deleteRequest xmlns='urn:oasis:names:tc:SPML:2:0' recursive='false'/>
<deleteResponse xmlns='urn:oasis:names:tc:SPML:2:0' status='success'/>
<modifyRequest xmlns='urn:oasis:names:tc:SPML:2:0' returnData='identifier'>
<psoID ID='cn=TPS User8,ou=TPS,dc=fosterstechodc,dc=com'/>
<modification modificationMode='replace'>
<data>
<dsml:modification xmlns:dsml='urn:oasis:names:tc:DSML:2:0:core' name='otherHomePhone' operation='replace'>
<dsml:value>999999</dsml:value>
</dsml:modification>
</data>
</modification>
<modification modificationMode='delete'>
<data>
<dsml:modification xmlns:dsml='urn:oasis:names:tc:DSML:2:0:core' name='description' operation='delete'>
</dsml:modification>
</data>
</modification>
<modification modificationMode='add'>
<data>
<dsml:modification xmlns:dsml='urn:oasis:names:tc:DSML:2:0:core' name='firstname' operation='add'>
<dsml:value>Barbara</dsml:value>
</dsml:modification>
</data>
</modification>
</modifyRequest>
SpmlClient: sending to http://10.101.151.209/ARServerSPML/SPMLProvider.asmx
<modifyRequest xmlns='urn:oasis:names:tc:SPML:2:0' returnData='identifier'>
<psoID ID='cn=TPS User8,ou=TPS,dc=fosterstechodc,dc=com'/>
<modification modificationMode='replace'>
<data>
<dsml:modification xmlns:dsml='urn:oasis:names:tc:DSML:2:0:core' name='otherHomePhone' operation='replace'>
<dsml:value>999999</dsml:value>
</dsml:modification>
</data>
</modification>
<modification modificationMode='delete'>
<data>
<dsml:modification xmlns:dsml='urn:oasis:names:tc:DSML:2:0:core' name='description' operation='delete'>
</dsml:modification>
</data>
</modification>
<modification modificationMode='add'>
<data>
<dsml:modification xmlns:dsml='urn:oasis:names:tc:DSML:2:0:core' name='firstname' operation='add'>
<dsml:value>Barbara</dsml:value>
</dsml:modification>
</data>
</modification>
</modifyRequest>
SpmlClient: received
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><modifyResponse status="failure" xmlns="urn:oasis:names:tc:SPML:2:0"><error>malformedRequest</error><errorMessage>At least one <modification> element must be specified.</errorMessage></modifyResponse></soap:Body></soap:Envelope>
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><modifyResponse status="failure" xmlns="urn:oasis:names:tc:SPML:2:0"><error>malformedRequest</error><errorMessage>At least one <modification> element must be specified.</errorMessage></modifyResponse></soap:Body></soap:Envelope>
org.openspml.v2.util.Spml2ExceptionWithResponse: At least one <modification
The response says the modifaction tag is not present.
The code for this request is
Modification[] modifications =
{ newModWithDSMLMod("otherHomePhone", "999999", ModificationMode.REPLACE),
newModWithDSMLMod("description", null, ModificationMode.DELETE),
newModWithDSMLMod("cn", "Barbara", ModificationMode.REPLACE)};
modifyResp = customSPMLClient.modifyUser(client,searchPSOId,modifications);
method:
public ModifyResponse modifyUser(Spml2Client client,PSOIdentifier psoId,Modification[] modifications) throws Exception {
client.setTrace(true);
ReflectiveXMLMarshaller marshaller = new ReflectiveXMLMarshaller();
ModifyRequest modReq = new ModifyRequest(null, // String requestId,
null, // ExecutionMode executionMode,
psoId, // PSOIdentifier psoID
modifications, // Modification[] modifications
ReturnData.IDENTIFIER // ReturnData returnData
System.out.println(modReq.toXML(marshaller));
ModifyResponse modResp = (ModifyResponse) client.send(modReq);
System.out.println(modResp.toXML(marshaller));
return modResp;
private static Modification newModWithDSMLMod(String modName, String modValue, ModificationMode modMode)
throws DSMLProfileException
/*DSMLModification dsmlMod = null;
dsmlMod = new DSMLModification(modName, modValue, modMode);
Extensible data = new Extensible();
data.addOpenContentElement(dsmlMod);
Selection component = null;
return new Modification(component, data, null, modMode);
Please help me out.
I need sample java code for search operation tooo.
regards,
Sindhu.Mthe sample JAVA codes are provided for sending SPML requests, HTTPClient and one more (i dont remember rite now) within the OIM installation folders itself. It's in the 'SampleHttpClient' folder. Check it once. WSDL, sample XML's and the JAVA codes all are there. You just need to set the classpath and run it.
- oidm. -
How to click a HTML page button from Java code?
Know the HTML page name and the button id in this page, how to click the button automaticly in java code(Like in awt or swing)?
ukkus wrote:
Hi,
Thank for the quick reply,
It will be very helpful if you can tell me how can we do this, I am not able to get how to do the same, with the link that you have provided.You haven't even had time to read it yet.
>
Actually main scenario is:
I have to RUN a JSP report which will call this script. That JSP report and script is in UNIX server. Can you please explain how to perform this task.Running this from a JSP is an even worse programming practice than running it from a standalone application. -
Component for Java Code in ECM & EPM
Hello All,
We are implementing Enterprise Compensation Management and Performance management(EHP4) . We need to customize some of the screens on ESS/MSS tabs. What is the Java component that I can extract the code from and put it on NWDI? I know some of them are in ABAP WebDynpro and some are in Java WebDynpro. I am interested in Java Webdynpro screens
Please advise,
Any kind of help appreciated.
Thanks,
DileepHi,
Below mentioned are the required set of components.
SAP ESS 603 SP6
SAP MSS 600 SP17
SAPPCUI_GP 603 SP6
Current Base components are :
sap.com_EP_BUILDT 7.01 SP6
sap.com_EPBC 7.01 SP6
sap.com_EPBC2 7.01 SP6
sap.com_EP_PSERV 7.01 SP6
sap.com_EP_WDC 7.01 SP6
sap.com_SAP_BUILDT 7.01 SP6
sap.com_SAP_JTECHS 7.01 SP6
sap.com_SAP-EU 7.01 SP6
sap.com_SAP-JEE 7.01 SP6
If you are planning to do modification to standard ESS and MSS, I would suggest to create two tracks . On one track have standard ESS, MSS components and do not connect it to runtime system. This track can be used to lookup sap standard code at any point. And on the second track have you ESS. MSS components with modification and connect it to runtimes. -
WYSIWYG HTML editor developed in Java
I need a HTML editor developed in Java and of open source so that I could inhibit some actions. This editor needs to be graphic introducing the result of HTML, as it does FrontPage, so that any user can modify his content.
It will be that someone can help ?Have a look at [Metaphase Editor|http://www.metaphaseeditor.com] . It's a WYSWIWYG HTML Editor component for Java and is licensed under LGPL.
The binaries and source code is available at [Project Kenai|http://kenai.com/projects/metaphaseeditor] . -
Terminate a BPEL Process using Java Code
Hi,
How can I achieve the forcible termination of a BPEL process via Java code??
Thanks
PramodI guess I'll not be able to use event handlers because if I set an OnMessage, the process wont get kicked off till I receive a message, isnt it?
My requirement is that I want the BPEL to keep executing as normal but as soon as I send a request to Stop, then it should terminate.
Actually, is it possible to achieve the following? That is, I want to keep running a bpel process but at the same time keep monitoring for an input message(sent from another partnerlink maybe). As soon as I receive my input message, a different scope is executed and in this scope I can then put a terminate.
Thanks
Pramod -
Implementing partialTriggers using java code???
Can we perform Partial Trigger on a component using java code?
For example,
I have a textBox component and a commandButton.If bind partialTriggers attribute of the textBox to the commandButton, it gets renedered whenever I click the commandButton.
Can I acheive the same,by writing some piece of java code inside the action listener of commandButton?
Regards,
Lokesh.If you bind the component to a bean attribute (i.e. attrXYZ) you can use
RequestContext.getCurrentInstance().addPartialTarget(attrXYZ);in the listener to update it.
Timo -
Resource Object Approval via Java API
Is there a way to do approval of Resource Object via Java code/API?
You have to use updateTask API
HashMap search = new HashMap();
search.put("Process Instance.Task Information.Assigned To User Key", "81");
tcResultSet pend = requestOperationsIntf.getApprovalTasksAssigned(search);
// The above ResultSet stores all the request information pending for approval. Right now there is just one row
pend.goToRow(0);
long taskInsKey = pend.getLongValue("Process Instance.Task Details.Key");
// Extract the taskInstance key form the above resultSet to pass to the next API
Map mhProcessMap = new HashMap();
mhProcessMap.put("Process Instance.Task Details.Data", "Approve");
// Where 'Approve', 'Reject' etc will be your approval task responses
proOperIntf.updateTask(taskInsKey, mhProcessMap); -
JSF component inside HTML table -- not rendering properly
I have a HTML table like the one below. In one of those columns (td) I have a JSF component. When I run the app, the JSF component (even if its a simple inputText or panelGrid or panelGroup) is not getting inside the td. Instead, it forms a seperate table after this td.
Code I have:
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td>... ..MULTIPLE Td's here - Deleted for simplicity </td>
<td class="topNav">
Blog Directory
</td>
<td>
<img src="./images/top_button_right.gif"/>
</td>
<td class="topNav">
<f:panelGroup>
<h:inputText value="Username"/>
<h:inputSecret value="Password"/>
</f:panelGroup>
</td>
</tr>
</tbody>
</table>
What I expected:
username, passwd field inside the top level HTML table.
What comes: (as a result of running thsi JSF page )
<table> -- Original table
<td> </td> -- -TD that had the inputText - comes empty here
</table>
<table>
<tbody>
<tr>
<td><input type="text" name="_id1:header:EasyHeader:_id4" value="Username" /><input type="password" name="_id1:header:EasyHeader:_id5" value="" /></td>
</tr>
<tr>
<td><table>
I am a newbie to JSF & due to the complexity of the layout & page, I m unable to get rid of the HTML tags totally.
Thanks in advance.
GaneshFound the solution to the problem.
wrapped the entire HTML page till the JSF component ( panelGrid) under <f:verbatim>.
something like this
<f:verbatim>
<table>
<tr> <td>...</td>
<td>
</f:verbatim>
<h:panelGrid> ... </h:panelGrid>
<f:verbatim>
</td>
</table>
</f:verbatim> -
How to load a class dynamically (via reflection) in a jsf-component
Hi all,
I am writing my own jsf component and I would like to do it generically. Therefore I have an attribute, where the developer can pass a fully qualified classname, which I want to use to instantiate. But I have a Problem with the classloaders, everytime I get a ClassNotFound-Exception during debugging.
Does anybody know how it is possible, to to get the most parent classloader?
Currently I am even not able to load a class, which is in the same package like all other compontent-classes.
Thank you very much in advance
ThomasWithin web applications, I believe it is recommended to use Thread.getContextClassLoader(). Keep in mind that web applications require different classloader semantics than regular Java applications. The class loader which gets resources from the WAR is favored over others, even when this violates the normal class loading conventions.
-
since installing the latest version of Firefox, I get two of these java messages every time I open a new window
[Exception... "Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [nsIFileInputStream.init]" nsresult: "0x80520012 (NS_ERROR_FILE_NOT_FOUND)" location: "JS frame :: chrome://1clickweather/content/js/utils/filemanager.js :: <TOP_LEVEL> :: line 233" data: no]To avoid confusion: http://kb.mozillazine.org/JavaScript_is_not_Java
That issue is caused by the 1clickweather extension as you can see in your above posted error message.<br />
See:
* https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes -
Can we call Plain JAVA Code online via MDM Cient
Hi SDNers,
For some validation purpose i need to write a JAVA Code(Some body told me that it can be possible i.e we can Java Code for doing Validation)
i have two Questions.
1. Can we call JAVA Code online via MDM Client.
2. where i have to write this JAVA Code and what will be steps of writing this Code.
Thanx in Advance.Hi Tanveer,
Thanx a lot for ur prompt reply
Pls reply my this Question also promptly i will be highly thankful for it.
Q.
My Requirment is i have to do the validation
"on the basis of acct grp i have to put validation
a. the G/L acct must be in particular range.
b. it must have specific length"
My sr. developer is saying simply putting the IF ELSE condition in the validation Editor technique 'ld be hard to maintain at later stage as we large number of Acct Grps.
He is saying look for some Custom function for it
"SO TELL ME CLEARLY THAT
--CAN I USE JAVA API FOR THIS
--AS A EXP. MDM CONSULTANT WILL U
RECOMMEND IT?
--IF YES
THEN
WHAT 'LD BE EXACT STEPS.
---IF NO
THEN
WHAT ARE THE OTHERS WAYS
i.e
IF U R FACING THIS PROBLEM THEN WAT
SOLN U R GOING TO USE?
PLS
REPLY ASAP as per the exact question(i.e all parts of Q)
i will highly thank for u.
Regards
kuldeep
Maybe you are looking for
-
After going through the Thunderbird setup on a Windows 8.1 computer, and after selecting IMAP instead of POP, I get to the point where it asks me to input name, email and password. However, when I do so, it invariably comes back and says my name and/
-
ASR 9006 to 6509 1 gig fiber connection
I have an ASR 9006 with a SFP-GE-L connecting to a Cisco 6500. The link shows up on the ASR side but not on the 6500 side. If I move the SFP from the ASR to a different 6500 chassis the connection works so I know the SFP is working. Any ideas on m
-
You can only log in using your primary BigPond Broadband account
Hi I recently moved from QLD to WA and moved my bundle with me, I had foxtel on tbox over there but the box got left in the move so I bought another one today. I have tried to register it but it comes up with the following message ' You can only log
-
Designing opinions about a network database application
Hi all, I want to develop a small application with Java that will manage data. The size of the data is small. I do not need a client server database (ex.Oracle or Sql server). I also want to make a version of these application to work as desktop appl
-
NullPointerException when trying to view Preferences
Hi All. I've downloaded 9IJDEVELOPER WITH OA EXTENSION ARU FOR 11i10 RUP4 (Patch 5455514) and extracted to my local disk. The operating system is Windows XP Professional. I set environment variables JDEVBIN, JDEVDOC, JDEVHOME (this one is redundant?)