Package org.olat.group

Examples of org.olat.group.BusinessGroup


   * @throws IOException
   */
  public void doIndex(SearchResourceContext parentResourceContext, Object businessObj, OlatFullIndexer indexWriter) throws IOException,InterruptedException {
    if (!(businessObj instanceof BusinessGroup) )
      throw new AssertException("businessObj must be BusinessGroup");
    BusinessGroup businessGroup = (BusinessGroup)businessObj;
   
    NarrowedPropertyManager npm = NarrowedPropertyManager.getInstance(businessGroup);
    ForumManager fom = ForumManager.getInstance();

    Property forumKeyProperty = npm.findProperty(null, null, CollaborationTools.PROP_CAT_BG_COLLABTOOLS, CollaborationTools.KEY_FORUM);
    // Check if forum-property exist
    if (forumKeyProperty != null) {
      Long forumKey = forumKeyProperty.getLongValue();
      Forum forum = fom.loadForum(forumKey);
      SearchResourceContext forumSearchResourceContext = new SearchResourceContext(parentResourceContext);
      forumSearchResourceContext.setBusinessControlFor(BusinessGroupMainRunController.ORES_TOOLFORUM);
      forumSearchResourceContext.setDocumentType(TYPE);
      forumSearchResourceContext.setDocumentContext(businessGroup.getKey() + " " + forumKey);
      forumSearchResourceContext.setParentContextType(GroupDocument.TYPE);
      forumSearchResourceContext.setParentContextName(businessGroup.getName());
      doIndexAllMessages(forumSearchResourceContext, forum, indexWriter );
    }
  }
View Full Code Here


   

  public void doIndex(SearchResourceContext parentResourceContext, Object businessObj, OlatFullIndexer indexWriter) throws IOException,InterruptedException {
    if (!(businessObj instanceof BusinessGroup) )
      throw new AssertException("businessObj must be BusinessGroup");
    BusinessGroup businessGroup = (BusinessGroup)businessObj;
   
    // Index Group Wiki
    if (log.isDebug()) log.debug("Analyse Wiki for Group=" + businessGroup);
    CollaborationTools collabTools = CollaborationToolsFactory.getInstance().getOrCreateCollaborationTools(businessGroup);
    if (collabTools.isToolEnabled(CollaborationTools.TOOL_WIKI) ) {
      try {
        Wiki wiki = WikiManager.getInstance().getOrLoadWiki(businessGroup);
          // loop over all wiki pages
          List<WikiPage> wikiPageList = wiki.getAllPagesWithContent();
          for (WikiPage wikiPage : wikiPageList) {
            SearchResourceContext wikiResourceContext = new SearchResourceContext(parentResourceContext);
            wikiResourceContext.setBusinessControlFor(BusinessGroupMainRunController.ORES_TOOLWIKI);
            wikiResourceContext.setDocumentType(TYPE);
            wikiResourceContext.setDocumentContext(businessGroup.getKey() + " ");
            wikiResourceContext.setFilePath(wikiPage.getPageName());
     
            Document document = WikiPageDocument.createDocument(wikiResourceContext, wikiPage);
            indexWriter.addDocument(document);
          }
View Full Code Here

    List groupList = businessGroupManager.getAllBusinessGroups();
    if (Tracing.isDebugEnabled(GroupIndexer.class)) Tracing.logDebug("GroupIndexer groupList.size=" + groupList.size(), GroupIndexer.class);
    // loop over all groups
    Iterator iter = groupList.iterator();
    while(iter.hasNext()) {
      BusinessGroup businessGroup = null;
      try {
        businessGroup = (BusinessGroup)iter.next();
        if (Tracing.isDebugEnabled(GroupIndexer.class)) Tracing.logDebug("Index BusinessGroup=" + businessGroup , GroupIndexer.class);
        SearchResourceContext searchResourceContext = new SearchResourceContext(parentResourceContext);
        searchResourceContext.setBusinessControlFor(businessGroup);
View Full Code Here

    List oGroups = bman.findBusinessGroupsOwnedBy(null, identity, null);
    List aGroups = bman.findBusinessGroupsAttendedBy(null, identity, null);
   
    boolean inGroup = false; //TODO
    for (Iterator it_ogroups = oGroups.iterator(); !inGroup && it_ogroups.hasNext();) {
      BusinessGroup gr = (BusinessGroup) it_ogroups.next();
      Long grk = gr.getKey();
      if (grk.equals(key)) inGroup = true;
    }
    for (Iterator it_agroups = aGroups.iterator(); !inGroup && it_agroups.hasNext();) {
      BusinessGroup gr = (BusinessGroup) it_agroups.next();
      Long grk = gr.getKey();
      if (grk.equals(key)) inGroup = true;
    }
    if (inGroup) {
      return super.checkAccess(businessControl, identity, roles);
    } else {
View Full Code Here

    if (ChangeManager.isChangeEvent(event)) {
      ObjectAccessEvent oae = (ObjectAccessEvent) event;     
      if (Tracing.isDebugEnabled(GroupIndexer.class)) Tracing.logDebug("info: oae = "+oae.toString(),GroupIndexer.class);
      int action = oae.getAction();
      Long   id   = oae.getOresId();
      BusinessGroup newBusinessGroup = BusinessGroupManagerImpl.getInstance().loadBusinessGroup(id,true);
      SearchResourceContext searchResourceContext = new SearchResourceContext(); // businessContextString
      searchResourceContext.setBusinessControlFor(newBusinessGroup);
      Document document = GroupDocument.createDocument(searchResourceContext, newBusinessGroup);
      if (action == ChangeManager.ACTION_UPDATE) {
        //-> OLAT-3367 SearchServiceImpl.getInstance().addToIndex(document);
View Full Code Here

      }
     
      CourseGroupManager groupManager = course.getCourseEnvironment().getCourseGroupManager();
      List<BusinessGroup> groups = groupManager.getAllLearningGroupsFromAllContexts();
        for (Iterator<BusinessGroup> iter = groups.iterator(); iter.hasNext();) {
          BusinessGroup group = iter.next();
          if (!synchonizeBuddyRoster(group)) {
            log.error("couldn't sync group: "+group.getResourceableTypeName());
          }
          counter++;
          if (counter%6==0) {
            DBFactory.getInstance(false).intermediateCommit();
          }
View Full Code Here

      BGContextManager cm = BGContextManagerImpl.getInstance();
      //null as argument pulls all buddygroups
      List<BusinessGroup> groups = cm.getGroupsOfBGContext(null);
      int counter = 0;
      for (Iterator<BusinessGroup> iter = groups.iterator(); iter.hasNext();) {
        BusinessGroup group = iter.next();
        synchonizeBuddyRoster(group);
        counter++;
        if (counter%6==0) {
          DBFactory.getInstance(false).intermediateCommit();
        }
View Full Code Here

    sb.append(CPCore.OLAT_ORGANIZATION_IDENTIFIER);
    sb.append("\" structure=\"hierarchical\">");
    sb.append("<title>");
    String name = "";
    if( WikiManager.getInstance().isGroupContextWiki(ores)) {
      BusinessGroup group = BusinessGroupManagerImpl.getInstance().loadBusinessGroup(ores.getResourceableId(), true);
      name = group.getName();
      sb.append(trans.translate("wiki.exported.from.group", new String[]{name}));
    } else {
      RepositoryEntry entry = RepositoryManager.getInstance().lookupRepositoryEntry(ores, true);
      name = entry.getDisplayname();
      sb.append(trans.translate("wiki.exported.from.repository", new String[]{name}));
View Full Code Here

   

  public void doIndex(SearchResourceContext parentResourceContext, Object businessObj, OlatFullIndexer indexWriter) throws IOException,InterruptedException {
    if (!(businessObj instanceof BusinessGroup) )
      throw new AssertException("businessObj must be BusinessGroup");
    BusinessGroup businessGroup = (BusinessGroup)businessObj;
   
    OlatRootFolderImpl rootContainer = new OlatRootFolderImpl(getFolderRelPath(businessGroup), null);
    SearchResourceContext forumSearchResourceContext = new SearchResourceContext(parentResourceContext);
    forumSearchResourceContext.setBusinessControlFor(BusinessGroupMainRunController.ORES_TOOLFOLDER);
    forumSearchResourceContext.setDocumentType(TYPE);
    forumSearchResourceContext.setParentContextType(GroupDocument.TYPE);
    forumSearchResourceContext.setParentContextName(businessGroup.getName());
    doIndexVFSContainer(forumSearchResourceContext,rootContainer,indexWriter,"", FolderIndexerAccess.FULL_ACCESS);
  }
View Full Code Here

 
  @Override
  public void event(UserRequest ureq, Controller source, Event event) {
    if (source == this.groupController) {
      if (event == Event.DONE_EVENT) {
        BusinessGroup newGroup = doCopyGroup();
        if (newGroup == null) {
          this.groupController.setGroupNameExistsError(null);
        } else {
          this.copiedGroup = newGroup;
          // finished event
View Full Code Here

TOP

Related Classes of org.olat.group.BusinessGroup

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.