コード例 #1
0
ファイル: SyncThread.java プロジェクト: tchukuchuk/rhodes
 public static void doSyncSourceByName(String strSrcName, boolean bShowStatus) {
   if (bShowStatus && (m_statusListener != null)) {
     m_statusListener.createStatusPopup(RhoAppAdapter.getMessageText("syncronizing_data"));
   }
   getInstance()
       .addQueueCommand(new SyncCommand(SyncThread.scSyncOne, strSrcName, (int) 0, bShowStatus));
 }
コード例 #2
0
ファイル: SyncNotify.java プロジェクト: LittleForker/rhodes
  public void reportSyncStatus(String status, int error, String strDetails) {
    synchronized (m_mxSyncNotifications) {
      if (m_syncStatusListener != null
          && (isReportingEnabled() || error == RhoAppAdapter.ERR_SYNCVERSION)) {

        if (error == RhoAppAdapter.ERR_SYNCVERSION) status = RhoAppAdapter.getErrorText(error);
        else {
          if (strDetails.length() == 0) strDetails = RhoAppAdapter.getErrorText(error);
          status +=
              (strDetails.length() > 0 ? RhoAppAdapter.getMessageText("details") + strDetails : "");
        }

        LOG.INFO("Status: " + status);

        m_syncStatusListener.reportStatus(status, error);
      }
    }
  }
コード例 #3
0
ファイル: SyncNotify.java プロジェクト: LittleForker/rhodes
  void fireSyncNotification(SyncSource src, boolean bFinish, int nErrCode, String strMessage) {
    if (getSync().getState() == SyncEngine.esExit) return;

    if (strMessage.length() > 0 || nErrCode != RhoAppAdapter.ERR_NONE) {
      if (!getSync().isSearch()) {
        if (src != null && (strMessage == null || strMessage.length() == 0))
          strMessage = RhoAppAdapter.getMessageText("sync_failed_for") + src.getName() + ".";

        reportSyncStatus(strMessage, nErrCode, src != null ? src.m_strError : "");
      }
    }

    doFireSyncNotification(src, bFinish, nErrCode, "", "", "");
  }
コード例 #4
0
  protected boolean checkRhoExtensions(String application, String model) {
    if (application.equalsIgnoreCase("AppManager")) {
      // TODO: AppManager
      respondOK();
      return true;
    } else if (application.equalsIgnoreCase("system")) {
      if (model.equalsIgnoreCase("geolocation")) {
        showGeoLocation();
        return true;
      } else if (model.equalsIgnoreCase("loadserversources")) {
        RhoAppAdapter.loadServerSources(postData.toString());
        return true;
      } else if (model.equalsIgnoreCase("loadallsyncsources")) {
        RhoAppAdapter.loadAllSyncSources();
        return true;
      } else if (model.equalsIgnoreCase("resetDBOnSyncUserChanged")) {
        RhoAppAdapter.resetDBOnSyncUserChanged();
        return true;
      }

    } else if (application.equalsIgnoreCase("shared")) return false;

    return false;
  }
コード例 #5
0
ファイル: SyncNotify.java プロジェクト: LittleForker/rhodes
  void fireBulkSyncNotification(boolean bFinish, String status, String partition, int nErrCode) {
    if (getSync().getState() == SyncEngine.esExit) return;

    if (nErrCode != RhoAppAdapter.ERR_NONE) {
      String strMessage = RhoAppAdapter.getMessageText("sync_failed_for") + "bulk.";
      reportSyncStatus(strMessage, nErrCode, "");
    }

    String strParams = "";
    strParams += "partition=" + partition;
    strParams += "&bulk_status=" + status;
    strParams += "&sync_type=bulk";

    doFireSyncNotification(null, bFinish, nErrCode, "", strParams, "");
  }
コード例 #6
0
ファイル: SyncNotify.java プロジェクト: LittleForker/rhodes
  void fireAllSyncNotifications(
      boolean bFinish, int nErrCode, String strError, String strServerError) {
    if (getSync().getState() == SyncEngine.esExit) return;

    if (nErrCode != RhoAppAdapter.ERR_NONE) {
      if (!getSync().isSearch()) {
        String strMessage = RhoAppAdapter.getMessageText("sync_failed_for") + "all.";

        reportSyncStatus(strMessage, nErrCode, strError);
      }
    }

    synchronized (m_mxSyncNotifications) {
      SyncNotification pSN = getSyncNotifyBySrc(null);
      if (pSN != null)
        doFireSyncNotification(null, bFinish, nErrCode, strError, "", strServerError);
    }
  }
コード例 #7
0
ファイル: SyncThread.java プロジェクト: tchukuchuk/rhodes
 void checkShowStatus(SyncCommand oSyncCmd) {
   boolean bShowStatus = oSyncCmd.m_bShowStatus && !this.isNoThreadedMode();
   m_oSyncEngine.getNotify().enableReporting(bShowStatus);
   if (m_oSyncEngine.getNotify().isReportingEnabled())
     m_statusListener.createStatusPopup(RhoAppAdapter.getMessageText("syncronizing_data"));
 }