ParserExtension and Custom Renderer components
Hi,
I am trying to create a custom component of my own which will control access to UINodes based on the contents of the User's HTTPSession object. In the HTTPSession I have a list of Roles that are assigned to the user and based on these roles I would like to turn on/off certain UI nodes. Initially I tried to create a component that was defined like this:
<sso:ssoassetchecker asset="987654321">
<contents>
<messageBox automatic="true"/>
</contents>
</sso:ssoassetchecker>However I was having trouble (probably due to me needing to have the contents tag in there but no having child node support in my custom UINode).
So I decided to look at the ParserExtension mechanism to get a component that looked like this:
<link text="User List (Super)" destination="UserList-SuperAdmin.uix" sso:assetcheck="sso_super_admin_role"/>This almost worked but I think that the ParserExtension will not operate dynamically for each user. I have some code in the ParserExtension that looks like this:
public Object elementEnded(ParseContext context, String namespaceURI, String localName, Object parsed, Dictionary attributes)
logger.debug("::elementEnded - About to parse new attribute type");
if (parsed instanceof MutableUINode)
MutableUINode node = (MutableUINode)parsed;
Object assetId = attributes.get("assetcheck");
if (assetId != null)
List roleIdsToCheck = new LinkedList();
StringTokenizer strTok = new StringTokenizer((String)assetId, ":");
logger.debug("::elementEnded - Checking whether user has any of the roles : " + assetId + " for node " + node.getNodeID());
while (strTok.hasMoreTokens())
roleIdsToCheck.add(strTok.nextToken());
BajaContext bajaContext = BajaParseContext.getBajaContext(context);
HttpServletRequest request = bajaContext.getServletRequest();
UserInfo userInfo = SSOManager.getUserInfo(request);
boolean roleFound = false;
if (null != userInfo)
String username = userInfo.getUsername();
long userId = userInfo.getUserId();
logger.debug("::elementEnded - Getting ROLES for username : " + userInfo);
Iterator rolesToCheckIterator = roleIdsToCheck.iterator();
while ( (rolesToCheckIterator.hasNext()) && (!roleFound) )
String curRoleToCheck = (String)rolesToCheckIterator.next();
logger.debug("::elementEnded - Checking whether user has current role : " + curRoleToCheck);
if (userInfo.checkPermissionForRole(curRoleToCheck))
roleFound = true;
logger.debug("::elementEnded - MATCH User does have current role : " + curRoleToCheck);
if (!roleFound)
logger.debug("::elementEnded - No match found for specified roles - HIDING node");
node.setAttributeValue(UIConstants.RENDERED_ATTR, "false");
parsed = null;
else
logWarning(context, "Controller extensions not supported on " + parsed + " objects");
return parsed;
}I know it is a bit hacky at the moment just turning off the rendered attribute and returning null but I just want to get it going.
So, after all that the question is this : will this ParserExtension get called each time the page is rendered and correctly get the data from the user's httpsession OR will the session only be looked up the first time the page is rendered?
Many thanks,
pj.
The page should only be parsed once (and when the file is modified). It seems like if you're only trying to turn on and off certain ui nodes you should be able to write a template...
Similar Messages
-
Mapviewer, parallel lines and custom rendering
I have been scratching my head a bit on this:
We have some databases which contains various types of water/sewer-pipes. These lines (pipes) has an attribute connected to them, which describes displacement and ranges from -3 to 3 (where a "normal" centered lines is 0).
Since we are very interested in the mapviewer WMS-feature, and want to render the map just the way we do in our apps, I am wondering, is there some way I can implement "server-logic" to apply displacement to the lines according to the displacement-attribute ?
Thanks in advance,
OyvindOyvind
You could use a view that references the original geometry (or just store it back in the same table in a different column), offsetting it to one side or the other using the LRS functions.
First, youll have to add an LRS value (unless you already have them) using SDO_LRS.CONVERT_TO_LRS_GEOM. Start and End could be 0 and 1.
Then offest that LRS geometry using SDO_LRS.OFFSET_GEOM_SEGMENT.
Then remove the LRS items (unless that doesnt make any difference in your app):
CREATE OR REPLACE VIEW corrected_pipedata
(geom)
AS
SELECT SDO_LRS.CONVERT_TO_STD_GEOM( SDO_LRS.OFFSET_GEOM_SEGMENT( SDO_LRS.CONVERT_TO_LRS_GEOM(a.in_geom, 0, 1),
0, 1,
a.in_offset))
FROM pipedata a
Example:
SELECT geometry_l from c_path_segment WHERE rownum < 2;SDO_GEOMETRY(3002, 8307, *, SDO_ELEM_INFO_ARRAY(1, 2, 1), SDO_ORDINATE_ARRAY(-80.5460927551392, 28.4766171261354, 0, -80.5460869608106, 28.4766337523028, 0))
SELECT SDO_LRS.CONVERT_TO_STD_GEOM(SDO_LRS.OFFSET_GEOM_SEGMENT( SDO_LRS.CONVERT_TO_LRS_GEOM(a.geometry_l, 0, 1),0, 1,
-1 ,
0.005,
'unit=meter arc_tolerance=0.05'))
FROM c_path_segment a
WHERE rownum < 2;
SDO_GEOMETRY(3002, 8307, *, SDO_ELEM_INFO_ARRAY(1, 2, 1), SDO_ORDINATE_ARRAY(-80.5460833610681, 28.4766140113997, 0, -80.5460829955615, 28.4766144706575, 0, -80.546077201
2316, 28.4766310968245, 0))
SELECT SDO_LRS.CONVERT_TO_STD_GEOM(SDO_LRS.OFFSET_GEOM_SEGMENT( SDO_LRS.CONVERT_TO_LRS_GEOM(a.geometry_l, 0, 1),0, 1,
1 ,
0.005,
'unit=meter arc_tolerance=0.05'))
FROM c_path_segment a
WHERE rownum < 2;
SDO_GEOMETRY(3002, 8307, *, SDO_ELEM_INFO_ARRAY(1, 2, 1), SDO_ORDINATE_ARRAY(-80.5461024997426, 28.4766189245689, 0, -80.5461025147173, 28.4766197816126, 0, -80.546096720
3901, 28.4766364077804, 0, -80.546096182864, 28.4766370831801, 0)) -
JTree selection problem when using custom renderer and editor
Hello:
I created a JTree with custom renderer and editor.
The customization makes JCheckBox to be the component
responsible for editing and rendering.
The problem is that when I click on the node with the checkbox
the JTree selection model does not get updated.
Without customizations of the editor and renderer the MouseEvent would be fired and BasicTreeUI$MouseHandler.mousePressed() method would call
the selectPathForEvent() method which would be responsible for updating
the selection model. At the same time if I attach a mouse listener to the JTree (customized) I see the events when clicking on the nodes. It seems like the MouseEvent gets lost and somehow as a result of which the selection model does not get updated.
Am I missing something?
Thanks
AlexanderYou probably forgot to call super.getTreeCellRendererComponent(...) at the beginning of your getTreeCellRendererComponent(...) method in your custom renderer.
Or maybe in the getTreeCellEditorComponent(...) of the TreeCellEditor... -
Best Practice : Creating Custom Renderer for Standard Component
I've been reading the docs and a few threads about Custom Renderers. The best practice seems to be to create a Custom Component where you need a Custom Renderer. Is this the case?
See [this post|http://forums.sun.com/thread.jspa?forumID=427&threadID=520422]
I've created several Custom Renderers to override the HTML provided by the Standard Components, however I can't see the benefit in also creating a Custom Component when the behaviour of the standard component is just fine.
Thanks,
Damian.It all depends on what you are trying to accomplish. Generally speaking if all you need is for the user interface output to be changed then a renderer will work just fine. A new component is usually made in order to provide some fundamental change in server side functionality not related to the user interface. - Ponderator
-
Possible to create a custom renderer for rendering standard component ?
This is in context for creating dynamic Data tables. Is it possible to create a custom Renderer for rendering component (standard) without creating a custom component?
namancLet's assume you want to create a custom renderer which will be used to render the error-messages (the h:messages tag). The component-family in this case is: javax.faces.Messages, the renderer-type javax.faces.Messages.
Therefor in your application's faces-config.xml add this renderer-statement (inside a render-kit, obviuosly):
<faces-config>
<!-- other stuff like components, managed beans, navigation-rules,... -->
<render-kit>
<renderer>
<component-family>javax.faces.Messages</component-family>
<renderer-type>javax.faces.Messages</renderer-type>
<renderer-class>my.very.special.MessagesRenderer</renderer-class>
</renderer>
</render-kit>
<!-- other renderers... -->
</faces-config>The code for MessagesRenderer is very dependent on your needs, therefor I will not post something here. Basically you need to extend javax.faces.render.Renderer. For help in that camp, surf to the online tutorials or get yourself a book (I learned a lot from Kito Mann's "JSF in Action"). Additionally grab the source for Sun's RI AND Myfaces and dig into that java-code. There is a huge learning potential looking at that source-material.
hth
Alexander -
Custom renderer for radio buttons?
I want to change how radio buttons are rendered (so they aren't all rendered alone in their own table). What would be the best way to do this?
One way would be to create a custom component, tag handler, and renderer (and register them all in faces-config.xml).
But what about using the existing JSF components and just writing my own renderer. Could that work? Would just need to write a renderer and configure faces-config.xml to use the appropriate component-family (for the existing JSF radio button component) and renderer-type (for the existing component tag class for the radio button)�.like this:
<render-kit>
<renderer>
<component-family>javax.faces.SelectOne</component-family>
<renderer-type>javax.faces.Radio</renderer-type>
<renderer-class>my.custom.renderer</renderer-class>
</renderer>
</render-kit>
Could this work?
Thanks.Could this work?Yes. Why do you doubt it?
-
How to build custom JSF components?
The JSF tutorials demonstrate ways to build JSF web "applications" ...
I am interested in developing JSF web "components" ... Is there any resource that I can avail of or if it's possible for some of u to share a sample ...
thanks much,
keyurHi Keyur,
The tutorial does need to include a custom component example. We have been working on an example and it's just about done. We need to work out some bugs, get it working on the RI that is publicly available, and document it.
If you need to get started in the meantime, here are some basic steps for creating a custom component:
1. Write a tag handler class that extends javax.faces.webapp.FacesTag. In this
class, you need:
* a getRendererType method, which returns the name of your custom renderer, if
you are using one (explained in step 4).
* a createComponent method, which returns an instance of your custom component.
* an overrideProperties method, in which you set all of the new attributes of
your component.
2. Create a TLD that associates the custom tag to the tag handler.
3. Write a class that either extends a standard JSF component or extends directly from javax.faces.component.UIComponentBase.
If a standard JSF component has most of the functionality you need, you can extend the component class that defines this component. These classes are found in the javax.faces.component package. Otherwise, extend UIComponentBase.
4. Either create a custom renderer by extending javax.faces.render.Renderer, or include the rendering code in one of the encodeXXX methods of your custom
component class. From the encodeXXX method, use the ResponseWriter from FacesContext to write out the markup. If what you need to render is fairly
simple, it's easier to include the rendering code in the component class.
5. From your ServletContextListener instance, register your Renderer to the standard RenderKit by: using RenderKitFactory to get the RenderKit, and using
addRenderer on the RenderKit to add your new Renderer. You only need to do this if you created a Renderer in step 4.
6. Declare your new TLD in your JSP page and use the tag in the page.
This will all be clearer once we publish the custom component documentation. We are working on it presently and will announce its release on this forum.
Thank you for your interest in JavaServer Faces -
JSF custom renderer executes multiple times
I have just created a jsf custom component to render three input texts next to each other (for SSN input). My custom renderer extends javax.faces.render.Renderer, and I am writing out the elements in the encodeEnd method. The problem I encountered is - upon saving the form and the screen refreshes, the renderer gets called two times. So what I end up seeing on the screen are two sets of the three input texts component. Does anyone know why the renderer gets called more than once? Any insight is much appreciated.
To the best of my knowledge, the standard does not specify the default renderer class for any components.
I would take a wrapper/decorator approach. Add a field to your renderer for the default renderer. Before configuring your renderer, obtain the default renderer and set it on your renderer, then configure it.
OTOH, there might be easier ways for you to accomplish what you want to do. You could use a PhaseListener to add components to the view whenever a commandButton is encountered in the tree. -
Hello folks,
I am looking for best practices advice when (1) creating
custom components and (2) styling and skinning.
I already know how to skin a component part of the Flex
framework. I can make a class extending ProgrammaticSkin and have
my component skinned using CSS to link the component with the
reference to my custom class.
However what about those cases when you are completely
creating a component from scratch?
Imagine a "Freehand Drawing Canvas" component that allows the
user to draw on it and has some buttons to set color styles, line
styles, etc., or imagine a "Screen Flow Gallery" component that
displays visual objects in a fashion similar to Cover Flow in the
Mac.
In many components I am aware you may reuse other components
part of the Flex framework but I am trying to picture an scenario
where you would need to draw everything yourself because there just
isn't something to base it upon so you will end up drawing it from
scratch.
To learn how instead of building one of those components I
mentioned previously I decided to start with something simple that
would illustrate this like a LiteButton component that will behave
just like the Flex mx.controls.Button but will extend UIComponent
and be completely custom drawn.
The component will have a default look and will also be
style-able and skin-able. I will provide styles for users of the
component to modify and regarding skinning anyone can create a
custom ProgrammaticSkin adding its own drawing logic and link it to
the component via CSS with the ClassReference applied to the skin
selector.
So far so good and it's clear what I want to achieve. I
actually know how to do most of the stuff here but I have one
single problem.
Here is my question, where should I put my custom drawing
logic? If I do it in the updateDisplayList inside the class
extending UIComponent it works, however I thought that it would be
a better practice to do it using programmatic skins, that way I
could provide different skin themes for my component set.
The problem is that I can't make the programmatic work in
this scenario. I tried instantiating the custom programmatic skin
during the updateDisplayList of the LiteButton component and adding
it to my display object via addChild but that didn't do anything. I
also tried creating a "default.css" stylesheet and tried to use
ClassReference as I would normally do to skin an already existing
component (or composite component as well) but that didn't do
anything either.
So how do I apply programmatic skins for completely custom
drawn components of my Flex library project?
I could do it inside the updateDisplayList of the LiteButton
class extending UIComponent but again I would like to provide
different theme sets for my components so it makes sense using
programmatic skins."jbucaran" <[email protected]> wrote in
message
news:[email protected]...
> Hello folks,
>
> I am looking for best practices advice when (1) creating
custom components
> and
> (2) styling and skinning.
>
> I already know how to skin a component part of the Flex
framework. I can
> make
> a class extending ProgrammaticSkin and have my component
skinned using CSS
> to
> link the component with the reference to my custom
class.
>
> However what about those cases when you are completely
creating a
> component
> from scratch?
>
> Imagine a "Freehand Drawing Canvas" component that
allows the user to draw
> on
> it and has some buttons to set color styles, line
styles, etc., or imagine
> a
> "Screen Flow Gallery" component that displays visual
objects in a fashion
> similar to Cover Flow in the Mac.
>
> In many components I am aware you may reuse other
components part of the
> Flex
> framework but I am trying to picture an scenario where
you would need to
> draw
> everything yourself because there just isn't something
to base it upon so
> you
> will end up drawing it from scratch.
This may help with that
http://livedocs.adobe.com/flex/3/html/help.html?content=skinstyle_3.html
> To learn how instead of building one of those components
I mentioned
> previously I decided to start with something simple that
would illustrate
> this
> like a LiteButton component that will behave just like
the Flex
> mx.controls.Button but will extend UIComponent and be
completely custom
> drawn.
>
> The component will have a default look and will also be
style-able and
> skin-able. I will provide styles for users of the
component to modify and
> regarding skinning anyone can create a custom
ProgrammaticSkin adding its
> own
> drawing logic and link it to the component via CSS with
the ClassReference
> applied to the skin selector.
>
> So far so good and it's clear what I want to achieve.
Actually after
> playing
> with the weekend and today I know how to do most of the
stuff but I have
> one
> single problem. So here is my question, where should I
provide my custom
> drawing logic? If I do it in the updateDisplayList
inside the class
> extending
> UIComponent it works, however I thought that it would be
a better practice
> to
> do it using programmatic skins, that way I could provide
different skin
> themes
> for my component set.
These aren't mutually exclusive. When you provide a skin with
a
TypeSelector, you have to add it to the display list
somewhere, and this is
typically done in updateDisplayList or addChildren. I prefer
to do it in
updateDisplayList, because you can then change it if the
style changes.
> The problem is that I can't make the programmatic work
in this scenario. I
> tried instantiating the custom programmatic skin during
the
> updateDisplayList
> of the LiteButton component and adding it to my display
object via
> addChild but
> that didn't do anything.
Exactly what did you do?
> I also tried creating a "default.css" stylesheet and
> tried to use ClassReference as I would normally do to
skin an already
> existing
> component (or composite component as well) but that
didn't do anything
> either.
I've never had any problem using an approach similar to
this...but I will
say that I couldn't see any advantage in creating a
default.css style sheet,
since it's not really default in the way that the one that
comes with Flex
is. It's much more obvious to anyone using your component
what's going on
there if you create a style sheet where they're likely to
spot it.
> So how do I apply programmatic skins with the default
look for custom
> drawn
> components?
It seems like your approach is fine, but maybe you've made a
mistake in your
implementation.
> I could do it inside the updateDisplayList of the
LiteButton class
> extending
> UIComponent but again I would like to provide different
theme sets for my
> components so it makes sense using programmatic skins.
You might want to consider also adding an instance of
HaloBorder to your
component. That brings a lot of functionality with it.
HTH;
Amy -
Problem with JTree custom renderer when editing
I have a JTree which uses a custom renderer to display my own icons for different types of nodes. The problem I am having is when I setEditable to true and then attept to edit a node the icon switches back to the default icon, as soon as I am done editing it goes back.
What I am doing wrong?Here is my rendererer
public class DeviceTreeRenderer extends DefaultTreeCellRenderer implements GuiConstants {
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
JLabel returnValue = (JLabel)super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus);
if (value != null) {
returnValue.setToolTipText(value.toString());
if (value instanceof Device) {
returnValue.setIcon(TREE_DEVICE);
if (!((Device)value).isAlive()) {
returnValue.setEnabled(false);
else if (value instanceof GuiPanelGroup) {
if (expanded) {
returnValue.setIcon(TREE_PANEL_GROUP_OPEN);
else {
returnValue.setIcon(TREE_PANEL_GROUP_CLOSED);
else if (value instanceof GuiPanel && ((GuiPanel)value).isDirty()) {
returnValue.setIcon(TREE_PANEL_DIRTY);
return returnValue;
}Here is my editor:
public class WwpJTreeCellEditor extends DefaultTreeCellEditor implements GuiConstants {
private WwpJTree tree;
* Creates a new WwpJTreeCellEditor.
* @param tree The WwpJTree to associate with this editor.
public WwpJTreeCellEditor(WwpJTree tree) {
super(tree, (DefaultTreeCellRenderer)tree.getCellRenderer());
this.tree = tree;
* Overrides the default isCellEditable so that we check the isEditable() method
* of the WwpJTreeNodes.
* @param e An EventObject.
public boolean isCellEditable(EventObject e) {
boolean returnValue = super.isCellEditable(e);
if (returnValue) {
WwpJTreeNode node = this.tree.getSelectedNode();
if (node == null || !node.isEditable() || node.isDragging()) {
returnValue = false;
return returnValue;
}In my JTree I make these calls:
super.setCellRenderer(new DeviceTreeRenderer());
super.setCellEditor(new WwpJTreeCellEditor(this));
super.setEditable(true); -
Help! Using a custom renderer to display an image
I have a JTable where I want to set the renderer of one column to a custom renderer. And I want this renderer to show either a play button image, or a stop button image, depending on the status, which is a Boolean value. However, the image won't show up when I run the application. Here's the code from the renderer...
public class StatusRenderer extends DefaultTableCellRenderer {
private ImageIcon playIcon = new ImageIcon("C:/play.jpg");
private ImageIcon stopIcon = new ImageIcon("C:/stop.jpg");
public StatusRenderer() {
setHorizontalAlignment(JLabel.CENTER);
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int col) {
Boolean b = (Boolean) value;
setIcon(b.booleanValue() ? playIcon : stopIcon);
return this;
The application runs, but no icon shows up in the table cell. I'd really appreciate any help on this. Thanks.look at http://www2.gol.com/users/tame/swing/examples/JTableExamples1.html
for some great table examples (they may need minor mods to work on 1.3/1.4)
Basically I think you need something more like:
public class StatusRenderer extends JLabel
implements DefaultTableCellRenderer
public StatusRenderer() {
super();
setHorizontalAlignment(JLabel.CENTER);
public Component getTableCellRendererComponent(JTable table,
Object value, boolean sSelected,
boolean hasFocus, int row,
int col)
Boolean b = (Boolean) value;
setIcon(b.booleanValue() ? playIcon : stopIcon);
return this;
}Don't forget to add the renderer to the column you want it in ! -
Java API's supported in the Jdeveloper, IAS, and RDBMS product components
If there are any technical errors or "mistatement of the facts" in this posting, please let me know about them ..
This article is being delivered in Draft form and may contain
errors. Please use the MetaLink "Feedback" button to advise
Oracle of any issues related to this article.
PURPOSE
This article describes the "Enterprise Java Beans" (EJB), "Java Server Pages"
(JSP) and servlets Application Programming Interfaces (API) supported by the
Oracle products, Jdeveloper, Internet Application Server (IAS) and the Oracle
RDBMS release 2 and release 3, also known as Version 8.1.6 and 8.1.7,
respectively.
SCOPE & APPLICATION
All parties interested in the Java API's supported by these products.
Java API's supported in the Jdeveloper, IAS, and RDBMS product components
JDEVELOPER
JDEVELOPER is Oracle's Java development tool designed for coding / development,
testing / debugging, and deployment of Java Applications to the IAS and
RDBMS platforms.
With the java software api's being in a constant state of evolution, each new
release of Jdeveloper adds support for the "then current" version of the java
software api's, if it does not already have it implemented.
JDEVELOPER SERVLET API JSP API EJB API
VERSION VERSION VERSION VERSION
3.2.X.X 2.2 1.1 1.1
3.1.X.X 2.1 1.0 1.0
NOTE :
Sun Microsystems and their advisory teams (Oracle is on it) is working on
"draft" specifications for the next version of all of these API's
EJB -------> http://java.sun.com/products/ejb/index.html
JSP -------> http://java.sun.com/products/jsp/index.html
Servlets --> http://java.sun.com/products/servlet/?frontpage-javaplatform
It is anticipated that future releases of Jdeveloper will continue to be
upgraded to include support for the next version of each api.
To obtain the latest information on Oracle's Internet Development Suite (IDS)
of tools, please review the "Internet Developer Suite" information located
on Oracle's technet web site at :
http://technet.oracle.com/products/index.htm
IAS
IAS is Oracle's next evolution of the web server and application server
product technology superceeding the Web Application Server (WAS) and Oracle
Application Server (OAS) product lines.
IAS SERVLET API JSP API EJB API EJE VERSION
VERSION VERSION VERSION VERSION SUPPORTED
9I(1.0.2) 2.2 1.1 1.1 817
8i(1.0.1-NT) 2.0 1.0 1.0 816
8i(1.0.0-UNIX) 2.0 1.0 1.0 816
The IAS product contains two Java Virtual Machines (JVM) within it's
architecture.
They are called :
1) APACHE JSERV servlet engine
2) ORACLE ENTERPRISE JAVA ENGINE (EJE)
APACHE JSERV servlet engine
The APACHE JSERV servlet engine is an EXISTING product licensed from the
apache group which supports the servlet api 2.0.ONLY.
The APACHE JSERV product does not support ANY JSP's unless the customer
installs a third party jsp engine.
The IAS 8i/9i which has the APACHE JSERV product embedded in it, comes with
Oracle's JSP engine (OJSP) already integrated into it. OJSP supports JSP's up
to the specific JSP engine version documented in the Oracle Universal
Installer (OUI) for the 8.1.7 RDBMS or the IAS products. It is also documented
in the product's release notes.
Oracle ENTERPRISE JAVA ENGINE (EJE)
The EJE formerly known as :
1) Oracle 8i Java Virtual Machine (JVM)
2) JSERVER component,
3) Aurora JVM
was originally releas ed in the RDBMS 8.1.5 database with jdk 1.1.6 based java
support.
The currently supported versions of the Oracle 8i RDBMS, versions 2 and 3,
also known as Version 8.1.6 and 8.1.7, respectively, provides a jdk 1.2.1
based java virtual machine support.
"EJE" Version 816
This EJE, found in rdbms 8.1.6 and IAS 8i, contains support for the ejb
api 1.0, corba, and java stored procedures.
"EJE" Version 817
This EJE, found in rdbms 8.1.7 and IAS 9i, contains support for the ejb,
corba, and java stored procedures as well as the Oracle Servlet Engine (OSE)
which provides support for the servlets 2.2 api and JSP 1.1 api.
Note :
EJB support in the "EJE" Version 817 has been upgraded to comply with the EJB
1.1 api specification which includes "entity beans" support.
What is the bottom line ??
1) Servlets deployed to the APACHE JSERV must comply with servlet api 2.0.
2) Servlets 2.1 or higher are only supported in EJE's OSE component found in
the rdbms 817 or ias 9i products. Servlets api 2.0 can also run in the OSE.
References
1) "Oracle9i Application Server Technical White Paper" located at :
http://technet.oracle.com/products/ias/pdf/9ias_102.pdf
2) "Whats New? Oracle8i JVM Accelerator, Oracle Servlet Engine, OracleJSP ..."
located at :
http://technet.oracle.com/products/oracle8i/pdf/504.pdf
3) "Oracle8i Release 3 New Features Summary" located at :
http://technet.oracle.com/products/oracle8i/pdf/8iR3_nfs.pdf
nullwhich jvm is used by jserv ?? EJE or a separate jdk ?
The Jserv servlet engine is running in a separate jdk JVM external to the EJE jvm which is embedded within the "database" component of ias and the RDBMS.
See the reference below for more details ...
if jserv only support old apis, why it is in oracle's products ?
i would assume that the oracle servlet engine was under development when ias 8i was released and became available in time for the ias 9i and rdbms 817 products.
looking back in history leads me to believe ias 8i was a migration path to get to ias 9i or rdbms 817.
Based upon the long history of new releases of every oracle product being upgraded with new features, it's reasonable to assume that these products will continue to evolve.
when I deploy a jsp how to deploy in the right servlet container ("EJE") ?
as documented in the reference below, you can deploy JSP's to either the apache jserv jvm or the EJE since the ORACLE JSP engine functionality is in both jvm's.
there are many posts where you can see that people have deploy in jserv and they have problems because they don't use the right container (servlet 2.0 instead of
servlet 2.2) http://technet.oracle.com:89/ubb/Forum2/HTML/006349.html
when ias 8i came out this was clearly an issue since servlet support was at api 2.0, and the current servlet api was probably at 2.1.
oracle clearly made every effort to get ias 9i released quickly to supply a servlet 2.1 and 2.2 capable engine to resolve this issue.
since ias 9i and rdbms 8.1.7 are available this is no longer an issue.
The reference below explains the architecture and understanding it would eliminate a lot of "deploy to the wrong ias 9i component" issues.
so why jserv is bundled with oracle 8i/9ias since EJE support the right api version ?
if in ias 9i release , oracle had removed the jserv component without any advance warning, many customers would have been very upset since oracle makes every attempt to give advance notice before removal of functionality.
References
1) "Oracle9i Application Server Technical White Paper" located at :
http://technet.oracle.com/products/ias/pdf/9ias_102.pdf -
'...' not appearing in obscured table cell when using custom renderer.
Hello all -
I am using a custom JPanel as a cell renderer in a JTable to display two icons per cell. Unfortunately, I am running into a problem that occurs when resizing a column such that the width of the column is less than the size of the cell content. Normally, when resizing a cell in this manner, it will start to cut off the text within the cell and add '...' to signify that some material is obscured. However, using my cell renderer, the text simply cuts off with no indication whatsoever there is more content that is being hidden. I have tried looking through the JComponent code to find a function to overload but I haven't had much luck. Does anyone have any suggestions?
For a simple example, compile and run the following code and try resizing the two columns. You should be able to notice the difference.
Thanks,
- Alex
import java.awt.*;
import java.awt.image.*;
import java.util.*;
import javax.swing.*;
import javax.swing.table.*;
public class TwoIcons extends JFrame {
public static void main(String[] args){
createIcons();
SwingUtilities.invokeLater
new Runnable()
public void run() {
new TwoIcons();
public TwoIcons(){
super("Test");
DefaultTableModel tm = new DefaultTableModel(
new Object[][]{
{new IconPair("cross", "cross"), "just a string"},
{new IconPair("circle", "cross"),"just another string"},
{new IconPair("String", "circle"),"yet another string"}
}, new String[]{"Two Icons","String"}){
public Class getColumnClass(int columnIndex){
if(columnIndex==0){
return IconPair.class;
else
return super.getColumnClass(columnIndex);
JTable table = new JTable(tm);
final Color bg = table.getBackground();
table.setDefaultRenderer(IconPair.class, new TableCellRenderer(){
RendererPanel renderer = new RendererPanel(bg);
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
renderer.setIcons((IconPair)value);
return renderer;
JScrollPane scp = new JScrollPane(table);
add(scp);
setSize(400,100);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
pack();
setVisible(true);
class RendererPanel extends JPanel{
JLabel icon1, icon2;
RendererPanel(Color bg){
setLayout(new BoxLayout(this,BoxLayout.LINE_AXIS) );
icon1=new JLabel();
icon2=new JLabel();
add(icon1);
add(icon2);
setBackground(bg);
public void setIcons(IconPair value) {
icon1.setIcon(value.i1);
icon1.setToolTipText("Icon 1");
icon2.setIcon(value.i2);
icon2.setToolTipText("Icon 2");
//uncomment next 2 lines if you want text as well
icon1.setText(value.s1);
icon2.setText(value.s2);
class IconPair {
public Icon i1,i2;
public String s1,s2;
IconPair(String s1, String s2){
this.i1=(Icon)icons.get(s1);
this.i2=(Icon)icons.get(s2);
this.s1=s1;
this.s2=s2;
static Map icons = new HashMap();
public static void createIcons(){
Image img = new BufferedImage(10,10, BufferedImage.TYPE_INT_ARGB);
Graphics2D g2=(Graphics2D)(img.getGraphics());
g2.setColor(Color.BLUE);
g2.drawLine(0,0,10,10);
g2.drawLine(0,10,10,0);
icons.put("cross",new ImageIcon(img));
img = new BufferedImage(10,10, BufferedImage.TYPE_INT_ARGB);
g2=(Graphics2D)(img.getGraphics());
g2.setColor(Color.ORANGE);
g2.drawOval(1,1,8,8);
icons.put("circle",new ImageIcon(img));
}Things aren't resizable in your layout for the custom renderer. Here's your code working as you want (I think)
import java.awt.*;
import java.awt.image.*;
import java.util.*;
import javax.swing.*;
import javax.swing.table.*;
public class TwoIcons extends JFrame {
public static void main(String[] args){
createIcons();
SwingUtilities.invokeLater
new Runnable()
public void run() {
new TwoIcons();
public TwoIcons(){
super("Test");
DefaultTableModel tm = new DefaultTableModel(
new Object[][]{
{new IconPair("cross", "cross"), "just a string"},
{new IconPair("circle", "cross"),"just another string"},
{new IconPair("String", "circle"),"yet another string"}
}, new String[]{"Two Icons","String"}){
public Class getColumnClass(int columnIndex){
if(columnIndex==0){
return IconPair.class;
else
return super.getColumnClass(columnIndex);
JTable table = new JTable(tm);
final Color bg = table.getBackground();
table.setDefaultRenderer(IconPair.class, new TableCellRenderer(){
RendererPanel renderer = new RendererPanel(bg);
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
renderer.setIcons((IconPair)value);
return renderer;
JScrollPane scp = new JScrollPane(table);
getContentPane().add(scp);
setSize(400,100);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
pack();
setVisible(true);
class RendererPanel extends JPanel{
JLabel icon1, icon2;
RendererPanel(Color bg){
setLayout(new BoxLayout(this,BoxLayout.LINE_AXIS) );
icon1=new JLabel();
icon2=new JLabel();
add(icon1);
add(icon2);
icon1.setMinimumSize(new Dimension(0, 0));
icon2.setMinimumSize(new Dimension(0, 0));
icon1.setMaximumSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE));
icon2.setMaximumSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE));
setBackground(bg);
public void setIcons(IconPair value) {
icon1.setIcon(value.i1);
icon1.setToolTipText("Icon 1");
icon2.setIcon(value.i2);
icon2.setToolTipText("Icon 2");
//uncomment next 2 lines if you want text as well
icon1.setText(value.s1);
icon2.setText(value.s2);
class IconPair {
public Icon i1,i2;
public String s1,s2;
IconPair(String s1, String s2){
this.i1=(Icon)icons.get(s1);
this.i2=(Icon)icons.get(s2);
this.s1=s1;
this.s2=s2;
static Map icons = new HashMap();
public static void createIcons(){
Image img = new BufferedImage(10,10, BufferedImage.TYPE_INT_ARGB);
Graphics2D g2=(Graphics2D)(img.getGraphics());
g2.setColor(Color.BLUE);
g2.drawLine(0,0,10,10);
g2.drawLine(0,10,10,0);
icons.put("cross",new ImageIcon(img));
img = new BufferedImage(10,10, BufferedImage.TYPE_INT_ARGB);
g2=(Graphics2D)(img.getGraphics());
g2.setColor(Color.ORANGE);
g2.drawOval(1,1,8,8);
icons.put("circle",new ImageIcon(img));
}Note that the ... is a function of the JLabel when it is too small to render its text. -
We are attempting to add OfficeWriter report rendering extensions for SSRS 2012 in SharePoint (2010) integrated mode through powershell. The documentation for “New-SPRSExtension” is rather
sparse and we have not found any clear examples on the internet. With SSRS 2012 in native mode, we make the following two changes to the config files:
We add the following report rendering extension declaration to
RSReportServer.config:
<Configuration>
<Extensions>
<Render>
<Extension Name="XLTemplate" Type="SoftArtisans.OfficeWriter.ReportingServices.ExcelTemplateRenderer,
SoftArtisans.OfficeWriter.RS2008"/>
<Extension Name="WordTemplate" Type="SoftArtisans.OfficeWriter.ReportingServices.WordTemplateRenderer,
SoftArtisans.OfficeWriter.RS2008"/>
</Render>
</Extensions>
</Configuration>
We add the following security trust codegroup to
RSSvrPolicy.config:
<configuration>
<mscorlib>
<security>
<policy>
<PolicyLevel version="1">
<CodeGroup version="1" PermissionSetName="Nothing">
<CodeGroup
version="*"
PermissionSetName="FullTrust"
Name="SoftArtisans_OfficeWriter_Strong_Name"
Description="This
code group grants SoftArtisans OfficeWriter code full trust.">
<IMembershipCondition
class="StrongNameMembershipCondition"
version="*"
PublicKeyBlob="00240000048000009400000006020000002400005253413100040000010001004779CB207F11
5E86EF9DD3233F9F130F8891911345176650F72330F84CA3F54C96DEB08439680660F02872EEF5DA3955
A14C63F96E57DFB71B1535280C37DA2CB5BA37D78A9882414DB11F67FD66DEBC4AD93DD34F4A587D34D
B4D23D9C6AF83431D88A7EF42BB01082913F3560DCB50129C5BBA7ECA0DE8BC286DA74F58FADE"/>
</CodeGroup>
</CodeGroup>
</PolicyLevel>
</policy>
</security>
</mscorlib>
</configuration>
What would be the equivalent syntax for “New-SPRSExtension” to do the above for SSRS 2012 in SharePoint (2010) integrated mode?
Alison Bird SoftArtisans Technical Services www.softartisans.comHi Alison,
Unlike the deployment of other custom extensions such as custom delivery extension and data processing extension, it is not necessary to add a code group for the custom assembly that grants FullTrust permission for the extension during the deployment of
custom rendering extension. If you have copy the custom assembly to the %ProgramFiles%\Microsoft SQL Server\MSRS11.<InstanceName>\Reporting Services\ReportServer\Bin folder, and modify the RSreportserver.config file to add the extention entry properly,
please open the SSRS Service Application created on the SharePoint and verify that your extension is included in the list of available export types for a report.
Reference:
Deploying a Rendering Extension
Regards,
Mike Yin
TechNet Community Support -
My custom rendering extension is working in Report Builder (in RSReportServer.config), but not in Report Designer (in RSReportDesigner.config): instead of adding a "TXT" export option, it's just adding a duplicate "CSV" option.
SUMMARY:
Is there a way to get these features working, with Report Designer?
DETAILS:
We are running SSRS (Reporting Services) under SQL Server 2008 R2.
Here's my rendering section:
<Render>
<Extension Name="XML" Type="Microsoft.ReportingServices.Rendering.DataRenderer.XmlDataReport,Microsoft.ReportingServices.DataRendering" />
<Extension Name="CSV" Type="Microsoft.ReportingServices.Rendering.DataRenderer.CsvReport,Microsoft.ReportingServices.DataRendering" />
<!-- TXT extension with help from: http://social.msdn.microsoft.com/Forums/sqlserver/en-US/d79845a8-17fb-4ec6-b121-2c40cf466d73/how-do-i-add-a-pipe-delimited-option-in-ssrs-2008-report-manager?forum=sqlreportingservices -->
<Extension Name="TXT" Type="Microsoft.ReportingServices.Rendering.DataRenderer.CsvReport,Microsoft.ReportingServices.DataRendering">
<OverrideNames>
<Name Language="en-US">TXT(ASCII,NoColHds)</Name>
</OverrideNames>
<Configuration>
<DeviceInfo>
<FileExtension>txt</FileExtension>
<FieldDelimiter>,</FieldDelimiter>
<Encoding>ASCII</Encoding>
<NoHeader>true</NoHeader>
</DeviceInfo>
</Configuration>
</Extension>
<Extension Name="IMAGE" Type="Microsoft.ReportingServices.Rendering.ImageRenderer.ImageRenderer,Microsoft.ReportingServices.ImageRendering" />
<Extension Name="PDF" Type="Microsoft.ReportingServices.Rendering.ImageRenderer.PDFRenderer,Microsoft.ReportingServices.ImageRendering" />
<Extension Name="HTML4.0" Type="Microsoft.ReportingServices.Rendering.HtmlRenderer.Html40RenderingExtension,Microsoft.ReportingServices.HtmlRendering" Visible="false" />
<Extension Name="MHTML" Type="Microsoft.ReportingServices.Rendering.HtmlRenderer.MHtmlRenderingExtension,Microsoft.ReportingServices.HtmlRendering" />
<Extension Name="RPL" Type="Microsoft.ReportingServices.Rendering.RPLRendering.RPLRenderer,Microsoft.ReportingServices.RPLRendering" Visible="false" />
<Extension Name="EXCEL" Type="Microsoft.ReportingServices.Rendering.ExcelRenderer.ExcelRenderer,Microsoft.ReportingServices.ExcelRendering" />
<Extension Name="WORD" Type="Microsoft.ReportingServices.Rendering.WordRenderer.WordDocumentRenderer,Microsoft.ReportingServices.WordRendering" />
</Render>
When I add the above "TXT" section to RSReportServer.config, then Report Builder (and production) both show an export option "TXT(ASCII,NoColHds)".
But when I add this "TXT" section to RSReportDesigner.config, and then (in Report Designer / BIDS) attempt to export from a "Preview" of the report, the export drop-down does not show a "CSV" option followed by a "TXT"
option, but instead shows the "CSV" option twice.
This simply limits testing of the export option, to Report Builder... or requires any reports be published from Report Designer before they can be tested with
this export option.
(FYI, why this export option: compliance in our industry requires sending data to government agencies, in text files, with fixed-length columns, and ASCII encoding. Also, we're attempting to give the production of these files to the *users* managing
communication with those agencies... so we're putting them into SSRS.
I worked around the fixed length columns (and no delimiters -- no commas), by writing a version of the report where all string columns are padded, and all columns are concatenated, to form ONE LONG COLUMN... but Reporting Services' CSV export format produces
a Unicode file (UTF-8, which the agency rejected, because it had a leading "", or "EF BB BF" in hex), whereas the agency requires an ASCII file.)Hi Doug_atMidway,
According to your description, you want to enable your custom render extension. Right?
In Reporting Services, if you want to deploy the custom extension, you just need to add the extension into rsreportserver.config file. The
RSReportDesigner.config file stores settings about the rendering extensions available to Report Designer. Since you still use the csv rendering extension in your assembly, we don't need to do any modification in rsreportdesigner.config file. Pleaes
refer to the links below:
Thanks for attempting to help, Simon.
As my question states, I've *already done* both the above: changed (1) rsreportserver.config and (2) rsreportdesigner.config. I added the same code, shown above, to both files. I did that so I could see the new "txt" extension
both (1) when exporting in production and Report Builder, and (2) when exporting in Report Designer's "preview".
The change in (2) is not working: I do not see the "TXT" extension in Report Designer, when I try to export from a preview. Instead, Report Designer shows the CSV extension repeated.
Thanks for the docs. I consulted them (well, I consulted the EQUIVALENT pages, for SQL Server 2008 R2), when creating my block of code above.
Do you see anything to correct, in my code?
Are the features I'm using actually working, with rsreportdesigner.config?
Thanks again,
-- Doug
Maybe you are looking for
-
App store will not accept my Apple ID for updates after installing Mavericks?
I have recently installed Mavericks on my Macbook Pro. After installing it the two new updates for iPhoto and iMovie popped up. I click on the 'update' icon and I am prompted for my Apple ID as usual. After entering the correct ID the prompt disap
-
Capturing Hi Def Video and transfering XML files from IMovie
...I'm new to Mac, and FCP...worked on AVID for years...I have two questions I have a new Imac which came with FCP HD...I've hooked up my sony HDR-HC7 camcorder...When I attempt to capture, I cannot seem to find the capture screen, with machine contr
-
Business package for master reference data
Hi, can anyone know is there any business package for master reference data.i.e any standard iviews are there for MRD with workflow. Thanks, vinay
-
OCS problem in Solution manager 4.0
Hi All, When i import sap patch for PI Basis on Solution manager 4.0, Its imported successfully, but Status Bar in OCS shows me "is obsolete". when i tried to Define que, I am getting msg. "OCS package SAPKIPYJ78 does not match the current" Plea
-
Does anybody know what the settings (ODBC) are to connect with Access. I know where to change the settings, I indicated where to find the database but it still won't work. The name of the database is db1. This is my code: public class AccessDatabase