Package org.olat.resource

Examples of org.olat.resource.OLATResource


    /*
     * policies: - ownerGroup can do everything on this businessgroup -> is an
     * admin, can invite people to owner.- & partipiciantgroup -
     * partipiciantGroup can read this businessgroup
     */
    OLATResource businessgroupOlatResource =  OLATResourceManager.getInstance().createOLATResourceInstance(businessgroup);
    OLATResourceManager.getInstance().saveOLATResource(businessgroupOlatResource);

    //    securityManager.createAndPersistPolicy(ownerGroup, Constants.PERMISSION_ACCESS, businessgroup);
    securityManager.createAndPersistPolicyWithResource(ownerGroup, Constants.PERMISSION_ACCESS, businessgroupOlatResource);
    securityManager.createAndPersistPolicyWithResource(partipiciantGroup, Constants.PERMISSION_READ, businessgroupOlatResource);
View Full Code Here


    /*
     * policies: - ownerGroup can do everything on this businessgroup -> is an
     * admin, can invite people to owner.- & partipiciantgroup -
     * partipiciantGroup can read this businessgroup
     */
    OLATResource businessgroupOlatResource = OLATResourceManager.getInstance().createOLATResourceInstance(businessgroup);
    OLATResourceManager.getInstance().saveOLATResource(businessgroupOlatResource);
    OLATResource groupContextOlatResource = OLATResourceManager.getInstance().findResourceable(groupContext);
    if (groupContextOlatResource == null) {
      OLATResourceManager.getInstance().createOLATResourceInstance(groupContext);
      OLATResourceManager.getInstance().saveOLATResource(groupContextOlatResource);
    }
    securityManager.createAndPersistPolicyWithResource(ownerGroup, Constants.PERMISSION_ACCESS, businessgroupOlatResource);
View Full Code Here

      Tracing.logDebug("Created Right Group named " + name, BusinessGroupFactory.class);
    }
    /*
     * policies: - partipiciantGroup can read this businessgroup
     */
    OLATResource businessgroupOlatResource = OLATResourceManager.getInstance().createOLATResourceInstance(businessgroup);
    OLATResourceManager.getInstance().saveOLATResource(businessgroupOlatResource);
    securityManager.createAndPersistPolicyWithResource(partipiciantGroup, Constants.PERMISSION_READ, businessgroupOlatResource);
    // membership: add identity if available
    if (identity != null) {
      securityManager.addIdentityToSecurityGroup(identity, partipiciantGroup);
View Full Code Here

      case 1: // permission
        Policy po = (Policy)co;
        String perm = po.getPermission();
        return perm;
      case 2:
        OLATResource or = (OLATResource)co;
        return or.getResourceableId();
      case 3:
        OLATResource ore = (OLATResource)co;
        return ore.getResourceableTypeName();
    }
    return co.toString();
  }
View Full Code Here

    // addedEntry.setAccess(RepositoryEntry.ACC_OWNERS);
    addedEntry.setAccess(0);//Access for nobody
   
    // Set the resource on the repository entry and save the entry.
    RepositoryManager rm = RepositoryManager.getInstance();
    OLATResource ores = OLATResourceManager.getInstance().findOrPersistResourceable(addCallback.getResourceable());
    addedEntry.setOlatResource(ores);
   
    // create security group
    SecurityGroup newGroup = securityManager.createAndPersistSecurityGroup();
    // member of this group may modify member's membership
    securityManager.createAndPersistPolicy(newGroup, Constants.PERMISSION_ACCESS, newGroup);
    // members of this group are always authors also
    securityManager.createAndPersistPolicy(newGroup, Constants.PERMISSION_HASROLE, Constants.ORESOURCE_AUTHOR);
   
    securityManager.addIdentityToSecurityGroup(ureq.getIdentity(), newGroup);
    addedEntry.setOwnerGroup(newGroup);
   
    rm.saveRepositoryEntry(addedEntry);

    detailsController = new RepositoryEditDescriptionController(ureq, getWindowControl(), addedEntry, true);
    detailsController.addControllerListener(this);
    repositoryadd.put("details", detailsController.getInitialComponent());
    // try to get type description based on handlertype
    repositoryadd.contextPut("header",
        translator.translate("add.header.specific", new String[] {translator.translate(ores.getResourceableTypeName())}));
    repositoryadd.setPage(VELOCITY_ROOT + "/addDetails.html");
  }
View Full Code Here

        String actionid = te.getActionId();
        int rowid = te.getRowId();
        RepositoryTableModel repoTableModel = (RepositoryTableModel) resourcesCtr.getTableDataModel();
        RepositoryEntry currentRepoEntry = (RepositoryEntry)repoTableModel.getObject(rowid);
        if (actionid.equals(RepositoryTableModel.TABLE_ACTION_SELECT_LINK)) {
          OLATResource ores = currentRepoEntry.getOlatResource();
          if (ores == null) throw new AssertException("repoEntry had no olatresource, repoKey = " + currentRepoEntry.getKey());
         
          addLoggingResourceable(LoggingResourceable.wrap(ores, OlatResourceableType.genRepoEntry));
          String title = currentRepoEntry.getDisplayname();
         
View Full Code Here

      StringBuilder sb = new StringBuilder(translate("error.download"));
      sb.append(": No download handler for repository entry: ");
      sb.append(repositoryEntry.getKey());
      throw new OLATRuntimeException(RepositoryDetailsController.class, sb.toString(), null);
    }
    OLATResource ores = OLATResourceManager.getInstance().findResourceable(repositoryEntry.getOlatResource());
    if (ores == null) {
      showError("error.download");
      return;
    }   
    boolean isAlreadyLocked = typeToDownload.isLocked(ores);
View Full Code Here

  /**
   * If lock successfully aquired start copy, else show warning.
   * @param ureq
   */
  private void doCopy(UserRequest ureq) {
    OLATResource ores = OLATResourceManager.getInstance().findResourceable(repositoryEntry.getOlatResource());
    boolean isAlreadyLocked = RepositoryHandlerFactory.getInstance().getRepositoryHandler(repositoryEntry).isLocked(ores);
    lockResult = RepositoryHandlerFactory.getInstance().getRepositoryHandler(repositoryEntry).acquireLock(ores, ureq.getIdentity());
    if(lockResult==null || (lockResult!=null && lockResult.isSuccess()) && !isAlreadyLocked) {
      removeAsListenerAndDispose(copyController);
      copyController = new RepositoryCopyController(ureq, getWindowControl(), repositoryEntry);
View Full Code Here

   */
  private List<String> getCourseTitles(BGContext context) {
    List<String> courseTitles = new ArrayList<String>();
    List resources = BGContextManagerImpl.getInstance().findOLATResourcesForBGContext(context);
    for (Iterator iter = resources.iterator(); iter.hasNext();) {
      OLATResource resource = (OLATResource) iter.next();
      if (resource.getResourceableTypeName().equals(CourseModule.getCourseTypeName())) {
        ICourse course = CourseFactory.loadCourse(resource);
        courseTitles.add(course.getCourseTitle());
      }
      }
    return courseTitles;
View Full Code Here

      log.debug("no group context exists, create a new default defaultContextName=" + defaultContextName);
    } else {
      log.debug("Found no default group context, create a new default defaultContextName=" + defaultContextName);
    }
    // no context exists => create a new default context
    OLATResource courseResource = OLATResourceManager.getInstance().findOrPersistResourceable(course);
    BGContext context = BGContextManagerImpl.getInstance().createAndAddBGContextToResource(defaultContextName, courseResource, BusinessGroup.TYPE_LEARNINGROUP, null, true);
    return context;
  }
View Full Code Here

TOP

Related Classes of org.olat.resource.OLATResource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.