Jump to content
Welcome to our new Citrix community!

CTXS.Extensions API for StoreFront 1912 customizations


Recommended Posts

Hello,

we are looking to heavily customize StoreFront.  Many customization examples online relate to custom Java scripts which use CTXS.Extensions API.  

Outside of some random examples I don't see Citrix official CTXS.Extensions API documentation.  

https://www.citrix.com/content/dam/citrix/en_us/citrix-developer/documents/receiver-apis.html

 

Does anyone know if such documentation exist ?  

 

 

 

Link to comment
Share on other sites

Unfortunately, besides the few examples in the Citrix blogs, the doc you mention is the only documentation that exists.

I've been asking for better documentation on all the JavaScript objects, attributes, and methods available, but nothing has come out of it.

I've done some work with the API, so if you have any specific questions, please ask, and I'll see if I can assist.

Link to comment
Share on other sites

I agree, wish Citrix published better documentation on this.

 

Hi Sam, we are autolaunching an app on login and use HTML5 with option to open in the same tab, the issue we trying to solve is to prevent the app launch loop when a user closes the session before SF times out. we tried using a variable Flag in beforeDisplayHomeScreen(callback) to track the initial launch but this function seems to be executed on return when session is closed. Any thoughts or guidance? 

 

var ctxAppName = "OutlookWeb";
CTXS.Extensions.noteApp = function (app) {
	if(app.name == ctxAppName){  		       
		CTXS.ExtensionAPI.launch(app);					    	
	}	
};

 

Link to comment
Share on other sites

There is a comment on the noteApp extension that you shouldn't use the app immediately (like launch it) in that routine.

So I set some variables at the top of the file, and then autolaunch in afterDisplayHomeScreen:

// at top of script.js
var autolaunchDone     = false;
var foundAppToLaunch = false;
var appToAutoLaunch   = null
var autoLaunchAppName = "OutlookWeb";


// ensure user has permissions to the app
CTXS.Extensions.noteApp = function(app) {
    if (app.name == autoLaunchAppName) {
    	foundAppToLaunch = true;
    	appToAutoLaunch = app;
    }
}

CTXS.Extensions.afterDisplayHomeScreen = function() {
  // do we have an app to autolaunch ?
  if ((!autolaunchDone) && (foundAppToLaunch)) {
    CTXS.ExtensionAPI.launch(appToAutoLaunch);
    autolaunchDone = true;
  }
}

 

Link to comment
Share on other sites

Thanks Sam. 

 

Currently I'm using the sessionStorage to track the launch. Basically creating a variable after the launch, checking for its non existence during the initial launch and removing the variable on app close/disconnect.

 

One caveat is if NS Gateway times out before the app is closed, the session variable doesn't get cleared. I was trying to keep all edits local to storefront but it look like I might need to touch NetScaler to clear the variable at login. 

 

Some history behind this use case, we are trying to associate hostname url to single app. Eg: Exchange OWA to provide ease of access with clientless experience and still have security control over copy/paste, printing etc.. 

 

We also wanted a repeatable and manageable model so ended using the keywords defined in studio.

 

Members, for those who might be interested I'm including the storefront JS code below.  Feel free to chime in if you notice  improvements or extensions can be made.

 

var ctxAppName;
var foundAppToLaunch = false;
var appToAutoLaunch   = null;

// find appName associated with hostname url - Utlizing Published App keywords defined in Studio, repeatable model for other apps. 
CTXS.Extensions.preProcessAppData = function (store, json) {
	for ( i = 0; i < json.resources.length; i++) {
		for ( y = 0; y < json.resources[i].keywords.length; y++) {
			if(json.resources[i].keywords[y] == location.hostname){
				ctxAppName = json.resources[i].name;			
			}
		}	
	}	
};

// hide apps not associated with hostname url
CTXS.Extensions.excludeApp = function(app) {
	if (app.name!= ctxAppName) {
		return true;
	}
};

// ensure user has pemissions to the app
CTXS.Extensions.noteApp = function(app) {
    if (app.name == ctxAppName) {
    	foundAppToLaunch = true;
    	appToAutoLaunch = app;
    }
}

CTXS.Extensions.afterDisplayHomeScreen = function() {
  // do we have an app to autolaunch and has the first launch occured ?
	if(sessionStorage.getItem("appLaunched") === null && foundAppToLaunch){  		
        sessionStorage.setItem("appLaunched", "true");			
		CTXS.ExtensionAPI.launch(appToAutoLaunch);					    	
	}
	else {		
		sessionStorage.removeItem("appLaunched");		
		CTXS.Environment.logOff();
	}
}

 

 

 

 

Link to comment
Share on other sites

Thanks Sam.  This is so unfortunate.  I wish I could stick to web interface..

 

Most of web.config and styles.css examples I found so far seem to apply to StoreFront 3.x and have no effect in StoreFront 1912.  

 

With this in styles.css I can remove icon graphic and make tiles little smaller but would like to make tiles as small enough just to display application name. 

 

.largeTiles .storeapp-favorite-icon {
    display: none;
}
.storeapp-action-link {
    display: none;
}
.largeTiles .storeapp-details-link {
    display: none;
}
.largeTiles.smallCards .folder, .largeTiles.smallCards .storeapp {
    width: 150px;
    height: 135px;
}
.largeTiles .storeapp .storeapp-name {
    text-overflow: ellipsis;
    overflow: hidden;
    font-size: 12px;
}

 

image.png.40e8b6d0a422d707308a3b0d0a36150f.png

Link to comment
Share on other sites

Thank you Sir, this looked really close. 

I just realized I can't hide storeapp-details-link which is what actually launches the app.  Without it there is no way to launch the app, outside of clicking the app name (Excel 2016 in my case) to expand app details and then click Open. 

It's not easy, indeed.

I really wish Citrix published all the options without  having to inspect thousands of css objects. 

Link to comment
Share on other sites

  • 2 months later...

Hello,

 

We are evaluating StoreFront 1912 LTSR CU2.  So far I managed to customize it so it is looks more like the v3.x, but the Uncategorized Categories is going to be a deal breaker.  

 

Is there a way to display the icons that is not in a folder as icons below the Categories folders, but not in the Uncategorized folder?

 

Thanks

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...