code: public void writeOrganizationalUnit(CmsDbContext dbc, CmsOrganizationalUnit organizationalUnit)
      throws CmsException {
  
          m_monitor.uncacheOrgUnit(organizationalUnit);
          getUserDriver(dbc).writeOrganizationalUnit(dbc, organizationalUnit);
  
          // create a publish list for the 'virtual' publish event
          CmsResource ouRes = readResource(dbc, organizationalUnit.getId(), CmsResourceFilter.DEFAULT);
          CmsPublishList pl = new CmsPublishList(ouRes, false);
          pl.add(ouRes, false);
  
          getProjectDriver(dbc).writePublishHistory(
              dbc,
              pl.getPublishHistoryId(),
              new CmsPublishedResource(ouRes, -1, CmsResourceState.STATE_NEW));
  
          // fire the 'virtual' publish event
          Map<String, Object> eventData = new HashMap<String, Object>();
          eventData.put(I_CmsEventListener.KEY_PUBLISHID, pl.getPublishHistoryId().toString());
          eventData.put(I_CmsEventListener.KEY_PROJECTID, dbc.currentProject().getUuid());
          eventData.put(I_CmsEventListener.KEY_DBCONTEXT, dbc);
          CmsEvent afterPublishEvent = new CmsEvent(I_CmsEventListener.EVENT_PUBLISH_PROJECT, eventData);
          OpenCms.fireCmsEvent(afterPublishEvent);
  
          m_monitor.cacheOrgUnit(organizationalUnit);
      }
docs: Writes an already existing organizational unit.<p>
  
  The organizational unit id has to be a valid OpenCms organizational unit id.<br>
  
  The organizational unit with the given id will be completely overridden
  by the given data.<p>
  
  @param dbc the current db context
  @param organizationalUnit the organizational unit that should be written
  
  @throws CmsException if operation was not successful
  
  @see org.opencms.security.CmsOrgUnitManager#writeOrganizationalUnit(CmsObject, CmsOrganizationalUnit)