Issue #612 has been updated by Jon Kidder.
I am able to process a ranged attribute in javascript with revision 1858
successfully. The base javascript is below. I have also verified through
packet captures that the attribute list is being set and that a significantly
smaller result set is being returned.
<![CDATA[js:
var attrName = "member" ;
var newDataset = new Array();
var rangeStart = null ;
var rangeEnd = null ;
var rangeSize = null ;
var arrayCounter = 0 ;
var tmpDataset = srcBean.getDatasetValuesById(attrName).toArray() ;
if (tmpDataset.length > 0)
{
rangeStart = 0
rangeEnd = "*"
rangeSize = 0
}
else
{
var attrList = srcBean.getDatasetsNames().toArray()
if (attrList != null)
{
if (attrList.length > 0)
{
for (var i=0; i < attrList.length; i++ )
{
if
(attrList[i].toString().contains(attrName + ";range"))
{
var startPos = null
var sepPos = null
startPos =
attrList[i].toString().indexOf(";range=") + 7
sepPos =
attrList[i].toString().indexOf("-", startPos)
rangeStart =
attrList[i].toString().substring(startPos, sepPos)
rangeEnd =
attrList[i].toString().substring(sepPos + 1)
rangeSize = Number(rangeEnd) -
Number(rangeStart)
break
}
}
}
}
}
if (rangeStart != null)
{
var tmpAttrName = "" ;
while (rangeStart != "*")
{
if (rangeStart == "0" && rangeEnd != "*")
{
tmpAttrName = attrName + ";range=" +
rangeStart.toString() + "-" + rangeEnd.toString()
tmpDataset =
srcBean.getDatasetValuesById(tmpAttrName).toArray()
}
else if (rangeStart != "0")
{
tmpAttrName = "member;range=" +
rangeStart.toString() + "-" + rangeEnd.toString()
tmpDataset =
srcLdap.attribute(srcBean.getMainIdentifier(), tmpAttrName).toArray()
}
if (rangeEnd == "*")
{
rangeStart = "*"
}
if (tmpDataset != null)
{
if (tmpDataset.length > 0)
{
for (var i=0; i<tmpDataset.length; i++ )
{
// Add attribute value
processing logic here;
// Be sure to explicitly type
the array elements to prevent conversion to an object array;
newDataset[arrayCounter++] =
String(tmpDataset[i])
}
if (rangeEnd != "*")
{
rangeStart = Number(rangeEnd) +
1
rangeEnd = Number(rangeStart) +
Number(rangeSize)
}
}
else
{
rangeEnd = "*"
}
}
else
{
rangeEnd = "*"
}
}
}
newDataset
]]>
----------------------------------------
Bug #612: ScriptableJndiServices.attribute does not set the attribute list when
performing a search
http://tools.lsc-project.org/issues/612
Author: Jon Kidder
Status: Feedback
Priority: Normal
Assigned to:
Category: Core
Target version: 2.0.3
Problem in version: 2.0.2
ScriptableJndiServices.attribute is using a null attribute list when performing
searches. This prevents the function from being used to retreive operational
attributes or "modified" attributes in the case of Microsoft's ranging
implementation. I believe the error is in line 217 of
ScriptableJndiServices.java:
sc.setReturningAttributes(new String[] {attrName});
Shouldn't this line simply be:
sc.setReturningAttributes(attrName);
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://tools.lsc-project.org/my/account
_______________________________________________________________
Ldap Synchronization Connector (LSC) - http://lsc-project.org
lsc-dev mailing list
[email protected]
http://lists.lsc-project.org/listinfo/lsc-dev