Skip to content
This repository was archived by the owner on Jan 3, 2023. It is now read-only.
Merged
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
8 changes: 6 additions & 2 deletions CacheInitializer/ParamHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@ class Options
public string server { get; set; }

[Option('a', "appname", Required = false,
HelpText = "App to load")]
HelpText = "App to load (using app name)")]
public string appname { get; set; }

[Option('p', "appname", Required = false,
[Option('i', "appid", Required = false,
HelpText = "App to load (using app ID)")]
public string appid { get; set; }

[Option('p', "proxy", Required = false,
HelpText = "Virtual Proxy to use")]
public string virtualProxy { get; set; }

Expand Down
24 changes: 19 additions & 5 deletions CacheInitializer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ static void Main(string[] args)
{
serverURL = new Uri(options.server);
appname = options.appname;
appid = options.appid;
virtualProxy = !string.IsNullOrEmpty(options.virtualProxy) ? options.virtualProxy : "" ;
openSheets = options.fetchobjects;
if (options.selectionfield != null)
Expand Down Expand Up @@ -73,19 +74,32 @@ static void Main(string[] args)


////Start to cache the apps
if (appname != null)

if (appid != null)
{
//Open up and cache one app
IAppIdentifier appidentifier = remoteQlikSenseLocation.AppWithNameOrDefault(appname);
//Open up and cache one app, based on app ID
IAppIdentifier appidentifier = remoteQlikSenseLocation.AppWithId(appid);

LoadCache(remoteQlikSenseLocation, appidentifier, openSheets, mySelection);

}
else
{
//Get all apps, open them up and cache them
remoteQlikSenseLocation.GetAppIdentifiers().ToList().ForEach(id => LoadCache(remoteQlikSenseLocation, id, openSheets, null));
if (appname != null)
{
//Open up and cache one app
IAppIdentifier appidentifier = remoteQlikSenseLocation.AppWithNameOrDefault(appname);

LoadCache(remoteQlikSenseLocation, appidentifier, openSheets, mySelection);
}
else
{
//Get all apps, open them up and cache them
remoteQlikSenseLocation.GetAppIdentifiers().ToList().ForEach(id => LoadCache(remoteQlikSenseLocation, id, openSheets, null));
}
}


////Wrap it up
var dt = DateTime.Now - d;
Print("Cache initialization complete. Total time: {0}", dt.ToString());
Expand Down