Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

HTMLEditorKit and CSS

843804Dec 18 2004 — edited Feb 28 2005
I'm having problems using CSS with HTMLEditorKit . Here it is a small example:
package com.textpane.gui;

import java.awt.event.*;
import java.awt.*;

import javax.swing.*;
import javax.swing.text.*;
import javax.swing.text.html.*;

public class JTextPaneApp
extends JFrame
{
    public final static int APP_WIDTH = 640;
    public final static int APP_HEIGHT = 400;

    public JTextPane jTextPane;
    public StyleSheet styleSheet;
    public HTMLDocument htmlDocument;
    public HTMLEditorKit htmlEditorKit;

    public javax.swing.text.Element contentElement;

    public JTextPaneApp()
    {
        setSize(APP_WIDTH, APP_HEIGHT);
        setResizable(false);
        setTitle("JTextPane App");

        styleSheet = new StyleSheet();
        styleSheet.addRule("body {font-family: Tahoma; font-size: 11pt; font-style: normal; font-weight: normal;}");
        styleSheet.addRule(".nick {color: blue;}");
        styleSheet.addRule(".normal {color: black;}");

        htmlEditorKit = new HTMLEditorKit();
        htmlEditorKit.setStyleSheet(styleSheet);
        htmlDocument = (HTMLDocument)htmlEditorKit.createDefaultDocument();

        jTextPane = new JTextPane();
        jTextPane.setEditorKit(htmlEditorKit);
        jTextPane.setDocument(htmlDocument);

        try {
            javax.swing.text.Element htmlElement = htmlDocument.getRootElements()[0];
            javax.swing.text.Element bodyElement = htmlElement.getElement(0);
            htmlDocument.insertAfterStart(bodyElement, "<div></div>");

            contentElement = bodyElement.getElement(0);
        } catch (Exception e) {
            e.printStackTrace();
        }


        Container contentPane = getContentPane();
        contentPane.setLayout(new BorderLayout());

        contentPane.add(jTextPane, BorderLayout.CENTER);

        addWindowListener
        (
            new WindowAdapter()
            {
                public void windowClosing(WindowEvent e)
                {
                    System.exit(0);
                }
            }
        );

        StringBuffer sbHtml = new StringBuffer();
        sbHtml.append("<div>");
        sbHtml.append("<font class=\"nick\">").append("Peter said: ").append("</font>");
        sbHtml.append("<font class=\"normal\">").append("Hello, world!").append("</font>");
        sbHtml.append("</div>");

        try {
            htmlDocument.insertBeforeEnd(contentElement, sbHtml.toString());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args)
    {
        try {
            JTextPaneApp jTextPaneApp = new JTextPaneApp();
            jTextPaneApp.setVisible(true);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
The string "Peter said: " should be rendered in blue and the string "Hello, world!" should be rendered in black, but everything is rendered in black. The body rule does work but the other rules don't seem to work. Can anybody help me, please?

Comments

Sherry George

Hi Bhaskar,

Did you forgot to post the error message? Setting that parameter (to 1 or 2) allows OBIEE users to call database functions. Here is the documentation.

https://docs.oracle.com/middleware/1221/core/BIMIG/GUID-C2C5B43E-4BB9-4ED7-94DE-D262698DCF98.htm#BIMIG-GUID-C2C5B43E-4BB…

Edit: There shouldn't be any impact to existing reports (but you would know better in term's of security who needs what access). Also you cannot  do it through EM.

3427784

I was in the same boat a while back. I believe setting it at level 2 lets all users call database functions in OBIEE. If I find my reference from my notes, I'll post it over here.

User_1JG01

Sherry George,

sorry my bad

here you go

++++++++++++++++++++++++++++++++++++++++++++++++

Odbc driver returned an error (SQLExecDirectW).

State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. EVALUATE_SUPPORT_LEVEL inside NQSConfig.INI is not set to support EVALUATE. (HY000)
++++++++++++++++++++++++++++++++++++++++++++++++
Sherry George

ok, and did you confirm that the report that throws the error uses "Evaluate" in it's criteria? If so change the value of the param to 1 or 2 and test. Here is the 11g doc for the same.

https://docs.oracle.com/cd/E28280_01/bi.1111/e10541/configfileref.htm#BIESG417

The links  explain the usage and what the values mean and possible security vulnerabilities if  not set to zero.

Syedsalmancs110

Just to add to all above comments:

EVALUATE_SUPPORT_LEVEL value 1 or 2 meaning:

For value 1 Evaluate is supported for users with manageRepositories permission(it is assigned through application policies to an application role of which user is part of)

For value 2 Evaluate is supported for any user.

User_1JG01

Hi Sherry

thanks for your inputs, yes i have noticed EVALUATE function has been used across various fields in couple of reports

guess based on above definition also provided by Syed , i m thinking to go for

VALUATE_SUPPORT_LEVEL = 1;

So once i make these changes, should i have to request my IT team to restart the entire OBIEE servers or is  there anything that i could do from my end through EM/Console to have these changes reflected immediately

Please share your inputs

Regards:

Bhasker.V

Jsglp

Sherry George
Answer

Hi Bhaskar,

If you set the value to 1 then only  users with the manageRepositories permission will be able to run the reports. And normal bi user's doesn't have that permission. But if this is required only for users with that permission then set the value to 1 and restart BI services or if all users need to run reports with "Evaluate" in it, then set to 2 and restart services.And you can restart the services from EM.

Marked as Answer by User_1JG01 · Sep 27 2020
Syedsalmancs110

Make the change in NQSConfig.INI i.e. define EVALUATE_SUPPORT_LEVEL

EVALUATE_SUPPORT_LEVEL = 1;

Save the file

Through either EM or through command console restart your OPMN managed BIEE Services(coreapplication_obis1,coreapplication_obips1 etc..)

User_1JG01

sure

EVALUATE_SUPPORT_LEVEL = 2;

guess i wanted to go with 2 with your explanation,

is there a way to change it from the front end applications, rather than doing this from back end

where i searched for this in the directoty i have 2 of these files NQSConfig.INI

one located under instance/instance1/....../coreapplication_obis1/

Other one is under Oracle_BI/bifoundation/......./OracleBiServerComponent/

Please let me know

Regards:

bahsekr.V

jsglp

Sherry George

You should make the edit in the file itself. And the file is the one under the instance directory. Also take a backup before editing the file.

User_1JG01

Thanks for all the info. m all set with this request

Regards:

Bhasker.V

Jsglp

1 - 11
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Mar 28 2005
Added on Dec 18 2004
2 comments
1,899 views