How to handle object in 3D annotation JS Engine
Hello!
I have wrote a default js script for 3d annotation that should work with some XML data (on selection event) transferred to this script when the document is initialized.
While debugging the script I found out, that my root XML object (and all its children) is recognized in the script as [object __External_Object_Wrapper__] and I can do nothing with this object.
If there is some solution to make 3d annotation script engine 'see' this XML object and its structure so it could be used in the default script.
XML object is created from attached file with the following code:
initAttached("MyData1"); // --- function to import data file to "MyData1"
var oDB = this.getDataObjectContents("MyData1");
var cDB = util.stringFromStream(oDB);
c3d.docData=eval(cDB); // --- XML object to work with in 3d annotation selection event
Thank you for any help!
Hi again
Okay, I got it.
See, there are these little nuances that are hard to pick up sometimes.
Thanks
KRistin
Similar Messages
-
Physics Engine: How to handle object collisions / best practices?
Right now I'm trying to find out by examining all methods and comparing to other engines like box2D how to get information about colliding objects.
I thought I could use i.E. the "checkCollideWith" method of the btRigidBody instance, but it always returns true.
Then, there are several interesting methods in the collisionDispatcher class, but also they don't yield any satisfying results.
I could set a "nearCallbackFunction", but then, the collision wasn't handeled internally anymore.
Has anyone found out how to get reliable information about colliding objects?
Also the Pellet-Engine looks really "ported from C++", not like a typical AS3 project. I could imagine that Adobe would refactor the whole thing at a given time to make it fit more into their AS3 environment. Then, there would also be "real" events for things like that.Well I answered it myself. I should have noticed that "Pellet" sounds familiar. Like the physics engine used in Blender3D, "Bullet".
And when I looked at the wiki, I found out that Pellet was a clone of Bullet so I could easily port these lines of code to AS3:
// inside onAnimate method of BasicScene
var numManifolds:int = _dynamicsWorld.getDispatcher().getNumManifolds();
for (i = 0; i < numManifolds; i++) {
var contactManifold:btPersistentManifold = _dynamicsWorld.getDispatcher().getManifoldByIndexInternal(i);
var obA:btCollisionObject = contactManifold.getBody0();
var obB:btCollisionObject = contactManifold.getBody1();
var numContacts:int = contactManifold.getNumContacts();
var j:int;
for (j = 0; j < numContacts; j++) {
var pt:btManifoldPoint = contactManifold.getContactPoint(j);
if (pt.getDistance() < 0) {
// const btVector3& ptA = pt.getPositionWorldOnA();
// const btVector3& ptB = pt.getPositionWorldOnB();
// const btVector3& normalOnB = pt.m_normalWorldOnB;
trace ("yay, dingdingding! => " + obA + ", " + obB+ " collided!");
I just used the code described here:
http://www.bulletphysics.org/mediawiki-1.5.8/index.php/Collision_Callbacks_and_Triggers
You can get the full documentation here:
http://www.bulletphysics.org/mediawiki-1.5.8/index.php?title=Documentation
Probably everything will also work in Pellet this way, you've just port the code to AS3, no need to even change variable or method names, it seems to be all the same in Pellet. -
How to handle [object Object] in textArea (Flex 4.5)
Hello
My code:
protected function myDG_selectionChangeHandler(event:GridSelectionEvent):void
var selItems:Vector.<Object> = event.currentTarget.selectedItems;
var numItems:Number = selItems.length;
for (var i:Number = 0; i<numItems; i++)
selectedItemsTA.text = selectedItemsTA.text + selItems[i] + "\n";
Currently I'm just trying to make multiple selections in a datagrid and reflect those in a text area control.
My selections just come across as [object Object]. So, obviously I don't know for sure what data is behind that.
It's really not much different from the example here: http://help.adobe.com/en_US/flex/using/WSc2368ca491e3ff923c946c5112135c8ee9e-7fff.html but their textarea is reset to empty each time through, and I'm using a datagrid vs. their list, and of course the event type.
Thanks
KristinHi again
Okay, I got it.
See, there are these little nuances that are hard to pick up sometimes.
Thanks
KRistin -
How to handle the call transaction in method of a custom business object
Hello all,
There is a custom report " RPTCORAPP" for approving leaves . As per my requirement i have develop a copy of leave workflow and for approval process i have call "RPTCORAPP" in Custom method of custom object. i have made a transaction for this custom report for approving attendances. I am calling this method though call transaction statement within method.
Problem: while approving the attendance workitem is not disappearing from the portal. Problem is due to call transaction statement.
once workitem come to the user, user click on it. control goes to the report, which display all the leave to approve on
the portal.
If after approving/ rejecting attendance user close the screen.workflow remain in the "process" status.Control wont come back after call transaction statement in the method.
At the same time if user clicks on back button inspite of closing the screen. it is working fine. workitem disappears from the portal.
How to handle the scenarion. if after approving/rejecting, i want the control to come back to the NEXT STATEMENT after call transactionstatement in my method.
Please help it out........:)Hi swami,
thanks for reply. but i am not using BDC in my method. iam just calling a custom transaction thriugh statement
Call transaction 'ZHR_APPROVE_CLINOUT'. This transaction directly run the report RPTCORAPP and display all the request. -
How to handle the Exception in GP using executable callabel object.
Hi all,
I handled an exception in GP using Background callable Object. That is working fine.
(Ex: Exception_No_User_Found). The Problem is I am not able to handle the exceptions for normal callable object. I have done the same thing as i did in background callable object except implementing IGPBackgroundCallableObject Class. I have created an WebDynpro DC Project where in getDescription method i declared an Exception and in execute method of component controller I caught the exception if no user found.
Then i created an callable object for this simple DC project. but that is not working i could not catch the exception. when i execute the process it is asking the User ID if i give the wrong userId it is not refreshing back to the user id input form.
But if i test that simple callable object separately it is throwing an Exception when I give the wrong input..
but the same thing is working fine using background callable object.
I couldn't handle the exception for the simple callable object or executable callable object.
Please If anyone bring me the solution that would be appreciated.
Thanks in advance.
Regards,
Malar.Hi Shikhil
Thanks for your reply
Please have a look below for exceptions which i am getting in GP and let me know how to handle these exceptions.
1) "Activity could not be read"
2) "Action has been stopped"
3) error while processing the item can not be displayed
if you give any idea/clue how to handle these exceptions then it would be great help to me
Thanks
Sunil -
How to handle lock object in BDC call transcation method?
Hi,
how to handle lock object in BDC call transcation method?
Thanks In advances.If you are updating Z-fields then you need to create a lock entry, before you use call transaction.
After creating lock object, please use FM Enqueue_<lockname> before CALL transaction and FM Dequeue_<lockname> after you have commited your data.
Thanks,
Kartavya -
How to handle type safety when using com.sap.typeservices.IProposalList
Hi,
I have been testing out the new features in Web Dynpro Java CE EHP1 using a scenario with BPM and SAP MDM. One of the new features I tested is the Ajax feature of using suggestion values. I have an InputField UI element which have bound to a context attribute (CountriesView/Country) which is of type string. The UI element has the "suggestValues" value set to true. I then use the IProposalList to produce a valueset. This will make the InputField UI appear as a combo box and allow the users to type in a few characters and utilize the Ajax framework to automatically search in the list of values.
The following code works perfectly ok but I don't understand how I should handle the compiler warning "IProposalList is a raw type. References to generic type IProposalList<T> should be parameterized"?
IProposalList proposalsCountry = wdContext.nodeCountriesView().getNodeInfo().getAttribute(IPrivateComp1.ICountriesViewElement.COUNTRY).getModifiableSimpleType().getSVServices().getProposals();
for(int i=0;i<bua.length;i++){
IPrivateComp1.ICountriesViewElement buaelement=wdContext.createCountriesViewElement();
buaelement.setCountry(bua<i>[0]);
buaelement.setCode(bua<i>[1]);
bualist.add(buaelement);
proposalsCountry.add(bua<i>[0]);
wdContext.nodeCountriesView().bind(bualist);
I don't have any issues handling this for other types such as ArrayList. Using the syntax "IProposalList<String> proposalsCountry ...." will handle the "proposalsCountry.add .." part but I still have a warning "Type safety: The expression of type IProposalList needs unchecked conversion to conform to IProposalList<String>"
Any ideas on how to handle this?
Thanks,
JohanHi,
Eventhough there are no replies to this thread I thought I should update with what I belive is an answer to my question. Excerpt from http://stackoverflow.com/questions/382/what-is-the-meaning-of-the-type-safety-warning-in-certain-java-generics-casts:
"This warning is there because Java is not actually storing type information at runtime in an object that uses generics. Thus, if 'object' is actually a List<String>, there will be no ClassCastException at runtime except until an item is accessed from the list that doesn't match the generic type defined in the variable. This can cause further complications if items are added to the list with this incorrect generic type information. Any code still holding a reference to the list but with the correct generic type information will now have an inconsistent list. To remove the warning, try:
List<?> list = (List<?>) object;However, note that you will not be able to use certain methods such as add because the compiler doesn't know if you are trying to add an object of incorrect type. The above will work in a lot of situations, but if you have to use add or some similarly restricted method, you will just have to suffer the yellow underline in Eclipse (or a SuppressWarning annotation)."
The last line explain the reason for my issue and the lack of a solution when using add method.
/Johan -
How to handle exception CX_SY_REF_IS_INITIAL
hi experts,
im working on a test scenario for abap mapping in SAP XI im getting this error
An exception with the type CX_SY_REF_IS_INITIAL occurred, but was neither handled locally, nor declared in a RAISING clause Dereferencing of the NULL reference
i understand that i need to catch this exception in the abap coding but i'm not familiar with oops concepts
can any one please suggest me how to handle this exception for the following code...
method IF_MAPPING~EXECUTE.
break x1149.
* initialize iXML
TYPE-POOLS: ixml.
class cl_ixml definition load.
** Instances & Variable declaration =======================
* instance main factory
TYPES: BEGIN OF t_xml_line,
data(256) TYPE x,
END OF t_xml_line.
DATA: l_ixml TYPE REF TO if_ixml,
* instance input stream factory
l_streamfactory TYPE REF TO if_ixml_stream_factory,
* instance input stream
l_istream TYPE REF TO if_ixml_istream,
* instance input document
l_document TYPE REF TO if_ixml_document,
* instance parse input document
l_parser TYPE REF TO if_ixml_parser,
* instance for elements within the nodes
node TYPE REF TO if_ixml_node,
*instance of nodemap
nodemap TYPE REF TO if_ixml_named_node_map,
* instance for iterator
iterator TYPE REF TO if_ixml_node_iterator,
name TYPE string,
value TYPE string,
* instance main factory
o_ixml TYPE REF TO if_ixml,
* instance output document
o_document TYPE REF TO if_ixml_document,
* instance output stream
o_istream TYPE REF TO if_ixml_ostream,
* instance parse output document
o_parser TYPE REF TO if_ixml_parser,
* instance fot renderer
renderer type ref to if_ixml_renderer,
irc type i,
l_xml_size TYPE i,
*ROOT ELEMENT
l_element_MT_DEMANDTEC_COST TYPE REF TO if_ixml_element,
*NEXT CHILD ELEMENT FROM THE ABOVE PARENT
l_element_DT_DEMANDTEC TYPE REF TO if_ixml_element,
*CHILDREN1 ELEMENT FOR DT_DEMANDTEC
l_element_DT_WHSE TYPE REF TO if_ixml_element,
*CHILDREN2 ELEMENT FOR DT_DEMANDTEC
l_element_DT_DC TYPE REF TO if_ixml_element,
*CHILDREN3 ELEMENT FOR DT_DEMANDTEC
l_element_DT_PLANT TYPE REF TO if_ixml_element,
*CHILDREN4 ELEMENT FOR DT_DEMANDTEC
l_element_DT_QTY TYPE REF TO if_ixml_element.
*saving the xml document
DATA: l_xml_table TYPE TABLE OF t_xml_line.
types: begin of t_source,
whse(5),
dc(4) ,
plant(4),
qty type i,
end of t_source.
types: tt_source TYPE STANDARD TABLE OF t_source.
data: wa_source type t_source.
data: it_source TYPE tt_source,
ivalue type string.
* Procedures and business logic =======================================
* Creating the main iXML factory
l_ixml = cl_ixml=>create( ).
* Creating a stream factory
l_streamfactory = l_ixml->create_stream_factory( ).
* create input stream
l_istream = l_streamfactory->create_istream_xstring( source ).
* initialize input document
l_document = l_ixml->create_document( ).
* Create a Parser
l_parser = l_ixml->create_parser( stream_factory = l_streamfactory
istream = l_istream
document = l_document ).
* parse input document
l_parser->parse( ).
* Validate a document
l_parser->set_validating( mode = if_ixml_parser=>co_validate ).
* Parse the stream
IF l_parser->parse( ) NE 0.
IF l_parser->num_errors( ) NE 0.
DATA: parseerror TYPE REF TO if_ixml_parse_error,
str TYPE string,
i TYPE i,
count TYPE i,
index TYPE i.
count = l_parser->num_errors( ).
WRITE: count, ' parse errors have occured:'.
index = 0.
WHILE index < count.
parseerror = l_parser->get_error( index = index ).
i = parseerror->get_line( ).
WRITE: 'line: ', i.
i = parseerror->get_column( ).
WRITE: 'column: ', i.
str = parseerror->get_reason( ).
WRITE: str.
index = index + 1.
ENDWHILE.
ENDIF.
ENDIF.
* Process the document
IF l_parser->is_dom_generating( ) EQ 'X'.
refresh : it_source.
node ?= l_document.
CHECK NOT node IS INITIAL.
* create a node iterator
iterator = node->create_iterator( ).
* get current node
node = iterator->get_next( ).
* loop over all nodes
WHILE NOT node IS INITIAL.
CASE node->get_type( ).
WHEN if_ixml_node=>co_node_element.
* element node
name = node->get_name( ).
nodemap = node->get_attributes( ).
WHEN if_ixml_node=>co_node_text.
* text node
value = node->get_value( ).
if name eq 'DT_WHSE'.
wa_source-whse = value.
ELSEIF name eq 'DT_DC'.
wa_source-DC = value.
ELSEIF name eq 'DT_PLANT'.
wa_source-PLANT = value.
ELSEIF name eq 'DT_QTY'.
wa_source-QTY = value.
COLLECT wa_source INto it_source.
CLEAR wa_source.
ENDIF.
endcase.
node = iterator->get_next( ).
endwhile.
ENDIF.
loop at it_source into wa_source .
at first.
* Creating a ixml factory
o_ixml = cl_ixml=>create( ).
* Creating the dom object model
o_document = l_ixml->create_document( ).
endat.
* Build and Fill root node MT_DEMANDTEC_COST
AT FIRST.
l_element_MT_DEMANDTEC_COST =
O_document->create_simple_element(
name = 'MT_DEMANDTEC_COST'
parent = o_document ).
ENDAT.
* Build and Fill Child node DT_DEMANDTEC for parent
* MT_DEMANDTEC_COST
l_element_DT_DEMANDTEC = O_document->create_simple_element(
name = 'DT_DEMANDTEC'
parent = l_element_MT_DEMANDTEC_COST ).
* Build and Fill Child node1 DT_WHSE for parent DT_DEMANDTEC
ivalue = wa_source-WHSE.
l_element_DT_WHSE = O_document->create_simple_element(
name = 'DT_WHSE'
VALUE = ivalue
parent = l_element_DT_DEMANDTEC ).
* Build and Fill Child node2 DT_WHSE for parent DT_DEMANDTEC
ivalue = wa_source-DC.
l_element_DT_DC = O_document->create_simple_element(
name = 'DT_DC'
VALUE = ivalue
parent = l_element_DT_DEMANDTEC ).
* Build and Fill Child node3 DT_WHSE for parent DT_DEMANDTEC
ivalue = wa_source-PLANT.
l_element_DT_PLANT = O_document->create_simple_element(
name = 'DT_PLANT'
VALUE = ivalue
parent = l_element_DT_DEMANDTEC ).
* Build and Fill Child node4 DT_QTY for parent DT_DEMANDTEC
ivalue = wa_source-QTY.
l_element_DT_QTY = O_document->create_simple_element(
name = 'DT_QTY'
VALUE = ivalue
parent = l_element_DT_DEMANDTEC ).
endloop.
* render document ======================================================
* create output stream
o_istream = l_streamfactory->create_ostream_xstring( result ).
* Connect internal XML table to stream factory
o_istream = l_streamfactory->create_ostream_itable( table =
l_xml_table ).
renderer = o_ixml->create_renderer( ostream = o_istream
document = o_document ).
irc = renderer->render( ).
* how do i catch the exception for type CX_SY_REF_IS_INITIAL ...?
endmethod.
full reward points for answers.
Thanks & Regards,
Uday Kumar.
Edited by: UDAY on May 6, 2008 9:32 PMHi Uday,
Its occurs because you're trying to access a objects with null reference. Or you forgot to create an instance or an error occurs during the instance creation. So You should put all your "Procedures and business logic" inside a Try/catch block. as follow.
" Define a class exception object to get error message......
DATA o_exception TYPE REF TO cx_sy_ref_is_initial.
"// Use the statment Try block to catch the error.
TRY.
* Creating the main iXML factory
l_ixml = cl_ixml=>create( ).
* Creating a stream factory
l_streamfactory = l_ixml->create_stream_factory( ).
* create input stream
l_istream = l_streamfactory->create_istream_xstring( source ).
* initialize input document
l_document = l_ixml->create_document( ).
* Create a Parser
l_parser = l_ixml->create_parser( stream_factory = l_streamfactory
istream = l_istream
document = l_document ).
* parse input document
l_parser->parse( ).
* Validate a document
l_parser->set_validating( mode = if_ixml_parser=>co_validate ).
* Parse the stream
IF l_parser->parse( ) NE 0.
IF l_parser->num_errors( ) NE 0.
DATA: parseerror TYPE REF TO if_ixml_parse_error,
str TYPE string,
i TYPE i,
count TYPE i,
index TYPE i.
count = l_parser->num_errors( ).
WRITE: count, ' parse errors have occured:'.
index = 0.
WHILE index < count.
parseerror = l_parser->get_error( index = index ).
i = parseerror->get_line( ).
WRITE: 'line: ', i.
i = parseerror->get_column( ).
WRITE: 'column: ', i.
str = parseerror->get_reason( ).
WRITE: str.
index = index + 1.
ENDWHILE.
ENDIF.
ENDIF.
* Process the document
IF l_parser->is_dom_generating( ) EQ 'X'.
refresh : it_source.
node ?= l_document.
CHECK NOT node IS INITIAL.
* create a node iterator
iterator = node->create_iterator( ).
* get current node
node = iterator->get_next( ).
* loop over all nodes
WHILE NOT node IS INITIAL.
CASE node->get_type( ).
WHEN if_ixml_node=>co_node_element.
* element node
name = node->get_name( ).
nodemap = node->get_attributes( ).
WHEN if_ixml_node=>co_node_text.
* text node
value = node->get_value( ).
if name eq 'DT_WHSE'.
wa_source-whse = value.
ELSEIF name eq 'DT_DC'.
wa_source-DC = value.
ELSEIF name eq 'DT_PLANT'.
wa_source-PLANT = value.
ELSEIF name eq 'DT_QTY'.
wa_source-QTY = value.
COLLECT wa_source INto it_source.
CLEAR wa_source.
ENDIF.
endcase.
node = iterator->get_next( ).
endwhile.
ENDIF.
loop at it_source into wa_source .
at first.
* Creating a ixml factory
o_ixml = cl_ixml=>create( ).
* Creating the dom object model
o_document = l_ixml->create_document( ).
endat.
* Build and Fill root node MT_DEMANDTEC_COST
AT FIRST.
l_element_MT_DEMANDTEC_COST =
O_document->create_simple_element(
name = 'MT_DEMANDTEC_COST'
parent = o_document ).
ENDAT.
* Build and Fill Child node DT_DEMANDTEC for parent
* MT_DEMANDTEC_COST
l_element_DT_DEMANDTEC = O_document->create_simple_element(
name = 'DT_DEMANDTEC'
parent = l_element_MT_DEMANDTEC_COST ).
* Build and Fill Child node1 DT_WHSE for parent DT_DEMANDTEC
ivalue = wa_source-WHSE.
l_element_DT_WHSE = O_document->create_simple_element(
name = 'DT_WHSE'
VALUE = ivalue
parent = l_element_DT_DEMANDTEC ).
* Build and Fill Child node2 DT_WHSE for parent DT_DEMANDTEC
ivalue = wa_source-DC.
l_element_DT_DC = O_document->create_simple_element(
name = 'DT_DC'
VALUE = ivalue
parent = l_element_DT_DEMANDTEC ).
* Build and Fill Child node3 DT_WHSE for parent DT_DEMANDTEC
ivalue = wa_source-PLANT.
l_element_DT_PLANT = O_document->create_simple_element(
name = 'DT_PLANT'
VALUE = ivalue
parent = l_element_DT_DEMANDTEC ).
* Build and Fill Child node4 DT_QTY for parent DT_DEMANDTEC
ivalue = wa_source-QTY.
l_element_DT_QTY = O_document->create_simple_element(
name = 'DT_QTY'
VALUE = ivalue
parent = l_element_DT_DEMANDTEC ).
endloop.
* render document ======================================================
* create output stream
o_istream = l_streamfactory->create_ostream_xstring( result ).
* Connect internal XML table to stream factory
o_istream = l_streamfactory->create_ostream_itable( table =
l_xml_table ).
renderer = o_ixml->create_renderer( ostream = o_istream
document = o_document ).
irc = renderer->render( ).
" The Statement CATCH define a block that catches the exceptions of the
" exception class cx_sy_ref_is_initial
CATCH cx_sy_ref_is_initial INTO o_exception.
" If you need to get the error message text do as follow
DATA errorMsg type string.
" Get the message text
errorMsg = o_exception->GET_TEXT( ).
" Display the error information
MESSAGE errorMsg TYPE 'I'.
ENDTRY.
The TRY block defines a guarded area whose class-based exceptions can be caught in the subsequent CATCH blocks. If no exception occurs in the TRY block and it reaches its end, the system continues the processing after ENDTRY. If a class-based exception occurs in the TRY block, the system searches for an exception handler in the same or an external TRY control structure.
Font: SAP Help
You can see a how to create and use an exception in this example [ ABAP Objects - Defining a Class-based exceptions|https://wiki.sdn.sap.com/wiki/x/19w] .
Best Regards.
Marcelo Ramos -
How to handle multiple records in BPMN process
Hi All,
We are using Oracle BPM 11g.In my requirement,I am using the database adapter to get the data from table and I need to validate the each record and update the status of that record from the BPM Process.But I dont know how to handle if multiple records come at a time.Can anybody please helpout from this problem.
Thanks in advanced.
Narasimha Rao.Can you have a look at this post: http://redstack.wordpress.com/2010/09/30/iteratingtraversing-arrays-in-bpm/
It's solving a different problem, but the key is that it's using a multi-instance subprocess to iterate over an array of "things" that need to be acted in. In your case it's the set of results from the db query rather than the set of tests in the example. But the principle is the same. You'd take collection of rows from the DB and process them in a multi-instance subprocess. The text that begins with the following would be good place to start:
"Now let’s implement the body of our process. We will use the Subprocess object to handle the traversal of the array of tests. Drag a Subprocess from the component palette on the right into the process and drop it on the line between the Start and End nodes."
In the loop characteristics you'd define whether you want to execute serially or in parallel. -
How to handle format trigger in bi publisher report
Hi all,
anyone have idea how to handle format trigger in bi publisher report....
also if someone will illustrate the how exactly we use the triggers in bi publisher reports.
regards
RatneshHi,
there's no direct support for the format triggers out of Oracle Reports. Therefore they are mentioned in the log file and in the created layout after conversion the objects with format triggers are colored red to show, that there you had to do some additional work.
Currently you had to built the logic of format triggers in BI Publisher new. Hve a look in the User Guide, there are some examples for if or choose statements.
regards
Rainer -
Missing start boundary exception, caused by an empty Part, how to handle?
Hello,
i wrote an application that automatically handles mails from laboratories. The only essential part of the mail is the attachment, where chemical analyses are submitted (from permitted addresses, recognized by whitelist and fileheader of the attachment). Other ways to submit data weren't allowed.
Currently a mail was received that can't be parsed. It's from a laboratory, that
use its provider's (a german internet suplier named Arcor) webmail, a browser-based mailing portal. It always worked fine, because they wrote some greetings. But this time they sent a blank message. The result is following structure of the mail:
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_Part_50112_10709369.1203586767396"
//Some X-Flags
------=_Part_50112_10709369.1203586767396
Content-Type: multipart/alternative;
boundary="*----=_Part_50111_24141780.1203586767396*"
------=_Part_50111_24141780.1203586767396--
------=_Part_50112_10709369.1203586767396
Content-Type: application/octet-stream
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=somefile.bin
ABCDEF.... //Some binary data
------=_Part_50112_10709369.1203586767396--
It seems the webmailer creates an empty mailpart and only writes the end boundary (Line: ------=_Part_50111_24141780.1203586767396--).
I know, the start boundary is really missing.
I checked it out by getting a mailaccount from Arcor, and it always creates this structure when sending a message without a text. By the way, the Message-ID (header) generated from Arcor's server seems to be from javamail. (.....1234.567890.....JavaMail.ngmail@....).
I don't know how many mailclients create "empty" parts, but impossible is nothing (e.g. other or future webmailer services).
But how to handle?
The error occures when calling MimeMultipart.getCount(), which causes to parse the mail if not parsed. All actions, which cause the mail to be parsed, will end in this exception (for this mail).
I looked at the javamail source and found out, that the line of the empty part is not recognized as a boundary, because of its ending delimiters:
if (line.equals(boundary))
break;
So the boundary is added to the preamble. It goes on with reading lines from the stream, until line == null.
if (line == null)
throw new MessagingException("Missing start boundary");
Because there is no test, if the line matches the end boundary, it's not recognized. Wouldn't it be better in this case, to add an empty bodypart and set a variable to false (e.g. complete) instead of throwing an exception? Because MimeMultipart.parse() is called by other methods, like getCount, getBodyPart and writeTo, I can't nearly do anything automatically with the mail. How should i walk through the bodyparts and fetch the parts I'm interested in?
Subclassing seems to be difficult to me:
Object content = message.getContent();
//javax.mail.Message, won't return a subclassed multipart
if (content instanceof Multipart) {
//recursive method!
handleMultipart((Multipart) content); //collecting parts from multipart
Of course, I could ask the laboratory: "please send me a greeting!" ;-)
Greetings,
cliffInteresting.
Yes, it's probably a bug that JavaMail allows you to
create a multipart with no body parts, since the
MIME specification doesn't allow that. Still, the
webmail application should be fixed so that it doesn't
try to do that, at least including an empty plain text
body part.
Please contact the webmail provider and tell them of
this bug in their application.
I'll also look into making JavaMail cope with these
broken messages more gracefully. Contact me
at [email protected] and I'll let you know when
I have a version ready to test. -
How to handle multiple selection in the Spark List control with checkbox as itemrenderer?
Hi All,
I am using checkbox as an ItemRenderer in spark list.
I have a query.
how to handle multiple selection in the Spark List control with checkbox as itemrenderer?
how to retrieve the selected item label?
Thank you in advance.Hi there, I'll tweak your code a little bit to something like this:
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical">
<mx:Script>
<![CDATA[
import mx.events.ListEvent;
import mx.controls.CheckBox;
[Bindable]
private var mySelectedIndexes:ArrayCollection=new ArrayCollection();
private function onChange(e:ListEvent):void
if(CheckBox(e.itemRenderer).selected){
mySelectedIndexes.addItem(e.rowIndex);
}else{
mySelectedIndexes.removeItemAt(mySelectedIndexes.getItemIndex(e.rowIndex));
chkList.selectedIndices=mySelectedIndexes.toArray();
]]>
</mx:Script>
<mx:ArrayCollection id="collection">
<mx:Object label="Test A"/>
<mx:Object label="Test B"/>
<mx:Object label="Test C"/>
<mx:Object label="Test D"/>
<mx:Object label="Test E"/>
<mx:Object label="Test F"/>
<mx:Object label="Test G"/>
</mx:ArrayCollection>
<mx:List id="chkList" dataProvider="{collection}" itemRenderer="mx.controls.CheckBox" itemClick="onChange(event);" allowMultipleSelection="true"/>
</mx:Application> -
PDF Form to XML. How to handle invoice detail lines
I am using LC Designer 7.x on a PDF form that has a submit button that loads a ColdFusion MX7 page that will save the XML in a MS SQL 2005 XML field.
My source of confusion is how to handle the invoice detail lines on the PDF invoice form.
The XML that I want is
5 All Season Tires
400.02
A car with 5 wheels
20400.00
My question is how do I setup the form fields to do this.
What I did prior to XML was have fields whose name included the line number and store them as FDF.
eg
description01 amount01 description02 amount02
But that will not work, or I dont know how to translate that to the desired XML.
Any thoughts you might have would be appreciated.
Thanks
Archie CampbellArchie,
You want to create a subform called "invoiceLine" which you've set to repeat for each data item using the Binding tab of the Object palette. This subform must be contained within another (e.g. "invoiceLines") whose content is set to be "Flowed" on the Subform tab of the Object palette. So your object hierarchy looks like:
invoiceLines = subform with flowed content
invoiceLine = subform repeated for each data item
description
amount
Rob Gabbard
Cardinal Solutions Group
www.cardinalsolutions.com -
How to handle large images?
Hi,
Does anyone know how to handle big jpg images (1280*960) so that they could be presented in a midlet.
The problem is that the images requires so much memory that they can't be decoded to an Image object with Image.createImage method. One solution would be to extract thumbnail image from exif headers. Unfortunately at least images taken with Nokia 6680 don't contain thumbnail in exif headers.
So the only solution seems to be to decode the byte presentation of the image and resize it before creating an Image object.
Do anybody know any library for this or tips where to start?
Br, IlpoHi,
I think it is not possible. My application contains a file browser (which uses jsr-75). User can use the browser to select an image either from phone memory or memory card. After the selection I would like to present the selected image for that user can be sure it is the right image. The selected image will be then sent to the server side with some additional data for further processing (but that is another story).
Now the problem is that for example with Nokia 6680 user can take images as big as 1280*960 and I can't present them anymore because of the memory restrictions. With 640*480 image there is no problem because I can create an image object and then use a simple algorithm to resize the image for presentation.
Br, Ilpo -
How to handle message prioritization in interface determination
Hi Experts,
How to handle the prioritization of messages if we say that for single source message it will be forwarded to 2 types of target messages.
Here's the scenario:
InterfaceDetermination object
SourceMessageA => TargetMessageTypeA
SourceMessageA => TargetMessageTypeB
Since both of the target messages will receive the source message, i want to prioritize that TargetMessageTypeB will be receive it first before TargetMessageTypeA.
Should I structure it in the Interface Determination as this:
SourceMessageA => TargetMessageTypeB
SourceMessageA => TargetMessageTypeA
or this should be handled by BPM? Let say BPM is the last option how could this be configured in ID?
Cheers,
R-jayHello Folk,
you have once option in the interface determination check the maintanence order at runtime , it will solve your problem.
regards,
Ravi.
Maybe you are looking for
-
SuSE 8.0 9iAS R2 and 9iDB R2 - Reporting Success
Hi All, I'm just writing in to report Success on SuSE ver. 8.0 (The Internet D/L'ed version) for... Oracle 9iAS Release 2 (Yes Portal is working) and Oracle 9iDB Release 2 I currently have install documents that I put together for these particular in
-
Can I enable a role using a encrypted password ?
Sir, I encrypt the role password using dbms_obfuscation package. Can I enable a role using such a password before decrypting it ? Thanks a lot Stephen
-
HI all, How to append some more records to the already released scheduled job .how to do this.
-
Inconsistancy of illuminated key board in low light conditions
I have several accounts on my power book and my administrator account has onyl a dim key board in low light while the other accounts have a bright light. I have checked to turn this function on under keyboard preferances. Does anyone know what I can
-
Adding sound in dhtml timeline
Hi, I'm working on a page that has a simple dhtml timeline. At a point in time an animated gif starts at the end of this animation (or almost at the end) I want to auto start a sound file. What's the best way of doing this? I can convert audio to alm