X1 DIY approvals

5:11 PM
X1 DIY approvals -

In my blog series so far, I have focused myself on the nuts and bolts of X1 Customization.

This post is an exception. I'm going to go through a complex "problem" and to explain how X1 adaptation can be used to address it.

The problem that I have chosen is not easy by any means, but it is something that I have before on a regular basis, since the first "Dazzle" prototype asked more than five years. We even prevoiusly a solution, but the use of this function was very low, and it is delivered since outdated. to understand why we failed in the past is to make the key, this attempt successful.

The problem will be considered i is "workflow" or, more specifically, how to build a system so that can request user applications and some back-end system or human have decided whether they are worthy before they are given access. The workflow is not complex in itself, , but every customer wants something a little different . Therefore, we have not in the past, and why it is an ideal subject for an adaptation blog.

Please note that this post is both X1 adjustments and showcase adjustments for the front-end cover and rear. End parts of the problem

Here's what we do:

  • How to decide which applications can see a user.
  • How to select which apps are subject to approval
  • How to make sure that these applications "floating" in a condition to be treated, if requested
  • to show how apps as "subject to authorization" or "pending" possibly
  • how to recognize requests and call on your own systems to meet them
  • to highlight such a request as approved or rejected

If I use this blog to prepare lists I also wanted to add the following:

  • as the user workflow to ask related questions such as "why do you want this app '
  • as inform the user feedback from the approver

Those can be addressed, but they need a few APIs that are not in the X1-tech preview (but by the release as his) , I will strive to meet them in a later blog

How to decide which applications can see a user.

storefront has a very simple installation policy. Users can (only) see applications to publish from a XenApp or XenDesktop server, and they can only run applications that they can see both, and have to store an appropriate status Subscription.

The simplest approach to support Therefore workflow is easily publish applications that require workflow with applications that do not, and to use the subscription memory for controlling access.

but this is where the first customer "gotcha" tends to make. Many customers want an alternative. You want to use for "visibility" of an AD group and another AD group for "permissions". For example, I might want to say: "Everyone can request the distribution sales force," but only the people "Salesforce users" can run it.

With X1, we have an answer to this, but it requires some additional setup.

For these applications, we would recommend two application messages: a dummy Salesforce published on the "Sales" group and the real Salesforce released Salesforce user. Use we can adjustments to ensure that the user only sees one of them. For our purposes, I will no more to say about the "dummy app" approach and focus on the basic scheme

How to select which apps are subject to approval .:

Marking applications for admission is simply the case, add a keyword. I'm the keyword "WFS" (workflow support) to use, because it has been historically used, and some of the older (pre-X1) receiver is still supported.

add a keyword, simply Enter keywords: WFS in for each app description field you want workflow. This happens when the app on XenApp or XenDesktop posting.

Adding the keyword will not do anything (yet). We need to add server-side adjustment to recognize this concept and to act

How to make sure that these applications "floating" in a condition be added if requested .:

This is where it starts to get complicated. In the early days of the receiver and storefront we supported a connection technology that used Microsoft Workflow Studio. This technology is long dead, but we have a simple alternative.

I make available a simple adaptation storefront in the form of a DLL that you can drop in your storefront, which automatically ensures that when a user subscribes to an application, the WFS has keyword, this app is in added the "pending" state, rather than the "subscribed" state. Once the app is highlighted in this manner, Storefront will ensure it can not be started until the workflow (more on that later) is completed.

This is a DLL for the StoreFront 2.7 (the Tech Preview) (see below for a built version 3.0). It is distributed under the normal conditions of the Citrix Developer Network, included below:

 / *************************** * ********************************************* * * Copyright (c ) 2015 Citrix Systems, Inc. All rights reserved. * You can only reproduce, distribute, perform, display or create derivative works of this file * according to prepare a valid license from Citrix. * * This sample code CITRIX "AS IS" AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF ASSUMED * merchantability and fitness for a particular purpose. * ************************************************* ************************ / 

here are the steps it for installation:

  1. Find. the directory where the memory that you want to activate for the workflow For example, C: inetpub wwwroot Purple
  2. Edit web.config in this directory and add the following to the end of section
      
  3. [1945010herunterladen] to the DLL from this link (SF 2.7) and save it in the bin directory (eg C: inetpub wwroot purple bin)
[ EDIT. for StoreFront 3.0 (or 3.0 Tech Preview), you need a different set of binaries. Download from here. The binary for this part is called SimpleWorkflowHandler.dll]

There is no need for IIS to restart (or the machine), the change will be applied automatically.

test

to it, run the X1 UI (navigate to a website) and take a look at a workflow application.

[EDIT. The following section applies only to the 2.7 Tech Preview. For 3.0 / 3.0 Tech Preview skip to ' As can be seen, and call for your own systems to meet them requests']

The user interface will not look different (!) - but if you try and click "Add" on the button, you will notice it throws you page in the "App details". Obviously something has happened - just not what we wanted How to show apps as "the authorization" or "pending" possibly The X1 UI not automatically the app show different because workflow (at least not in the Tech Preview), and as you just saw, it breaks actually a little. This is because we have some unfinished code - but you can write an adjustment around this.Workflow Apps requiresworkflow a property got: true, which can be used in order to be recognized. Unfortunately, the tech locks Preview subscription for applications with this feature, so you need a tweak to prevent this. Add this to custom script.js
 CTXS.Extensions.preProcessAppData = function (store, appData) {for (var i = 0, max = appData.resources.length; i  

to the CSS class to recognize and use it in your adjustment. For example, shows the following Adjustment "request" and not on "Add" for each application, the workflow needs. (This adjustment Note may not survive versions, as it is based on a deeper knowledge of the UI structure - but we are planning for this case add built-in support, so no big problem)

Add this to custom style.css

 / * Hide 'Add' text * / .requiresworkflow.available .storeapp-action link span {display: none; } / * Show 'Request' instead of * / .requiresworkflow.available .storeapp Action Link: before {content: "Request"; } 

This should

receive

If you will move to "request" the resource to the state outstanding. This is a little ugly at present:

Again, we can make some adjustments to add this to avoid neatly by a shorter message as "Pending Approval" choosing the ugly packaging.

This is the right way to do it [spoiler – this won’t work yet]. In the custom directory you will find a string database for each language find. This allows you to add your own strings - or any of the standard to change those.

 (function ($) {$ .localization.customStringBundle ( 'en', {PendingApproval: "Until '});}) So in principle you should custom  strings.en.js work this (jQuery .); 
   

Unfortunately, when writing this post, I discovered an error in the tech preview, we do not invite the really strings.en.js file - although we do load files for non-English language this will be fixed, but in the meantime, here is a replacement fix with CSS styles.css> Include as usual.

 .pending .storeapp-action link span {display: none;} .pending .storeapp Action link: before {content: "Pending";} 

A recent client side adjustment - in the local " favorites "screen is no indication that an application in waiting state, this is easy to fix again in custom add styles.css

 .myapps view .pending {opacity:.. 0.5; } 

Here is a demo of the can showing these visual effects (you can not really subscribe to this UI - it's just a dummy site) ..

In the demo site: an app was

  • denied - you will get a pop-up message appears when you open the user interface
  • an app (ADP iPay) is pending - you will see it dimmed in favorites and a "pending" symbol in "Apps"
  • an app (Adobe Reader) approval requires - you will get a 'Request' label 'Apps '[see
For comparison of the two files that we have changed are here:
custom / script.js
custom / style.css

How to recognize requests and call to your own systems to meet them

This is the meat of the problem, and the poor news is that only I going to give a skeleton answer. Drawings are only saved on storefront server (and if you have a cluster, it is replicated to every storefront server). Here the approach is:

  • We use a new utility library access to subscription provide storage, from .NET code
  • (and a PowerShell-friendly command-line tool for those who are less familiar with .Net)
  • make the "business logic" that is informed requested by any app, and finally he moves to a "subscribe" or "denied" condition.

First the library. This is made available under the same license as the previous download.

  • Download Download the library from here and the command line program from here (SF2.7)
  • Create a directory on .. and put both files in the
  • they add the user (s) that uses the library utility on the "CitrixSubscriptionsStoreServiceUsers" group
  • : your storefront server this from ( test eg C) run
[ EDIT. For Storefront 3.0 / 3.0 Tech Preview, you need a different set of binaries. Download from here.]
Before you can use this new utility library, you need to ensure that the caller has permission to view / edit to save the subscription. To do this, go to the control panel, search for "local users" and click on "Local Users and Groups Edit". You must then itself (or the appropriate service account) to add to the group CitrixSubscriptionsStoreServiceUsers.

A quick test.

open a command prompt and try the following :. You need to provide the name of your own store, and want to spend it a list of all subscriptions Subscription store

 C:  test> dir 03/24/2015 06: 27 pm 16,384 SSClient.exe 03/24/2015 06:27 25,0 SubscriptionStoreHelper.dll C:  test> SSClient.exe -STORE Purple -dump users: WWCO  helenj resource: SampleFarm.Access 2013 status: subscribed users: WWCO  helenj resource: SampleFarm.Adobe Reader XI status: subscribed 
 user: WWCO  richardh resource: Controller.Word 2013 status: subscribed users: WWCO  richardh resource: SampleFarm.VLC Media Player status: pending C:  test> 

you can check the status of pending subscription (or the other) change. Experiment with the following (after a workflow app Request).

Note the store / user and app with your own values. must

 SSClient.exe replace -store -user Purple -update WWCO  richardh apt "SampleFarm.VLC media player" status denied 

or

$ client .exe -store -user Purple -update WWCO richardh apt "SampleFarm.VLC media player" status subscribed

Under the hood:

Let in what will actually do this tool ... and how to write your own. we

the key is the 'SubscriptionStoreHelper' dll. This provides a simple interface for subscription shop. Here is the primary interface sets it (If you plan to use this, I would recommend downloading the associated XML file Visual Studio to give some tooltips for DLL)

  public interface  ISubscriptionStore { ///    ///   flush automatically save all changes (true by default)   ///    Bool  Auto Save { obtained; set; }  ///    ///   Are all subscriptions for a given user   ///    ///    stream of subscriptions      IEnumerable   GetSubscriptionsForUser ( string  usernameOrSid );  ///    ///   make all subscriptions added / to the store since the last   ///  [1945035verändert] receive call 'subscriptions. "  ///    ///    Stream of subscriptions      IEnumerable   GetNewSubscriptions ();  ///    ///   Get all subscriptions added / changed since the specified date   ///   Note the date is lower accuracy and are only an approximation.   ///   Some subscriptions may also be returned before the date.   ///    ///    Approximate date      ///    stream of subscriptions      IEnumerable   GetSubscriptionsSince ( Date Time  out);  ///    ///   Get all subscription entries in the database   ///    / //    stream of subscriptions      IEnumerable   GetAllSubscriptions ();  ///    ///   a single subscription removed based on user / sid and resource ID.   ///   Note. Not currently supported by storefront of   ///    ///    user to remove subscription.      ///    resources subscription to remove data.      ///     Bool  RemoveSubscriptionInfo ( string  usernameOrSid  string  resource); create  ///    ///   update or subscription entries.   ///    / //    to store the Info-Subscription      ///    Merge properties with existing properties (default: false)      ///    True on success      Bool  SetSubscriptionInfo (SubInfo info  Bool  mergeProperties =  false );  ///    ///   a single subscription will receive based on the user / sid and resource in the given subscription info   // /    ///    user subscription for Look of      ///    resources to look up      ///    The matching record or null if none is found      SubInfo  getSubscriptionInfo ( string  usernameOrSid  string  resource);  ///    ///   Flush all changes to the store. This is only required if AutoSave to false  is on  ///    void  SaveChanges (); } 

Let us write a simple client to use these. (for C # those of you not familiar can jump with you or as a side forward)

in Visual Studio to create a new command line project, include the standard program with the following text a reference to the SubscriptionStoreHelper.dll and replace:

  with  system;  namespace  Citrix.DeveloperNetwork.StoreFront { public class   SSDump  { public static int  Main ( string  [] args) { string  url =  string  .Format ( "net.pipe: // localhost / Citrix / subscriptions / 1__Citrix_ {0}", args [0]);  var  client = new  SubscriptionStore  (url);  var  = subscriptions client.GetAllSubscriptions ();  foreach  ( var  info  in  subscriptions) { Console  .Out.WriteLine ( "{0} {1} {2}" info.User, info.Resource, info.Status); }}}} 

Remember you must copy it to your storefront server to run it!

This program is very simple. It does the following:

  • URL Construct the memory referencing to the command line specified
  • Creates a SubscriptionStore Helper Object
  • Gets the object all subscriptions to the list
  • dumps to the command line subscriptions

, you can use the same pattern to update subscriptions or- Clear in theory . I say "in theory" because erasure is not currently implemented on storefront. It is part of the API, but it is not.

Instead of all operations and spell flows in detail, I'll just some key features indicate enter to access source to the command line tool, which they all.

  • You can ask for all subscriptions, subscriptions for some time or subscriptions for a given user
  • exerts
  • You can then ask for all new / updated subscription (so you can monitor for changes)
  • you can set subscription status or subscription properties. Characteristics associated with each subscription for general purposes Name / value pairs. These are used today to remember the order that applications are displayed on the "Favorites" screen, but you can invent your own applications.

I wrote a general purpose command line client that uses this library (this is the SSClient you downloaded earlier). Enter SSClient.exe no arguments a complete list of options display. This gives:

 C:  test> SSClient.exe Usage SubscriptionStoreClient -url    or SubscriptionStoreClient -store  [-siteid]  save WCF endpoint for the drawing:  . For example, net.pipe: // localhost / Citrix / subscriptions / 1__Citrix_Store : Store Name. For example, Store : IIS site id (default: 1) : set | update | Clear | Dump set / update / delete ================= Set creates a new entry. Update fused to a current. -set Clear away [-sid | -user ] app  status  [-properties] -update [-sid | -user ] app  status  [-properties] -delete [-sid | -user ] app  [NB currently implemented in StoreFront] : User sid update for subscrption : User for subscrption (AD format) to update. (Sid or user must be specified) : update resource ID of the subscription : Status in DB to store (eg subscribed / unsubscribed / pending / refused : semicolon-separated list of name = value pairs dump = === content of the database dump Can. loop and display any changes -dump [-csv] [-user ] [-app] [-props [names]] [-start] [[-stream [-delay timespan]] -csv: to facilitate output in CSV format post -props. Include subscription properties name (required for the CSV) can be optionally specified -start  Only after the specified date / time (approx) return entries stream 

you can also use the access, and tweak you in any way must take into account license for the standard Citrix Developer Network (as included above, and in the source file).

Back to Workflow

we will look at how to use these tools for a simple workflow. As I said I the details are up to you, but here is an example.

  1. Save the subscription for each app Monitor the "floating" condition occurs.
    (Note the -csv option SSClient elsewhere are data in a format consume easy to use, for example in PowerShell).
  2. SSClient.exe -store Purple -dump -csv -status pending stream
    for any change fire from the corresponding workflow.
  3. When a workflow is complete, the app move in the "denied" or "subscribed" state
 SSClient.exe -STORE Purple -User "WWCO  Richard" app "Sample Farm. VLC media player" -Update -status subscribed 

Summary and next steps

workflow in X1 is not yet baked. There are a number of places in this post not where we needed to improve the default behavior, have to do what we need. However, support for displaying and processing of applications, have the workflow is coming. That is, while XenMobile has burned an email-based approval system, there are no immediate plans to add something similar to storefront. If you want a partner to build such a solution, or a customer who is to integrate into an existing system, then I hope this blog, the tools that you need. Please let me know if there are any gaps.

In the next post I will return approach to the "dummy apps", and show how you can link to a system that uses Active Directory groups to shortlist subscriptions. I'll also show you how you can already mentioned the subscriptions properties useful to pass state between the X1 client and back-end systems. This can be used to prompt the user for details or its application, or inform them of the reasons for rejection.

blogs in this series

  • Welcome to the Receiver X1
  • providing and branding receiver X1
  • X1 adaptation: with CSS deeper
  • Scripting X1
  • receiver X1 APIs
  • X1 skin for NetScaler Gateway
  • X1 DIY approvals
  • Old receiver is dead. Long live New receiver.
Previous
Next Post »
0 Komentar