Creating custom class instances for XML nodes
Hi guys,
I'm trying to load an external XML document in my application
and create an instance of a custom class for each node in the XML
based on the value of some of their elements. The instances created
will eventually end up in a DataGrid by the way. The problem I'm
having is there seems to be many ways of doing small parts of this
and I have no idea how to make them all gel. Initially I'm using
HTTPService to load the XML file but I've seen people just use an
XML object. Then, after that, I initially set the loaded XML to an
ArrayCollection but others have used XMLList or XMLListCollection.
I've no idea what's the best way to do this.
Eventually, when I've created all of these instances by
looping over the XML and creating them how will I make them
bindable to the data grid? I'm guessing I'll have to group them
somehow...
Any help would be greatly appreciated. Thanks
Hey Tracy,
That is exactly what I was talking about in a previous post
you replied to
http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?catid=585&threadid=1344350
Anyhow, Below is some code I created to do what your saying
somewhat dynamically. The idea being you can have many different
object types that you may want to populate with data from XML. In
my case I am using e4x as the result type from my web services. At
present I have about 6 different classes that call this function.
I'd love to get some opinions on the function. Good bad or
???? Any improvements etc????
package . . . .
import flash.utils.describeType;
import flash.utils.getDefinitionByName;
import flash.utils.getQualifiedClassName;
import mx.utils.ObjectUtil;
* Utility class to convert xml based Objects to class
instances.
* Takes a value object as the destination and an xmlList of
data
* Look through all the items in the value object. Note we
are using classInfo..accessor since
* our objects are bound all variables become getter /
setter's or accessors.
* Also note, we can handle custom objects, arrays and
arrayCollections.
* History
* 03.11.2008 - Steven Rieger : Created class
public final class XMLToInstance
public static function xmlToInstance( destinationObject :
Object, sourceXMLList : XMLList ) : void
// Get the class definition in XML, from the passed in
object ( introspection so to speak )
var classInfo : XML = describeType( destinationObject );
// Loop through each variable defined in the class.
for each ( var aVar : XML in classInfo..accessor )
// If this is String, Number, etc. . . Just copy the data
into the destination object.
if( isSimple( aVar.@type ) )
destinationObject[aVar.@name] = sourceXMLList[aVar.@name];
else
// Dynamically create a class of the appropriate type
var className : String = aVar.@type;
var ObjectClass : Class = getDefinitionByName( className )
as Class;
var newDestObject : Object = Object( new ObjectClass());
// If this is a custom type
if( isCustomType( className ) && ObjectClass != null
// Recursively call itself passing in the custom data type
and the data to store in it.
// I haven't tested nested objects more than one level. I
suppose it should work.
// Note to self. Check.
xmlToInstance( newDestObject, sourceXMLList[aVar.@name] );
else
// Must be some sort of Array, Array Collection . . .
if( ObjectClass != null )
var anXMLList : XMLList = new XMLList(
sourceXMLList[aVar.@name] );
for each( var anItem : XML in anXMLList )
// I'm sure there are more types, just not using any of them
yet.
if( newDestObject is Array )
newDestObject.push( anItem )
else
newDestObject.addItem( anItem );
// Add the data to the destination object. . . .
destinationObject[aVar.@name] = newDestObject;
} // end function objectToInstance
public static function isSimple( dataType : String ) :
Boolean
* This function is pretty self explanatory.
* Check to see if this is a simple data type. Did I miss
any?
* History
* 03.11.2008 - Steven Rieger : Created function
switch( dataType.toLowerCase() )
case "number":
case "string":
case "boolean":
return true;
return false;
} // end isSimple
public static function isCustomType( className : String ) :
Boolean
* This function is pretty self explanatory.
* Check to see if this is a custom data type. Add them here
as you need. . .
* History
* 03.11.2008 - Steven Rieger : Created function
var aClassName : String = className.replace( "::", "."
).toLowerCase();
aClassName = aClassName.substr( aClassName.lastIndexOf( "."
) + 1, aClassName.length - aClassName.lastIndexOf( "." ) );
switch( aClassName )
case "ndatetimevo":
case "expenselineitemvo":
return true;
return false;
} // end isCustomType
} // end class
} // end package
Similar Messages
-
Custom class type for Plant material
Is there any way to create a custom class type for plant and material? Any other way to use standard functionality to use classification in material master for specific plan will also work.
thanks,Hi Rahul,
The Classification data in material master can only be maintianed at Client level and not at plant level.
The standard Class type 001 can be used to create your own classes. Create a class for each applicable plant. Add the applicable characterstics under every class. That way you will be able to maintain plant spceific details when you are adding Objects for the material master.
Regards,
kathir -
Unable to create custom phone labels for new contacts since the upgrade
I have a AT&T iphone 4 version 4.3.1 and since the last couple of recent upgrades I have been unable to create custom phone labels for any new contacts because the lower label options are gone. This is only a problem with new contacts. My existing contacts with custom labels are still there and if I edit those contacts the table that has create custom labels is also still there, but not for new contacts. Has anyone else noticed this problem.
If you read the error above about the hash and manifest, you will se this is a RB Setup error and not a CM12 error. You would be better to post your question in the SQL forum or better yet to use BIDS instead.
Garth Jones | My blogs: Enhansoft and
Old Blog site | Twitter:
@GarthMJ -
How to create customer master data for walking customer in retail
hi experts !!!!!!
for retail industry e.g books trading industry
how to create customer master data for walking customer in retail
its dummy or one time customer
if i create one time customer then same customer number can i use for every new order and every new customer how ?????
thanksDear Hanumant,
As per my view,,
You can use one time customer functionality to full fill your requirement.
When you create sales order with one time customer system take you to the customer data maintanence screen through that you can maintain the one time customer data.
Same one time customer number you can use for every new order through maintaining different data.
I hope this will help you,
Regards,
Murali.
Edited by: Murali Mohan.Tallapaneni on Dec 19, 2008 6:08 AM -
User exist to create custom error messge for service entry sheet
Hi,
Can any body tell me any user exist to create custom error messge for service entry sheet?
Thanks,Hi
Can you please elaborate on the business scenario??
You may look at EXIT_SAPLMLSR_020 or EXIT_SAPLMLSR_021 for this purpose.
Regards
Prasad -
How to create custom class for Swing compnents
import java.awt.Color;
import java.awt.Font;
import javax.swing.JLabel;
import javax.swing.*;
public class SampleJFrame extends JFrame {
public static void main(String[] args) {
SampleJFrame frame = new SampleJFrame();
JPanel panel = new JPanel();
panel.setLayout(null);
getLabel label;
Color color, color1;
color = new Color( 120 , 120 , 160 );
color1 = new Color( 135 , 38 , 87);
label = new getLabel( "Hiiiiii", 150, 700, 800, 50, color1, "Serif", Font.BOLD, 28 );
panel.add(label);
frame.add(panel);
frame.setSize(700, 770);
frame.setVisible(true);
frame.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
import java.awt.Color;
import java.awt.Font;
import javax.swing.JLabel;
public class getLabel extends JLabel {
* This method create and return the JLabel with necessary parameter
* @param labelName
* @param x coordinate
* @param y coordinate
* @param width
* @param height
* @param foreground color
* @param fontName
* @param fontStyle
* @param fontSize
* @return JLabel
public getLabel( String labelName, int x, int y, int width, int height, Color foreGround,
String fontName, int fontStyle, int fontSize ){
JLabel label = new JLabel(labelName);
label.setBounds( x, y, width, height);
label.setForeground(foreGround);
label.setFont(new Font(fontName, fontStyle, fontSize));
} // End of getLabel block
}I want to use customs JLabel class where I can add necessay element to JLabel comonent
But in above case the getLabel class compiles but when I am add label using getLabel class
to my JFrame class it doesnt shows anything.
I dont get what is the error please help
Edited by: harshal_2010 on Apr 29, 2010 6:43 AM
Edited by: harshal_2010 on Apr 29, 2010 7:01 AMI don't understand, Why you try to create new Label in getLabel constructor?
You get label class already extended from JLabel and don't necessary to create new JLabel.
public getLabel( String labelName, int x, int y, int width, int height, Color foreGround,
String fontName, int fontStyle, int fontSize ){
super(labelName);
this.setBounds( x, y, width, height);
this.setForeground(foreGround);
this.setFont(new Font(fontName, fontStyle, fontSize));
}I think, you need to create ControlsFactory and use it for creating custom controls. It's best solution for you. -
Hello, I have CME 8.6 installed on two 2851s and before going into production, I am testing a few phones.
One of my 2851's is creating cnf.xml files for each phone using SEP<Mac address>.cnf.xml and the other one will not and the phones keep booting up with XMLDefault.cnf.xml.
I've looked at both configurations and I can't see what the difference is. Other than not being able to create the SEP<MacAddress>.cnf.xml files, the phones appear to be loading up fine.
One difference I see is the "its" directory is located on system: on the one that creates the cnf files, and the "its" directory is located in flash on the one that doesn't, although I don't know how that matters.
Below is the one that doesn't create the SEP<MACADDRESS>.cnf.xml files for phones:
Current configuration : 2657 bytes
! Last configuration change at 02:12:45 UTC Wed Oct 8 2014
version 15.1
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
hostname RtrPod2
boot-start-marker
boot-end-marker
no aaa new-model
no network-clock-participate wic 3
crypto pki token default removal timeout 0
dot11 syslog
ip source-route
ip cef
ip dhcp excluded-address 20.0.30.0 20.0.30.10
ip dhcp excluded-address 20.0.10.0 20.0.10.10
ip dhcp pool Data
network 20.0.10.0 255.255.255.0
default-router 20.0.10.254
option 150 ip 20.0.30.254
ip dhcp pool Voice
network 20.0.30.0 255.255.255.0
default-router 20.0.30.254
option 150 ip 20.0.30.254
dns-server 8.8.8.8
no ipv6 cef
multilink bundle-name authenticated
voice-card 0
license udi pid CISCO2851 sn FTX1331AJQ1
username cisco privilege 15 password 0 cisco
redundancy
controller T1 0/3/0
controller T1 0/3/1
interface Loopback0
no ip address
interface GigabitEthernet0/0
no ip address
duplex auto
speed auto
interface GigabitEthernet0/0.10
encapsulation dot1Q 10
ip address 20.0.10.254 255.255.255.0
interface GigabitEthernet0/0.30
encapsulation dot1Q 30
ip address 20.0.30.254 255.255.255.0
interface GigabitEthernet0/1
ip address 192.168.5.232 255.255.255.0
duplex auto
speed auto
interface Serial0/0/0
no ip address
shutdown
clock rate 2000000
interface Serial0/0/1
ip address 200.2.0.1 255.255.255.0
ip forward-protocol nd
no ip http server
no ip http secure-server
tftp-server flash:cmterm-7940-7960-sccp.8-1-2.cop.sgn alias cmterm-7940-7960-sccp.8-1-2
tftp-server flash:/Ringtones/DistinctiveRingList.xml alias DistinctiveRingList.xml
tftp-server flash:/Ringtones/Ringlist.xml alias Ringlist.xml
tftp-server flash:P00308010200.bin
tftp-server flash:P00308010200.loads
tftp-server flash:P00308010200.sb2
tftp-server flash:P00308010200.sbn
control-plane
mgcp profile default
telephony-service
no auto-reg-ephone
max-ephones 110
max-dn 288
ip source-address 20.0.30.254 port 2000
system message Branch System
load 7960-7940 P00308010200
max-conferences 8 gain -6
transfer-system full-consult
create cnf-files version-stamp Jan 01 2002 00:00:00
ephone-dn 1 dual-line
number 2000
label Phil Davis
description Branch Office
ephone 1
device-security-mode none
mac-address 0009.E89D.0B4F
username "cisco" password cisco
button 1:1
line con 0
line aux 0
line vty 0 4
login local
transport input all
line vty 5 15
login local
transport input all
scheduler allocate 20000 1000
endHello, and thanks for the good advice. I did try and added the cnf perphone command and ran no create cnf-files and then create cnf-files, but unfortunately its still not making them.
Also, from the other few CME installations I've seen, all of the information is in flash, but for some reason when I xtracted the tar for this CME, it's showing up in system: ? Could that be a problem? Here is what I see:
CompactFlash directory:
File Length Name/status
1 67922508 c2800nm-adventerprisek9-mz.151-4.M8.bin
2 85149696 cme-full-8.0.0.1.tar
3 2942935 apps11.8-5-3TH1-6.sbn
4 503269 cnu11.8-5-3TH1-6.sbn
5 2104751 cvm11sccp.8-5-3TH1-6.sbn
6 340615 dsp11.8-5-3TH1-6.sbn
7 1616686 jar11sccp.8-5-3TH1-6.sbn
8 670 SCCP11.8-5-3S.loads
9 674 term06.default.loads
10 674 term11.default.loads
11 1916 MISCH-1.3.3.SBN
12 900 CP7921G-1.3.3.LOADS
13 900 CP7925G-1.3.3.LOADS
14 674 term42.default.loads
15 674 term62.default.loads
16 670 SCCP42.8-5-3S.loads
17 655 term31.default.loads
18 654 term41.default.loads
19 654 term45.default.loads
20 654 term61.default.loads
21 654 term65.default.loads
22 654 term70.default.loads
23 654 term71.default.loads
24 654 term75.default.loads
25 651 SCCP31.8-5-3S.loads
26 650 SCCP41.8-5-3S.loads
27 650 SCCP45.8-5-3S.loads
28 650 SCCP70.8-5-3S.loads
29 650 SCCP75.8-5-3S.loads
30 61 SCCP69xx.8-5-3-0.loads
31 131470 Desktops/320x212x12/CampusNight.png
32 80565 Desktops/320x212x12/CiscoFountain.png
33 8156 Desktops/320x212x12/CiscoLogo.png
34 138278 Desktops/320x212x12/FOUNTAIN.PNG
35 740 Desktops/320x212x12/LIST.XML
36 109076 Desktops/320x212x12/MorroRock.png
37 108087 Desktops/320x212x12/NantucketFlowers.png
38 10820 Desktops/320x212x12/TN-CampusNight.png
39 9657 Desktops/320x212x12/TN-CiscoFountain.png
40 2089 Desktops/320x212x12/TN-CiscoLogo.png
41 7953 Desktops/320x212x12/TN-Fountain.png
42 7274 Desktops/320x212x12/TN-MorroRock.png
43 9933 Desktops/320x212x12/TN-NantucketFlowers.png
44 740 Desktops/320x212x16/LIST.XML
45 740 Desktops/320x216x16/LIST.XML
46 8224 Ringtones/Analog1.raw
47 8307 Ringtones/Analog2.raw
48 5280 Ringtones/AreYouThere.raw
49 5040 Ringtones/AreYouThereF.raw
50 8206 Ringtones/Bass.raw
51 12240 Ringtones/CallBack.raw
52 16066 Ringtones/Chime.raw
53 8160 Ringtones/Classic1.raw
54 16080 Ringtones/Classic2.raw
55 10800 Ringtones/ClockShop.raw
56 2823 Ringtones/DistinctiveRingList.xml
57 9665 Ringtones/Drums1.raw
58 13610 Ringtones/Drums2.raw
59 15928 Ringtones/FilmScore.raw
60 16244 Ringtones/HarpSynth.raw
61 8245 Ringtones/Jamaica.raw
62 16127 Ringtones/KotoEffect.raw
63 12776 Ringtones/MusicBox.raw
64 8223 Ringtones/Piano1.raw
65 15422 Ringtones/Piano2.raw
66 9360 Ringtones/Pop.raw
67 7200 Ringtones/Pulse1.raw
68 4000 Ringtones/Ring1.raw
69 4000 Ringtones/Ring2.raw
70 4000 Ringtones/Ring3.raw
71 4000 Ringtones/Ring4.raw
72 4000 Ringtones/Ring5.raw
73 4000 Ringtones/Ring6.raw
74 4088 Ringtones/Ring7.raw
75 495 Ringtones/Ringlist.xml
76 10858 Ringtones/Sax1.raw
77 14233 Ringtones/Sax2.raw
78 16100 Ringtones/Vibe.raw
79 8095286 apps37sccp.1-3-4-0.bin
80 2942935 apps31.8-5-3TH1-6.sbn
81 2935993 apps42.8-5-3TH1-6.sbn
82 2935993 apps45.8-5-3TH1-6.sbn
83 2935993 apps75.8-5-3TH1-6.sbn
84 2933329 apps41.8-5-3TH1-6.sbn
85 2933329 apps70.8-5-3TH1-6.sbn
86 2599169 APPSH-1.3.3.SBN
87 2591877 APPS-1.3.3.SBN
88 2118620 SYSH-1.3.3.SBN
89 2103754 cvm70sccp.8-5-3TH1-6.sbn [invalid checksum]
90 2101414 cvm41sccp.8-5-3TH1-6.sbn [invalid checksum]
91 2100804 cvm45sccp.8-5-3TH1-6.sbn [invalid checksum]
92 2100554 cvm75sccp.8-5-3TH1-6.sbn [invalid checksum]
93 2100286 cvm31sccp.8-5-3TH1-6.sbn [invalid checksum]
94 2099070 cvm42sccp.8-5-3TH1-6.sbn [invalid checksum]
95 2083047 SYS-1.3.3.SBN [invalid checksum]
96 1939872 WLANH-1.3.3.SBN [invalid checksum]
97 1906272 SCCP69xx.8-5-3-0.zz [invalid checksum]
98 1892036 GUIH-1.3.3.SBN [invalid checksum]
99 1887312 jar75sccp.8-5-3TH1-6.sbn [invalid checksum]
100 1882934 jar45sccp.8-5-3TH1-6.sbn [invalid checksum]
101 1848343 GUI-1.3.3.SBN [invalid checksum]
102 1828410 jar70sccp.8-5-3TH1-6.sbn [invalid checksum]
103 1756328 jar42sccp.8-5-3TH1-6.sbn [invalid checksum]
104 1628021 jar41sccp.8-5-3TH1-6.sbn [invalid checksum]
105 1616425 jar31sccp.8-5-3TH1-6.sbn [invalid checksum]
106 1379535 WLAN-1.3.3.SBN [invalid checksum]
107 939293 TNUXH-1.3.3.SBN [invalid checksum]
108 896477 TNUX-1.3.3.SBN [invalid checksum]
109 537925 dsp41.8-5-3TH1-6.sbn [invalid checksum]
110 537925 dsp70.8-5-3TH1-6.sbn [invalid checksum]
111 524969 cnu45.8-5-3TH1-6.sbn [invalid checksum]
112 524917 cnu42.8-5-3TH1-6.sbn [invalid checksum]
113 524876 cnu75.8-5-3TH1-6.sbn [invalid checksum]
114 503753 cnu31.8-5-3TH1-6.sbn [invalid checksum]
115 500084 cnu70.8-5-3TH1-6.sbn [invalid checksum]
116 499644 cnu41.8-5-3TH1-6.sbn [invalid checksum]
117 496521 music-on-hold.au [invalid checksum]
118 340615 dsp31.8-5-3TH1-6.sbn [invalid checksum]
119 340615 dsp42.8-5-3TH1-6.sbn [invalid checksum]
120 340615 dsp45.8-5-3TH1-6.sbn [invalid checksum]
121 340615 dsp75.8-5-3TH1-6.sbn [invalid checksum]
122 264368 DSP69xx.0-0-0-3.zz [invalid checksum]
123 165355 B016-1-0-3.SBN [invalid checksum]
124 146463 B015-1-0-3.SBN [invalid checksum]
125 44896 BOOT69xx.0-0-0-14.zz [invalid checksum]
126 11601 CME-8-0-Full-Readme-v.1.0.txt [invalid checksum]
127 5134 7970-71-75-Background-readme-v1.txt [invalid checksum]
128 1916 MISC-1.3.3.SBN [invalid checksum]
129 4118 GUI/admin_user.html [invalid checksum]
130 677820 GUI/admin_user.js [invalid checksum]
131 1029 GUI/CiscoLogo.gif [invalid checksum]
132 639 GUI/CME_GUI_README.TXT [invalid checksum]
133 953 GUI/Delete.gif [invalid checksum]
134 16344 GUI/DOM.JS [invalid checksum]
135 864 GUI/downarrow.gif [invalid checksum]
136 6315 GUI/ephone_admin.html [invalid checksum]
137 4558 GUI/LOGOHOME.GIF [invalid checksum]
138 3978 GUI/normal_user.html [invalid checksum]
139 78428 GUI/normal_user.js [invalid checksum]
140 1347 GUI/Plus.gif [invalid checksum]
141 843 GUI/SXICONAD.GIF [invalid checksum]
142 174 GUI/Tab.gif [invalid checksum]
143 2496 GUI/telephony_service.html [invalid checksum]
144 870 GUI/UPARROW.GIF [invalid checksum]
145 10230 GUI/xml-test.html [invalid checksum]
146 3412 GUI/xml.template [invalid checksum]
147 12 OS79XX.txt
148 130552 P00308010200.bin
149 461 P00308010200.loads
150 708448 P00308010200.sb2
151 130956 P00308010200.sbn
152 703535 cmterm-7940-7960-sccp.8-1-2.cop.sgn
[239789964 bytes used, 281983088 available, 521773052 total]
509544K bytes of ATA CompactFlash (Read/Write)
RtrPod2#show telephony-service tftp-bindings
tftp-server system:/its/united_states/7960-tones.xml alias United_States/7960-tones.xml
tftp-server system:/its/united_states/7960-font.xml alias English_United_States/7960-font.xml
tftp-server system:/its/united_states/7960-font.xml alias English_United_States/7920-font.xml
tftp-server system:/its/united_states/7960-dictionary.xml alias English_United_States/7960-dictionary.xml
tftp-server system:/its/united_states/7960-kate.xml alias English_United_States/7960-kate.xml
tftp-server system:/its/united_states/7960-kate.xml alias English_United_States/7920-kate.xml
tftp-server system:/its/united_states/SCCP-dictionary.xml alias English_United_States/SCCP-dictionary.xml
tftp-server system:/its/SEPDEFAULT.cnf alias SEPDefault.cnf
tftp-server system:/its/vrf1/XMLDefault.cnf.xml alias XMLDefault.cnf.xml -
Creating custom classes from a more complex DTD
Are there any examples of creating more complex custom document types? The sample in the dev. guide and the xml syntax are a good start but not enough.
If anyone has an example from their own work, I'd appreciate it. You can send them to [email protected]
Thanks!I'm having trouble gaining access to the content of those objects within a multilevel tree structure once the XML file has been loaded into the database. Those attributes off root via an editing tool or jsp/bean are rendered; however, the branched object structures are not. Instead the following is in its place: <MYClASSOBJECT2 RefType="ID">7265<!--ClassObject: MYClASSOBJECT2--><!--Name:Null--></MYClASSOBJECT2>
Here is some background. All custom classes have been successfully loaded into iFS, including the branching objects, which have been entered as extensions of Document as well as the associated ClassDomain entries. I've read Mark's PencilObject entry of June 23, but I continue to get undesired results. Currently, I am using SimpleXMLRender and am inclined to believe that I will need to customize the renderer for it to recognize the deep structures within my XML. Can you shed any light on my situation? In a nutshell, how do I gain access to the content within my multilevel XML? -
Build app with ODT and Oracle UDT - Error while creating custom class
Hello CShay,
I am testing you sample code to create UDT with ASP.Net app. It is also published in Oracle magazine.
The article is also published at following link:
http://www.oracle.com/technology/oramag/oracle/08-may/o38net.html
I am able to successfully implement all the steps before "Using Custom Class Wizard". When I right click on any of the object (CUSTOMER_OBJ, PHONELIST_OBJ, and ADDRESS_OBJ) and select Generate Custom Class, I get the following error:
Oracle custom class wizard.
Class can be generated only for either C#, VB or Managed C++ projects.
Am I missing any thing?
Thanks in advance for your help.Yes I confirm that I choose File->New Website.
I don't see the following option
File -> New Project, and then under Visual C#, select ASP.NET Web Application
I am using VS2005 Professional Edition.
The options I see under Visual C# are:
If I click on
Windows tab:
Windows Application
Windows Control Library
Console Application
Empty Project
Class Library
Web Control Library
Window Servcie
Crystal Report Application
and Search Online Templates in My Templates tab.
Couple of options for Smart Device which also doesn't include ASP.Net
then Database, Starter kits and Office tabs which also doesn't include ASP.net thing.
I don't know how did you see that option or you might be using different version of VS (Enterprise).
But right now I am stuck.
Please provide me your valuable comments.
Thanks for your help. -
Custom Application Privs for XML file generation in 11i(11.5.7)
We have created Custom Application Module in the Oracle Apps R11i.
I am running the below query in my custom application module user using SQL*Plus, it gives the error:
SQL Statment:
DECLARE
queryCtx DBMS_XMLQuery.ctxType;
result CLOB;
BEGIN
-- set the query context.
queryCtx := DBMS_XMLQuery.newContext('select * from per_all_people_f where
rownum <=10');
DBMS_XMLQuery.setRowTag(queryCtx,'EMP'); -- sets the row tag name
DBMS_XMLQuery.setRowSetTag(queryCtx,'EMPSET'); -- sets rowset tag name
result := DBMS_XMLQuery.getXML(queryCtx); -- get the result
DBMS_XMLQuery.closeContext(queryCtx); -- close the query handle;
END;
Error:
Error on line 0
DECLARE
queryCtx DBMS_XMLQuery.ctxType;
result CLOB;
BEGIN
-- set t
ORA-29532: Java call terminated by uncaught Java exception:
java.lang.NullPointerException
ORA-06512: at "SYS.DBMS_XMLQUERY", line 206
ORA-06512: at "SYS.DBMS_XMLQUERY", line 214
ORA-06512: at "SYS.DBMS_XMLQUERY", line 204
ORA-06512: at line 11
The same query is running fine with apps user. What are the objects privileges required for the custom module user?.I have found resolution for this.
1. Created the Public Synonym for the following Apps user Java Class objects:
/109a284b_OracleXMLStaticQuery
/12249373_OracleXMLStaticQuery
/c33162ba_OracleXMLStaticQuery
2. Execute privilege for Apps.DBMS_XMLQUERY to custom application user.
Thanks.
-Venkat -
How to create custom BOL object for dynamic query in CRM 7.0
Hi,
Could anyone please explain me with steps that how to create the custom BOL object for dynamic query in CRM 7.0, I did it in previous version but its throwing exception when i try to create the object of my dynamic query class. I just defined the entry of my in crmv_obj_btil to create the dynamic query BOL object. do i need to do any other thing also to make it work?
Regards,
Kamesh Bathla
Edited by: Kamesh Bathla on Jul 6, 2009 5:12 PMHi Justin,
First of thanks for your reply, and coming to my requirement, I need to report the list of items which are there in the dynamic select statement what am getting from the DB. The select statement number of columns may vary in my example for different countries the select item columns count is different. For US its '15', for UK it may be 10 ...like so, and some of the column value might be a combination or calculation part of other table columns (The select query contains more than one table in the from clause).
In order to execute the dynamic select statement and return the result i choose to write a function which will parse the cursor for dynamic query and then iterate the values and construct a Type Object and append it to the pipe row.
Am relatively very new for these sort of things, welcome in case of any suggestions to make it simple (Instead of the function what i thought to work with) also a sample narrating the new procedure will be appreciated.
Thanks in Advance,
mallikj2. -
Unable to create a data server for xml file
Hi ,
I have created a data server for a xml file but when i test the connection i am getting the below error.
java.sql.SQLException: class org.xml.sax.SAXException
Prefix not found: xsi
at oracle.odi.jdbc.datasource.LoginTimeoutDatasourceAdapter.doGetConnection(LoginTimeoutDatasourceAdapter.java:133)
at oracle.odi.jdbc.datasource.LoginTimeoutDatasourceAdapter.getConnection(LoginTimeoutDatasourceAdapter.java:62)
at com.sunopsis.sql.SnpsConnection.testConnection(SnpsConnection.java:1100)
at com.sunopsis.graphical.dialog.SnpsDialogTestConnet.getLocalConnect(SnpsDialogTestConnet.java:371)
at com.sunopsis.graphical.dialog.SnpsDialogTestConnet.localConnect(SnpsDialogTestConnet.java:794)
at com.sunopsis.graphical.dialog.SnpsDialogTestConnet.jButtonTest_ActionPerformed(SnpsDialogTestConnet.java:754)
at com.sunopsis.graphical.dialog.SnpsDialogTestConnet.connEtoC1(SnpsDialogTestConnet.java:137)
at com.sunopsis.graphical.dialog.SnpsDialogTestConnet.access$1(SnpsDialogTestConnet.java:133)
at com.sunopsis.graphical.dialog.SnpsDialogTestConnet$IvjEventHandler.actionPerformed(SnpsDialogTestConnet.java:87)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
at java.awt.Component.processMouseEvent(Component.java:6263)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6028)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4630)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
at java.awt.Container.dispatchEventImpl(Container.java:2085)
at java.awt.Window.dispatchEventImpl(Window.java:2478)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Can any one help me out with this issue ?
Thanks in advance,
BalajitkHI Balaji,
Below is the sample xml file which i have saved as test.xml and placed it @ D: drive
Test.xml:
<employee>
<emp>
<eno>1</eno>
<ename>Test1</ename>
</emp>
<emp>
<eno>2</eno>
<ename>Test2</ename>
</emp>
<emp>
<eno>2</eno>
<ename>Test2</ename>
</emp>
</employee>
Goto Topology >Expand Technologues>right click on XML and select new data source
in Defination Tab, provide the physical architecture name
in JDBC Tab, provide the below details
JDBC Driver: com.sunopsis.jdbc.driver.xml.SnpsXmlDriver
JDBC URL: jdbc:snps:xml?f=d:\test.xml&d=test.dtd&re=employee&s=TEST&ro=false
Save it
Click on Test Connection and again click on test, it should show test connection as "Successfully Test"
Hope this may helps you
Regards,
Phanikanth -
How to create custom forms in the xml form builder
Hi all ,
can anyone give the brief on
when we creat a project we get defaulty edit ,show and renderlist forms . what are list edit and listshow forms . what is the use of those forms.
how can we create out own customised forms ? and how can we call the customized and listedit and list show form in the Portal.
thanks
RajeevHi,
Edit form
You use this form to create or change individual documents (for example, single news items). Typically, this form contains input fields in which you can create content (for example, the title or text for a news item).
Show form
You use this form to display a single document. Typically, the Show form displays all elements of a document (for example, the title, author, and all the text contained in a news item). Do not use entry controls on the Show form.
RenderListItem form
You use this form to define the layout of a list entry in a folder in the flexible user interface. Typically, you display some of the elements of a document, such as the title and summary of a news item, on this form. You call up the Show form if you want to display the entire document.
You do not create pushbuttons or links for creating, changing, or deleting XML documents in the RenderListItem form. You define which commands are to be displayed using command groups of the flexible user interface. You can create several iViews for displaying the same XML documents with different command groups.
ListEdit form
You use this form to change a list of documents. Typically, this form contains pushbuttons for creating, changing, and deleting entries. You call up the Edit form if you want to change or create content. You call up the Show form if you want to display all entries.
ListShow form
You use this form to display a list of documents. Typically, this form only displays part of a document element (for example, the title of a news item). You call up the Show form if you want to display the entire document.
Refer this documents
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/ee639033-0801-0010-0883-b2c76b18583a
Regards,
Kumar -
Help creating custom XMP file for Photoshop CS5
I was wondering if there is anyone out there that would be willing to help me create a custom XMP file for Photoshop CS5. What I need is very simple, I really just don't know how to go about creating it myself.
Feel free to email me at [email protected]Hi Robert,
please have a look at the "Generic Panel" example of the File Info SDK.
Using that you only need to create a simple XML-file to create a simple custom panel.
-- Stefan Makswit -
ORA-31167: 64k size limit for XML node
Hi,
I have an application that archives XML documents provided by another organization. The other organization, a government regulatory body, controls the format and content of the documents. Many of the documents have large text nodes consisting of hundreds of kilobytes of CSV data.
This application was developed against Oracle 9i and runs fine on that product. Testing against Oracle 10g, I get "ORA-31167: XML nodes over 64K in size cannot be inserted".
As I read it, 64k is a fixed limit in Oracle10g. This limit did not seem to appear in Oracle9i however?
What are my options for upgrading this application to Oracle10g? I can think of:
1) Stay on 9i.
2) Mess around with the XML content. This kind of compromises the purpose of the application, which is to archive the documents unchanged.
3) Store the documents as CLOBs and forego the XML DB features.
4) Abandon Oracle and use another XML database???!
I've been really impressed with Oracle XML DB to date. I find this limitation quite hard to believe. I'm really hoping there is a simple alternative that I'm missing.
Any ideas?
John Hurst
Wellington, New ZealandI inherited an application that was developed against Oracle 9.2.0.8, and which was recently upgraded to Oracle 10.2.0.3. I get "ORA-31167: XML nodes over 64K in size cannot be inserted" on about 5% of the documents, unfortunately they are the most important documents.
Since the only data retrieval is with getCLOB(), I have attempted the xmlparse workaround xmlparse(DOCUMENT someCLOB WELLFORMED) yet still receive the ORA-31167 error.
@ After more deugging, the getXMLFromFile() causes the error not the insert, while a getFileContent()successfully completes.
Can you suggest another way to extract the values from the XML?
Any chance of a 10g patch for this limit?
Thanks,
Procedure SQL:
BEGIN
freeCLOBOnExit := tempCLOB IS NULL;
DBMS_LOB.createTemporary(tempCLOB, TRUE, DBMS_LOB.SESSION);
xmlFileContent := xdb_utilities.getXMLFromFile(fileName, directoryName, tempCLOB=>tempCLOB);
x_assetid := xmlFileContent.extract('/cds:document/cds:document-spec/cds:asset-id/text()', 'xmlns:cds="http://cds.central"').getStringVal();
x_sourceid := xmlFileContent.extract('/cds:document/cds:document-spec/cds:source-id/text()', 'xmlns:cds="http://cds.central"').getStringVal();
x_synopsis := xmlFileContent.extract('/cds:document/cds:document-spec/cds:synopsis/text()', 'xmlns:cds="http://cds.central"').getStringVal();
x_date := xmlFileContent.extract('/cds:document/cds:document-spec/cds:update-date/text()', 'xmlns:cds="http://cds.central"').getStringVal();
o_date := get_xml_date(x_date);
x_audience := xmlFileContent.extract('/cds:document/cds:document-spec/cds:audience/text()', 'xmlns:cds="http://cds.central"').getStringVal();
x_collection := xmlFileContent.extract('/cds:document/cds:document-spec/cds:collection-name/text()', 'xmlns:cds="http://cds.central"').getStringVal();
DELETE from INFODOC where asset_id = x_assetid;
INSERT INTO INFODOC VALUES( x_assetid, x_sourceid, x_synopsis, o_date, x_audience, x_collection, xmlparse(DOCUMENT tempCLOB WELLFORMED));
COMMIT;
IF (freeCLOBOnExit) THEN
dbms_lob.freeTemporary(tempCLOB);
ELSE
dbms_lob.trim(tempCLOB, 0);
END IF;
END;
Table DDL:
CREATE TABLE "SYSTEM"."INFODOC"
( "ASSET_ID" VARCHAR2(35 BYTE),
"SOURCE_ID" VARCHAR2(25 BYTE) NOT NULL ENABLE,
"SYNOPSIS" VARCHAR2(256 BYTE) NOT NULL ENABLE,
"UPDATE_DATE" DATE NOT NULL ENABLE,
"AUDIENCE" VARCHAR2(15 BYTE) NOT NULL ENABLE,
"COLLECTION_NAME" VARCHAR2(20 BYTE) NOT NULL ENABLE,
"XMLDOC" "SYS"."XMLTYPE" NOT NULL ENABLE
) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "INFODOC"
XMLTYPE COLUMN "XMLDOC" STORE AS CLOB (
TABLESPACE "INFODOC" ENABLE STORAGE IN ROW CHUNK 8192 PCTVERSION 10
NOCACHE LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)) ;
Message was edited by:
dauza
Message was edited by:
dauza
Maybe you are looking for
-
Ipod nano screen fade then locks
has anyone had this problem where if you hold the menu button down, then the 2gb black ipod nano locks up and the image on the screen fades away slowly until the lcd is blank? then the nano won't start up anymore (until it is plugged into a computer)
-
Resizing pop-up window in webdynpro abap
Hi, I am a newbie to abap webdynpro.I would like to know how to resize a pop-up window. I have used the method 'SET_WINDOW_POSITION' from interface 'IF_WD_WINDOW' Below seen is my coding, but this is not working. Can anybody clarify! L_FINAL_WINDOW-
-
Retail Intercompany Consignment process
) What way it should be configured or processes should be followed so that Vendor Consignmnet stock is available in Store under the same Consignment vendor no through which DC procures consignment. In our current prototye when the Stocks are being is
-
"Copy to" and "Move to" Broken in Bridge CS5
"Copy to" and "Move to" are broken for me in Windows 7 64-bit Ultimate, Bridge CS5 4.0.4.2. When I select one of these commands and choose "Choose folder...", the dialog box only shows files in my user folder-- rather than showing the entire director
-
PA 71-- Fast Entry of Time data
Hi Experts, I would like to understand do we have any workaround to add text to 2001/2002 infotype when we maintatin data thru PA71 like we do in PA61. Regards Joe