Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ecl/eclcmd/queries/ecl-queries.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,8 @@ class EclCmdQueriesCopyQueryset : public EclCmdCommon
continue;
if (iter.matchFlag(optCloneActiveState, ECLOPT_CLONE_ACTIVE_STATE))
continue;
if (iter.matchFlag(optDeletePrevious, ECLOPT_DELETE_PREVIOUS)||iter.matchFlag(optDeletePrevious, ECLOPT_DELETE_PREVIOUS_S))
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space after the || operator. The condition should be formatted as "iter.matchFlag(optDeletePrevious, ECLOPT_DELETE_PREVIOUS) || iter.matchFlag(optDeletePrevious, ECLOPT_DELETE_PREVIOUS_S)" for consistency with other similar checks in this file.

Suggested change
if (iter.matchFlag(optDeletePrevious, ECLOPT_DELETE_PREVIOUS)||iter.matchFlag(optDeletePrevious, ECLOPT_DELETE_PREVIOUS_S))
if (iter.matchFlag(optDeletePrevious, ECLOPT_DELETE_PREVIOUS) || iter.matchFlag(optDeletePrevious, ECLOPT_DELETE_PREVIOUS_S))

Copilot uses AI. Check for mistakes.
continue;
if (iter.matchFlag(optDontCopyFiles, ECLOPT_DONT_COPY_FILES))
continue;
if (iter.matchFlag(optAllQueries, ECLOPT_ALL))
Expand Down Expand Up @@ -796,6 +798,8 @@ class EclCmdQueriesCopyQueryset : public EclCmdCommon
req->setDfsServer(optDaliIP.get());
req->setSourceProcess(optSourceProcess);
req->setCloneActiveState(optCloneActiveState);
if (optDeletePrevious)
req->setActivate(CWUQueryActivationMode_ActivateDeletePrevious);
req->setOverwriteDfs(optOverwrite);
req->setUpdateSuperFiles(optUpdateSuperfiles);
req->setUpdateCloneFrom(optUpdateCloneFrom);
Expand Down Expand Up @@ -862,6 +866,7 @@ class EclCmdQueriesCopyQueryset : public EclCmdCommon
" --daliip=<ip> Remote Dali DFS to use for copying file information\n"
" --source-process Process cluster to copy files from\n"
" --clone-active-state Make copied queries active if active on source\n"
" -dp, --delete-prev Delete previously active query\n"
" -O, --overwrite Completely replace existing DFS file information (dangerous)\n"
" --update-super-files Update local DFS super-files if remote DALI has changed\n"
" --update-clone-from Update local clone from location if remote DALI has changed\n"
Expand All @@ -887,6 +892,7 @@ class EclCmdQueriesCopyQueryset : public EclCmdCommon
bool optDontCopyFiles;
bool optAllowForeign;
bool optAllQueries;
bool optDeletePrevious = false;
bool optSourceSSL = false; //user explicitly turning on SSL for accessing the remote source location (ssl defaults to use SSL if we are hitting ESP via SSL)
bool optSourceNoSSL = false; //user explicitly turning OFF SSL for accessing the remote source location (ssl defaults to not use SSL if we are not hitting ESP via SSL)
};
Expand Down
2 changes: 1 addition & 1 deletion esp/scm/ws_workunits.ecm
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ EspInclude(ws_workunits_queryset_req_resp);

ESPservice [
auth_feature("DEFERRED"), //This declares that the method logic handles feature level authorization
version("2.03"), default_client_version("2.03"), cache_group("ESPWsWUs"),
version("2.04"), default_client_version("2.04"), cache_group("ESPWsWUs"),
noforms,exceptions_inline("./smc_xslt/exceptions.xslt"),use_method_name] WsWorkunits
{
ESPmethod [cache_seconds(60), resp_xsl_default("/esp/xslt/workunits.xslt")] WUQuery(WUQueryRequest, WUQueryResponse);
Expand Down
1 change: 1 addition & 0 deletions esp/scm/ws_workunits_queryset_req_resp.ecm
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,7 @@ ESPrequest [nil_remove] WUCopyQuerySetRequest
[min_ver("1.95")] string DfuPublisherWuid; //Wuid can be preallocated and then passed in here to use. Will be created if empty
[min_ver("1.97")] string RemoteStorage;
[min_ver("2.02")] string KeyCompression;
[min_ver("2.04")] ESPEnum WUQueryActivationMode Activate;
};

ESPresponse [exceptions_inline] WUCopyQuerySetResponse
Expand Down
20 changes: 17 additions & 3 deletions esp/services/ws_workunits/ws_workunitsQuerySets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3056,12 +3056,18 @@ class QueryCloner
queryDirectory.set(dir);
}

void setActivationMode(int mode)
{
activationMode = mode;
}

void addToBePublished(const char *wuid, const char *name, bool makeActive, const char *userid, IPropertyTree *query)
{
IPropertyTree *entry = toBePublished->addPropTree("Publish");
entry->setProp("@wuid", wuid);
entry->setProp("@name", name);
entry->setPropBool("@makeActive", makeActive);
entry->setPropInt("@activationMode", makeActive ? activationMode : DO_NOT_ACTIVATE);
entry->setProp("@userid", userid);
entry->addPropTree("Info", createPTreeFromIPT(query));

Expand All @@ -3082,7 +3088,12 @@ class QueryCloner
IPropertyTree &entry = entries->query();
StringBuffer newQueryId;
Owned<IWorkUnit> workunit = factory->updateWorkUnit(entry.queryProp("@wuid"));
addQueryToQuerySet(workunit, destQuerySet, entry.queryProp("@name"), entry.getPropBool("@makeActive") ? ACTIVATE_SUSPEND_PREVIOUS : DO_NOT_ACTIVATE, newQueryId, entry.queryProp("@userid"));
int queryActivationMode = DO_NOT_ACTIVATE;
if (entry.hasProp("@activationMode"))
queryActivationMode = entry.getPropInt("@activationMode");
else if (entry.getPropBool("@makeActive"))
queryActivationMode = ACTIVATE_SUSPEND_PREVIOUS;
addQueryToQuerySet(workunit, destQuerySet, entry.queryProp("@name"), (WUQueryActivationOptions)queryActivationMode, newQueryId, entry.queryProp("@userid"));
copiedQueryIds.append(newQueryId);
IPropertyTree *info = entry.queryPropTree("Info");
if (info)
Expand Down Expand Up @@ -3131,7 +3142,7 @@ class QueryCloner
{
existingQueryIds.append(existingQueryId.str());
if (makeActive)
activateQuery(destQuerySet, ACTIVATE_SUSPEND_PREVIOUS, queryName, existingQueryId.str(), context->queryUserId());
activateQuery(destQuerySet, (WUQueryActivationOptions)activationMode, queryName, existingQueryId.str(), context->queryUserId());
return;
}
addToBePublished(wuid, queryName, makeActive, context->queryUserId(), query);
Expand All @@ -3158,7 +3169,7 @@ class QueryCloner
{
existingQueryIds.append(existingQueryId.str());
if (makeActive)
activateQuery(destQuerySet, ACTIVATE_SUSPEND_PREVIOUS, queryName, existingQueryId.str(), context->queryUserId());
activateQuery(destQuerySet, (WUQueryActivationOptions)activationMode, queryName, existingQueryId.str(), context->queryUserId());
return;
}
StringBuffer newQueryId;
Expand Down Expand Up @@ -3321,6 +3332,7 @@ class QueryCloner
bool cloneFilesEnabled = false;
bool useSSL = false;
unsigned updateFlags = 0;
int activationMode = ACTIVATE_SUSPEND_PREVIOUS;
StringArray locations;

public:
Expand Down Expand Up @@ -3353,6 +3365,8 @@ bool CWsWorkunitsEx::onWUCopyQuerySet(IEspContext &context, IEspWUCopyQuerySetRe
QueryCloner cloner(&context, srcAddress, srcTarget, target, req.getSourceSSL());
cloner.setQueryDirectory(queryDirectory);

cloner.setActivationMode(req.getActivate());

SCMStringBuffer process;
StringBuffer publisherWuid(req.getDfuPublisherWuid());
if (req.getCopyFiles())
Expand Down
Loading