How to create link to another database using link control? - xpages

How to create link to another database using link control? I thought that I simply start URL with slash but it doesnt work as xpages prepends path to current database to this link and I'm getting wrong link as this one: /app/projects.nsf/database.nsf/page.xsp
<xp:link escape="true" text="Link" id="link1" value="/database.nsf/page.xsp">
</xp:link>
I know that I can create absolute link starting with http:// but I would like to avoid this ...

You can use the xp:text element and convert it to an anchor:
<xp:text escape="true" id="link1" tagName="a" value="Link">
<xp:this.attrs>
<xp:attr name="href" value="/database.nsf/page.xsp"></xp:attr>
</xp:this.attrs>
</xp:text>
Or add the link as Passthrough Tag.

If the database is in the same sub-directory on the server, you can use ../xxx.nsf
For every sub-folder you want to go back, you can prepend a ../
Example in your case:
<xp:link escape="true" text="Link" id="link1" value="../database.nsf/page.xsp">
</xp:link>
If the database would be one folder above the current databases' folder you can use this:
<xp:link escape="true" text="Link" id="link1" value="../../database.nsf/page.xsp">
</xp:link>
Hope that helps.
Michael

To build on Sven's answer, I computed the URL, and set the target to be a new tab.
So my xp:text element is:
<xp:text id="label4" escape="true"
styleClass="btn btn-default" value="Open Fastworks Document"
tagName="a">
<xp:this.attrs>
<xp:attr name="href">
<xp:this.value><![CDATA[#{javascript:var sUNID = document1.getItemValueString("FWUNID");
var sNSF = document1.getItemValueString("FWNSF").replace("\\","/");
//sys_all/A4DC4CFDA12A1A4E80257F48003DD8F9?OpenDocument
"/"+sNSF + "/sys_all/"+sUNID;}]]></xp:this.value>
</xp:attr>
<xp:attr name="target"
value="_blank">
</xp:attr>
</xp:this.attrs>
</xp:text>
This then produces HTML such as :
<a class="btn btn-default" id="view:_id1:_id2:callback2:label4" href="/Fastworks/Version52m/Accident.nsf/sys_all/31F7D581D23BCFE580257FA1002E3B43" target="_blank">Open Fastworks Document</a>

Related

Trouble with handling attachments in Xpages

I am trying to write a fileUpload/fileDownload custom control with a Bootstrap like look. I am fairly happy with the look (see below).
However, I am getting very inconsistent behavior. I would very much like the user to be able to click the delete button and the attachment is removed and the repeat control is refreshed. In a similar fashion if the user selects "Upload" I think the attachment should be uploaded to the document and the repeat control refreshed as well.
I am storing the attachments in a single document that is separate from the main document [it is stored in a separate db from the code].
I am using the js fileInput library with the upload control.
I am using a repeat control to roll my own file download viewer.
The code works some of the time, but not always. When the page fails I get this error message (see below).
Any suggestions would be greatly appreciated.
Context Path: /scoApps/OTM1/OTM1.nsf
Page Name: /xpTest.xsp
javax.faces.FacesException
at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:106)
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:228)
at com.ibm.xsp.webapp.FacesServletEx.serviceView(FacesServletEx.java:157)
at com.ibm.xsp.webapp.FacesServlet.service(FacesServlet.java:160)
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:576)
at com.ibm.domino.xsp.module.nsf.NSFComponentModule.invokeServlet(NSFComponentModule.java:1335)
at com.ibm.designer.runtime.domino.adapter.ComponentModule$AdapterInvoker.invokeServlet(ComponentModule.java:853)
at com.ibm.designer.runtime.domino.adapter.ComponentModule$ServletInvoker.doService(ComponentModule.java:796)
at com.ibm.designer.runtime.domino.adapter.ComponentModule.doService(ComponentModule.java:565)
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.IllegalArgumentException
at javax.faces.model.ListDataModel.getRowData(ListDataModel.java:141)
at com.ibm.xsp.component.UIRepeatContainer.addIndexedDataContext(UIRepeatContainer.java:173)
at com.ibm.xsp.component.UIRepeatContainer.getDataContexts(UIRepeatContainer.java:86)
at com.ibm.xsp.util.DataPublisher.getDataContextList(DataPublisher.java:349)
at com.ibm.xsp.util.DataPublisher.revokeControlData(DataPublisher.java:271)
at com.ibm.xsp.component.UIDataPanelBase.revokeControlData(UIDataPanelBase.java:319)
at com.ibm.xsp.component.UIDataPanelBase.processDecodes(UIDataPanelBase.java:334)
at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1177)
at com.ibm.xsp.component.UIRepeat.processDecodes(UIRepeat.java:526)
at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1177)
at com.ibm.xsp.component.UIDataPanelBase.processDecodes(UIDataPanelBase.java:331)
at javax.faces.component.UIForm.processDecodes(UIForm.java:166)
at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1177)
at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1177)
at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:343)
at com.ibm.xsp.component.UIViewRootEx._processDecodes(UIViewRootEx.java:1438)
at com.ibm.xsp.component.UIViewRootEx.processDecodes(UIViewRootEx.java:1399)
at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:98)
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core" xmlns:xc="http://www.ibm.com/xsp/custom">
<xp:this.data>
<xp:dominoDocument var="document1" databaseName="scoApps\OTM1\OTM1Data.nsf" formName="attachment" action="editDocument" documentId="349CDB2FB259D5D3862581090076AC50" />
</xp:this.data>
<script src="fileinput/js/fileinput.js" type="text/javascript" />
<link href="fileinput/css/fileinput.min.css" media="all" rel="stylesheet" type="text/css" />
<xp:scriptBlock id="scriptBlockInitFile">
<xp:this.value><![CDATA[$(document).ready(
function() {
$('input[type=file]').fileinput({
previewFileType: "image",
browseClass: "btn btn-primary",
browseLabel: "Browse...",
browseIcon: '<i class="glyphicon glyphicon-plus"></i>',
removeClass: "btn btn-danger",
removeLabel: "Delete",
removeIcon: '<i class="glyphicon glyphicon-trash"></i>',
uploadClass: "btn btn-info",
});
}
);]]></xp:this.value>
</xp:scriptBlock>
<xp:div themeId="container" style="width:800px">
<xp:br />
<xp:fileUpload id="fileUpload1" value="#{document1.attachments}">
<xp:this.attrs>
<xp:attr name="multiple" value="true" />
<xp:attr name="data-show-preview" value="false" />
</xp:this.attrs>
</xp:fileUpload>
<xp:br />
<xp:button value="Save Changes" id="button1" styleClass="btn btn-primary">
<xp:eventHandler event="onclick" submit="true" refreshMode="complete" disableValidators="true">
<xp:this.action>
<xp:actionGroup>
<xp:save />
</xp:actionGroup>
</xp:this.action>
</xp:eventHandler>
</xp:button>
</xp:div>
<xp:repeat rows="30" id="attrepeat" first="0" var="att" indexVar="attachmentIndex">
<xp:this.facets>
<xp:text disableTheme="true" xp:key="header" escape="false">
<xp:this.value><![CDATA[<table class="table table-striped table-bordered table-hover"><col width="150"><col width="450"><th>File Name</th><th style="text-align:right">Delete</th>]]></xp:this.value>
</xp:text>
<xp:text disableTheme="true" xp:key="footer" escape="false">
<xp:this.value><![CDATA[</table>]]></xp:this.value>
</xp:text>
</xp:this.facets>
<xp:this.value><![CDATA[#{javascript:var bckDoc = document1.getDocument()
var attachments:java.util.Vector = session.evaluate("#AttachmentNames",bckDoc);
attachments}]]></xp:this.value>
<xp:tr>
<xp:td>
<xp:link escape="true" id="link1" target="_blank" text="#{javascript:att.toString();}">
<xp:this.value><![CDATA[#{javascript:var tmpStr:String;
var str:String;
var bckDoc = document1.getDocument()
var attachments:java.util.Vector = session.evaluate("#AttachmentNames",bckDoc);
tmpStr = attachments.toString;
tmpStr
var bckDoc = document1.getDocument()
var attachments:java.util.Vector = session.evaluate("#AttachmentNames",bckDoc);
tmpStr = attachments.elementAt(0);
var unid = "349CDB2FB259D5D3862581090076AC50"
var dbPath = "scoApps/OTM1/OTM1.nsf/"
var dbDataPath = "scoApps/OTM1/OTM1Data.nsf/"
var url = "http://localhost/";
url += dbPath;
url += "/xsp/.ibmmodres/domino/OpenAttachment/";
url += dbDataPath + "/";
url += unid
url += "/" + "attachments" + "/";
url += tmpStr;
url}]]></xp:this.value>
<xp:image id="image1" rendered="false">
<xp:this.url><![CDATA[#{javascript:var pdfImage = 'pdf.gif';
//if(attachment.indexOf("pdf")> 0)
return pdfImage; }]]></xp:this.url>
</xp:image>
&#160;
</xp:link>
</xp:td>
<xp:td style="text-align:right">
<xp:button value="Delete" id="button2" styleClass="btn btn-danger">
<xp:eventHandler event="onclick" submit="true" refreshMode="complete">
<xp:this.action><![CDATA[#{javascript:function removeAttachment(targDB,doc_Url,fileName,docUnid2) {
//passing parameters by reference
var docUrl:String= doc_Url;
var targetDB:NotesDatabase = session.getDatabase(session.getCurrentDatabase().getServer(),targDB);
var attachmentName:String =fileName;
//deducing the document's unid from the document's url
//docUrl=#Left(docUrl,"?");
//var docUnid=#RightBack(docUrl,"/");
print (docUnid2);
//setting the handle to the document
var docContext:NotesDocument=targetDB.getDocumentByUNID(docUnid2);
if (docContext==null) {
viewScope.CodeError="Either the UNID is invalid or the target db does not contain the doc or both";
return;
}
//getting the handle to the concerned attachment
var embObj:NotesEmbeddedObject=docContext.getAttachment(attachmentName);
if (embObj==null) {
viewScope.CodeError="No attachment is found by the name "+ attachmentName;
return;
}
//remove the attachment
embObj.remove()
docContext.save(true,false);
}
var fleNme = att.toString();
print (fleNme);
removeAttachment("scoApps/OTM1/OTM1Data.nsf","http://localhost/scoApps/OTM1/OTM1.nsf//xsp/.ibmmodres/domino/OpenAttachment/scoApps/OTM1/OTM1Data.nsf//349CDB2FB259D5D3862581090076AC50/attachments/ITReport.xlsx",fleNme,"349CDB2FB259D5D3862581090076AC50");}]]></xp:this.action>
</xp:eventHandler>
</xp:button>
</xp:td>
</xp:tr>
</xp:repeat>
</xp:view>
It's failing in the ApplyRequestValues phase, something related to running code for rows within the repeat. I've had that before in a Data View with using the caching was ID only. The key is identifying which component's code is failing (the value of the repeat, the link, the image or the button - if it's a component, which property) and whether it needs to run in that phase. It may not.
Looking at the stack trace, the "caused by" bit failing on getRowData() implies it might be a problem with value of the repeat, but I'm not totally sure. It could be one of the repeat's child components that's failing.
If it's a read-only bit of code, it could be wrapped in an if (view.isRenderingPhase()) block. Just make sure you output something valid for other phases! E.g. for a rendered property, set the result for other phases to true (I've missed that before and caused myself problems!)
If it's because the document datasource has not been initialised at that phase, wrapping everything in a Panel may solve the problem, by associating the dominoDocument datasource to be a child of the Panel, which may encourage it to be better re-initialised during the restoreView phase. This is a total stab in the dark, but I know during page load a dominoDocument datasource gets loaded at a different time when it's a child of a Panel as opposed to a child of the XPage itself.

XPages view data source and limit to single category

I have a categorized view that I am using as a view data source in an XPage. I have set the categoryFilter of the data source so that only the call history of the selected individual (for a given incident) is displayed. The filter being stored in the sessionScope is a concatenation of the UniqueID of the person and the IncidentID. The lookup view is categorized by that value.
One would expect that to work, however the filtering does not seem to be working and I can see all call histories regardless of the person I choose. I've done this before and I must be missing something obvious.
I have verified the sessionScope.callHistoryID is being updated as I select a new person. My Call History db currently only has 2 history documents for one guest, yet they display for every guest in the Xpage.
sessionScope.callHistoryID from the debugger is obviously not the same (see below):
<xp:panel id="pnlCallHistoryModal" style="padding-bottom:20px">
<xp:this.data>
<xp:dominoView var="callhistoryView"
viewName="luCallHistorybyPaxandIncidentID"
databaseName="blah.nsf"
ignoreRequestParams="true"
categoryFilter="#{javascript:sessionScope.callHistoryID}">
</xp:dominoView>
</xp:this.data>
<div class="col-xs-12 col-md-12 col-lg-12 panel-body">
<xp:repeat id="repeat1" value="#{callhistoryView}"
var="viewRow" indexVar="rowIndex" rows="500"
repeatControls="false">
<xp:this.facets>
<xp:text disableTheme="true" xp:key="header"
escape="false">
<xp:this.value><![CDATA[
<table class="table table-hover">
<tbody>]]></xp:this.value>
</xp:text>
<xp:text disableTheme="true" xp:key="footer"
escape="false">
<xp:this.value><![CDATA[
</tbody>
</table>]]></xp:this.value>
</xp:text>
</xp:this.facets>
<xp:tr>
<xp:this.rendered><![CDATA[# {javascript:if(viewRow.isCategory()){
return false
}else{
return true
}}]]></xp:this.rendered>
<xp:td styleClass="col-md-10 col-lg-10 small">
<xp:text escape="true" id="name">
<xp:this.value><![CDATA[#{javascript:#ProperCase(viewRow.getColumnValue("CallerFullName"))}]]></xp:this.value>
</xp:text>
<br></br>
<xp:text escape="true" id="computedField1"
styleClass="small secondary-text">
<xp:this.value><![CDATA[#{javascript:if(viewRow.getColumnValue("CallerMemo").length > 128){
return viewRow.getColumnValue("CallerMemo").substring(0,128) + " ..."
}else{
return viewRow.getColumnValue("CallerMemo")
}}]]></xp:this.value>
</xp:text>
</xp:td>
<xp:td styleClass="col-md-2 col-lg-2 small">
<xp:text escape="true" id="creationdatetime"
styleClass="small">
<xp:this.value><![CDATA[#{javascript:viewRow.getColumnValue("CallDateTime")}]]></xp:this.value>
<xp:this.converter>
<xp:convertDateTime type="both"
dateStyle="short" timeStyle="short">
</xp:convertDateTime>
</xp:this.converter>
</xp:text>
</xp:td>
</xp:tr>
</xp:repeat>
</div>
</xp:panel>
I suspect this will be doing the equivalent of ViewNavigator.createViewNavFromCategory(). It's worth checking how that acts if the category name doesn't exist. It may fall back to a partial match.
For "restrict to category", you might be better placed using the keys property and settings keysExactMatch to true.

Xpages - Creating Repeat or View from different database with ACL set to No Access

I am trying to create a repeat element from a view in a different database that does not allow Anonymous ACL access.
PubDb.nsf has ACL set for user Anonymous to Author
PrivDb.nsf has ACL set for user Anonymous and Default "no access".
The database, PrivDb has information that I want to secure, but would like to pull a couple of views out for public display.
When I create a repeat in PubDb.nsf using PrivDb.nsf view, It will not display any data. I am able to use sessionAsSigner to get SSJS to see the view and open documents at the server side level, but when I try to display the view or repeat elements there is no data ? If I change ACL in PrivDb for Anonymous to Reader everything works, but now the entire db is open to Anonymous access.
I understand that sessionAsSigner and sessionAsSignerWithFullAccess allows me to use db signers effective rights, and I can use SSJS to access the notesdocuments and publish data using computed fields for individual docs, but I can't find any information that tells me I can or can't display an xpages element (repeat or view) using the sessionAsSigner. Maybe I can create a lotusscript agent that populates the block?
Below is the code I use to create the repeat element in PubDb.nsf. Note, I assigned the DB twice, once in Application and again in View because when I didn't use sessionAsSigner in the view's computed value I would get prompted for authentication, and it's required in the app field.
<xp:this.data>
<xp:dominoView var="view2">
<xp:this.databaseName><![CDATA[${javascript:
var DB:NotesDatabase=sessionAsSigner.getDatabase(database.getServer(),"PrivDb.nsf");
DB;
}]]>
</xp:this.databaseName>
<xp:this.viewName><![CDATA[${javascript:
var dbOther:NotesDatabase = sessionAsSignerWithFullAccess.getDatabase(database.getServer(), "PrivDb.nsf");
var lookupView:NotesView = dbOther.getView( "PrivView" );
lookupView.recycle();
lookupView}]]>
</xp:this.viewName>
</xp:dominoView>
</xp:this.data>
<div class="container">
<div class="page-header">
<h1>This is a test.</h1>
</div>
<xp:br></xp:br>
<xp:br></xp:br>
<div class="row">
<div class="col-md-1"></div>
<div class="col-md-10">
<xp:repeat id="repeat1" rows="30" var="playerData"
value="#{view2}" repeatControls="true">
<div class="panel panel-default">
<xp:text escape="true" id="computedField1"
value="#{playerData.$5}">
</xp:text>
hcp:  
<xp:text escape="true" id="computedField5"
value="#{playerData.$6}">
</xp:text>
<xp:br></xp:br>
<xp:text escape="true" id="computedField2"
value="#{playerData.$7}">
</xp:text>
   
<xp:text escape="true" id="computedField3"
value="#{playerData.$8}">
</xp:text>
   
<xp:text escape="true" id="computedField4"
value="#{playerData.$9}">
</xp:text>
<xp:br></xp:br>
</div>
<div class="col-md-1"></div>
</xp:repeat>
</div>
</div>
</div>
Try changing your repeat to return for instance the view entries directly using sessionAsSigner instead of going through a view data source. So in your case:
<xp:repeat id="repeat1" rows="30" var="playerData">
<xp:this.value><![CDATA[#{javascript:
sessionAsSigner.getDatabase(database.getServer(), "PrivDb.nsf").getView("PrivView").getAllEntries();
}]]></xp:this.value>
...
</xp:repeat>

xpages link in new tab ignoring validations

I have the following link on my footer layout:
<xp:link escape="true" id="link1" text="Click me" target="_blank">
<xp:eventHandler event="onclick" submit="true"
refreshMode="complete">
<xp:this.action><![CDATA[#{javascript:facesContext.getExternalContext().redirect("http://www.example.com")}]]></xp:this.action>
</xp:eventHandler>
</xp:link>
The main layout contains some required fields. If I click the link I will get the message: "That field is required!" and so on. But, if I click the link in my main page ( which is something like a home page ) , the URL redirects me to the respective site, but on the same tab. Is target="_blank" ignored?
How can I achieve this considering I want when clicking on link the validations to be ignored and the url to be opened on new tab?
The issue is that you are using server-side logic to determine the target/URL to load. Your client-side properties are therefore ignored.
Do this instead:
<xp:link escape="true" id="link1" text="Click me" target="_blank" value="http://www.example.com">
</xp:link>
You also calculate the URL in advance:
<xp:link escape="true" id="link1" text="Click me" target="_blank" value="http://www.example.com">
<xp:this.value><![CDATA[#{javascript:
if (something) {
return "http://example.org";
} else {
return "http://example.com";
}
}]]></xp:this.value>
</xp:link>

Web self registration on Xpages

I am looking to create an Xpage self registration site that registers users onto the Domino name and address book. I am just doing a proof of concept.
I will put the code below, but it is a fairly simple matter of capturing the user details, dropping their details and password into the NAB and then, hey presto the user should be able to immediately log into the app.nsf.
At the moment I am manually putting the user into a group that is listed in the ACL as manager on app.nsf (for testing, I am putting them in the group prior to creating the user - just mentioning it in case it is important).
It basically works, BUT, there is a rather large delay. As in, it takes many minutes and sometimes more. After some research I discovered the console command "show nlcache reset" and a lotusscript/java/javascript code version of it. But it seems to have no effect, either coded or manually from the console - (there is also no response from the console that the command has been initiated, just a new line, is this normal?).
The only quirky thing is that the OU=99123456789 (or something similar, it is a company identifier). So a user will look something like this Fred Citizen/99123456789/Domain (don't think this should matter). The user will however log in as "Fred Citizen" and password.
Any ideas?
We are running 9.0.1
Thanks in advance.
Cheers
Damien
Code Below:
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:this.data>
<xp:dominoDocument var="userreg" databaseName="names.nsf"
formName="Person">
</xp:dominoDocument>
</xp:this.data>
<fieldset class="userreg">
<label for="FirstName">First Name</label>
<xp:inputText id="FirstName" value="#{userreg.FirstName}">
</xp:inputText>
<br />
<label for="LastName">Last Name</label>
<xp:inputText id="LastName" value="#{userreg.LastName}">
</xp:inputText>
<br />
<label for="CompanyName">Company Name - ABN</label>
<xp:inputText id="CompanyName" value="#{userreg.CompanyName}">
</xp:inputText>
<br />
<label for="Level0_1">Service ID</label>
<xp:inputText id="Level0_1" value="#{userreg.Level0_1}">
</xp:inputText>
<br />
<label for="HTTPPassword">Password</label>
<xp:inputText id="HTTPPassword" value="#{userreg.HTTPPassword}"
password="true">
</xp:inputText>
<br />
<label for="InternetAddress">Email Address</label>
<xp:inputText id="InternetAddress" value="#{userreg.InternetAddress}">
</xp:inputText>
<br />
<xp:text escape="true" id="type" value="#{userreg.type}"
rendered="false">
</xp:text>
<xp:button value="Register" id="userreg_submit">
<xp:eventHandler event="onclick" submit="true"
refreshMode="complete">
<xp:this.action>
<xp:actionGroup>
<xp:actionGroup>
<xp:actionGroup>
<xp:modifyField name="type" value="Person">
</xp:modifyField>
<xp:modifyField name="FullName">
<xp:this.value><![CDATA[#{javascript:var fullNameArray = new Array();
var first = getComponent("FirstName").getValue();
var last = getComponent("LastName").getValue();
var abn = getComponent("CompanyName").getValue();
fullNameArray[0]= "CN=" + first + " " + last + "/OU=" + abn + "/O=RR1";
fullNameArray[1] = first + " " + last;
return fullNameArray;
}]]></xp:this.value>
</xp:modifyField>
<xp:saveDocument></xp:saveDocument>
</xp:actionGroup>
</xp:actionGroup>
</xp:actionGroup>
</xp:this.action>
</xp:eventHandler>
</xp:button>
<xp:br></xp:br>
<xp:br></xp:br></fieldset></xp:view>
I had the same issue with my portal users registering and have been able to over come this with the following code. It's virtually instant. This code is in my register button after my bean creates the user in the nab and updates all the groups, acl etc....
sessionAsSigner.sendConsoleCommand( session.getServerName(), "lo updall yourNabDBName -t ($VIMGroups)" );
sessionAsSigner.sendConsoleCommand( session.getServerName(), "lo updall yourNabDBName -t ($Users)" );
sessionAsSigner.sendConsoleCommand( session.getServerName(), "lo updall yourNabDBName -t ($ServerAccess)" );
sessionAsSigner.sendConsoleCommand( session.getServerName(), "sh nl r" );
For a lotuscript version of this you need to manually refresh a couple of views in the nab and then it worked.
Dim nabFullNameView As NotesView
Dim nabServerAccessView As NotesView
Dim nabUsersView As notesview
Set nabUsersView = dbNAB.GetView("($Users)")
Set nabFullNameView = dbNAB.GetView("($LDAPCN)")
Set nabServerAccessView = dbNAB.GetView("($ServerAccess)")
Call nabFullNameView.Refresh
Call nabServerAccessView.Refresh
Call nabUsersView.Refresh
'Closing session commits person document to NAB.
Call s.Close

Resources