What can i do for Pagination infer arguments error - spring-boot

`Hi i am using pagination to display data but i got an error showing cannot infer arguments ...can anyone help me through it.Thanks in advance
<sub>```
private Paginator<OrganizationInfo> getOrganizationInfoPaginator(
Organization organizationAlias,
SelectConditionStep<Record> selectConditionStep) {
return new Paginator<GETTING ERROR HERE>(selectConditionStep, List.of( new SortableField<>(OrganizationSortable.NAME.toString(), organizationAlias.getName()),
new SortableField<>(OrganizationSortable.KEY.toString(), organizationAlias.getKeys())),
new IdField<>(organizationAlias.ID, organizationAlias.getIdentity().toString()), records ->
records.stream().map(org -> {
var orgId = org.get(organizationAlias.ID);
return new OrganizationInfo(orgId,
// org.get(organizationAlias.ID),
org.get(organizationAlias.NAME),
org.get(organizationAlias.ORGANIZATION_KEY),
org.get(organizationAlias.ADDRESS_ID),
org.get(organizationAlias.CONTACT_NO),
org.get(organizationAlias.CREATED_AT),
org.get(organizationAlias.FAX_NO),
org.get(organizationAlias.WEBSITE),
org.get(organizationAlias.STATUS_ID),
org.get(ORGANIZATION_STATUS_TRANSLATION.NAME),
org.get(USER.EMAIL),
org.get(USER.PHONE));
}).collect(Collectors.toList()));
}
```</sub>
I need to display 10 data for each page but it is showing error in pagination

Related

Parse Server relation.add() not working

Issue Description
If I create a relation and use the relation.add() method on it nothing happens.
Steps to reproduce
let Booking = Parse.Object.extend("Booking")
let bookingQuery = new Parse.Query(Booking)
bookingQuery.get(newBookingObject.id, {
success: booking => {
console.log("invites", invites)
// prints array of existing ParseObjects from another class
let relation = booking.relation("invites")
console.log(relation)
// prints new relation with key "invites" and parent "Booking"
relation.add(invites)
console.log(relation)
// prints exactly the same relation object as before - nothing changed
booking.save().then(res => console.log(res))
// an empty relation is added
},
error: error => console.log("error", error)
// no errors
})
Expected Results
relation.add(arrayOfParseObjects) should add objects to relation
Actual Outcome
Nothing happens
insted of
relation.add(invites)
please try the following
for (var i =0; i<invites.length;i++){
relation.add(invites[i])
}
Regards

Create a custom login in wakanda 1.1.3

I am creating a Angular2 application in which i need a custom login instead of the existing directory login So, I added the following code and created some new files and code as the following
i added a new file login.js under the backend location with the following code
directory.setLoginListener("loginFuction","Admin");
I made changes to my require.js as the following
function loginFunction(email,password){
console.log("Call is being made to the backend");
var u = ds.User.find("email : 1" ,email);
console.log(u);
if(!u){
return false;
}else{
var token = currentSession.promoteWith("Admin");
if(u.password == password){
var theGroups = [];
switch(u.role){
case 'Admin':
theGroups.push('Admin');
break;
case 'Users':
theGroups.push('Users');
break;
}
var connectTime = new Date();
return {
ID : u.ID,
name : u.email,
fullName : u. fullname,
belongsTo : theGroups,
storage:{
time : connectTime
}
};
}else{
return {
error : 1024,
errorMessage : "invalid login"
}
}
}
};
when i call the loginFunction from my normal component like
this.wakanda.directory.login('adithya#gmail.com','adithya').then(res => {
console.log(res);
});
I am getting an error stating
EXCEPTION: Uncaught (in promise): Error: Directory.login: Unauthorized
All the table are being made global access, and everything is being made as public.
Can anyone help me with this solution.
Thanks in advance.
The exact method of creating the custom login in wakanda studio 1.1.3 is of the following we have to make change in the function call present in the bootstrap.js like the following
directory.setLoginListener("loginFunction");
by removing the "Admin" as the second parameter .

How to query relational data using subclasses? parse.com and Unity

Im trying to query all elements of subclass in Unity. I have found SDK constraint or missing something here.
According to documentation querying subclasses is possible.
> var query = new ParseQuery<Armor>()
.WhereLessThanOrEqualTo("rupees", ((Player)ParseUser.CurrentUser).Rupees);
query.FindAsync().ContinueWith(t =>
{
IEnumerable<Armor> result = t.Result;
});
Im however using relation table and cannot specify
Here is my code:
IEnumerator LoadMyDesigns(Action<RequestResult> result) {
ParseUser user = ParseUser.CurrentUser;
ParseRelation<Design> relation = user.GetRelation<Design>("designs");
Task<IEnumerable<Design>> task = relation.Query.FindAsync();
while (!task.IsCompleted) yield return new WaitForEndOfFrame();
if (task.IsFaulted) {
//error
foreach(var e in task.Exception.InnerExceptions) {
ParseException parseException = (ParseException) e;
Debug.LogError("Error message " + parseException.Message);
Debug.LogError("Error code: " + parseException.Code);
result(new RequestResult(true, parseException.Message));
}
}
else {
result(new RequestResult(true, new List<Design>(task.Result)));
}
}
And error:
ArgumentNullException: Must specify a ParseObject class name when creating a ParseQuery.
So the question is how do I specify query subclass type when using relations?
Thanks.
I've struggled with the same problem and in my case I needed to provide the propertyName again in de GetRelationProperty call.
For example:
[ParseFieldName("designs")]
public ParseRelation<Design> Designs
{
get { return GetRelationProperty<Design>("Designs"); }
}
Try querying your designs Table.
Make a new query for class "Designs" where equal("owner", PFUser.currentUser())
This should return all of the designs for the current User.

Error in processing entity WorkOrder unable to create entity object

I am receiving the following error calling GetAssetEquipmentOp:
"Error in processing entity WorkOrder unable to create entity object"
Here is the code so far:
public stringType getAssetDescription(string equipmentcode)
{
try
{
// Setup Service Objects
MP0302_GetAssetEquipment_001.GetAssetEquipmentService getservice = new MP0302_GetAssetEquipment_001.GetAssetEquipmentService();
MP0302_GetAssetEquipment_001.MP0302_GetAssetEquipment_001 getrequest = new MP0302_GetAssetEquipment_001.MP0302_GetAssetEquipment_001();
MP0302_GetAssetEquipment_001.MP0302_GetAssetEquipment_001_Result getresult = new MP0302_GetAssetEquipment_001.MP0302_GetAssetEquipment_001_Result();
// Setup Return Object
stringType desc = new stringType();
// Setup Service Parameters
getrequest.ASSETID = new MP0302_GetAssetEquipment_001.EQUIPMENTID_Type();
getrequest.ASSETID.EQUIPMENTCODE = equipmentcode;
getrequest.ASSETID.ORGANIZATIONID = new MP0302_GetAssetEquipment_001.ORGANIZATIONID_Type();
getrequest.ASSETID.ORGANIZATIONID.ORGANIZATIONCODE = _orgCodeBody;
// Setup Datastream Object
Datastream.EWS.Session sess = new Datastream.EWS.Session(_userid, _passwd, _orgCodeHead, _url, _tenant, false);
// Prepare Service Request
sess.PrepareServiceRequest(getservice);
// Call Web Service and get result
getresult = getservice.GetAssetEquipmentOp(getrequest);
// Extract Description
desc.stringValue = getresult.ResultData.AssetEquipment.ASSETID.DESCRIPTION;
desc.errorNum = 0;
// Close Up/Dispose
sess.CompleteServiceRequest(getservice);
sess.Dispose();
// Return value
return desc;
}
catch (Exception ex)
{
stringType errorStringType = new stringType();
errorStringType.errorNum = 1;
errorStringType.errorDesc = ex.Message;
return errorStringType;
}
}
I have checked the following:
- User group has interface permissions including BECONN
- User has "Connector" option selected
- User has status authorizations including * to Q for EVNT
Any help would be appreciated.
Problem solved! The problem was that the work order number did not exist. It is a very misleading error but once an existing work order was tested, it fetched the work order with no issues.

Create a custum Sharepoint list and add items problems

Im new to SharePoint programming, or programming at all for that case. My problem is that I get a error-message when I try to go to my sharepoint site after I debugged this oode (it worked fine in visual studio). I don't know whats wrong? The error message i get is:
"Server Error in '/' Application.
0x80004005Updates are currently disallowed on GET requests. To allow updates on a GET, set the 'AllowUnsafeUpdates' property on SPWeb."
I've read that you got to allow safe updates? but is that the case? I think maybe it is my code that is not right... Please help :)
// choose your site
SPSite site = new SPSite("http://....");
SPWeb web = SPContext.Current.Web;
//Add a list to the choosen site
SPListCollection lists = web.Lists;
// create new Generic list called "OrdersList"
lists.Add("OrdersTest", "All of my testorders will be here", SPListTemplateType.GenericList);
//Add the new list to the website
SPList newList = web.Lists["OrdersTest"];
// create Number type new column called "OrderID"
newList.Fields.Add("OrderID", SPFieldType.Number, true);
// create Number type new column called "OrderNumber"
newList.Fields.Add("OrderNumber", SPFieldType.Number, true);
// create Text type new column called "OrderProducts"
newList.Fields.Add("OrderProducts", SPFieldType.Text, true);
newList.Update();
//Create a object to that list
SPListItem newOrder = newList.AddItem();
//Add a new item
newOrder["OrderID"] = 1;
newOrder["OrderNumber"] = 1;
newOrder["OrderProducts"] = "Icecream";
newOrder.Update();
// create new Generic list called "ProductTest"
lists.Add("ProductTest", "All of my testproducts will be here", SPListTemplateType.GenericList);
//Add the new list to the website
SPList newList2 = web.Lists["ProductTest"];
// create Number type new column called "ProductID"
newList2.Fields.Add("ProductID", SPFieldType.Number, true);
// create Text type new column called "ProductName"
newList2.Fields.Add("ProductName", SPFieldType.Text, true);
// create Number type new column called "OrderID"
newList2.Fields.Add("ProductPrice", SPFieldType.Number, true);
//Create a object to that list
SPListItem nyProduct = newList2.AddItem();
//Add a new item
nyProduct["ProductID"] = 1;
nyProduct["ProductName"] = "Icecream";
nyProduct["ProductPrice"] = 13;
nyProduct.Update();
You need to set AllowUnsafeUpdates to true for updating data in get requests.
using(SPSite site = new SPSite("http://...."))
using (SPWeb web = site.OpenWeb())
{
bool b = web.AllowUnsafeUpdates;
web.AllowUnsafeUpdates = true;
try
{
//your code
//create and update list
}
catch (Exception ex)
{
//handles errors
}
finally
{
web.AllowUnsafeUpdates = b;
}
}

Resources