Liferay exception on user creation com.liferay.portal.GroupFriendlyURLException - java

I created an user whit XXX username from java code.
Because it was done with wrong permission and I can't see it from web interface, I delete directly from database.
After that if I try to create the same user I got the following exeception:
com.liferay.portal.GroupFriendlyURLException
What could gone wrong?

After some investigation I discover that:
Store user info in USER_ table
For each USER_ row there are a row in GROUP_ table, where personal sites url are
On user cration Liferay use username to generate a friendly url
this url have to be validated, and one rule is that must be unique
My problem was that I deleted the USER_ row only, so whe I tried to recreate deleted user control on GROUP_ table failed.
So I solved with:
GROUP_ row deletion (the one whit / on friendly url column)
Liferay restart

Related

Picketlink: finding users with given role

I configured a JPA store and see users and roles getting added correctly to the db when I call the related picketlink (2.7.1) API's
My questions is this: how does one get a list of all users that have a given role?
I tried doing this using the following RelationshipQuery
RelationshipQuery<Grant> rq = relationshipManager.createRelationshipQuery(Grant.class);
rq.setParameter(Grant.ROLE, role);
List<Grant> grants = rq.getResultList()
But the resulting grant list contains a single assignment grant, that refers to the last user in the database that has that role.
I checked the example queries in the documentation and tests but found nothing that does what I want. I know the project is no longer active but am hoping to find a solution to this.
Found out that role data wasn't imported correctly from the old db. Once I fixed that the above code worked as expected.

Moodle automatically update courses and categories

I'm developing an application (Java, Spring, Hibernate, OracleDB) who take courses and student information from one external DB and create the course with its resources on a Moodle 3.0.5+ (Build: 20160811) instance.
The application create successfully the Categories/sub-categories/Courses but it won't show up immediately. I have to go to /Site Administration/Courses/Manage Courses and Categories/ and trigger the "update" by selecting categories miscellaneous, press edit and the save, and voilĂ  categories are showing up.
I need help to know how to trigger that update programmatically, any clue would be really appreciated.
Here is where i have to trigger manually the category update:
Thanks in advance.
EDIT:
Thanks to #martin-greenaway i've checked updated tables on update/create categories:
it's mdl_logstore_log, which have an column named 'eventname' with record
\core\event\course_category_updated
So i'm guessing there isn't a trigger in the database but in moodle itself.

How to add user login check in GenericDao.java in Ofbiz

I am Trying to achieve single DB and multiple organization (not Multi tenancy) in ofbiz, how do i get user login Id till GenericDAO and append it to the query.
Please Suggest if you have any other ideas except multi tenancy!
Thanks
EDIT:
if (!conditions.isEmpty()) {
whereString.append(prefix);
whereString.append(EntityCondition.makeCondition(conditions, EntityOperator.AND).makeWhereString(modelEntity, whereEntityConditionParams, this.datasource));
}
System.out.println("************ whereString ************ "+whereString+" ---- ");
return whereString;
In line number 841 in my ofbiz v13.07 GenericDAO.java, i can get to know the place where query string is getting created. i want to access the session here to get the company Id and so i append it to the where clause. to get relevant data.

Using Baas Parse for Android application but duplicate Table User

I 'm trying to use the Baas Parse for my Android application.
I've followed the quickstart guide with success, so i'have successfully registered a TestObject into my Parse database.
Now, I try to adapt Parse to my needs and to register a User into Parse database with that code:
Parse.initialize(this, "NkThBbZ4gcXQf3s59UGTozpCjKQbECVP5SmuXCkY", "n7a65t3o8fZNAXTOygWIg2L9Kui316yepfgoSdhf");
ParseObject userParse = new ParseObject("User");
userParse.put("username", user.getPseudonyme());
userParse.put("password", user.getPassword());
userParse.saveInBackground();
But it doesn't insert my user into the User table, instead it creates a new table and insert my User in that new User table.
The first User table is a default table created by parse as far as i understand but i don't understand why is it impossible to use it.
The result is that i have 2 Users tables.
Thank you very much for your answers if anyone had the same problem.
Sebastien
The pre-made User table actually has an underscore before it. It is the _User table, not the User table. The underscore is to signify it's a special class that Parse gives you. Use _User instead of User.

JDO - List of Strings not being retrieved from database

On my User class I have a field that is a list of strings:
#Persistent
private List<String> openIds;
When I create a new user I do this:
User user = new User();
user.openIds.add(openid);
pm.makePersistent(user);
When I break after that last line and look, the openIds contains the openid I put in there.
But, when I later call User user = pm.getObjectById(User.class, id); with the correct id, the openIds field is an empty list.
Anyone know what could cause that?
EDIT: BTW I'm running on the Google App Engine
UPDATE: Looking at the datastore viewer, I can see the openid was correctly stored in the database. So its just not getting it out correctly...
UPDATE 2: Its working fine now. I'm pretty sure I didn't change anything. I think what must have happened is that there was an old version of the user object being pulled from the database. A user object that was put in before I had the code that saves the openid. Once I wiped the database things worked fine.
Not putting that field in the fetch plan ?
Accessing persistent fields directly, rather than going via setters ?

Categories

Resources