on 11-14-2007 8:46 PM
Hello all,
I am in the middle of developing custom action block for xMII. I have no problem creating the basic (I have successfully created a custom action block that perform simply things).
However, I am having trouble getting XML types in and out of a custom action.
Our setter never executes, perhaps because we have the type wrong? Is
org.w3c.dom.Document the type we should be using? We can get it to
work for int, double, and string.
If org.w3c.dom.Document the correct type, can someone please show me segment of code for working with XML type (just getting value in and out would be sufficient)
Also, what is the type for Datetime in the back-end java code, anyone know?
Thank you very much.
1. You need to use the built-in xMII data type "XMLDataType", and you create an instance of one using your Document object as in:
XMLDataType myXML = new XMLDataType(myDoc);
2. Use the Java class GregorianCalendar.
Rick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for the answer. The XML type is working fine now.
For GregorianCalendar,
private GregorianCalendar GCalendar = new GregorianCalendar();
When I use it in the setter method, it is not recongized
public void setDateTime ( GregorianCalendar gc )
But String is recongized.
public void setDateTime ( String gc )
So in order to make it works, I will have to convert (parsing and tokenizing) the String to the GregorianCalendar type? Thank you.
Yes, one of my own class when I am trying to create a Custom Action Block. Like for using double type's setter, I have
public void setDouble ( double newDouble ) {
myDouble = newDouble;
}
, and for other types, they all takes the same type as parameter like
public void setInt ( int newInt ), but for the DateTime type,
public void setDateTime ( GregorianCalendar gc ) doesn't seems to work.
It gave an error and basically ask me to use String as the type.
Your action should use the Calendar type in its method signature, but the GregorianCalendar class in its implementation:
public Calendar getQueryStartDate() {
return _startdate;
}
public void setQueryStartDate(Calendar value) {
_startdate = value;
}
public Calendar getQueryEndDate() {
return _enddate;
}
public void setQueryEndDate(Calendar value) {
_enddate = value;
}
User | Count |
---|---|
11 | |
6 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.