How to get the content of the Java HTML Editor in Oracle Forms?

You can retrieve the content of the Sferyx Java HTML Editor by invoking a function from PL/SQL for relatively short content - if you need to transfer larger strings please see the example below:

Declare
vString VarChar2(2000);
Begin
vString := FBean.Invoke_Char( 'HTMLEDITOR_AREA',1,'getBodyContent');
:block3.TEXT_AREA := vString;
End;

If you want to retrieve the editor content including all document images embedded inside the document  encoded as base64 strings you should use the following methods:

public void setEmbedAllImagesInsideTheDocument(boolean embed)
public boolean isEmbedAllImagesInsideTheDocument()

like this:

hArgs:=FBEAN.CREATE_ARGLIST;
FBEAN.ADD_ARG(hArgs,true);
FBean.Invoke('HTMLEDITOR_AREA',1, setEmbedAllImagesInsideTheDocument',hArgs);

After that by simply retrieving the document content using getContent() or getBodyContent() you will get also all images embedded inside the document as strings and you can save them easily into a CLOB field. See here how to save/retrieve the HTMLEditor content from a CLOB field.

This example illustrate how to retrieve the content in small chunks and compose a bigger string. This is necessary due to the limitation of the Oracle Forms environment which doesn't allow the transfer of strings larger than 4K. If the content is larger than 4K you will need to use the content buffer methods of the editor because of limitation in the Oracle Forms transfer length.

FUNCTION Get_HTMLEditor_Content RETURN varchar2 IS
l_text varchar2(4000);
l_buffer varchar2(32000);
l_index pls_integer;
l_len pls_integer;
l_length number;
l_done boolean;
hArgs FBEAN.ARGLIST;

BEGIN

l_buffer := null;
l_len := FBean.Invoke_Num( 'HTMLEDITOR_AREA',1, 'getBodyContentLength');

if l_len > 0 then
l_done := FALSE;
hArgs:=FBEAN.CREATE_ARGLIST;
l_index := 1;
else
l_done := TRUE;
end if;

while not l_done loop
FBEAN.ADD_ARG(hArgs,l_index);
FBEAN.ADD_ARG(hArgs,4000);
l_text := FBean.Invoke_char( 'HTMLEDITOR_AREA',1, 'getBodyContentPortion',hArgs);
l_buffer := l_buffer || l_text;
l_index := l_index + 4000;
if l_index > l_len then

l_done := TRUE;
end if;

FBEAN.CLEAR_ARGLIST(hArgs);
end loop;
return(l_buffer);
END;

If you are using CLOB fileds to store the documents see here how to save or retrieve the HTMLEditor content to/from CLOB field.