Ejemplo n.º 1
0
 public void execute(Event<UIWCMCacheManagerForm> event) throws Exception {
   UIWCMCacheManagerForm uiCacheForm = event.getSource();
   String cacheOpt = uiCacheForm.getUIFormSelectBox(FIELD_MODIFY).getValue();
   // get current cache
   cache = WCMCoreUtils.getService(CacheService.class).getCacheInstance(cacheOpt);
   // update cache info
   uiCacheForm.update(cache);
   event.getRequestContext().addUIComponentToUpdateByAjax(uiCacheForm);
 }
Ejemplo n.º 2
0
    public void execute(Event<UIWCMCacheManagerForm> event) throws Exception {
      UIWCMCacheManagerForm uiCacheForm = event.getSource();
      UIWCMCacheManagerPanel uiCachePanel =
          uiCacheForm.getAncestorOfType(UIWCMCacheManagerPanel.class);
      // droplist option choice
      // String cacheOpt = uiCacheForm.getUIFormSelectBox(FIELD_MODIFY).getValue();

      // get current cache
      // cache = WCMCoreUtils.getService(CacheService.class).getCacheInstance(cacheOpt);

      // check whether its allowed to change
      Boolean isChecked = uiCacheForm.getUIFormCheckBoxInput(CHECKBOX_ENABLE_CACHE).isChecked();
      if (isChecked) {
        String livetime = uiCacheForm.getUIStringInput(FIELD_LIVE_TIME).getValue();
        String maxsize = uiCacheForm.getUIStringInput(FIELD_MAX_SIZE).getValue();
        // update changes
        uiCacheForm.cache.setLiveTime(Long.parseLong(livetime));
        uiCacheForm.cache.setMaxSize(Integer.parseInt(maxsize));
        // update cache info
        uiCacheForm.update(cache);
      } else {
        throw new Exception("cache enable is not set");
      }

      event.getRequestContext().addUIComponentToUpdateByAjax(uiCachePanel);
    }
Ejemplo n.º 3
0
 public void execute(Event<UIWCMCacheManagerForm> event) throws Exception {
   UIWCMCacheManagerForm uiCacheForm = event.getSource();
   UIWCMCacheManagerPanel wcmCache = uiCacheForm.getAncestorOfType(UIWCMCacheManagerPanel.class);
   uiCacheForm.update(cache);
   event.getRequestContext().addUIComponentToUpdateByAjax(wcmCache);
 }