Sferyx LogoSferyx Internet Based Systems
 

HTML EDITOR COMPONENT

User Manual
Oracle Forms
SWT / Eclipse
XML features
FAQ
Download
Screenshots
Licensing & Prices

HTML EDITOR APPLET

User Manual
FAQ
Drupal Integration
SAKAI Integration
IBM Lotus Notes
Download
Screenshots
Licensing & Prices

PDF GENERATOR

User Manual
Oracle Forms
Licensing & Prices

EQUATION/MATHML EDITOR

User Manual
FAQ
Download
Screenshots
Licensing & Prices

PDFEXPORT ADD-ON

User Manual
On-line store
Customers
Contacts

 


Sferyx JSyndrome HTML Editor Component Edition


Oracle Forms HTML Editor Component Integration Manual
 

Advanced WYSIWYG Oracle Forms HTML Editor component with Automatic Image Upload and store to Database, clean Copy & Paste from Microsoft Office
and also PDF Export, Equation Editor, Rich Text Format import

 

  • Integrates easily with Oracle Forms, output can be easily used in Oracle BI Publisher
  • Full Copy & Paste and Drag & Drop from MS Word and MS Office, OpenOffice and many other applications with automatic publishing or uploading of all images and filtering of the proprietary tags - generates clean HTML code.
  • Possibility to embed all images as base64 encoded strings inside the document and create standards compliant self contained document - very useful to save the entire document including the images as a string for example in a CLOB  database field. All images can be automatically embedded into the document as base64 encoded strings
  • The content with all images can be saved as MIME formatted E-mail message and sent to Outlook
  • Read-only sections can be easily defined inside the document for creation of templates
  • Open/Save HTML/XHTML files, paste, open or import Rich Text Format (RTF) files
  • Export FO XML - FO XML content can be exported directly from the editor and converted using Apache FOP
  • Automatic image and file upload with support for PHP, ASP/.Net, JSP/Servlets, ColdFusion, Perl etc as Multipart Form Data
  • Automatic image and file WebDAV upload support
  • Configurable code generation - Legacy mode and Standards compliant mode without deprecated tags. Passes successfully various standards tests, including ACID ones for e-mail content
  • Available bundles with built-in Sferyx Equation Editor and Sferyx PDF Export,
  • Royalty Free distribution licenses
Customers

 


What's new in version 15.0  >>

All Sferyx products are secure and signed with  
Trusted Code Signing Certificate from Thawte

Download HTML Editor Component
Sferyx JSyndrome HTMLEditor Component Edition Pro : HTMLEditorDemo.zip
(ZIP file, ~ 2.6 MB)


 

 


General questions / System configurations

Demo version questions

Publishing content

Custom XML tags

Customization/Internationalization features

Content manipulation features

  1. How can I enable the text folding functionalities?

Application integration features

  1. How to disable the Main Menu?
  2. How to disable the Toolbars?
  3. How to disable the Statusbar?
  4. How to change the icons on the toolbars?
  5. How can I implement my own toolbar buttons instead of the default ones - also can I use different toolbar and move everything elsewhere?
  6. How to show/hide the rulers in the visual editor?


Oracle Forms Integration

  1.  

Licensing questions

Customization services

Customer support questions

Add-ons / Additional features

  1. Is there CSS (Style Sheet) editor component?
  2. Is there a PDF Export component?
  3. How do I enable the EquationEditor inside the HTML Editor?
  4. How to enable the PDF Export inside the HTML Editor?

 

 


1. How can I integrate the HTML Editor in Oracle Forms??

 

As any other java bean is integrated in Oracle Forms designer. Place the jar file in the designer's classpath and it will be automatically detected by the Oracle Forms Designer. You can add it after that easily as a bean area.
Please note that the delimiter between the jars in the classpath is "," and not ";" - if you put the ";" it will not work properly.

  • copy the HTMLEditorPro.jar file in the <ORACLE_HOME>/forms/java directory
  • edit your <ORACLE_HOME>/forms/server/formsweb.cfg file (for Oracle Forms 11g it is usually located into the folder <ORACLE_HOME>/Middleware/user_projects/domains/yourdomain/config/fmwconfig/servers/AdminServer/ applications/formsapp_11.1.2/config) to add everywhere the HTMLEditorPro.jar as follows:
    # Forms applet archive setting for JInitiator
    archive_jini=f90all_jinit.jar,HTMLEditorPro.jar
    # Forms applet archive setting for Microsoft Internet Explorer native JVM
    archive_ie=f90all.cab,HTMLEditorPro.jar
    # Forms applet archive setting for other clients (Sun Java Plugin, Appletviewer, etc)
    archive=f90all.jar,HTMLEditorPro.jar
  • open the HTMLEditorSampleForm.fmb module (Oracle Forms module)
  • if you don't see the editor into the Forms Builder you may need to add the  <ORACLE_HOME>/forms/java/HTMLEditorPro.jar to the system variable classpath
  • compile all and run the module
  • Into the Oracle Forms Visual designer insert a Bean area and set the implementation property to sferyx.administration.editors.HTMLEditorOracleBean

oracle forms html editor

 

 

 

You can note on the screenshots below the bean implementation property of the Bean Area is set to sferyx.administration.editors.HTMLEditorOracleBean

 

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

Invoking a function from PL/SQL:
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 strings you should use the following method:

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 below how to save/retrieve the HTMLEditor content from a CLOB field.

getBodyContentLength() and getBodyContentPortion()

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;FBEAN.CLEAR_ARGLIST(hArgs);
end loop;
return(l_buffer);
END;

 

 

3. How to set the content of the HTML Editor in Oracle Forms?

Declare
hArgs FBEAN.ARGLIST;
Begin
hArgs:=FBEAN.CREATE_ARGLIST;
FBEAN.ADD_ARG(hArgs,'some, text');
FBean.Invoke('HTML_EDITOR',1,'setContent',hArgs);

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. Here is an example on how to use this:

Declare
hArgs FBEAN.ARGLIST;
Begin
hArgs:=FBEAN.CREATE_ARGLIST;

FBEAN.INVOKE('HTML_EDITOR', 1, ''openContentBuffer');
FBEAN.ADD_ARG(hArgs, 'some text here');
FBEAN.INVOKE('
HTML_EDITOR', 1, 'appendContentToContentBuffer', hArgs);
FBEAN.CLEAR_ARGLIST(hArgs);
FBEAN.ADD_ARG(hArgs,
'some other text here');
FBEAN.INVOKE('
HTML_EDITOR', 1, 'appendContentToContentBuffer', hArgs);
FBEAN.CLEAR_ARGLIST(hArgs);
FBEAN.ADD_ARG(hArgs,
'some other text here');
FBEAN.INVOKE('b
HTML_EDITOR', 1, 'appendContentToContentBuffer', hArgs);
FBEAN.CLEAR_ARGLIST(hArgs);
FBEAN.ADD_ARG(hArgs,
'some other text here');
FBEAN.INVOKE('
HTML_EDITOR', 1, 'appendContentToContentBuffer', hArgs);
FBEAN.CLEAR_ARGLIST(hArgs);
FBEAN.ADD_ARG(hArgs,
'some other text here');
FBEAN.INVOKE('
HTML_EDITOR', 1, 'appendContentToContentBuffer', hArgs);
FBEAN.CLEAR_ARGLIST(hArgs);

FBEAN.INVOKE('HTML_EDITORFBEAN.CLEAR_ARGLIST(hArgs);

 

4. How to set / get the content of the HTML Editor in Oracle Forms from a CLOB field including all images as base64 encoded strings

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

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 below how to save/retrieve the HTMLEditor content from a CLOB field.

In the downloadable demo in the folder "examples/oracle forms" there is an example which contains the whole code and illustrates how this works.

INSERT INTO EDITOR FROM CLOB
 

For this example the database contains the table EPM_CONTRACT_CONS
and the structure of this table is as follows:

EPM_CONTRACT_CONS
==============================
EMP_NO                                  NUMBER
ASSUMPTION_DESC                 CLOB
 

insert some text into ASSUMPTION_DESC, and set EMP_NO to 1. Here below is the code for inserting the CLOB field content inside the HTMLEditor.


DECLARE
  bean varchar2(200):='HTMLEDITOR_AREA';
  t_id number(20):=1;
  hArgs FBEAN.ARGLIST;
  parts number(20);
  part varchar2(32500);
  part_size number(20) := 4000;
  body_length number(20);
BEGIN

  hArgs := FBEAN.CREATE_ARGLIST;

       -- Init Editor Buffer
      FBean.Invoke(bean,1,'openContentBuffer');
    
      -- Get CLOB content lenghtG(hArgs,part);
          FBean.Invoke(bean,1,'appendContentToContentBuffer',hArgs);
        end loop;   
      select nvl(dbms_lob.getlength(ASSUMPTION_DESC),0) into body_length from EPM_CONTRACT_CONS where EMP_NO = t_id;
    
        
     if body_length > 0 then
        -- Get Length and number of the parts
        select trunc(dbms_lob.getlength(ASSUMPTION_DESC)/ part_size) +1 into parts from EPM_CONTRACT_CONS where EMP_NO = t_id;
      
        for i in 1..parts loop
            select dbms_lob.substr(ASSUMPTION_DESC,part_size,((i-1)*part_size)+1) into part from EPM_CONTRACT_CONS where EMP_NO = t_id;
          
          hArgs := FBEAN.CREATE_ARGLIST;
             FBEAN.ADD_AR
     
      end if;

      -- Populate Editor
      FBean.Invoke(bean,1,'closeBufferAndInsert');

 
END;

 

SAVE INTO CLOB FROM EDITOR

This code is used to illustrate how to transfer the editor content to a CLOB field in the database. See the database table structure described above.

DECLARE

  bean varchar2(200):='HTMLEDITOR_AREA';
  t_id number(20):=1;
  hArgs FBEAN.ARGLIST;
  parts number(20);
  part varchar2(32500);
  body_length number(20);
  r_hd clob := null;
  res_hd clob;
  part_size binary_integer := 4000;
  pos number(20);
  old_length number(20);
  last_part_size binary_integer;
BEGIN

  hArgs := FBEAN.CREATE_ARGLIST;
 

 
  
      body_length := FBean.Invoke_num(bean,1,'getBodyContentLenght');
      parts := trunc(body_length / part_size);
      DBMS_LOB.CREATETEMPORARY(r_hd,TRUE);

      -- Complete Parts
      if parts > 0 then
    
          for i in 1..parts loop
          hArgs := FBEAN.CREATE_ARGLIST;
          pos := ((i-1)*part_size);
            fbean.add_arg(hargs,pos);
            fbean.add_arg(hargs,part_size);
          part := fbean.invoke_char(bean,1,'getBodyContentPortion',hargs);
          dbms_lob.write(r_hd,part_size,pos+1,part);
          end loop;
        
        -- last Part
        hArgs := FBEAN.CREATE_ARGLIST;
        pos := pos + part_size;
        last_part_size := body_length - (parts) * part_size - 1;
          fbean.add_arg(hargs,pos);

          fbean.add_arg(hargs,last_part_size);
        part := fbean.invoke_char(bean,1,'getBodyContentPortion',hargs);
        dbms_lob.write(r_hd,last_part_size,pos+1,part);
      else
        hArgs := FBEAN.CREATE_ARGLIST;
          fbean.add_arg(hargs,0);
          fbean.add_arg(hargs,body_length-1);
        part := fbean.invoke_char(bean,1,'getBodyContentPortion',hargs);
        dbms_lob.write(r_hd,length(part),1,part);
      end if;

      update EPM_CONTRACT_CONS set ASSUMPTION_DESC = r_hd where EMP_NO = t_id;
      DBMS_LOB.FREETEMPORARY(r_hd);

 
END;

 

Oracle Forms HTML Editor bean

5. How to enable copy/paste from/to the HTML Editor in Oracle Forms?

 

You will need to sign the component jar file with your security certificate. In case you may need help with this do not hesitate to contact our customer support at support@sferyx.com

 

6. How to remove toolbar/menu items in Oracle Forms?

Declare
hArgs2 FBEAN.ARGLIST;
--Here we remove the unwanted toolbar items using arglist
hArgs2:=FBEAN.CREATE_ARGLIST;
FBEAN.ADD_ARG(hArgs2,'newFileButton,openFileButton,saveFileButton');
FBean.Invoke('HTML_EDITOR',1,'setRemovedToolbarItems',hArgs2);
End;

All the names of the toolbar and menu items can be found in the main users manual.

7. Available methods accessible directly from the sferyx.administration.editors.HTMLEditorOracleBean - you should use the same rules for accessing those methods as described above in the OracleForms PL/SQL script examples:

 

public void setEnableCustomEventDispatching(boolean customEventsDispatchingEnabled) - this method allows to enable/disable dispatching of the events from the editor to the underlying form

public boolean isEnableCustomEventDispatching() 
- this method returns whether is enabled/disabled dispatching of the events from the editor to the underlying form

public void dispatchOracleFormsEvent(String name, Object event) - this method allows to dispatch events from the editor to the underlying form which will captured into the WHEN-CUSTOM-ITEM-EVENT trigger of the form.

public void setCustomEventDispatchingMask(String eventMask)
-This method allows only specified events to be dispatched once they have been enabled through the setEnableCustomEventDispatching. As argument can be specified a comma separated list of event names which are allowed to be dispatched to the  WHEN-CUSTOM-ITEM-EVENT. Example list of event names is as follows: "mouseReleased,insertUpdate,keyTyped" etc. By default all events are enabled through setEnableCustomEventDispatching.
 
public void resetCustomEventDispatchingMask() - will reset the dispatching event mask.

public void setEnableActionEventMaskForUIItems(String uiItemNames,boolean discardDefaultActions)- this method allows to be captured only specific action events from all UI elements such as toolbars and menus. discardDefaultActions specifies whether the default action for the UI element to be suppressed or not. This way you can implement easily your own handlers for all UI items of the editor by disabling the default functionality and implementing a new one.

public void addKeyToKeyEventMask(int keyCode, boolean shiftDown, boolean altDown, boolean ctrlDown, boolean metaDown, boolean altGraphDown) - If key is added to the key event mask only events generated from this key will be dispatched as custom events, others will be ignored . To reset the event mask use resetKeyEventMask method. keyCode is the code of the key on the keyboard. Example Enter is 13, Space bar is 32 etc.

public void resetKeyEventMask() -To reset the event mask use resetKeyEventMask method

So if you want to set key event mask for the F9, Shift+F9 and F10 you will need to do like this:

htmlEditor.addKeyToKeyEventMask(120,false,false,false,false,false);
htmlEditor.addKeyToKeyEventMask(120,true,false,false,false,false);
htmlEditor.addKeyToKeyEventMask(121,false,false,false,false,false);


public void setContent(String htmlContent)
- sets the content of the editor

public void insertContent(String htmlContent)
- inserts new content into the editor at the caret position

public void insertPlainText(String htmlContent)
- inserts new plain text into the editor at the caret position

public void setRemovedToolbarItems(String itemList)
-allows customization of the toolbars

public void setRemovedMenuItems(String itemList)
-allows customization of the menu items

public void setRemovedMenus(String itemList)
- allows customization of the menus

public void setStatusBarVisible(boolean visible)
-sets the state of the status bar.

public void setPopupMenuVisible(boolean visible) -sets the state of the popup menu.
 
public String getContent()
-gets the content of the editor.

public String getPlainText()
-gets the content of the editor as plain text.

public void setToolBarVisible(boolean visible)
-sets the state of the toolbar bar.

public String getBodyContent() 
-gets the body contentof the editor - no html and head tags will be generated

public void insertImage(String imageURL)
- inserts image at the caret position

public void insertLink(String linkURL) 
- inserts link over the selected text

public void setDefaultCharset(String encoding)
 
public void openLocation(String location)
- opens the given location inside the editor

public void setExternalDictionary(String externalDictionary)
- loads external dictionary

public void setPreviewModeOnly(boolean previewModeOnly)
- sets the preview mode only

public void openContentBuffer()
- opens a content buffer for loading large content

public void appendContentToContentBuffer(String content)
- appends new content to a content buffer for loading large content

public void closeBufferAndInsert()
- closes the buffer and inserts the content into the editor

public int getBodyContentLenght()
- returns a length limit set previously for the editor

public int getContentLenght()
- returns a length of the content.

public String getBodyContentPortion(int offset, int length)
- returns a portion of the body content.

public String getContentPortion(int offset, int length)
- returns a portion of the content.

public void setSourceEditorVisible(boolean visible)
-sets the state of the source editor.

public void setPreviewVisible(boolean visible) 
-sets the state of the preview.

public void setAsYouTypeSpellcheckingEnabled(boolean enabled)
- sets the state of spellchecker

public boolean isDocumentEdited()
- returns whether the document has been edited or not.

public void setPreferredPasteOperation(int preferredPasteOperation)
- sets the preferred paste operation

public int getPreferredPasteOperation()
- gets the preferred paste operation

public void loadExternalStyleSheet(String externalStyleSheetLocation)
-loads external CSS file

public String getBodyUnicodeContent()
 - returns the unicode content

public void setSourceCodeModeOnly(boolean sourceCodeModeOnly)
 - sets the source mode only

public void setShowBodyContentOnlyInSource(java.lang.String _showBodyContentOnlyInSource) -
This method will cause the editor to show only the body content when switching to the HTML source editor.

public String getExternalStyleSheetLocation() -
Returns the URL as string of the external style sheet loaded and used to apply style classes to the document elements

public void loadExternalStyleSheet(javax.swing.text.html.StyleSheet styleSheet, java.lang.String styleSheetURL) -
Loads external style sheet specified by the given URL and adds its content to the existing style classes.

public void setExternalStyleSheetLocation(java.lang.String externalStyleSheetLocation) -
Sets the external style sheet to be loaded and used for rendering and editing of the document.

public void loadStyleSheetRules(java.lang.String styleSheet) -
Allows to load some style rules dynamically like for example body{background-color:red} etc.

public void setDefaultInitialFont(String initialFont)
- sets the default font family to be used by the editor.

public void setDefaultInitialFontSize(String fontSize)
- sets the default font size to be used by the editor.

public String getContentAccessibleForScreenReaders()
- gets accessible content intended for screen readers - this will generate tags which are understood by the screen readers.

public String getBodyContentAccessibleForScreenReaders()
- gets accessible cbody ontent intended for screen readers - this will generate tags which are understood by the screen readers.

public HTMLEditor getHTMLEditorInstance() - you can use this method to get a direct reference to the HTMLEditor instance and use all the available API as you whish. This allows full customization and access to all the available features of the HTMLEditor class.

public void setRestrictedHeadingList(String headingList) - his method allows only certain fonts to be shown in the font list combo. The string must contain comma delimited list of the font names to be used like "Normal,Heading 1,Heading 2"

public void setRestrictedFontList(String fontList) - his method allows only certain fonts to be shown in the font list combo. The string must contain comma delimited list of the font names to be used like "arial,sans-serif,tahoma"

public void setRestrictedFontSizesList(String fontList) - his method allows only certain font sizes to be shown in the font size list combo. The string must contain comma delimited list of the font names to be used like "8,10,11"

public void setDefaultInitialFont(String initialFont) - sets the default font to be used

public void setDefaultInitialFontSize(String fontSize) - sets the default font size to be used

public void setWrapNewLineIntoBR(boolean wrap)
- causes <br> to be generated instead of <p> - and to emulate Microsoft Word like paragraph spacing.

public void setSingleParagraphSpacing(boolean wrap) - causes <p> to be generated with default single paragraph spacing- and to emulate Microsoft Word like paragraph spacing.

public String getContentAccessibleForScreenReaders() - converts some tags to be used properly by screen readers when needed.

public String getBodyContentAccessibleForScreenReaders() - converts some tags to be used properly by screen readers when needed.

public void resetDocumentEdited() -resets the point from which isDocumentEdited() to report changes, Useful to be reset after setting the content etc.

public void setPDFExportOutputEncoding(String encoding)  -sets the encoding for the PDF output when the PDFExport Add-on is installed - useful for Chinese etc.

public void setFlowToolbarLayout() - Sets the flow toolbar layout - all the toolbar items will be ordered one after another in a flowing manner in order to wrap around the available space.

public void loadInterfaceLanguageFile(String fileURL) -
Loads external language file for localization of the UI.

public String getEditorState() -Returns the current state of the editor. The returned value is one of
VISUAL_EDITOR
SOURCE_EDITOR
PAGE_PREVIEW



public void setDisableToolbarItems(String toolbarItemNames)


public void setEnableToolbarItems(String toolbarItemNames)


public void setEnabled(boolean enabled)

public boolean isEnabled()


public String selectCurrentWord() - will select the word at the current caret position


- will create an empty document inside the editor resetting all the content inside it..


public void replaceCurrentWord(String replaceWith) - sill replace the word at the current caret position with the given word


public void setLocalFileBrowsingDisabled(boolean disabled)- this method will enable/disable the local file dialog when needed. This will result in disabling of all browse buttons which lead to local file browsing

public boolean isLocalFileBrowsingDisabled() - returns whether the local file browsing is enabled


public void setLTROrientation()- this allows easy reversal of the document depending on the writing system used.


public void setRTLOrientation()


public void setEmbedAllImagesInsideTheDocument(boolean embed) - this new method enables the editor to embed all document images inside the HTML code which is retrieved using getContent(), getBodyContent() methods. This way is possible to create fully self contained documents to be saved as simple strings inside database fields (for example CLOB or similar) or even simple text files.

public boolean isEmbedAllImagesInsideTheDocument()



public void setCaretPosition(int position)  -sets the caret postion


public int getCaretPosition()  -returns the current caret position


public void setSelection(int start, int end)  -sets the selection start and end positions


public int getSelectionStart()  -returns the selection start


public int getSelectionEnd()  -returns the selection end


public boolean isCaretPlacedInAReadOnlySection() - indicates if the caret is inside a read-only section of the document


public void setUploadedObjectsTranslationPath(String uploadedObjectsTranslationPath)


public boolean uploadMultipartContent(String saveLocation, boolean entireFile)


public void setPublishContentUsingWebDAV(boolean publishContentUsingWebDAV_)

public void setGenerateUniqueImageFilenames(boolean generateUniqueImageFilenames_)


public void saveToLocation(String saveLocation, boolean entireFile)

public void setGlobalReplacementFontFamilyOnPaste(String replacementFontFamily)



public void setDontConvertCharacters(boolean convert) is used to convert the non ASCII characters to HTML entities for easier store and retrieve operations - you should set this to true - the default value is false.


public void closeBufferAndInsertAtCaretPosition() this method closes the existing content buffer and inserts its content inside the editor at the caret position - this method will not reset the entire content of the editor but will insert it along with the existing one. This should be used in conjunction with openContentBuffer() and appendContentToContentBuffer(String content). This methods are very useful in environments where long content strings cannot be inserted at once due to some limitations as happens for example in Oracle Forms. See supplied examples in the users manual.


public int getPlainTextContentLenght() this method returns the length of the plain text content of the editor.


public String getPlainTextContentPortion(int offset, int length) this method returns portion of the plain text content - this should be used in environments where is impossible the whole content at once due to some limitations such as the case of Oracle Forms. This should be used in conjunction with getPlainTextContentLength() and make cycle for retrieving all pieces through getPlainTextContentPortion(int start, in length)


 

8. How to enable capturing the events from the HTML Editor to the form?

This will enable the generation of the events from the editor to the form:

Declare
hArgs FBEAN.ARGLIST;
Begin
hArgs:=FBEAN.CREATE_ARGLIST;
FBEAN.ADD_ARG(hArgs,true);
FBean.Invoke('HTMLEDITOR_AREA',1,'setEnableCustomEventDispatching',hArgs);
End;

This code will capture the events using the WHEN-CUSTOM-ITEM-EVENT trigger of the form:

Declare
EventName VarChar2(32000);
Begin
EventName := :SYSTEM.Custom_Item_Event;

-- the event name contains all the event data starting with the event type like
-- keyPressed==>all the event data - for this make sure the variable used is long enough
-- you can later parse the data and use it accordingly:
-- here we put all in a text area to display it easily:

:block3.TEXT_AREA :=:block3.TEXT_AREA|| 'Event name: ' || EventName;
End;

mouseReleased
mousePressed
mouseExited
mouseEntered
mouseClicked
mouseMoved
mouseDragged
focusGained
focusLost
insertUpdate
changedUpdate
keyTyped
keyPressed
keyReleased

If you want only specific events to be delivered you can set an event mask using the following method:

public void setCustomEventDispatchingMask(String eventMask) -This method allows only specified events to be dispatched once they have been enabled through the setEnableCustomEventDispatching. As argument can be specified a comma separated list of event names which are allowed to be dispatched to the  WHEN-CUSTOM-ITEM-EVENT. Example list of event names is as follows: "mouseReleased,insertUpdate,keyTyped" etc. By default all events are enabled through setEnableCustomEventDispatching.

hArgs:=FBEAN.CREATE_ARGLIST;;
FBEAN.ADD_ARG(hArgs,'mouseReleased,insertUpdate,keyTyped');
FBean.Invoke('HTMLEDITOR_AREA',1,'setCustomEventDispatchingMask',hArgs);

The related methods for configuring the event dispatching are as follows:

public void setEnableCustomEventDispatching(boolean customEventsDispatchingEnabled) - this method allows to enable/disable dispatching of the events from the editor to the underlying form

public boolean isEnableCustomEventDispatching() 
- this method returns whether is enabled/disabled dispatching of the events from the editor to the underlying form

public void dispatchOracleFormsEvent(String name, Object event) - this method allows to dispatch events from the editor to the underlying form which will captured into the WHEN-CUSTOM-ITEM-EVENT trigger of the form.

public void setCustomEventDispatchingMask(String eventMask)
-This method allows only specified events to be dispatched once they have been enabled through the setEnableCustomEventDispatching. As argument can be specified a comma separated list of event names which are allowed to be dispatched to the  WHEN-CUSTOM-ITEM-EVENT. Example list of event names is as follows: "mouseReleased,insertUpdate,keyTyped" etc. By default all events are enabled through setEnableCustomEventDispatching.
 
public void resetCustomEventDispatchingMask() - will reset the dispatching event mask.

public void setEnableActionEventMaskForUIItems(String uiItemNames,boolean discardDefaultActions)- this method allows to be captured only specific action events from all UI elements such as toolbars and menus. discardDefaultActions specifies whether the default action for the UI element to be suppressed or not. This way you can implement easily your own handlers for all UI items of the editor by disabling the default functionality and implementing a new one.

public void addKeyToKeyEventMask(int keyCode, boolean shiftDown, boolean altDown, boolean ctrlDown, boolean metaDown, boolean altGraphDown) - If key is added to the key event mask only events generated from this key will be dispatched as custom events, others will be ignored . To reset the event mask use resetKeyEventMask method. keyCode is the code of the key on the keyboard. Example Enter is 13, Space bar is 32 etc.

public void resetKeyEventMask() -To reset the event mask use resetKeyEventMask method

So if you want to set key event mask for the F9, Shift+F9 and F10 you will need to do like this:

htmlEditor.addKeyToKeyEventMask(120,false,false,false,false,false);
htmlEditor.addKeyToKeyEventMask(120,true,false,false,false,false);
htmlEditor.addKeyToKeyEventMask(121,false,false,false,false,false);

 

9. General tips for integration with Oracle Forms?

Insert operations

public void openContentBuffer()

public void appendContentToContentBuffer(String content)

public void closeBufferAndInsert()

Retrieve operations

public int getBodyContentLenght() or public int getBodyContentLength() for bodyContent only

public int getContentLenght() or public int getContentLength() for entire content

public String getBodyContentPortion(int offset, int length) for bodyContent only

public String getContentPortion(int offset, int length) for entire content



Sample code:

Here we insert some content:
--------------------------------------
htmlEditor.openContentBuffer();
htmlEditor.appendContentToContentBuffer("This is ");
htmlEditor.appendContentToContentBuffer("some sample content");
htmlEditor.appendContentToContentBuffer(" long engouh to be tested...");


Close the buffer and insert it in the editor
--------------------------------------
htmlEditor.closeBufferAndInsert();


Retrieve the content in small pieces
---------------------------------------
int length=htmlEditor.getBodyContentLenght();
int portionLength=5;
int i=0;
while(i+portionLength<length)
{
System.out.println(htmlEditor.getBodyContentPortion(i,portionLength<length-i?portionLength:length-i));
i=i+portionLength;
}
 

10.Various customization features for Oracle Forms integration for loading translation files, dictionaries, single line spacing etc.

For the limited headings  use the following new methods:

Declare
hArgs FBEAN.ARGLIST;
Begin
hArgs:=FBEAN.CREATE_ARGLIST;
FBEAN.ADD_ARG(hArgs,'Normal,Heading 1,Heading 2');
FBean.Invoke('HTMLEDITOR_AREA',1,'setRestrictedHeadingList',hArgs);


-------------------------
For the limited fonts use the following new methods:

Declare
hArgs FBEAN.ARGLIST;
Begin
hArgs:=FBEAN.CREATE_ARGLIST;
FBEAN.ADD_ARG(hArgs,'arial,sans-serif,verdana,sans-serif');
FBean.Invoke('HTMLEDITOR_AREA',1,'setRestrictedFontList',hArgs);


-------------------------
For the limited font sizes use the following new methods:

Declare
hArgs FBEAN.ARGLIST;
Begin
hArgs:=FBEAN.CREATE_ARGLIST;
FBEAN.ADD_ARG(hArgs,'8,10,11');
FBean.Invoke('HTMLEDITOR_AREA',1,'setRestrictedFontSizesList',hArgs);

--------------------------
Request the focus:

hArgsEmpty FBEAN.ARGLIST;
Begin
hArgsEmpty:=FBEAN.CREATE_ARGLIST;
FBean.Invoke('HTMLEDITOR_AREA',1,'requestFocus', hArgsEmpty);

--------------------------
Restricted fonts & setWrapNewLineIntoBR - for single line spacing - this is inside  the WHEN-NEW-ITEM-INSTANCE on the bean area

Declare
vString BOOLEAN;
hArgs FBEAN.ARGLIST;
hArgs2 FBEAN.ARGLIST;
Begin
hArgs:=FBEAN.CREATE_ARGLIST;
hArgs2:=FBEAN.CREATE_ARGLIST;
FBEAN.ADD_ARG(hArgs,'arial,sans-serif,verdana,sans-serif,tahoma,times new roman');
FBEAN.ADD_ARG(hArgs2,true);

FBean.Invoke('HTMLEDITOR_AREA',1,'setRestrictedFontList', hArgs);
FBean.Invoke('HTMLEDITOR_AREA',1,'setWrapNewLineIntoBR',hArgs2);
End;


--------------------------
Loading a translation file

hArgs3 FBEAN.ARGLIST;
FBEAN.ADD_ARG(hArgs3,'http://your_host/your-translation.txt');
FBean.Invoke('HTMLEDITOR_AREA',1,'loadInterfaceLanguageFile',hArgs3);

 

11. Screenshots showing the Sferyx JSyndrome HTML Editor running inside the Oracle Forms builder, JInitiator and Java plug-in.

Java HTML Editor in Oracle Forms Builder

12. Screenshots showing the Sferyx JSyndrome HTML Editor running inside the JInitiator plug-in.

Java HTML Editor in Oracle Forms

13. Screenshots showing the Sferyx JSyndrome HTML Editor running inside the default Java plug-in..

Java HTML Editor in Oracle Forms

 

Our Services and assistance

All Sferyx products are assured with continuous e-mail support. With the retail products is included in the price 30 days startup support. Additionally, you can purchase annual support subscription tickets from our web store.

Sferyx offers also a wide range of customization services for its products in order to satisfy any customer requirement. We can adapt our products to fit the customer needs and any kind of integration requirements. We execute also express developments, customization under request, development of new features on demand. You can request a quote at sales@sferyx.com or support@sferyx.com indicating your requirements and the terms of delivery.

 

 


Copyright 2002-2013 Sferyx Srl. All rights reserved. Sferyx and the Sferyx logo are registered trademarks of Sferyx Srl. http://www.sferyx.com