how to set a value into ogc:PropertyName - weblogic.developer.interest.webservices.databinding(Archived)

Hello, I am trying to set a text value into the net.opengis.ogc.PropertyTypeName field. I have used XMLBeans to generate java classes for schemas in net.opengis.ogc. I am now trying to use the Java classes to create xml documents. I cannot figure out how to add a text value to the PropertyTypeField of a spatial operator. Please let me know...Thank you.

Related

Calculation in mapping

Hi,
I want to perform a simple transfomation;
Source application has a field AMOUNT, value in euro's
We need to transform this value to the destinition application in cents
How can we perform AMOUNT-destination=AMOUNT-source*100 
There is custom trasformation named "Multiply".
It isn't added to standard trasformations for some reason...
Mapping Parameters -> Custom Transformations -> Add -> <IC_Home>\integration\interconnect\istudio\Multiply.tdf -> Ok
Than use it 
Hi ,
Thanks for this tip, I didn't know about the examples of the custom transformations.
It works, but raises new questions to me:
How do they work?
I opened the tdf-files and for example the multiplier is written as:
name=Multiply
description=Multiplies two in fields or an in field and a constant
package=
class=
number types=1
param0 name=constant
param0 option=+
Where in this file the multiply action is stated? How does interconnect know what to do? I expected that the package and class field had to be filled before a custom transformation could work. and that the package and class are java written functions/applications.
Maybe Multiply is a reserved word which is a standard function within interconnect that can be used in standard transformations.
What are the functions that are available to use in my own custom transformations, without coding in java???
Is there documentation on this?
thanks
Ton 
A small investigation indicate that Multiply is realized class in oai.jar lib.
Package name is not needed because all libraries with custom transformations must be added to classpath in istudio.bat. And of course oai.jar is there as one of the core IC libraries.
As for class name - I think if "class" atribute is ommited it takes class name from "name" attribute... 
You can quite easily write your own java code that does the custom transformation. Compile the code, add it to the UserDefinedTransformation.jar, this gets included in the classpath of the adapter so that it can be used at runtime.
You then need a .tdf file placed in the iStudio directroy which defines the input parameters that are captured at design time by iStudio.

How to use database look up table function in xsl mapping

Can anybody tell me how to use database look up table function while mapping xsl between 2 nodes.
I have an XML file coming in and depending on one of XML elements we need to decide which further path to take. But, using this XML element, we need to query database table, get metadata and accordingly take appropriate path. I have written lookup function which returns metadata value.
Now, the issue is how do I pass the XML element valu as input to look up function? When I tried to drag it to the input node of lookup function, it throws an error like "Maximum number of parameters exceeded"
Thanks,

OOTB PDF generation

We are looking for a way to use the ootb pdf generation in Oracle BPM10.3 to create an attachment in a pdf file type from a business object.
Anybody have any insights to this? 
Hi,
There is no OOTB PDF generation capability in Oracle BPM, but (guessing you know this) the iText Java library works very well for this.
You'd need to:
1. Write a little Java class that accepts a hash table as an incoming parameter and uses the values received to create and populate a PDF. This class calls methods in the iText library (http://www.lowagie.com/iText/) that populate the PDF document with the values it's passed.
2. Jar the class and expose this and the iText "iText-2.1.7.jar" file as an External Resource in Oracle BPM.
3. In a method in Oracle BPM, set the values in a hash table from the values in your BPM Object and call the Java method you wrote using the hash table as an incoming parameter.
Rather than creating a PDF from scratch each time, you can also start with an Adobe AcroForm. You'd use this as a template and fill the form's bookmarked fields in using the fields sent in from the hash table.
Once the PDF has been created, you'd use the Catalog's Fuego.Attachment.create() method to attach the file to the instance.
Hope this helps,
Dan 
Dan and others,
Do you have a sample code of the little Java class that accepts a hash table as an incoming parameter and uses the values received to create and populate a PDF. This class calls methods in the iText library (http://www.lowagie.com/iText/) that populate the PDF document with the values it's passed? 
Are you on Oracle BPM 10g or are you on 11g?
Dan 
Oracle BPM 10G
Does Oracle BPM 11G already have such an API or Method?
Edited by: user8766631 on May 9, 2011 12:42 PM 
Anybody on this? 
There is nothing that works OOTB. You can try putting a "Print" button on the presentation and set its action property to "print" but the file generated looks really bad.
I use the iText Java API on projects. I wrote a Java helper class that I call from a BPM Object method that generates a PDF automatically and populates it with information gathered in the process. Input arguments into this helper class are a hashmap (information that I want displayed in the PDF), the name and location of an existing PDF template (the file I insert the text into) and the output PDF file's name and location.
I also use this to automatically add barcodes to existing PDF documents.
http://www.avioconsulting.com/blog/datwood/2011/05/12/generating-pdfs-oracle-bpm-process
Dan 
Do you have any sample code on how to do this?
I understand that we have to create a Java class but what methods of the itext lib should we use to generate a PDF out of that?
Any sample process would be really helpful? 
Yes - here's the link to the source: http://www.avioconsulting.com/blog/datwood/2011/05/12/generating-pdfs-oracle-bpm-process
Click the link (Jacket.java) at the bottom of the post.
Dan 
Hi Dan,
I have certain questions on this:-
1) What happens when we don't want to create a templateFile. How do we create a PDF then?
2) What happens when there are repeatable fields in a group inside the templateFile which are completed at runtime. For e.g. we have a field which calculates total cost by adding all added costs to the table. Now these added costs can be a total 5 different costs or even 10 different costs. How do we accept this and set it as form field in the PDF as an array of costs?
3) If we indeed are using this templateFile, where do we place it which deploying our code onto the server and what would be the access path to it? Will it be on Weblogic or physically located on the server or where?
4) Finally how do we get the contents in Binary format of this generated pdf file because the method Fuego.Lib.Attachment.create(contents : null, name : targetFile, description : "test"); accepts contents only in Binary format? xmpMetaData of the PDFStamper although in Binary format is ready only? So we cannot put it in the contents field of Fuego.Lib.Attachment.create(contents : null, name : targetFile, description : "test"); ?
So what should we put?
Even mailAttachments.extend(source : null, fileName : "test.pdf") requires source as Binary Contents. How we do this? 
 1) What happens when we don't want to create a templateFile. How do we create a PDF then?2) What happens when there are repeatable fields in a group inside the templateFile which are completed at runtime. For e.g. we have a field which calculates total cost by adding all added costs to the table. Now these added costs can be a total 5 different costs or even 10 different costs. How do we accept this and set it as form field in the PDF as an array of costs? Again, there is no OOTB solution and what I described is just one approach. Whenever possible, I'll use a template file. It's quick - the code's already written to support this. As you point out, it's not the answer for everything. You can build PDF files without a template (again using iText as the PDF API is just one approach that will work). This will mean some Java development on your end to write the code necessary to build them from scratch.
3) If we indeed are using this templateFile, where do we place it which deploying our code onto the server and what would be the access path to it? Will it be on Weblogic or physically located on the server or where4) Finally how do we get the contents in Binary format of this generated pdf file because the method Fuego.Lib.Attachment.create(contents : null, name : targetFile, description : "test"); accepts contents only in Binary format? xmpMetaData of the PDFStamper although in Binary format is ready only? So we cannot put it in the contents field of Fuego.Lib.Attachment.create(contents : null, name : targetFile, description : "test"); ?
So what should we put?
Even mailAttachments.extend(source : null, fileName : "test.pdf") requires source as Binary Contents. How we do this?? One approach is to put the binary for the PDF files in a database. If you have a content management system, use that to store the files.
Dan 
Do you have any examples on this?
Also I created a table in word with two columns and one row. I Saved it As a PDF file . In column I put customerName and the other column was blank.
I then used this as a template file and used your code to pass arguments to form.setField("customerName"), making the value to be "testName" for the key "customerName".
The target PDF file was created but it did not show the value for the key customerName in the PDF document.
How do we make it show that value for every key?
Does it have to be a table?
Or how do specify the key in the template PDF document so that it can be identified by the code?
Is it a table or some other way? 
Here's sample logic to invoke it (this assumes that you have defined two fields labeled "customerName" and "customerNameLabel"):
hashMap as Any[String]
hashMap["customerName"] = clientCase.clientName
hashMap["customerNameLabel"] = "Customer Name"
docName as String
docDirectory as String
docName = "Test document.pdf"
docDirectory = "c:/temp/"
generate(Integration.Jacket.Jacket, templateFile : docDirectory + docName,
                    targetFile : docDirectory + "Generated_" + clientCase.clientName + "_" + docName,
                    hashMap : hashMap)
endThis logic assumes that you put the PDF in the c:\temp directory and that you have a variable named "clientCase" that is a BPM Object and this BPM Object has a "clientName" attribute. This variable needs to be populated with text before this logic is invoked.
I uploaded a PDF template file that this could use. It has the two fields "customerName" and "customerNameLabel". Go to this link to download this template PDF http://www.4shared.com/document/irDl_Pgx/Test_document.html
Dan 
Thanks Dan.. 
Hi Dan,
What did you use to create the sample PDF document?
Did you create it in word and then saved it as a PDF document?
If so, how did you create the two fields?
"customerName" and "customerNameLabel" in the PDF document?
Are both these text fields?

Is there any java API to featch querys written in a file (XML or any) by ID

Is there any java api by which I can fetch required query by its ID from a XML or any type of file? Parameter support is required. I want to separate SQL query's from java code.
Do you mean to say that you want ID and value (where value is your sql query) combination must be stored outside the java program like XML or property file and then you want to pass some ID to get the corresponding query from property file?
And when you pass ID and parameter; you should get the SQL query with replaced parameter value in the query? 
cahvarahul wrote:
Is there any java api by which I can fetch required query by its ID from a XML or any type of file? You can use a property file for that.
Parameter support is required.Where "parameter" refers to the usage in PreparedStatement. If so then your question is at best vague. A text value can be pulled from a file.
If you want to define what specific parameters are associated with a particular statement then I would suspect that you have a flawed design. But you can do that. 
Yes, exactly. 
As suggested in reply#2 you can use properties file using [Apache Commons Configuration |http://commons.apache.org/configuration/] framework which will give you variety of option to play with parameter substitution in property file. 
Uhm, is Ibatis, maybe what you're looking for? Google that.

Problems searching for number attributes

Hi,
When I create a number search attribute in the Ultra Search Administration Tool (9.2) it does not become available for searching in the sample query interface. I have no problems with string search attributes attributes. Should it not be possible to search for number attributes?
Exploring the problem further, I have created a table source and have mapped a number column to a
number search attribute. After crawling the table, the attribute values can be found in the wk$attr_val table, ant wk_queryapi.getsectionname returns section 'b'. Looking into the temporary crawler files it seems that the
text of the 'b' section is some binary encoding like this:
<WKABIN> 6aL20Xc2d60000 6aL1fX616b0000 6aL1eX30b58000 6aL1dX185ac000 6aL1cXc2d6000 6aL1bX616b000 6aL1aX30b5800 6aL19X185ac00 6aL18Xc2d600 6aL17X616b00 6aL16X30b580 6aL15X185ac0 6aL14Xc2d60 6aL13X616b0 6aL12X30b58 6aL11X185ac 6aL10Xc2d6 6aLfX616b 6aLeX30b5 6aLdX185a 6aLcXc2d 6aLbX616 6aLaX30b 6aL9X185 6aL8Xc2 6aL7X61 6aL6X30 6aL5X18 6aL4Xc 6aL3X6 6aL2X3 6aL1X1</WKABIN>
When I call the function that should create the query text for the number 123 in attribute 106 it results in something that far from matches the encoding:
select wk_queryexp.wrap_attr_exp('123',106) from dual;
((WKA6AX &(123)) within B)Am I missing something? Am I unaware of a function which will translate a number to the appropriate binary form? And why does number attributes not appear on the list of selectable attributes in the sample query form?
Thanks in advance
Mikkel 
Hi Mikkel
1) number attributes are only exposed in the complete search sample (search.jsp), not the others (usearch.jsp, tsearch.jsp, gsearch.jsp)
2) Your understanding of the binary encoding is correct, except wk_queryexp package does not handle binary encoding. This is because that package
is meant for 9.0.1 API, which only supports string attributes.
In 9.0.2 and beyond, the encoding of number, date attributes is done in the query API layer in Java, using
the Equals, GreaterThan, LessThan, Between query operators. Please take a look at search.jsp
and see how they are used. The compile() method of the query operators will encode the values for you.
Keep in mind that you should code your application to use the query API, as the encoding algorithm
may change in the future.
David

Categories

Resources