Subversion Repositories XServices

Rev

Rev 39 | Rev 52 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 39 Rev 42
Line 147... Line 147...
147
			IRepositoryQuery query, TaskDataCollector collector,
147
			IRepositoryQuery query, TaskDataCollector collector,
148
			ISynchronizationSession session, IProgressMonitor monitor) {
148
			ISynchronizationSession session, IProgressMonitor monitor) {
149
			monitor.subTask("Calculating query result size ...");
149
			monitor.subTask("Calculating query result size ...");
150
		try {
150
		try {
151
			SBMClient client = new SBMClient(repository);
151
			SBMClient client = new SBMClient(repository);
152
			int countItem = client.getResultCount(getQueryTable(repository), 
152
			List<String> idlist = client.getResultCount(getQueryTable(repository), 
153
					query.getAttribute("sql_where"));
153
					query.getAttribute("sql_where"));
-
 
154
			int countItem = idlist.size();
154
			monitor.beginTask("", countItem);
155
			monitor.beginTask("", countItem);
155
			monitor.subTask("Loading "+countItem+" items ...");
156
			monitor.subTask("Loading "+countItem+" items ...");
-
 
157
			
156
			List<TTItem> list = client.getTTItemsByTable(
158
			//List<TTItem> list = client.getTTItemsByTable(
157
					getQueryTable(repository), query.getAttribute("sql_where"),
159
			//		getQueryTable(repository), query.getAttribute("sql_where"),
158
					true);
160
			//		true);
159
			monitor.worked(1);
161
			monitor.worked(1);
-
 
162
			int i = 1;
160
			for (TTItem ttitem : list) {
163
			for (String id : idlist) {
-
 
164
				if(id!=null) {
-
 
165
				monitor.subTask("Loading item "+i+"/"+countItem+" ...");
-
 
166
				TTItem ttitem = client.getTTItem("["+id+"]");
161
				TaskData data = datahandler.convert(repository, ttitem,
167
				TaskData data = datahandler.convert(repository, ttitem,
162
						monitor, query);
168
						monitor, query);
163
				collector.accept(data);
169
				collector.accept(data);
-
 
170
				}
164
				monitor.worked(1);
171
				monitor.worked(1);
165
				if(monitor.isCanceled()) return Status.CANCEL_STATUS;
172
				if(monitor.isCanceled()) return Status.CANCEL_STATUS;
-
 
173
				i++;
166
			}
174
			}
167
		} catch (CoreException e) {
175
		} catch (CoreException e) {
168
			IStatus status =  new Status(IStatus.ERROR, SBMConnectorPlugin.PLUGIN_ID,
176
			IStatus status =  new Status(IStatus.ERROR, SBMConnectorPlugin.PLUGIN_ID,
169
					e.getMessage(), e);
177
					e.getMessage(), e);
170
			//StatusManager.getManager().handle(status, StatusManager.BLOCK);
178
			//StatusManager.getManager().handle(status, StatusManager.BLOCK);