Update of /cvsroot/logicampus/logicampus/src/logicreate/services/classmgr
In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv10894/services/classmgr
Modified Files:
restoreBackup.lcp
Log Message:
don't double import learning object with a matching GUID.
Index: restoreBackup.lcp
===================================================================
RCS file: /cvsroot/logicampus/logicampus/src/logicreate/services/classmgr/restoreBackup.lcp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** restoreBackup.lcp 2 Mar 2008 22:29:24 -0000 1.4
--- restoreBackup.lcp 2 Mar 2008 22:42:02 -0000 1.5
***************
*** 144,155 ****
}
$lobRepoObj = Lc_Lob_Xml::parseNode($node, $tempdir);
! $lobRepoObj->save();
//link to this user;
! $lobUserObj = new LobUserLink();
! $lobUserObj->set('lobRepoEntryId',$lobRepoObj->getRepoId());
! $lobUserObj->set('userId',$u->userId);
! $lobUserObj->set('isOwner','1');
! $lobUserObj->save();
$classObj = $lobRepoObj->useInClass($classId);
--- 144,167 ----
}
$lobRepoObj = Lc_Lob_Xml::parseNode($node, $tempdir);
! //don't save this object if the GUID is already present in the DB
! $existingLob = LobRepoEntry::load( array('lob_guid'=>$lobRepoObj->repoObj->lobGuid) );
! if (is_object($existingLob) ) {
! $lobRepoObj->repoObj->lobRepoEntryId = $existingLob->lobRepoEntryId;
! $lobRepoObj->_isNew = false;
! } else {
! $lobRepoObj->save();
! }
//link to this user;
! $lobUserObj = LobUserLink::load( array('lob_repo_entry_id'=>$lobRepoObj->getRepoId(), 'user_id' => $u->userId));
! if (is_object($lobUserObj) ) {
! //do nothing
! } else {
! $lobUserObj = new LobUserLink();
! $lobUserObj->set('lobRepoEntryId',$lobRepoObj->getRepoId());
! $lobUserObj->set('userId',$u->userId);
! $lobUserObj->set('isOwner','1');
! $lobUserObj->save();
! }
$classObj = $lobRepoObj->useInClass($classId);
|