I'm updating my a site property through a job. The job runs ok, it does the work right and updates the property I want it to update properly and never failed.
But, when I save the site, it mess my pages, making them vanish. Worst, it don't always happen @.@ what is driving me crazy! =(
I'm sure the job is running right because once I get all pages back (through worksite setup and site editor) thing get working all. Here the method where I update the property (I have already tried both options of property edition ways:
@Override
public void updateStringProperty(Site site, String name, String value) {
try {
// ResourcePropertiesEdit rpe = site.getPropertiesEdit();
// rpe.addProperty(name, value);
ResourceProperties rp = site.getProperties();
rp.addProperty(name, value);
siteService.save(site);
} catch (IdUnusedException e) {
e.printStackTrace();
} catch (PermissionException e) {
e.printStackTrace();
}
}
It's written on the proxy layer, in which my application talks with Sakai interfaces to read/write data onto Sakai databse (You can see the instance of the site come from above) and it's how I get the list of sites to apply changes (also sakai proxy layer):
@Override
public List<Site> getReadInWebSites(Long course) {
Map<String, String> m = new HashMap<String, String>();
m.put(Property.COURSE.getName(), Long.toString(course));
m.put(Property.COURSEFINISHED.getName(), Boolean.toString(false));
return new ArrayList<Site>(siteService.getSites(SelectionType.ANY,
null, null, m, SortType.CREATED_BY_ASC, null));
}
Thanks in advance!
EDIT: New info, when I try to access the site (before rebuild its structure through worksite setup, I get this Warn in the log:
org.sakaiproject.portal.charon.site.DefaultSiteViewImpl - Failed to set canAddSite for current user. Defaulting to false ...