OpenLogger is giving the me the following error:
Expression Language Interpret Exception Error:Method
NotesXspDocument.getItemValueInteger(number) not found, or illegal
parameters - Error on chkReview:
Interpret exception
Error:Method NotesXspDocument.getItemValueInteger(number) not found,
or illegal parameters
The component chkReview only has 2 lines where getItemValueInteger is used, which is on the onClick event (single checkbox):
var reviewField:string = "numberOfReviewQuestions"+compositeData.reviewTeam;
var currentNumberReview = document1.getItemValueInteger(reviewField);
var sectionReview:string = compositeData.section + compositeData.reviewTeam;
var currentNumberSection = document1.getItemValueInteger(sectionReview);
compositeData.reviewTeam & compositeData.section both return a string. As such, I'm not sure if I have tunnel vision or not, however, I can't see what's wrong with my code? Can anyone point in the right direction? Stack trace below if this helps, and full onClick code also, thanks:
try{
var strCurrVal = getComponent('txtReviewSummary').getValue();
var strNewVal ="";
var strText ="";
var dt = new Date();
var strUser = userBean.getDisplayName();
var reviewField:string = "numberOfReviewQuestions"+compositeData.reviewTeam;
var currentNumberReview = document1.getItemValueInteger(reviewField);
var sectionReview:string = compositeData.section + compositeData.reviewTeam;
var currentNumberSection = document1.getItemValueInteger(sectionReview);
if (getComponent('chkReview').getValue() == "true") {
// checkbox selected - do something
var dateTimeFormat = new java.text.SimpleDateFormat("dd/MM/yyyy kk:mm");
var dateTimeString = dateTimeFormat.format(dt);
var strReview = " - [Review] - ("+dateTimeString+" - " + strUser + ")";
strNewVal = strCurrVal+strReview;
strText = "Review complete for " + compositeData.fieldName;
document1.replaceItemValue(reviewField, currentNumberReview-1);
} else {
// checkbox not selected- do something else
strNewVal = #Left(strCurrVal, " - [Review]");
strText = "Removed review for " + compositeData.fieldName + ". Previous value was: " + strNewVal;
document1.replaceItemValue(reviewField, currentNumberReview+1);
}
var arrNotes:array = AddNoteItem(currentDocument, dt, strText, strUser);
document1.replaceItemValue(concatReviewSummary, strNewVal);
document1.save();
}catch(e){
openLogBean.addError(e,this.getParent());
}
> com.ibm.jscript.InterpretException: Interpret exception at
> com.paulwithers.openLog.OpenLogErrorHolder.getInterpretException(OpenLogErrorHolder.java:114)
> at
> com.paulwithers.openLog.OpenLogErrorHolder.addError(OpenLogErrorHolder.java:216)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:90)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
> at java.lang.reflect.Method.invoke(Method.java:508) at
> com.ibm.jscript.types.JavaAccessObject.call(JavaAccessObject.java:322)
> at com.ibm.jscript.types.FBSObject.call(FBSObject.java:161) at
> com.ibm.jscript.ASTTree.ASTCall.interpret(ASTCall.java:197) at
> com.ibm.jscript.ASTTree.ASTTry.interpretCatch(ASTTry.java:150) at
> com.ibm.jscript.ASTTree.ASTTry.interpret(ASTTry.java:113) at
> com.ibm.jscript.ASTTree.ASTProgram.interpret(ASTProgram.java:119) at
> com.ibm.jscript.ASTTree.ASTProgram.interpretEx(ASTProgram.java:139) at
> com.ibm.jscript.JSExpression._interpretExpression(JSExpression.java:435)
> at com.ibm.jscript.JSExpression.access$1(JSExpression.java:424) at
> com.ibm.jscript.JSExpression$2.run(JSExpression.java:414) at
> java.security.AccessController.doPrivileged(AccessController.java:730)
> at
> com.ibm.jscript.JSExpression.interpretExpression(JSExpression.java:410)
> at com.ibm.jscript.JSExpression.evaluateValue(JSExpression.java:251)
> at com.ibm.jscript.JSExpression.evaluateValue(JSExpression.java:234)
> at
> com.ibm.xsp.javascript.JavaScriptInterpreter.interpret(JavaScriptInterpreter.java:222)
> at
> com.ibm.xsp.binding.javascript.JavaScriptMethodBinding.invoke(JavaScriptMethodBinding.java:111)
> at
> com.ibm.xsp.application.ActionListenerImpl.processAction(ActionListenerImpl.java:60)
> at javax.faces.component.UICommand.broadcast(UICommand.java:324) at
> com.ibm.xsp.component.UIEventHandler.broadcast(UIEventHandler.java:366)
> at
> com.ibm.xsp.component.UIDataPanelBase.broadcast(UIDataPanelBase.java:400)
> at
> com.ibm.xsp.component.UIDataPanelBase.broadcast(UIDataPanelBase.java:400)
> at
> com.ibm.xsp.component.UIDataPanelBase.broadcast(UIDataPanelBase.java:400)
> at
> com.ibm.xsp.component.UIDataPanelBase.broadcast(UIDataPanelBase.java:400)
> at
> com.ibm.xsp.component.UIDataPanelBase.broadcast(UIDataPanelBase.java:400)
> at
> com.ibm.xsp.component.UIViewRootEx.broadcast(UIViewRootEx.java:1535)
> at
> javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:307)
> at
> javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:428)
> at
> com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:94)
> at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:210)
> at
> com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:96)
> at
> com.ibm.xsp.controller.FacesControllerImpl.execute(FacesControllerImpl.java:256)
> at com.ibm.xsp.webapp.FacesServlet.serviceView(FacesServlet.java:227)
> at
> com.ibm.xsp.webapp.FacesServletEx.serviceView(FacesServletEx.java:157)
> at com.ibm.xsp.webapp.FacesServlet.service(FacesServlet.java:159) at
> com.ibm.xsp.webapp.FacesServletEx.service(FacesServletEx.java:138) at
> com.ibm.xsp.webapp.DesignerFacesServlet.service(DesignerFacesServlet.java:103)
> at
> com.ibm.designer.runtime.domino.adapter.ComponentModule.invokeServlet(ComponentModule.java:588)
> at
> com.ibm.domino.xsp.module.nsf.NSFComponentModule.invokeServlet(NSFComponentModule.java:1335)
> at
> com.ibm.designer.runtime.domino.adapter.ComponentModule$AdapterInvoker.invokeServlet(ComponentModule.java:865)
> at
> com.ibm.designer.runtime.domino.adapter.ComponentModule$ServletInvoker.doService(ComponentModule.java:808)
> at
> com.ibm.designer.runtime.domino.adapter.ComponentModule.doService(ComponentModule.java:577)
> at
> com.ibm.domino.xsp.module.nsf.NSFComponentModule.doService(NSFComponentModule.java:1319)
> at
> com.ibm.domino.xsp.module.nsf.NSFService.doServiceInternal(NSFService.java:662)
> at
> com.ibm.domino.xsp.module.nsf.NSFService.doService(NSFService.java:482)
> at
> com.ibm.designer.runtime.domino.adapter.LCDEnvironment.doService(LCDEnvironment.java:357)
> at
> com.ibm.designer.runtime.domino.adapter.LCDEnvironment.service(LCDEnvironment.java:313)
> at
> com.ibm.domino.xsp.bridge.http.engine.XspCmdManager.service(XspCmdManager.java:272)
> Caused by: java.lang.Throwable: Error:Method
> NotesXspDocument.getItemValueInteger(number) not found, or illegal
> parameters at
> com.paulwithers.openLog.OpenLogErrorHolder.getInterpretException(OpenLogErrorHolder.java:113)
> ... 52 more
Slightly different take then Paul (although he may be correct), XPage runtime is interpreting the composition of reviewField or sectionReview as a number, and attempting to find a method "getItemValueInteger" that runs using a numeric parameter.
I'd focus in on this:
var sectionReview:string = compositeData.section + compositeData.reviewTeam;
as the other seems to be unambiguously a String; good to remember that the ":string" are hints but not contracts, so you might want to coerce the composition of compositeData.section and compositeData.reviewTeam into a string, to be certain.
Example:
var reviewField:string = "numberOfReviewQuestions"+compositeData.reviewTeam;
var currentNumberReview = document1.getItemValueInteger(#Text(reviewField));
var sectionReview:string = compositeData.section + compositeData.reviewTeam;
var currentNumberSection = document1.getItemValueInteger(#Text(sectionReview));
I'm drawn to this approach as for me, when compositeData is unavailable, I get null pointer exceptions, not data type errors, in similar structures. Similarly, if document1 is unavailable or uninitialized, the error is generally not a method invocation error, but that document1 is null or not an object.
Most likely it's a timing issue. The assumption is false that everything on your XPage is processed in a single pass, so if it's on the XPage, it must exist. The compositeData variable probably hasn't been set at the time you're trying to use it. Confirm that by printing out the value. The other scenario, less likely, is document1 hasn't been initialised yet. Again, you can check that in your code by calling a standard non-parameterised method (getNoteID() may work).
Related
On the Sofascore.com site, I will automatically take the link in cell A1 at https://www.sofascore.com/tr/football/2022-11-16 or similar, and run it in the for next loop and print some information of the matches on my table. In order to print the information, I first have to click on each match one by one. I also do this with CSS.Click. But since I'm going to do this over and over, I definitely need a loop. CSS links are very similar to each other, only 1 number changes for each match. The first thing that comes to my mind is a next loop for CSSs that automatically picks up the next CSS code, but I don't have enough knowledge. I want to consult experts, thanks in advance.
I am open to all suggestions.
Sub sofascore()
Dim x As New Selenium.ChromeDriver, i, sonsat As Integer
x.SetProfile "C:\Users\Oğuzhan\AppData\Local\Google\Chrome\User Data"
x.AddArgument ("user-data-dir=C:\Users\xyz\AppData\Local\Google\Chrome\User Data\System Profile")
x.Start "chrome", "https://www.sofascore.com/"
x.Window.Maximize
Set ks = New Selenium.Keys
sonsat = Sheets("veri").Range("A10000").End(xlUp).Row
For i = 2 To sonsat
On Error Resume Next
x.Get Range("A" & i).Value
'CLICK THE SHOW ALL MATCHES ON THE SITE.
x.FindElementByCss("#__next > div > main > div.sc-
hLBbgP.dRtNhU.sc-cabffeca-0.QpfGa > div.sc- hLBbgP.sc-eDvSVe.gjJmZQ.fEHohf.sc-cabffeca-1.iITCqu > div.sc-hLBbgP.tYcjv.sc-cabffeca-2.loALSf > div > div.sc-hLBbgP.sc-eDvSVe.bdzsxu.hryjgv > button > div > span").Click
x.SendKeys ks.Home
x.Wait 200
'CLICK ON MATCH 1 ON THE LIST
x.FindElementByCss("#__next > div > main > div.sc-hLBbgP.dRtNhU.sc-cabffeca-0.QpfGa > div.sc-hLBbgP.sc-eDvSVe.gjJmZQ.fEHohf.sc-cabffeca-1.iITCqu > div.sc-hLBbgP.tYcjv.sc-cabffeca-2.loALSf > div > div:nth-child(2) > div > div > div:nth-child(2) > a > div > div > div.sc-hLBbgP.dRtNhU.sc-9199a964-1.kusmLq").Click
x.Wait 1500
'THE FOLLOWING CODES PRINT THE MATCH DATA INTO THE COLUMNS.
codes..
..
'THIS IS IMPORTANT NOW. FOR MATCH 2, THE LOOP STARTS AGAIN AND WITH THE EXACT SAME CODES. HERE I HAVE TO MANUALLY WRITE THE 2nd CSS CODE :(
x.FindElementByCss("#__next > div > main > div.sc-hLBbgP.dRtNhU.sc-cabffeca-0.QpfGa > div.sc-hLBbgP.sc-eDvSVe.gjJmZQ.fEHohf.sc-cabffeca-1.iITCqu > div.sc-hLBbgP.tYcjv.sc-cabffeca-2.loALSf > div > div:nth-child(2) > div > div > div:nth-child(3) > a > div > div > div.sc-hLBbgP.dRtNhU.sc-9199a964-1.kusmLq").Click
x.Wait 1500
'Same codes upper
....
...
...
Next
End Sub
I've tried many ways but probably nonsense. Expert comments will enlighten me.
I have a case where I am trying to scrape multiple pages, but I noticed that the desired part to scrape is different sometimes and this makes me to use IF statements to check for the existence of object like that
Set obj = html.querySelector("div > blockquote > p > span > strong")
If obj Is Nothing Then
Set obj = html.querySelector("div > blockquote > p > strong > span")
If obj Is Nothing Then
Set obj = html.querySelector("div > blockquote:nth-child(14) > p > strong")
If obj Is Nothing Then
Set obj = html.querySelector("div > blockquote:nth-child(13) > p > strong")
If obj Is Nothing Then
Set obj = html.querySelector("div > blockquote:nth-child(12) > p > strong")
End If
End If
End If
End If
Is there an alternative and more reliable way to solve such a problem?
You have to know there are more cases for the element
Without actual html to work with unsure if there are additional alternatives such as writing simpler/more transferable css selector lists.
That said, here are two options I would consider. Option 1: For very long css selector lists. Reduce the complexity of your code and have the one level of nesting. Option 2: For shorter css selector lists, use OR syntax to test for alternate patterns.
Having each alternate list on its own line, in one place, should aid with code maintenance over time.
Dim tests() As Variant, test As Long
tests = Array( _
"div > blockquote > p > span > strong", _
"div > blockquote > p > strong > span", _
"div > blockquote:nth-child(14) > p > strong", _
"div > blockquote:nth-child(13) > p > strong", _
"div > blockquote:nth-child(12) > p > strong")
'-------------------------
'Option 1: Single nested testing for longer selector list
For test = LBound(tests) To UBound(tests)
Set obj = HTML.querySelector(tests(test))
If Not obj Is Nothing Then Exit For
Next
'Option 2: CSS OR syntax for shorter selector list
Dim selectorList As String
selectorList = Join$(tests, ",")
Set obj = HTML.querySelector(selectorList)
'--------------- then continue -------
If Not obj Is Nothing Then
' do something
End If
If going with Option 1 I might then go on to consider using a flag boolean variable
Dim found As Boolean
For test = LBound(tests) To UBound(tests)
Set obj = html.querySelector(tests(test))
found = Not obj Is Nothing
If found Then Exit For
Next
If found Then
'do something
End If
Can select a single image & display it using these two:
<p:galleria value="#{imagesController.images}" var="image" panelWidth="1500" panelHeight="1000" showCaption="true">
<o:graphicImage value="#{nOTiFYMotorcycleController.imageFileUrlPng}" dataURI="true"/>
</p:galleria>
<o:graphicImage value="#{nOTiFYMotorcycleController.imageFileUrlPng}" dataURI="true"/>
If I try and create a multiple number of images (using OmniFaces Showcase https://showcase.omnifaces.org/components/graphicImage) with:
<!-- Galleria 4 - ui:repeat & o:graphicImage -->
<h3>The below one renders byte[] property taking a Long argument as resource in <code><ui:repeat></code> loop</h3>
<p>
<ui:repeat value="#{images.ids}" var="id">
<o:graphicImage value="#{images.getContent(id)}" lastModified="#{startup.time}"/>
</ui:repeat>
</p>
with:
#Named("images")
#GraphicImageBean
public class Images {
/**
*
*/
private static final long serialVersionUID = 1L;
/**
*
*/
private static final Logger LOGGER = LoggerFactory.getLogger(Images.class);
/**
*
*/
private static final Map<Long, String> IMAGES = Collections.unmodifiableMap(new TreeMap<Long, String>() {
private static final long serialVersionUID = 1L;
{
put(1L, "gu9032273eum01-01-m");
put(2L, "gu9032274eum01-01-m");
put(3L, "gu9032274eum02-01-m");
put(4L, "gu9032275eum01-01-m");
put(5L, "gu9032276eum01-01-m");
}
});
/**
* #param id
* #return
* #throws IOException
*/
public byte[] getContent(Long id) throws IOException {
// Note: this is a dummy example. In reality, you should be able to return the desired byte[] content from some
// service class by given ID.
LOGGER.info(">>>>> Images byte getContent id = {}", id);
return Utils.toByteArray(Faces.getResourceAsStream("/Users/NOTiFY/IdeaProjects/GoStopHandle/images/MotoGuzzi/2021/V85/" + IMAGES.get(id) + ".webp"));
}
/**
* #return
*/
public Long[] getIds() {
// Note: this is just a dummy example. In reality, you should be able to obtain them from another request/view
// scoped bean as ID of an entity representing the image.
LOGGER.info(">>>>> Images Long IMAGES = {}", IMAGES);
LOGGER.info(">>>>> Images Long IMAGES size = {}", IMAGES.size());
LOGGER.info(">>>>> Images Long IMAGES keySet = {}", IMAGES.keySet().toArray(new Long[IMAGES.size()]));
return IMAGES.keySet().toArray(new Long[IMAGES.size()]);
}
}
I get:
SEVERE [javax.enterprise.resource.webcontainer.jsf.application] (default task-6) Error Rendering View[/index.xhtml]: java.lang.IllegalArgumentException: o:graphicImage 'value' attribute must refer a #GraphicImageBean or #ApplicationScoped bean. Cannot find the right annotation on bean class 'class com.gostophandle.omnifaces.Images'.
> 15:23:30,307 SEVERE
> [javax.enterprise.resource.webcontainer.jsf.application] (default
> task-3) Error Rendering View[/index.xhtml]:
> java.lang.IllegalArgumentException: o:graphicImage 'value' attribute
> must refer a #GraphicImageBean or #ApplicationScoped bean. Cannot find
> the right annotation on bean class 'class
> com.gostophandle.omnifaces.Images'. at
> deployment.GoStopHandle.ear.GoStopHandleWAR.war//org.omnifaces.resourcehandler.GraphicResource.create(GraphicResource.java:204)
> at
> deployment.GoStopHandle.ear.GoStopHandleWAR.war//org.omnifaces.component.output.GraphicImage.createGraphicResourceByValue(GraphicImage.java:320)
> at
> deployment.GoStopHandle.ear.GoStopHandleWAR.war//org.omnifaces.component.output.GraphicImage.getSrc(GraphicImage.java:285)
> at
> deployment.GoStopHandle.ear.GoStopHandleWAR.war//org.omnifaces.component.output.GraphicImage.encodeBegin(GraphicImage.java:242)
> at
> javax.faces.api#3.0.0.SP04//javax.faces.component.UIComponent.encodeAll(UIComponent.java:1644)
> at
> com.sun.jsf-impl#2.3.14.SP04//com.sun.faces.facelets.component.RepeatRenderer.encodeChildren(RepeatRenderer.java:64)
> at
> com.sun.jsf-impl#2.3.14.SP04//com.sun.faces.facelets.component.UIRepeat.process(UIRepeat.java:559)
> at
> com.sun.jsf-impl#2.3.14.SP04//com.sun.faces.facelets.component.UIRepeat.encodeChildren(UIRepeat.java:1068)
> at
> javax.faces.api#3.0.0.SP04//javax.faces.component.UIComponent.encodeAll(UIComponent.java:1647)
> at
> javax.faces.api#3.0.0.SP04//javax.faces.component.UIComponent.encodeAll(UIComponent.java:1650)
> at
> deployment.GoStopHandle.ear.GoStopHandleWAR.war//org.primefaces.component.tabview.TabViewRenderer.encodeTabContent(TabViewRenderer.java:316)
> at
> deployment.GoStopHandle.ear.GoStopHandleWAR.war//org.primefaces.component.tabview.TabViewRenderer.lambda$encodeContents$1(TabViewRenderer.java:287)
> at
> deployment.GoStopHandle.ear.GoStopHandleWAR.war//org.primefaces.component.tabview.TabView.forEachTab(TabView.java:188)
> at
> deployment.GoStopHandle.ear.GoStopHandleWAR.war//org.primefaces.component.tabview.TabViewRenderer.encodeContents(TabViewRenderer.java:285)
> at
> deployment.GoStopHandle.ear.GoStopHandleWAR.war//org.primefaces.component.tabview.TabViewRenderer.encodeMarkup(TabViewRenderer.java:154)
> at
> deployment.GoStopHandle.ear.GoStopHandleWAR.war//org.primefaces.component.tabview.TabViewRenderer.encodeEnd(TabViewRenderer.java:92)
> at
> javax.faces.api#3.0.0.SP04//javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:595)
> at
> javax.faces.api#3.0.0.SP04//javax.faces.component.UIComponent.encodeAll(UIComponent.java:1654)
> at
> com.sun.jsf-impl#2.3.14.SP04//com.sun.faces.context.PartialViewContextImpl$PhaseAwareVisitCallback.visit(PartialViewContextImpl.java:615)
> at
> com.sun.jsf-impl#2.3.14.SP04//com.sun.faces.component.visit.PartialVisitContext.invokeVisitCallback(PartialVisitContext.java:159)
> at
> javax.faces.api#3.0.0.SP04//javax.faces.component.UIComponent.visitTree(UIComponent.java:1456)
> at
> deployment.GoStopHandle.ear.GoStopHandleWAR.war//org.primefaces.component.api.UITabPanel.visitTree(UITabPanel.java:939)
> at
> javax.faces.api#3.0.0.SP04//javax.faces.component.UIComponent.visitTree(UIComponent.java:1468)
> at
> javax.faces.api#3.0.0.SP04//javax.faces.component.UIForm.visitTree(UIForm.java:355)
> at
> javax.faces.api#3.0.0.SP04//javax.faces.component.UIComponent.visitTree(UIComponent.java:1468)
> at
> javax.faces.api#3.0.0.SP04//javax.faces.component.UIComponent.visitTree(UIComponent.java:1468)
> at
> com.sun.jsf-impl#2.3.14.SP04//com.sun.faces.context.PartialViewContextImpl.processComponents(PartialViewContextImpl.java:400)
> at
> com.sun.jsf-impl#2.3.14.SP04//com.sun.faces.context.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:319)
> at
> deployment.GoStopHandle.ear.GoStopHandleWAR.war//org.primefaces.context.PrimePartialViewContext.processPartial(PrimePartialViewContext.java:65)
> at
> javax.faces.api#3.0.0.SP04//javax.faces.context.PartialViewContextWrapper.processPartial(PartialViewContextWrapper.java:228)
> at
> deployment.GoStopHandle.ear.GoStopHandleWAR.war//org.omnifaces.context.OmniPartialViewContext.processPartial(OmniPartialViewContext.java:122)
> at
> javax.faces.api#3.0.0.SP04//javax.faces.component.UIViewRoot.encodeChildren(UIViewRoot.java:1102)
> at
> javax.faces.api#3.0.0.SP04//javax.faces.component.UIComponent.encodeAll(UIComponent.java:1647)
> at
> com.sun.jsf-impl#2.3.14.SP04//com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:442)
> at
> com.sun.jsf-impl#2.3.14.SP04//com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:170)
> at
> javax.faces.api#3.0.0.SP04//javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:132)
> at
> javax.faces.api#3.0.0.SP04//javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:132)
> at
> javax.faces.api#3.0.0.SP04//javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:132)
> at
> deployment.GoStopHandle.ear.GoStopHandleWAR.war//org.omnifaces.viewhandler.OmniViewHandler.renderView(OmniViewHandler.java:155)
> at
> com.sun.jsf-impl#2.3.14.SP04//com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:102)
> at
> com.sun.jsf-impl#2.3.14.SP04//com.sun.faces.lifecycle.Phase.doPhase(Phase.java:76)
> at
> com.sun.jsf-impl#2.3.14.SP04//com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:199)
> at
> javax.faces.api#3.0.0.SP04//javax.faces.webapp.FacesServlet.executeLifecyle(FacesServlet.java:708)
> at
> javax.faces.api#3.0.0.SP04//javax.faces.webapp.FacesServlet.service(FacesServlet.java:451) at
> io.undertow.servlet#2.2.5.Final//io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
> at
> io.undertow.servlet#2.2.5.Final//io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
> at
> io.undertow.websocket#2.2.5.Final//io.undertow.websockets.jsr.JsrWebSocketFilter.doFilter(JsrWebSocketFilter.java:173)
> at
> io.undertow.servlet#2.2.5.Final//io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
> at
> io.undertow.servlet#2.2.5.Final//io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
> at
> io.opentracing.contrib.opentracing-jaxrs2//io.opentracing.contrib.jaxrs2.server.SpanFinishingFilter.doFilter(SpanFinishingFilter.java:52)
> at
> io.undertow.servlet#2.2.5.Final//io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
> at
> io.undertow.servlet#2.2.5.Final//io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
> at
> io.undertow.servlet#2.2.5.Final//io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
> at
> io.undertow.servlet#2.2.5.Final//io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
> at
> io.undertow.servlet#2.2.5.Final//io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)
> at
> io.undertow.servlet#2.2.5.Final//io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
> at
> org.wildfly.extension.undertow#23.0.0.Final//org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
> at
> io.undertow.core#2.2.5.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
> at
> io.undertow.servlet#2.2.5.Final//io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68)
> at
> io.undertow.servlet#2.2.5.Final//io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:117)
> at
> io.undertow.servlet#2.2.5.Final//io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
> at
> io.undertow.core#2.2.5.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
> at
> io.undertow.core#2.2.5.Final//io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
> at
> io.undertow.servlet#2.2.5.Final//io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
> at
> io.undertow.core#2.2.5.Final//io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
> at
> io.undertow.servlet#2.2.5.Final//io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
> at
> io.undertow.core#2.2.5.Final//io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
> at
> io.undertow.core#2.2.5.Final//io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
> at
> io.undertow.core#2.2.5.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
> at
> org.wildfly.extension.undertow#23.0.0.Final//org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
> at
> io.undertow.core#2.2.5.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
> at
> org.wildfly.extension.undertow#23.0.0.Final//org.wildfly.extension.undertow.deployment.GlobalRequestControllerHandler.handleRequest(GlobalRequestControllerHandler.java:68)
> at
> io.undertow.servlet#2.2.5.Final//io.undertow.servlet.handlers.SendErrorPageHandler.handleRequest(SendErrorPageHandler.java:52)
> at
> io.undertow.core#2.2.5.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
> at
> io.undertow.servlet#2.2.5.Final//io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:269)
> at
> io.undertow.servlet#2.2.5.Final//io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:78)
> at
> io.undertow.servlet#2.2.5.Final//io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:133)
> at
> io.undertow.servlet#2.2.5.Final//io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:130)
> at
> io.undertow.servlet#2.2.5.Final//io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
> at
> io.undertow.servlet#2.2.5.Final//io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
> at
> org.wildfly.extension.undertow#23.0.0.Final//org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
> at
> org.wildfly.extension.undertow#23.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1530)
> at
> org.wildfly.extension.undertow#23.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1530)
> at
> org.wildfly.extension.undertow#23.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1530)
> at
> org.wildfly.extension.undertow#23.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1530)
> at
> org.wildfly.extension.undertow#23.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1530)
> at
> io.undertow.servlet#2.2.5.Final//io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:249)
> at
> io.undertow.servlet#2.2.5.Final//io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:78)
> at
> io.undertow.servlet#2.2.5.Final//io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:99)
> at
> io.undertow.core#2.2.5.Final//io.undertow.server.Connectors.executeRootHandler(Connectors.java:387)
> at
> io.undertow.core#2.2.5.Final//io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:841)
> at
> org.jboss.threads#2.4.0.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
> at
> org.jboss.threads#2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)
> at
> org.jboss.threads#2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
> at
> org.jboss.threads#2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
> at
> org.jboss.xnio#3.8.4.Final//org.xnio.XnioWorker$WorkerThreadFactory$1$1.run(XnioWorker.java:1280)
> at java.base/java.lang.Thread.run(Thread.java:832)
What I use:
PrimeFace (Elite) 10.0.0 Mojarra JSF 2.3.14.SP04 & OmniFaces 3.11
WildFly 23.0.0.Final Weld 3.1.5 (Final) & CDI 2.0 Java OpenJDK 15.0.2,
Kotlin 1.4.32, Gradle 6.8.3, MongoDB 4.4.4 Google Chrome, macOS Big
Sur 11.2.2
I'm trying to build a browse menu in TYPO3 that should be added to all subpages to navigate trough all submenu pages.
That's what I got:
temp.prevPage = HMENU
temp.prevPage {
special = browse
special{
items = prev
value = 22
prev.fields.title = <img src="fileadmin/dev/pics/prev.gif" title="next page" alt="prev page"/>
}
1 = TMENU
1.NO = 1
1.NO.allWrap = |
}
temp.nextPage = HMENU
temp.nextPage {
special = browse
special{
items = next
value = 22
next.fields.title = <img src="fileadmin/dev/pics/next.gif" title="next page" alt="prev page" />
}
1 = TMENU
1.NO = 1
1.NO.allWrap = |
}
To the Problem: The next and prev arrows are shown on any pid value correctly but it doesn't work if it is the pid of the actual page (actually I could leave value away, then it should work on the actual page but it doesn't).
Example: I'm currently on page with id (pid) 23, there the links to pid 21 (prev) and to 23 (next) are shown. But if I go to page with id 22, the links to prev an next disapear.
Template is on _root.
Menu-Tree:
_root
- Home
- pid19
- - pid20
- - pid21
- - pid22
- - pid23
- pid24
- - pid25
...
Any help will be highly appreciated.
You need to remove the special.value to always take the current pid. It could look something like this (slightly different, but copied from a live project):
lib.navi.horizontal = COA
lib.navi.horizontal {
10 = HMENU
10 {
special = browse
special {
items = prev
}
1 = TMENU
1.noBlur = 1
1.NO {
ATagParams = class="nav-arrow nav-prev"
ATagTitle.dataWrap = {field:title}
}
}
20 = HMENU
20 {
special = browse
special {
items = next
}
1 = TMENU
1.noBlur = 1
1.NO {
ATagParams = class="nav-arrow nav-next"
ATagTitle.dataWrap = {field:title}
}
}
}
This code has to go on pid 19 in your page structure
I made an xpage element for ftsearch using a tutorial from IBM
My request: is there possible having 2 date fields ( as input requirements for the search ) to find those documents having the creation date inside the interval consisting of those 2 dates?
Should I create a computed field dtCreated where I will store the creation date and then in the search property of the view I should add something like this:
var tmpArray = new Array("");
var cTerms = 0;
if (sessionScope.searchDate1) && (sessionScope.searchDate2) {
tmpArray[cTerms++] = "(Field dtCreated > \"" + sessionScope.searhcDate1 + "\")" && "(Field dtCreated < \"" + sessionScope.searhcDate2 + "\")";
}
....
....
Or there is another alternative?
My 2 session variables are having Short (5/5/14) Date format. Also, my default value for those 2 dates (session variables) are "" but of course I add some values before clicking the Submit button.
Thanks for your time!
You can use the special field _creationDate as creation date (see answer from Tommy). Based on this the following example query will work in the Notes client:
Field _creationDate > 01-01-2014 AND Field _creationDate < 01-03-2014
In order to get this query to work with your specific code do this:
var tmpArray = new Array("");
var cTerms = 0;
var dateFormatter = new java.text.SimpleDateFormat( "dd-MM-yyyy" );
if (sessionScope.searchDate1) && (sessionScope.searchDate2) {
tmpArray[cTerms++] = "Field _creationDate > " + dateFormatter.format(sessionScope.searchDate1) + " AND Field _creationDate < " + dateFormatter.format(sessionScope.searchDate2);
}
If you want to do an FTSearch, _CreationDate can be used
Documentation (scroll to Searching for Header Information):
http://publib.boulder.ibm.com/infocenter/domhelp/v8r0/index.jsp?topic=%2Fcom.ibm.designer.domino.main.doc%2FH_CUSTOMIZING_SEARCH_FORMS_7304.html
E.g. (there might be typos):
tmpArray[cTerms++] = "(Field _creationDate>" + sessionScope.searhcDate1 + ") AND (Field _creationDate<" + sessionScope.searhcDate2 + ")";
Or my preferred syntax:
tmpArray[cTerms++] = "[_creationDate>" + sessionScope.searhcDate1 + "] AND [_creationDate<" + sessionScope.searhcDate2 + "]";
To build on Tommy's answer:
Specifically, try "yyyy/m/d" as the format. If those values in sessionScope are java.util.Date (the type that date fields use), you could try something like this (typing off the top of my head, not in an app, so my apologies for typos):
var tmpArray = [];
var cTerms = 0;
if(sessionScope.searchDate1 && sessionScope.searchDate2) {
var formatter = new java.text.SimpleDateFormat("yyyy/M/d");
tmpArray[cTerms++] = "[_CreationDate] >= " + formatter.format(sessionScope.searchDate1) + " and [_CreaationDate] <= " + formatter.format(sessionScope.searchDate2)
}
What you want to end up with is a FT query like:
[_CreationDate] >= 2014/1/1 and [_CreationDate] <= 2014/2/1