Loading dynamic Content
I'm developing a site for an Intranet. Depending on the logged user I want to show him the menues he has access to.
To do that I thought of writing a jsp page that shows the menu and include it in a main page. But how does the bean used in this jsp page know who logged in he previous page?
The solution I found is to save the user in a session, and add two methods in the bean that loads the menu to set a get the user. Is this a good solution?
The code of the jsp page that loads the menu is:
<jsp:useBean id="modulosId" class="beans.configMenu.BeanAdmModulos" />
<table width="40%" border="0">
<% String nombreUsr=(String)session.getAttribute("sesion.usuario");%>
<% modulosId.setUsuario(nombreUsr); %>
<% java.util.Vector modulos = modulosId.getModulos(); %>
<% for(int i = 0; i < modulos.size(); i++) { %>
<tr>
<%= modulos.elementAt(i)%>
</tr>
<%}%>
</table>
Related with this I have another question. The menues I will load will be in a database. Each time I load the menues I will have to query the database. Is it better to add to the session all the menues or querying the database each time I load the page wouldn't bring performance penalties?
Thanks for your comments
I'm developing a site for an Intranet. Depending on
the logged user I want to show him the menues he has
access to.
To do that I thought of writing a jsp page that shows
the menu and include it in a main page. But how does
the bean used in this jsp page know who logged in he
previous page?
The solution I found is to save the user in a
session, and add two methods in the bean that loads
the menu to set a get the user. Is this a good
solution?
User credentials are often cached in the session, so this is fine. Your main decision will be whether to check the user's authorization (privileges, roles, rights, etc.) with each request or to cache those results with the user's authentication (logon) credentials in the session as well.
The code of the jsp page that loads the menu is:
<jsp:useBean id="modulosId"
class="beans.configMenu.BeanAdmModulos" />You have the option here of declaring this bean's scope to be 'session'. Otherwise, this is fine if you are manually checking the session itself (as you are doing below).
<table width="40%" border="0">
<% String
ng
nombreUsr=(String)session.getAttribute("sesion.usuario
");%>
<% modulosId.setUsuario(nombreUsr); %>
<% java.util.Vector modulos =
= modulosId.getModulos(); %>
<% for(int i = 0; i < modulos.size(); i++) { %>
<tr>
<%= modulos.elementAt(i)%>
</tr>
<%}%>
</table>
Related with this I have another question. The menues
I will load will be in a database. Each time I load
the menues I will have to query the database. Is it
better to add to the session all the menues or
querying the database each time I load the page
wouldn't bring performance penalties?
It is a speed versus memory tradeoff. If you are going to cache the menus, I would suggest caching the mapping between a role and a menu (or whatever equivalent exists in your app). There should be fewer roles than users; hence, this should use less memory. The solution may need some tweaking if users can have multiple roles.
Thanks for your commentsYou're welcome.
- Saish
Similar Messages
-
Alternative scrollpane to load dynamic content
I'm trying to load jpgs to my scrollpane dynamically. I
noticed the compiled scrollpane component in flash 8 is very large
in size (> 130kb) which i cannot afford to use. Instead I'm
using the flash 6 scrollpane which is not precompiled and only
several kbs after compiling to swf. However, I have problem
rendering loaded dynamic contents onto the pane. The first load
after starting flash 8 was always successful. After that, it fails.
In case anyone's interested, I have simple test code to demonstrate
the problem, and have uploaded it to
http://www.filesend.net/download.php?f=1c5d80093f0b68cdcf7fe4cca0e0c923
(you'll need to wait for 10 secs before the download button appears
on that linked page)
I'm just wondering what is the best choice of a small size
scrollpane that handles dynanimic MovieClip.loadMovie() well. Any
suggestions?i just found out that scrollpane component is not that huge
(only 38kb). Does anyone know why when I add it to my project my
swf increases by 130kb? -
Loading dynamic content in an accordion panel?
Basically I am looking to be able to incorporate the type of
functionality that is shown in the Products demo, except using an
accordion instead of the table - so the xml would feed into the
accordion, and the the data in the accordion would be clickable and
update a photo and a description section. Right now I'm having a
hard time getting my head around getting the accordion to be the
master region and be able to update the photo and descriptor detail
regions.
Any help or suggestions are more than welcome. Thanks in
advance for your time-
-ChuckHi Chuck,
You can have that master-detail relation using an accordion
instead of a table if add a special region called detailed region.
We have an example of an accordion that uses data. Check the
sample
here.
If you want to build the detailed region, add somewhere in
your page a region and set spry:detailregion attribute on it.
For example, for the link I gave you above, add this code as
detail region:
<div spry:detailregion="dsEmployees">
<p>{phone}</p>
</div>
and on one field from accordion add the spry:setrow attribute
to get that update.
<div class="AccordionPanelContent"><p
spry:setrow="dsEmployees">{firstname}</p>
The code I gave you works with the accordion sample above
mentioned.
Please let us know if you have other questions,
Diana -
Spry Tabbed panels + Progressive Enhancement and Dynamic Loading of Content With Spry
Is there any way to combine tabbed panels together with "Progressive Enhancement and Dynamic Loading of Content With Spry"?
Visit: http://labs.adobe.com/technologies/spry/articles/best_practices/progressive_enhancement.ht ml#updatecontent
And click on the "Using Spry.Utils.updateContent()"
The 3rd example shows how to use a fade transition whenever the content changes.
I already have tabbed panels. My menu contains buttons (on tabs) and my Content div contains the panels.
Tabs code;
<ul class="TabbedPanelsTabGroup">
<li class="TabbedPanelsTab">
<table class="Button" >
<tr>
<td style="padding-right:0px" title ="Home">
<a href="javascript:TabbedPanels1.showPanel(1);" title="Home" style="background-image:url(/Buttons/Home.png);width:172px;height:75px;display:block;"><br/></a>
</td>
</tr>
</table>
</li>
etc
etc
etc
and the panel code:
<div class="TabbedPanelsContent" id="Home">
CONTENT
</div>
I hoped i can use the example code from the link into my tabbed panels.
I thought this code:
onclick="FadeAndUpdateContent('event', 'data/AquoThonFrag.html'); return false;"
could be added to the tab code like this:
<a href="javascript:TabbedPanels1.showPanel(1);" onclick="FadeAndUpdateContent('event', 'data/AquoThonFrag.html'); return false;" title="Home" style="background-image:url(/Buttons/Home.png);width:172px;height:75px;display:block;"><br/></a>
But the content doesnt fade...
I know i need to change the header etc.
The following is from the link:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:spry="http://ns.adobe.com/spry">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Aquo Events</title>
<script src="../../../includes/SpryEffects.js" type="text/javascript"></script>
<script src="../../../includes/SpryData.js" type="text/javascript"></script>
<script type="text/javascript">
<!--
function FadeAndUpdateContent(ele, url)
try {
Spry.Effect.DoFade(ele,{ duration: 500, from: 100, to: 0, finish: function() {
Spry.Utils.updateContent(ele, url, function() {
Spry.Effect.DoFade(ele,{ duration: 500, from: 0, to: 100 });
}catch(e){ alert(e); }
-->
</script>
<style type="text/css">
/* IE HACK to prevent bad rendering when fading. */
#event { background-color: white; }
</style>
</head>
So i changed my header etc, put the SpryEffects.js and SpryData.js into position and nothing changed...
Is there a way to keep my tabbed panel (or change as less as possible) and let
A. The fade work
B. The loading work.
The problem now is that it loads all pages instead of only the home. Therefore i wanted this Progressive Enhancement.
And the fading part is just because its nice...It doesnt show in the post but off course i changed this link;
"data/AquoThonFrag.html"
into;
"javascript:TabbedPanels1.showPanel(1);"
I must say i dont know if this even works... -
Edge Animate CC 2014 - code (eg. compositionReady). How to enter the code to work.
Edge Animate - compositionReady
sym.$("container01").load("page.html #box01");
This is the file to be loaded - page.htm
<head>
<script src="http://example.com/inc/carousel.js?ver=4.1"></script>
</head>
Body
<body>
<div id="box01">
<style type="text/css" media="screen">
#box01 { height: 1%; margin: 30px 0 0; overflow:hidden; position: relative; padding: 0 50px 10px; }
</style>
<script>
jQuery(document).ready(function(){jQuery('#gallery').carousel({ buttons: true, interval: true, });});
</script>
</div>
</body>
On the page.html and ID = "box01" is dynamic content (gallery)
which loads a by means of an additional js script.
How do I load the page to see it animate edge?
I load through an iframe, but I need only a part of the page. So one div.
Something is missing, as in this writing is not working.
Is loaded into the container only one photo and no animation offset.
I greet.If you're using Fluid Grid Layouts, none of these methods will work. I think the very best you can do is determine the min-height required for desktops & tablets. Mobile devices don't need min-height because those divisions will stack on top of each other.
To illustrate with a working example,
http://alt-web.com/FluidGrid/Fluid2.html
The relevant CSS code:
/* Special Rules for Tablets */
@media only screen and (min-width: 481px) {
.gridContainer >div {min-height: 255px;}
/* Special Rules for Desktops */
@media only screen and (min-width: 1025px) {
.gridContainer >div {min-height: 325px;}
Nancy O. -
Mixing static and dynamic content in a single outputText value causes NPEs
Hi,
I am having a problem and I'm wondering if it is a result of my error or if this is a bug.
I am mixing dynamic and static content in the value attribute of tags (e.g., outputText). On initial page load, everything works fine. However, if the same view is reloaded (e.g., after a failed validation) I get an NPE from JSF:
[#|2006-10-24T08:49:03.756-0500|SEVERE|sun-appserver-pe8.2|javax.enterprise.system.container.web|_ThreadID=12;|StandardWrapperValve[Faces Servlet]: Servlet.service() for servlet Faces Servlet threw exception
java.lang.NullPointerException
at com.sun.faces.el.MixedELValueParser.getNextToken(MixedELValueParser.java:140)
at com.sun.faces.el.MixedELValueParser.parse(MixedELValueParser.java:123)
at com.sun.faces.el.MixedELValueBinding.getValue(MixedELValueBinding.java:60)
at javax.faces.component.UIOutput.getValue(UIOutput.java:147)
at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:82)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:201)
at com.sun.faces.renderkit.html_basic.LabelRenderer.encodeBegin(LabelRenderer.java:128)
at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:683)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:443)
at com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:233)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:701)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:445)
at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:130)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:701)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:445)
at com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:233)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:701)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:445)
at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:130)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:701)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:445)
at com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:233)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:701)
at javax.faces.webapp.UIComponentTag.encodeChildren(UIComponentTag.java:609)
at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:546)
at com.sun.faces.taglib.html_basic.PanelGridTag.doEndTag(PanelGridTag.java:460)
at org.apache.jsp.registration_jsp._jspx_meth_h_panelGrid_0(registration_jsp.java:324)
at org.apache.jsp.registration_jsp._jspx_meth_h_form_0(registration_jsp.java:223)
at org.apache.jsp.registration_jsp._jspx_meth_f_view_0(registration_jsp.java:157)
at org.apache.jsp.registration_jsp._jspService(registration_jsp.java:118)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:105)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:336)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:297)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:247)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
at sun.reflect.GeneratedMethodAccessor188.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:257)
at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:723)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:482)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:417)
at org.apache.catalina.core.ApplicationDispatcher.access$000(ApplicationDispatcher.java:80)
at org.apache.catalina.core.ApplicationDispatcher$PrivilegedForward.run(ApplicationDispatcher.java:95)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:313)
at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:326)
at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:132)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:248)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:194)
at sun.reflect.GeneratedMethodAccessor202.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:257)
at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:263)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:225)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:132)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:189)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.doProcess(ProcessorTask.java:604)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:475)
at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:371)
at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:264)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:281)
at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:83)My code looks like this:
<h:outputText escape="false"
value='<link href="#{myBean.styleSheet}" rel="stylesheet" type="text/css" />' />If I replace this with a much more convoluted set of tags, it works:
<h:outputText escape="false"
value='<link href="' /><h:outputText escape="false" value="#{myBean.styleSheet}"
/><h:outputText escape="false" value='" rel="stylesheet" type="text/css" />' />So is the problem that I am mixing dynamic and static content with a single value? If so, why does it work on the first view, and not after?
If it matters, I'm using the reference implementation version 1.1 (as included with NetBeans 5.5RC2) on SuSE 10.0 w/ JDK 1.5_09.
Thanks,
BillYes, that's how I originally had it, but then changed it to the outputText approach since a single tag could do what I wanted, as long as I was allowed to mix static and dynamic content within a single value.
I think this is a bug in JSF 1.1, since if what I am doing is illegal, it should throw an exception on the first page view, not work on first view and throw an exception on subsequent views. I'm guessing that this has something to do with the fact that on first page view it only runs the restore view and render response JSF phases, while on subsequent requests all of the phases will be run, and it's in one of those other phases that the exception is thrown.
For now, multiple tags is the work-around, I guess.
Thanks,
Bill -
Load XML content into HTML enabled TextField
I'm trying to figure out how to use html such as <br />
loaded from an XML element into a TextField.. if I use something
like
<desc>my description<br />line 2</desc> I
get 3 nodes instead of one when loading the XML file. If I use
something like <desc>my description<br />line
2</desc> then I get <br /> in the actual text.
Can anyone clue me in as to how to store HTML in an XML
element so I can load the content into a Dynamic TextField with
HTML enabled?
Thanks much!use the latter in your xml and use the htmlText property of
your html-enabled textfield to display your text. -
PHP dynamic content for form list field on tabbed panel
I have been trying to use PHP dynamic content to populate a
form list field. Works fine on a regular page, but doesn't seem to
work (or works very erratically) if the form is on a tab of a Spry
tabbed panel. Erratically means (as I've observed) the values will
appear if the list field is the second on a tab but not the first.
Haven't tried three on a tab... Anyone know if this is supposed to
work?Thank You !!! to both of you above.
Shant,
The scheme youv'e proposed makes sense and I had thought of the same before posting the question. I already did a little POC on it but then realised this works if I can use complete list of values of 1st Field to decide the value of 2nd and so forth. But I rather need to know which one among those was clicked. Moreover, my right side list is usually not null when page loads for the first time (bcoz Field name is a path exp).
Also, the real problem here is that, when I click on different values on the right side of multi-select(already selected values) of 1st Field, allowedValues and Derivation of 2nd should change. That GUI event is not capturable from whatever I've been able to read (onClick is not applicable for MultiSelect, and onChange doesn't serve my purpose, coz I need to know what value was clicked on).
The solution I thought and implemented was to take the right side of multi-select, into an extra (read redundant), single-select Field. And then have the 2nd multi-select depend on it via Derivation and allowedValues.
Having two redundant single-selects, isn't the most elegant solution but I can't think of anything better. Any thoughts ???
If I'm not really overlooking something MultiSelect class should have an extra Property exposed....
- AndyDev
Edited by: AndyDev on Nov 6, 2007 2:04 PM -
Spry - load tab content only when clicked / selected
I'm considering spry to create a multi-tab page layout.. tabs
such as 'account', 'balance', 'bin', 'history', etc.
Each tab's content is dynamic and based on moderately
demanding DB calls. Is there a way to set Spry such that
- only the default selected tab's content (on page load) is
'filled', while the content of other tabs is generated only upon
user's click?
- once a tab's content is loaded, not regenerate its dynamic
content? I think I have an idea how to do this, but doesn't hurt to
ask.
thanks.quote:
Originally posted by:
shanbyrt
Brandan98,
I have a little script that sets the default panel whenever I
click on a tab.
I know it sounds redundant, but if/when the page reloads
onclick it reloads the default tab's contents. Just so you know I'm
not talking about persistent state stuff that V1 addressed in other
posts. :)
here's the script that I have that sets default tabs
<script type="text/javascript">
function setPanel(pan){
if (pan == 1){
var tp2 = new Spry.Widget.TabbedPanels("tp2", {defaultTab:
0});
if (pan == 2){
var tp2 = new Spry.Widget.TabbedPanels("tp2",{defaultTab:
1}); }
var tp2 = new Spry.Widget.TabbedPanels("tp2");
</script>
It seems to work for me, but may not be the best approach.
Byron
Hi Byron,
If i understand you right, this script sets the current tab
as default so if the page refreshes it reloads the current tab not
the first tab? If so this is exactly what i'm after! I'm not hot on
javascript so could you possibly expand a little on how i would
implement this in a php page??
Thanks, Mike :) -
Hello, does anyone have experience implementing dynamic
contents to load from a Database into flash? I am trying to take up
a new project that will require data to be loaded from a DB. Any
turorials or help files would be great.Hi
Check out this
Video Tut.
It will get ya started. -
I am new to RoboHelp (using ver 7) and just went through the
excellent "Essentials of Adobe
Robohelp 7 HTML". I have been tasked with something I did not
find in the book...embedding
dynamic content. In other words, can the Help output use an
external data source to tailor its results?
For example, RoboHelp has a pre-loaded selection criteria of
customer names, and depending on whihc
one is selected, it retireves and embeds data from an
external source for that customer into the
Help web. Is this possible?Welcome to our community, Gary
RoboHelp doesn't quite work that way. Normally you have all
the content static and present on either a server or inside a .CHM
file. Much like a static Web Site would work.
Assuming you are creating web based help, I suppose it would
be possible to achieve what you are looking for by creating
Framesets or Inline Frames. Then populating a frame with dynamic
content.
Perhaps if you can more fully flesh out exactly what choosing
a particular customer number would result in, we might offer some
alternatives for achieving it using RoboHelp.
Cheers... Rick -
Print Dynamic Content with printJob
I recently developed a help resource application that builds
the interface and loads all the main and sub navigation items,
pages contents, and related resources dynamically. This was to make
it easy to provide search and print functionality, as well as
interface scalability. Therefore my print feature creates a print
layout MovieClip (so as to format well for 8.5 x 11 and printer
margins) and loads the appropriate text content related to the
visible page on screen when the print button is pressed.
I thought the print was all set to go, but what I found out
is that once you print a page of the Help Resource application that
same page prints in place of any other page you print from there on
out.
My print button calls a function that pulls all the
appropriate dynamic data (page title, page contents, related
resource names, etc.) and formats it as HTML and adds it to my
print layout MovieClips text field (docPrint._txt).
That function then calls my printJob function which creates a
blank sprite, adds my print layout movieclip to that sprite,
resizes the print layout MovieClip’s text field to fit
appropriately within the printer margins and prints the file.
Anyone have any ideas why my dynamic content prints as the
same page each time? Note that if I trace the contents of my text
field for my print layout MovieClip the contents change each time,
but the print stays the same.
Sorry for the long post and huge thanks to anyone who may
have an answer.
Have a great day!I am responding to my own post as I found a solution, though
I am now about bald from pulling all my hair out. Hopefully this
helps even one random soul in the future as the printJob class
seems to be one of the hardest to get help with or find information
online that pertains.
My code dynamically creates print page contents based on the
on screen contents the user is currently viewing within my
application. My print functions were always printing the first page
that was printed no matter what page within the application the
user was viewing.
As I have learned to do, I was declaring the variables for my
print objects in the root of my actionScript (outside all the
functions so they could be accessed across functions).
I had two variables:
var docPrint:document = new document(); // A MovieClip layout
for my print page located in my library
var printPage:Sprite = new Sprite(); // The Sprite to hold my
MovieClip for print purposes as a sprite is required
I also had two functions:
docContentsLoad(); // Loaded contents into docPrint Movieclip
and formatted
printJob(); // Created print job, adjusted docPrint for
printer settings, and sent print
It turns out the easiest solution was to combine my two
functions into one printJob function and place my two variables
(docPrint & printPage) at the beginning of the function. Now
the printing works fine everytime. No more repeat pages.
My assumption is that the only way to truly reset the print
document is to delcare the variables within the function being
called to print the document so that they are redeclared each
time. -
Sporadic issues uploading large dynamic content blocks using REST API
I have been using calls to endpoints like https://secure.eloqua.com/API/REST/1.0/assets/dynamicContent/157 (where "157" is a content block ID) to update existing dynamic content blocks. This has generally worked well for about a month and a half. Starting Saturday morning around Midnight, though, the majority of these calls started failing, with socket error "connection was forcibly closed by remote host".
That's the .NET verbiage; at a lower level, this is socket error #10054. When using CURL, I get the result pictured below:
This is sporadic; over the course of today, maybe 25% of these calls have succeeded and 75% have failed. The calls are mostly identical. At other times, we've gone days, maybe weeks without an issue, and I figured that the isolated failures of this sort that we did get related to scheduled downtime, loss of connectivity, and other transient conditions.
The payload (PUT data) I'm sending up is ~450KB of JSON. It contains the top-level details about the block itself, plus all of the dynamic content / rules criteria, including the default.
At first, I wondered if some sort of weird character (ampersand, less than / greater than...) had entered my data, flowed into the API call unescaped, and created a problem (e.g. invalid JSON). However, I did some troubleshooting, and the failure we're seeing does not seem to correlate with the absence or presence of any one content / rule item in particular. Rather, it seems to be volume related, i.e. I can send any one of the rules I want to create, or just a few, and that will succeed. But I cannot send all (or most) of the rules at once without experiencing failures most of the time (lately).
So, if there were a way for me to split up the creation of the block over multiple API calls (one call to create the block, another to add the default content rule, yet another for the first non-default content rule, and so on), I think that would work. I find no indication on Topliners or in the Eloqua API documentation to indicate that this is possible, though.
It has occurred to me that we are over some API call threshold. I know that some Eloqua installations have a per-day API call limit as low as 20,000. My question is, what do I see when I exceed the limit? Do I get the "forcibly closed" error, or another error perhaps, or is my activity simply throttled by the server? And is there somewhere in Eloqua that I can see where I stand with respect to this limit?
Finally, I know we've done some things recently that have increased our overall processing load on the Eloqua servers. In particular, a larger number of contacts than previously have been flowing in from our CRM system. One theory I had was that we're allocated a certain amount of total processing power, and that if we overload this capacity complex API calls are subject to timing out. (My communications timeout is set to 10 minutes, and the error message comes up after about 2-3 minutes, but I don't know what kind of timeouts Oracle might have set up on their own equipment.) That being said, my code needs to basically wait indefinitely for this data, and certainly not give up after 2-3 minutes. If there's a way to indicate this fact to Oracle, I'd certainly like to know about that.
Thank you all for reading and attempting to help!Hi James,
As far as I have been told (by Support) is that the API Limit is a soft limit that is not currently enforced.
I have seen other API endpoints failing from time to time (mostly on the BULK API) and have had to write logic to redo calls that fail. My failures seems to occur primarily due to server load and I can force them by making allot of exports at the same time.
In regards to the Dynamic Content Rules I think that you might be able to make the rules one/two rules at the time. What I would test is to make a Dynamic Content with only the default content. Then loop through your rules and only have new rules in the Rules section of the Dynamic Content.
One more thing. Try using the REST/2.0 endpoint. -
Need some help with dynamic content
Okay so I have made a whole site design from the ground up, yea I know thats the easy part haha. Well now we have came into a problem in the coding aspect of the design. For the site we have dynamic content involved that is coded with PHP/HTML. The website contains a user system that requires them to log into view the content of the page.
Well the issues I am having is I can not get flash to load this external file into a frame I have designated for it. Im not sure if flash can load external PHP/HTML and I need help to figure this issue out since I am new to Flash.
Thank you for your time,
Chris.One other thing you might try searching for, though to me it's just vague hearsay... Someone may have written a class that can be use which enhances Flash's limited html capabilities and allows for thml content to be displayed (possibly being its own version of a browser of sorts)... but like I said, it's only hearsay to me, assuming I'm remembering the right hear.
-
The information to be shown on the page has to be loaded dynamically from the database. As opposed to creating in static jsp pages, the fields and their attributes (name, label, etc.) are stored in the database tables, mag_registration_form_header and mag_registration_form_fields.
So somehow i have to be able to display all the fields and there data on a JSP. The motive behind this is that there will be something like a common template which many modules can use and there will be a single jsp file which will display the contents as per the event...
The template will be prepared in the java end..
This has to be done using struts framework....AJAX (and a JSP/Servlet that delivers the info the AJAX call requests).
Edit: If you're talking about changing info already appearing on a loaded page.
And how is the answer not JSP, when you yourself said you would use JSP to display it.
I don't believe you know enough about any of this to even be starting on this "project".
Maybe you are looking for
-
iphone 4 version 5.0 (9A334) won't sync with itunes 10.5 (141).... this message keeps popping up when I try to sync my iphone "could not be synced because the sync server failed to sync the iphone" anyone have this kind of problem? googled it, and it
-
Calculation View computing 1 million net present values using BFL procedure
Hi, i have around 1 Million financial positions in a position table and for each of them i want to calculate the net present value using SAP HANA BFL procedure _SYS_AFL.AFLBFL_NETPRESENTVALUE_PROC. The necessary cash flows, interests, etc. (used as i
-
Why does time machine close open applications? eg firefox, mail ...
since the latest update of time machine, a few days/weeks ago (sorry i can't be more precise), it seems that open applications close themselves. i've tried disabling time machine, and then all stay open, for hours ... so i'm blaming time machine. i d
-
Regarding Select without Where clause
Hi we have below code for F4HELP on invoice input field. you can see Select statement used without Where condition to fetch records from Ztable. and deleting the duplicating records. SCI error says,"Large table : it has no where condition. /No field
-
Automatic Purchase order approval
Hi Friends, we are generating Automatic purchase order for drop shipping material.And business clients wants to have automatic approval. Is there any configuration settings to have Automatic approval for Automatic Purchase Order?. Thanks