xpages custom control and dojo filtering select - select

I'm trying to make a custom control that uses a dojo filtering select. Set some properties for the custom control, such as server, database, and view that are available in the dojo filtering select for get options for control. So when I get the properties with the compositeData.propertyname command it is listed as wrong as described below. For a combobox is working perfectly.
Script interpreter error, line = 2, col = 45: [ReferenceError] 'compositeData' not found
The above line has the following command:
var server = compositeData.server
Does anyone know what can it be?
The code below
<xe:djFilteringSelect
id="djFilteringSelect1"
disableClientSideValidation="true">
<xp:selectItems id="selectItems3">
<xp:this.value><![CDATA[${javascript:
var servidor=compositeData.servidor
var base=compositeData.base
var baseNotes:NotesDatabase=session.getDatabase(servidor,base)
var vi_origem:NotesView=baseSolucao.getView(compositeData.visao);
var nav:NotesViewNavigator=vi_origem.createViewNav();
var entry:NotesViewEntry=nav.getFirst();
var options = new java.util.ArrayList();
var tmpEntry:NotesViewEntry;
var option = new javax.faces.model.SelectItem();
option.setLabel("");
option.setValue("");
options.add(option);
while (null!=entry)
{
tmpEntry=nav.getNext(entry);
var option = new javax.faces.model.SelectItem();
option.setLabel(entry.getColumnValues()[compositeData.coluna]);
option.setValue(entry.getColumnValues()[compositeData.coluna]);
options.add(option);
entry.recycle();
entry=tmpEntry;
}
return options
}]]></xp:this.value>
</xp:selectItems>
</xe:djFilteringSelect>

Related

Dartap Search Criteria

I'm using dartdap to query ldap for certain records.
Dartap v0.6.2 https://pub.dev/packages/dartdap
Dart SDK v.2.17.1
I can connect successfully to ldap, but I can't figure out how to pass search criteria. Let's say I want to retrieve records for cn (common name) containing Joe, cn=Joe*. How would I pass cn=Joe* to dartapp?
The following is a snippet from the credentials and connection section.
var filter = Filter.present('objectClass');
var attrs = ['dn', 'cn', 'objectClass']; //define returned attributes, but where do I pass a filter?
Future example() async {
var host = 'hostname';
var bindDN = 'user#domain';
var password = 'password';````
I found a way to filter. In case anyone else has the same issue, the following works:
// original
var filter = Filter.present('objectClass');
// change to
var filter = Filter.substring('cn', 'Joe*');

How to return all entries from specific date in log.nsf

I need to return all entries (collection) from a specific date from the miscellaneus view in log.nsf using SSJS.
The views first category is "text" and the second category is a "date".
I tried to use the methods getAllEntriesByKey(vector) or createViewNavFromCategory(vector) but I got kind of stuck as the categorized columns contain different data types.
how can I do that?
Here is one thing I tried
var logdb = sessionAsSigner.getDatabase("domino01/....","log.nsf");
var logView = logdb.getView("MiscEvents")
var v = new java.util.Vector()
var nav = logView.createViewNavFromCategory("domino01/...\\2019-02-15")
return nav.getCount()
and here is another
var logdb = sessionAsSigner.getDatabase("domino01/...","log.nsf");
var logView = logdb.getView("MiscEvents")
var v = new java.util.Vector()
v.add("domino01/...")
v.add(session.createDateTime("Today").getDateOnly())
var nav = logView.getAllEntriesByKey(v)
return nav.getCount()
Just remove the getDateOnly call from your 2nd example code.
v.add(session.createDateTime("Today"))

How to set the value of a vizframe id to another variable ( using this.getView().byId) using sapui5

I am using the using the sap webide. In my application I have some vizcharts binded to Odata. Now I am trying to download the vizcharts as PDF. But I am unable to get the value of vizcharts.
Below is my code from JS controller.
downloadClickHandler: function(oEvent) {var str = "width=500px,height=600px";
var wind = window.open("", "PrintWindow", str);
var chart = this.getView().byId("idVizFrameCountofTransactionUsed");
var Details = chart["sId"];wind.document.write(Details);
wind.print();
wind.close();
},
You can achieve it by:
_onDownload : function() {
var oVizFrame = this.byId("chartContainerVizFrame");
var oModel = oVizFrame.getModel();
var oData = oModel.oData;
}
In oData object now you have data from the chart. Please have a look in this example, and press download icon.

Odoo 8 - an Odoo client JavaScript error when trying to display workflow diagram

I am using Odoo 8 on Ubunutu. When trying to display diagram view for a particular workflow (example Settings->Workflows->Workflows->account.invoice.basic) I am getting an error message:
Odoo Client Error
TypeError: viewclass is not a constructor
http://127.0.0.1:8069/web/js/web.assets_backend/280e51f:3141
or this error when in Debug mode:
and the diagram is not displayed.
This is the code snipped from views.js and line 699 is where "new viewclass(...)" is.
do_create_view: function(view_type) {
// Lazy loading of views
var self = this;
var view = this.views[view_type];
var viewclass = this.registry.get_object(view_type);
var options = _.clone(view.options);
if (view_type === "form" && this.action && (this.action.target == 'new' || this.action.target == 'inline')) {
options.initial_mode = 'edit';
}
'line 699 var controller = new viewclass(this, this.dataset, view.view_id, options);
I am also getting the same error when trying to see Calendar View, Graph View, Gantt View in Manufacturing->Manufacturing Orders.
Debugging view.js reveals that "this.registry.get_object(view_type)" is returning NULL for view_type='diagram' making viewclass = NULL.
What causes this error and how I can eliminate it?
Use your odoo code from standard source, Like https://github.com/odoo/odoo.git

nDepend - how to modify "JustMyCode" queries using nDepend API?

My goal is to modify "JustMyCode" queries using nDepend API. I am using code like:
var justMyCodeGroup = prj.CodeQueries.CodeQueriesSet.ChildGroups.Single(x => x.Name.Contains("JustMyCode"));
var originalQuery = justMyCodeGroup.ChildQueries
.Single(x => x.QueryString.Contains("Discard generated Types from JustMyCode"));
var changedQuery = originalQuery.Controller.CreateQuery(originalQuery.IsActive,
query,
originalQuery.
DisplayStatInReport,
originalQuery.DisplayListInReport,
originalQuery.DisplaySelectionViewInReport,
originalQuery.IsCriticalRule);
var justMyCodeGroupWithModifiedQuery = justMyCodeGroup.ReplaceQuery(originalQuery, changedQuery);
prj.CodeQueries.CodeQueriesSet.ReplaceGroup(justMyCodeGroup, justMyCodeGroupWithModifiedQuery);
However, when I run the code above I get ArgumentException with message:
newGroup.Controller is different than this groupOfGroups.Controller
Any help ?
Update 1:
I also tried code:
var justMyCodeGroup = prj.CodeQueries.CodeQueriesSet.ChildGroups.Single(x => x.Name.Contains("JustMyCode"));
var originalQuery = justMyCodeGroup.ChildQueries
.Single(x => x.QueryString.Contains("Discard generated Types from JustMyCode"));
var changedQuery = originalQuery.Controller.CreateQuery(originalQuery.IsActive,
query,
originalQuery.
DisplayStatInReport,
originalQuery.DisplayListInReport,
originalQuery.DisplaySelectionViewInReport,
originalQuery.IsCriticalRule);
var justMyCodeGroupWithModifiedQuery = justMyCodeGroup.ReplaceQuery(originalQuery, changedQuery);
var newQueries = new List<IQuery>();
foreach (var q in justMyCodeGroup.ChildQueries)
{
if (q.QueryString.Contains("Discard generated Types from JustMyCode"))
{
continue;
}
newQueries.Add(prj.CodeQueries.CodeQueriesSet.Controller.CreateQuery(q.IsActive, q.QueryString,
q.DisplayStatInReport, q.DisplayListInReport, q.DisplaySelectionViewInReport, q.IsCriticalRule));
}
newQueries.Add(prj.CodeQueries.CodeQueriesSet.Controller.CreateQuery(originalQuery.IsActive, query, originalQuery.DisplayStatInReport, originalQuery.DisplayListInReport, originalQuery.DisplaySelectionViewInReport, originalQuery.IsCriticalRule));
var newGroup = prj.CodeQueries.CodeQueriesSet.Controller.CreateGroup(justMyCodeGroup.Name,
justMyCodeGroup.IsActive, justMyCodeGroup.ShownInReport, newQueries, new List<IGroup>());
prj.CodeQueries.CodeQueriesSet.RemoveGroup(justMyCodeGroup);
prj.CodeQueries.CodeQueriesSet.AddGroup(newGroup);
Right now, RemoveGroup throws exception:
this group of groups doesn't contain groupToRemove.
Update 2:
And I also wonder, why does this code return false ?
var justMyCodeGroup = prj.CodeQueries.CodeQueriesSet.ChildGroups.Single(x => x.Name.Contains("JustMyCode"));
prj.CodeQueries.CodeQueriesSet.ContainsGroup(justMyCodeGroup)
Refer to the PowerTools source file:
$NDependInstallDir$\NDepend.PowerTools.SourceCode\CQL2CQLinq\CQL2CQLinqPowerTool.cs
This PowerTools convert code queries written with old CQL syntax into code queries written with new CQLinq syntax, hence it loads the queries set from a project, update CQL queries, and then save the new queries set in the project.
The queriesController is gathered this way...
var queriesSet = project.CodeQueries.CodeQueriesSet;
var queriesController = queriesSet.Controller;
... and then used this way to modify the queries set:
queriesController.DoUpdateQueryObject(query, newQuery);