Specify the GUI declaratively in ActionScript like in JavaFX Script instead of MXML

After reading a bit about JavaFX Script (which is actually remarkebly close to ActionScript 3) as a developer I thought the way one can specify the GUI declaratively in JavaFX Script via JSON-like notation for the components is pretty cool. It would be nice to have something like that in Flex/ActionScript too. The advantages I see over MXML are:
1) a more compact notation than XML which is nice from a developers view point who actually writes this kind of code. Of course the idea would be that designers still design the GUI with graphical tools that generate this code but if you have to dive in and edit the code it's nice not to have to deal with verbose XML and I think even designers can easily understand JSON-like code; don't just assume that designers love XML because HTML was based on SGML! I'm not so sure if today many designers really still know raw HTML that well (like in 1997, the early days...). Server side developers probably know it better because they have to adapt it to jsp or asp or whatever framework.
2) The fact that it's all ActionScript gives a seamless integration between just composing the components to form the GUI and adding scripts to add additionial behavior instead of mixing XML with actionscript code => no more need for those nasty CDATA blocks! It would also be easy for development tools like Flexbuilder to give a seamsless experience with code completion and zooming in on the code because it's all Actionscript! There's also no need for a separate expression language to tie the MXML to the underlying Actionscript. It would it also make easier to create custom components (not just simple composition components which is really easy in MXML) because you don't have to implement separate XML tags.
here's a short JavaFX Script example:
Frame {
content: GroupPanel {
var myRow = Row { alignment: BASELINE }
var label_col = Column { alignment: TRAILING }
var field_col = Column { alignment: LEADING }
rows: [myRow]
columns: [label_col, field_col]
content:
[SimpleLabel {
row: myRow
column: label_col
text: "Type your text here:"
TextField {
row: myRow
column: field_col
columns: 50
visible: true
Note that this shouldn't be confused with programmatically specifying the GUI in Actionscript (which is possible today as an alternative to MXML). What I propose is at a (slightly) higher level: you don't give a detailed sequence of methods/functions to call to construct the GUI (i.e. HOW to do it) but just specify WHAT you want.
Hopefully some Adobe Flex will see this and think about it. Although I think MXML is not too bad and I can live with it if I have to ;)

I like that idea Sean. A standard and well-supported way to separate MXML and code would be good. I'd love to have builder support a MVC style triad for MXML files, with the
model.as being simply an all-public-all-bindable class full of VOs and view-specific information, any view-manipulation and view<->app communications in the
controller.as, and nothing but bindings and layour in the MXML. There's (almost) nothing stopping you doing this by hand at the moment, but it's a pain, and developers wouldn't stick to it for very long, when they need to create and maintain 3 separate files for that simple "error dialog" without a hand from Builder.
Then again, I'd rather Adobe spent the time that would take on opening and better-documenting builder's APIs, so we can write our own plugins easily, but that's my greedy side- A standard builder-supported MVC pattern for custom MXML components would be aweseome for people that aren't me :)
-Josh
As for JavaFX, I don't care for it.
On Tue, Sep 30, 2008 at 7:56 AM, Sean Christmann
<
[email protected]> wrote:
A new message was posted by Sean Christmann in
Developers --
  specify the GUI declaratively in ActionScript like in JavaFX Script instead of MXML
Jason you bring up a good point on a concept that I think Adobe should
poach from a different framework, Silverlight. In Silverlight the
code-behind pattern is automatic and very nice to work with. Every
interface can be composed of both a layout file and a script file, and
they get composited into the SAME class at compile time. So you can
have both a FileDialog.mxml and FileDialog.as file that know about each
other automatically, without the need to subclass one from the other.
Sean
Jason Stafford wrote:
A new message was posted by Jason Stafford in
Developers --
  specify the GUI declaratively in ActionScript like in JavaFX Script instead of MXML
Personally, I like the separation between the MXML and ActionScript.
We're working on a large project, and so we have all the ActionScript
separate from the MXML files.  For example we'll have something like
filedialoglayout.mxml, and then
filedialog.as that is a subclass of
filedialoglayout.  All event handlers and the like are setup in the
filedialog.as file - the mxml file doesn't know about any function names.
Advantages:
MXML files become layout only - and are more easily shared and worked on
with non-technical people
ActionScript is all in *.as files: no CDATA blocks and no FlexBuilder
quirks where editing ActionScript inside a CDATA block doesn't work
quite like in a real AS file.
For simple experiments, and for learning, it's obviously nice to have
everything in one mxml file, but in a big project like ours, the
separation helps keep things clearer and more maintainable.
Why use the mxml at all?  The MXML files are nice to edit with the
visual editor in Flex Builder, and it's much easier to apply styles and
embed assets in MXML than it is in pure ActionScript.
I think two ways to talk about the same thing (XML and ActionScript) is
already almost one too many - adding a third (JSON) would really be too
much.
Just my thoughts.
-Jason Stafford
Sean Christmann wrote:
A new message was posted by Sean Christmann in
Developers --
specify the GUI declaratively in ActionScript like in JavaFX Script
instead of MXML
This reminds me of a certain workflow pattern that has emerged for us
which might help provide some insight on this topic. I'm working on a
project with a couple other developers which connects to a webservice
for supplying clientside data. This data is available in both json
notation and xml notation. The thing is, while the developers have
overwhelmingly agreed that we should be consuming the json version
since it can be parsed faster and provide more meaningful context for
objects (ie strings vs ints vs arrays etc...), all these same
developers rely exclusively on the xml notation when asking questions
about the data or passing structures around to discuss.
I see the same thing when looking at JavaFX and MXML. JavaFX might
allow for more accurate structures and might be able to be compiled
faster, but MXML is better for being self documenting even if it
requires more verbosity.
Sean
Matt Chotin wrote:
A new message was posted by Matt Chotin in
Developers --
  specify the GUI declaratively in ActionScript like in JavaFX Script
instead of MXML
I'd be curious what other people think.  I see MXML as a distinct
advantage over doing the pseudo-script stuff.  I really don't like
the JavaFX system actually.
Matt
On 9/28/08 10:33 AM, "neo7471"
<[email protected]> wrote:
A new discussion was started by neo7471 in
Developers --
  specify the GUI declaratively in ActionScript like in JavaFX Script
instead of MXML
After reading a bit about JavaFX Script (which is actually remarkebly
close to ActionScript 3) as a developer I thought the way one can
specify the GUI declaratively in JavaFX Script via JSON-like notation
for the components is pretty cool. It would be nice to have something
like that in Flex/ActionScript too. The advantages I see over MXML are:
1) a more compact notation than XML which is nice from a developers
view point who actually writes this kind of code. Of course the idea
would be that designers still design the GUI with graphical tools
that generate this code but if you have to dive in and edit the code
it's nice not to have to deal with verbose XML and I think even
designers can easily understand JSON-like code; don't just assume
that designers love XML because HTML was based on SGML! I'm not so
sure if today many designers really still know raw HTML that well
(like in the 1997, the early days...). Server side developers
probably know it better because they! have to adapt it to jsp or asp
or whatever framework.
2) The fact that it's all ActionScript gives a seamless integration
between just composing the components to form the GUI and adding
scripts to add additionial behavior instead of mixing XML with
actionscript code => no more need for those naster CDATA blocks! It
would also be easy for development tools like Flexbuilder to give a
seamsless experience with code completion and zooming in on the code
because it's all Actionscript! There's also no need for a separate
expression language to tie the MXML to the underlying Actionscript.
It would it also make easier to create custom components (not just
simple composition components which is really easy in MXML) because
you don't have to implement separate XML tags.
here's a short JavaFX Script example:
Frame {
    content: GroupPanel {
    var myRow = Row { alignment: BASELINE }
    var label_col = Column { alignment: TRAILING }
    var field_col = Column { alignment: LEADING  }
    rows: [myRow]
    columns: [label_col, field_col]
    content:
    [SimpleLabel {
    row: myRow
    column: label_col
    text: "Type your text here:"
    TextField {
    row: myRow
    column: field_col
    columns: 50
    visible: true
Note that this shouldn't be confused with programmatically specifying
the GUI in Actionscript (which is possible today as an alternative to
MXML). What I propose is at a (slightly) higher level: you don't give
a detailed sequence of methods/functions to call to construct the GUI
(i.e. HOW to do it) but just specify WHAT you want.
Hopefully some Adobe Flex will see this and think about it. Although
I think MXML is not too bad and I can live with it if I have to ;)
View/reply at specify the GUI declaratively in ActionScript like in
JavaFX Script instead of MXML
<
http://www.adobeforums.com/webx?13@@.59b69b42>
Replies by email are OK.
Use the unsubscribe
<
http://www.adobeforums.com/webx?280@@.59b69b42!folder=.3c060fa3>
form to cancel your email subscription.
View/reply at
<
http://www.adobeforums.com/webx?13@@.59b69b42/0>
Replies by email are OK.
Use the unsubscribe form at
<
http://www.adobeforums.com/webx?280@@.59b69b42!folder=.3c060fa3> to
cancel your email subscription.
<div><div></div><div>
Jason Stafford
Principal Developer
Inspiration Software, Inc.
The leader in visual thinking & learning
Now available - Kidspiration(r) 3, the visual way to explore and understand words, numbers and concepts.
Learn more at
www.inspiration.com/kidspiration.
503-297-3004 Extension 119
503-297-4676 (Fax)
9400 SW Beaverton-Hillsdale Highway
Suite 300
Beaverton, OR 97005-3300
View/reply at
<
http://www.adobeforums.com/webx?13@@.59b69b42/2>
Replies by email are OK.
Use the unsubscribe form at
<
http://www.adobeforums.com/webx?280@@.59b69b42!folder=.3c060fa3></div>
</div> to cancel your email subscription.
Sean Christmann | Experience Architect | EffectiveUI | 720.937.2696
View/reply at
specify the GUI declaratively in ActionScript like in JavaFX Script instead of MXML
Replies by email are OK.
Use the
unsubscribe form to cancel your email subscription.
"Therefore, send not to know For whom the bell tolls. It tolls for thee."
http://flex.joshmcdonald.info/
:: Josh 'G-Funk' McDonald
:: 0437 221 380 ::
[email protected]

Similar Messages

  • How to specify the XML Declaration for an XML variable

    I need to set the XML declaration for my XML variable as
    follows:
    var employees:XML =
    <?xml version="1.0" encoding="utf-8"?>
    <employees>
    <employee ssn="123-123-1234">
    <name first="John" last="Doe"/>
    <address>
    <street>11 Main St.</street>
    <city>San Francisco</city>
    <state>CA</state>
    <zip>98765</zip>
    </address>
    </employee>
    <employee ssn="789-789-7890">
    <name first="Mary" last="Roe"/>
    <address>
    <street>99 Broad St.</street>
    <city>Newton</city>
    <state>MA</state>
    <zip>01234</zip>
    </address>
    </employee>
    </employees>;
    However, if I specify <?xml version="1.0"
    encoding="utf-8"?>, I get a design time and compile error. If I
    remove it it works fine. But the server to which I send this XML is
    expecting the declaration. Can somebody help me with this?
    Thanks

    I work mostly with the Java versions of the parser so you'll have to make the translation to C++. As far as I know, you can't use the SAX API to access to the encoding.
    You need to use the DOM along with Oracle's extension to the basic DOM functionality. Oracle's package, oracle.xml.parser.v2 defines a class which implements the Document interface called XMLDocument. This class has a method, getEncoding(), which returns the encoding. You would use the method in getDocument() in the Parser base class inherited by DOMParser to retrive the XMLDocument.
    Jeff

  • Crystal Report XI: Can you write your query in SQL instead of using the GUI

    Hello
      In crystal report version XI, can you write your query in sqlplus and then use the crystal report designer to build your report instead of using the GUI . I would like to be able to go database and show sql query and open that query and make changes directly there, is that possible on this version, if yes is there a setting somewhere? Please let me know.
    Thank you
    alpha

    Moved to Database forum.
    No you can no longer modify the SQL directly. Use a Command Object to enter the SQL directly.
    Thank you
    Don

  • How to get the hour glass in the GUI status bar.

    Hi all,
    how can I get the hour glass and a corresponding text in the GUI status bar? Like during the compilation I would like to show a message 'Processing data ...'.
    Best regards,
    Nils

    A good example is provided in https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap code samples/abap objects/abap code sample progress indicator.pdf

  • I want to remove buttons in favour of a Windows menu equivalent, how do I control the software without cluttering the GUI?

    My Graphical User Interface is fairly full of controls & buttons, removing the buttons should simplify and improve the appearance of the GUI. I would like to capture all of the menu selections and drive the software without relying on offscreen buttons etc. Is there a standard technique? I have started to look at queue, notifiers, occurences etc but I havent seen anything yet that looks obvious for the application.
    Help appreciated.

    You want to replace front panel controls with a custom menu? If that's true, then the code to do that is similar to the best way to handle the original controls. The event structure has both menu selection (User) and Menu Selection (App). As the shipping example Menu Selection with Events shows, you get the ItemTag and MenuRef from which you get the menu's item name which can be connected to a case structure. Since the menu name is a string, it also works well in a queue based state machine.

  • Why can't i edit the variable declaration in Netbeans GUI Applications?

    When i drag and drop jbutton,jlabel and other tools from toolbox on the jform the code is
    automatically generated by the Netbeans.
    At bottom the variable declaration for the jbutton and for the other tools is automatically
    generated.
    The part of that declaration is shaded as grey.
    Is it possible to edit those variables from Netbeans?

    Yup, as Chuck states, it is possible to edit that region of code, since the file is nothing more than a text file, but doing so "breaks" the code so that you cannot modify the GUI content in NetBeans WYSIWYG form editor. Please note, that there are ways of changing the characteristics of those variables without editing them directly. You should look into how to change properties of your GUI with NetBeans. The online tutorials can show you how.

  • I want the gui of the java be like windows

    hi
    i have already frame i made it by drag and drop and when i make design preview , it's be like windows in the shape of the buttons , frames and tool bar
    but when i make run to the code .it appear by default view .. how when i make run .. the gui be like the windows

    i want more help .. ...please indicate spoon size

  • LPX issues with LR, BFD, and the GUI looks like Garageband now...

    I downloaded LPX a few days ago.  Everything worked fine except BFD Eco, which is what I use almost exclusively for drum samples (primarily demo work at this stage).
    I also bought an iPad Air per rave reviews of the LR app.  Got that setup, and it worked, but as with other users on the forum here, it started to crash on me within moments of turning it on and pairing it with LPX.  So I searched the forums and found someone who was advised to delete the .plist files under ~/Library/Preferences, then restart the machine.  They were also advised to delete any old .plist files from a previous version of Logic, which I also did.
    [Back story:  I bought the AC7 Core app a couple years ago to try and perform transport functions from my iPhone.  This app "tricks" logic into thinking it's a Mackie interface, so I figure that somewhere during the install, Logic got really confused about my using a Mackie controller which is interfering with my use of the iPad LR app.  Other people are having the same issue... seems like a solid bet, right?]
    So I deleted the following files:
    com.apple.logic10.plist
    com.apple.logic.pro.cs
    com.apple.logic.pro.plist
    And now LPX looks like Garageband.  Check it out:
    It has those crappy wood panel bars on the left and right, I don't have access to the mix window, I can only see channel strip plugins by using the inspector... this is weird!  Which file did I delete that could have caused this?  Or am I missing something else?
    Additionally, LPX prompted me to download additional Drummer kits AFTER I went through the whole "download additional content" process, telling it to DL anything I didn't already have.
    This was all a wild goose chase to reduce latency from my iPad Air to LPX.  It can automate faders and sends fine, but playing drum pads and keyboard lines has a noticeable delay (about 50-100ms).  So if anyone is willing to help fix the GUI, it would also be super nice if you could give me some pointers on reducing latency & improving stability with the LR.
    In case anyone's interested, BFD Eco is still not functioning properly.  Bought it in 2011 and apparently I need the 64-bit version.  Purchased from fxpansion and now my machine can't find the install script file to actually upgrade my license.  eesh.
    Nick

    Nick,
    To get out of GarageBand mode, open your preferences, go to the Advanced tab and be sure to tick "Show Advanced Tools."

  • Need Help to update the labels in the GUI syncronously - Swing application

    Hello everyone,
    I need some help regarding a swing application. I am not able to syncronously update the counters and labels that display on my Swing GUI as the application runs in the background. But when the running of application is completed, then the labels on the GUI are getting updated, But I want update the labels and counters on the GUI syncronously as the code executes... below I am giving the format of the code I have written..............
    public class SwingApp extends JFrame{
            // here i have declared the label and component varibles like...
                      private JTextField startTextField;
           private JComboBox maxComboBox;
           private JTextField logTextField;
           private JTextField searchTextField;
           private JLabel imagesDownloaded1;
           private JLabel imagesDownloaded2;
           private JLabel imagesDidnotDownload1;
           private JLabel imagesDidnotDownload2;
                      private JButton startButton;
    //now in the constructer.............
    public Swing(){
    //I used gridbaglayout and wrote the code for the GUI to appear....
    startButton = new JButton("Start Downloading");
        startButton.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            try{
                 actionSearch();   //actionSearch will contain all the code and the function calls of my application...........
            }catch(Exception e1){
                 System.out.println(e1);
        constraints = new GridBagConstraints();
        constraints.gridwidth = GridBagConstraints.REMAINDER;
        constraints.insets = new Insets(5, 5, 5, 5);
        layout.setConstraints(startButton, constraints);
        searchPanel.add(startButton);
    //update is a function which initiates a thread which updates the GUI. this function will be called to pass the required variables in the application
    public void update(final int count_hits, final int counter_image_download1, final int didnot_download1) throws Exception{
         Thread thread = new Thread(new Runnable() {
             public void run() {
                  System.out.println("entered into thread");
                  System.out.println("the variable that has to be set is " + count_hits);
                  server_hits_count.repaint(count_hits);
                  server_hits_count.setText( " "+ Integer.toString(count_hits));
                  imagesDownloaded2.setText(" " + Integer.toString(counter_image_download1));
                  imagesDidnotDownload2.setText(" " + Integer.toString(didnot_download1));
                  repaint();
         //this.update(count_hits);
         thread.start();
    //Now in main............................
    public static void main(String[] args){
    Swing s = new Swing();
    s.setVisible(true);
    }//end of main
    }//end of class SwingAbove I have given the skeleton code of my application........ Please tell me how to update the GUI syncronously...
    Please its a bit urgent...............
    Thank you very much in advance
    chaitanya

    First off, note that this question should have been posted in the Swing section.
    GUI events run in a separate thread (the AWT / Event Dispatch Thread) than your program.
    You should be invoking AWT/Swing events via SwingUtilities.invokeLater().
    If for whatever reason you want to have the program thread wait for the event to process
    you can use invokeAndWait().
    http://java.sun.com/javase/6/docs/api/javax/swing/SwingUtilities.html

  • How to create a user account by mirroring another account in PowerShell (Trying to learn to use Powshell for some daily AD tasks intead of the GUI)

    Hi,
    I am trying to create user accounts via PowerShell instead of the Gui in server 2008 R2 (PowerShell 2.0).
    I know how to create a user account with the following Power Shell command below is one from a dummy domain I created to practice.
    PS C:\Users\Administrator> New-ADUser -SamAccountName "TestOut" -UserPrincipalNa
    me "[email protected]" -GivenName "Test" -Surname "out" -DisplayName "Testou
    t" -Name "Testout" -Enabled $true -Path "CN=users,DC=bwcat,DC=net,DC=int" -Accou
    ntPassword (Read-Host -AsSecureString "Enter Account Password") 
    However when doing day to day tasks where I work normally we have a new hire, they contact IT and ask that a user account is created.   I will ask who they would like to mirror.
    I then would go into the gui pull up the user that they want to mirror right click him and choose copy.  This would create a new user account that I would then fill out.
    I am wondering if its possible to do this same thing via PowerShell, or  if its not an option because it takes more work type up everything than it does to go into the gui and do it.
    Anyway thanks for the help.

    Hi Wilder, hi Mark,
    first of all: The tutorial sources Mark posted - especially the book "Powershell 3 in A month of lunches" - are good to get a baseline start. A really great reference, especially when you try to learn it while still dealing with your daily business.
    On another note, Wilder: While I fully agree that learning things sequentially is usually the best, I too jumped right in instead of learning how to walk first (though it's been some time now. Fewer years than you'd think, but still ...). So I thought I'd
    give you a little aid with that function husk, so you could just stuff interesting bits into an available structure, making use of the fun tools in a useful context (It's fun fiddling around with the commands, but if you have to type in all of them manually
    each time, using the GUI is often just faster. Doing fun things and being efficient with it feels even better though ...). So ... while I
    do agree with yourself, learn it the Correct & Proper Way, I also do
    intend to finish this little explanation about the husk, all the way to the end.
    Everything below this paragraph is part of this.
    function Copy-ADUser
    <#
    .SYNOPSIS
    A brief description of the Copy-ADUser function.
    .DESCRIPTION
    A detailed description of the Copy-ADUser function.
    .PARAMETER GivenName
    A description of the GivenName parameter.
    .PARAMETER Surname
    A description of the Surname parameter.
    .PARAMETER Template
    A description of the Template parameter.
    .EXAMPLE
    PS C:\> Copy-ADUser -GivenName "Max" -Surname "Mustermann" -Template "Jonny.Normal"
    .NOTES
    Additional information about the function.
    #>
    [CmdletBinding()]
    Param (
    [Parameter(Mandatory = $true)]
    [string]
    $Surname,
    [Parameter(Mandatory = $true)]
    [string]
    $GivenName,
    [Parameter(Mandatory = $true)]
    [string]
    $Template
    ) # Create finished Strings
    $JoinedName = $GivenName + "." + $Surname
    # Create new User
    $NewUser = New-ADUser -Surname $Surname -GivenName $GivenName -DisplayName "$Surname, $GivenName" -SamAccountName $JoinedName -Name "$Surename, $GivenName" -PassThru
    # Copy from old User
    $NewUser | Add-ADPrincipalGroupMembership -MemberOf (Get-ADPrincipalGroupMembership $Template | Where { $_.Name -ne 'Domain Users' })
    # Do Whatever else you feel like doing
    This is again the same function husk I posted earlier. Only this time, I filled a little logic (the pieces that were already posted in this thread). This time, I'll not only go over each part again ... I'll do it by reposting the segments and trying to show
    some examples on how to modify the parts. Thus some of it will be repetitive, but this way all the info is in one spot.
    Segment: Comment Based Help
    <#
    .SYNOPSIS
    A brief description of the Copy-ADUser function.
    .DESCRIPTION
    A detailed description of the Copy-ADUser function.
    .PARAMETER GivenName
    A description of the GivenName parameter.
    .PARAMETER Surname
    A description of the Surname parameter.
    .PARAMETER Template
    A description of the Template parameter.
    .EXAMPLE
    PS C:\> Copy-ADUser -GivenName "Max" -Surname "Mustermann" -Template "Jonny.Normal"
    .NOTES
    Additional information about the function.
    #>
    That's the premier documentation part of a function, that teaches a user what the function does and how to use it. It's what's shown when using the Get-Help cmdlet.
    Comment texts are not restricted to single lines however. For example you could replace ...
    .EXAMPLE
    PS C:\> Copy-ADUser -GivenName "Max" -Surname "Mustermann" -Template "Jonny.Normal"
    ... with ...
    .EXAMPLE
    PS C:\> Copy-ADUser -GivenName "Max" -Surname "Mustermann" -Template "Jonny.Normal"
    Creates a new user named Max Mustermann and copies the group memberships of the already existing user Jonny Normal to this new User
    ... and get an explanation on what the example does when using Get-Help with the
    -Detailed parameter (Explaining examples is always a good idea).
    Segment: Parameter
    [CmdletBinding()]
    Param (
    [Parameter(Mandatory = $true)]
    [string]
    $Surname,
    [Parameter(Mandatory = $true)]
    [string]
    $GivenName,
    [Parameter(Mandatory = $true)]
    [string]
    $Template
    This is the segment that tells Powershell what input your function accepts. Each parameter of Copy-ADUser you set will be available in the next segment as a variable of the same name. You can add additional parameters if you need more information for your
    logic. For example, let's add a parameter that allows you to specify what Organization the new user should belong to:
    [CmdletBinding()]
    Param (
    [Parameter(Mandatory = $true)]
    [string]
    $Surname,
    [Parameter(Mandatory = $true)]
    [string]
    $GivenName,
    [string]
    $Organization,
    [Parameter(Mandatory = $true)]
    [string]
    $Template
    That's how that would look like. You may notice that I didn't add the line with
    "[Parameter(Mandatory = $true)] this time. This means you
    may add the Organization parameter when calling Copy-ADUser, but you need not.
    Segment: Logic
    # Create new User
    $NewUser = New-ADUser -Surname $Surname -GivenName $GivenName -DisplayName "$Surname, $GivenName" -SamAccountName "$GivenName.$Surename" -Name "$Surename, $GivenName" -PassThru
    # Copy from old User
    $NewUser | Add-ADPrincipalGroupMembership -MemberOf (Get-ADPrincipalGroupMembership $Template | Where { $_.Name -ne 'Domain Users' })
    # Do Whatever else you feel like doing
    This is the part of the function that does the actual work. Compared to the first husk I posted, this time there are two commands in it (and some comments). First, I create a new user, using the information passed into
    the parameters -Surname and -GivenName. Then I Copy the group memberships of the user identified by the information given by the
    -Template parameter.
    So, let's modify it!
    # Tell the user you are starting
    Write-Host "Starting to create the user account for $GivenName $Surname"
    # Create new User
    $NewUser = New-ADUser -Surname $Surname -GivenName $GivenName -DisplayName "$Surname, $GivenName" -SamAccountName "$GivenName.$Surename" -Name "$Surename, $GivenName" -PassThru
    # Tell the user you are copying Group Memberships
    Write-Host "Copying the group-memberhips of $Template to $GivenName $Surname"
    # Copy from old User
    $NewUser | Add-ADPrincipalGroupMembership -MemberOf (Get-ADPrincipalGroupMembership $Template | Where { $_.Name -ne 'Domain Users' })
    # Do Whatever else you feel like doing
    Now after adding a few lines, the logic will tell us what it's doing (and do so before it
    is taking action)!
    Hm ... didn't we create a change in the Parameter Segment to add an -Organization parameter? Let's use it!
    # If the -Organization parameter was set, the $Organization variable will be longer than 0. Thus do ...
    if ($Organization.Length -gt 0)
    # Tell the user you are starting
    Write-Host "Starting to create the user account for $GivenName $Surname in the Organization $Organization"
    # Create new User
    $NewUser = New-ADUser -Surname $Surname -GivenName $GivenName -DisplayName "$Surname, $GivenName" -SamAccountName "$GivenName.$Surename" -Name "$Surename, $GivenName" -Organization $Organization -PassThru
    # If the -Organization parameter was NOT set, the $Organization variable will have a length of 0. Thus the if-condition does not apply, thus we do the else block
    else
    # Tell the user you are starting
    Write-Host "Starting to create the user account for $GivenName $Surname"
    # Create new User
    $NewUser = New-ADUser -Surname $Surname -GivenName $GivenName -DisplayName "$Surname, $GivenName" -SamAccountName "$GivenName.$Surename" -Name "$Surename, $GivenName" -PassThru
    # Tell the user you are copying Group Memberships
    Write-Host "Copying the group-memberhips of $Template to $GivenName $Surname"
    # Copy from old User
    $NewUser | Add-ADPrincipalGroupMembership -MemberOf (Get-ADPrincipalGroupMembership $Template | Where { $_.Name -ne 'Domain Users' })
    # Do Whatever else you feel like doing
    There! Now we first check whether the -Organization parameter was set (it's not mandatory after all, so you can skip it). If it
    was set, do whatever is in the curly braces after if (...). However, if it wasn't set, do whatever is in the curly braces after
    else.
    And that concludes my "minor" (and hopefully helpful) tutorial on how to use the function husk I posted :)
    With this, whenever you find another cool command that helps you in the user creation process, you can simply add it, similar to what I did in these examples.
    And if it all didn't make much sense, go through the tutorials in proper order and come back - it'll make much more sense then.
    Cheers and good luck with PowerShell,
    Fred
    There's no place like 127.0.0.1

  • How to specify the type of table in the form parameters

    How to specify the type of table in the form parameters. for example, how to specify the type of table "vacancies".
    FORM getcertainday
                       USING
                       vacancies TYPE STANDARD TABLE
                       efirstday LIKE hrp9200-zfirst_day
                       lfristday LIKE hrp9200-zfirst_day.

    Hi
    Are you asking about subroutine program to declare a variable for perform statement etc
    if it so check this coding
    DATA: NUM1 TYPE I,
    NUM2 TYPE I,
    SUM TYPE I.
    NUM1 = 2. NUM2 = 4.
    PERFORM ADDIT USING NUM1 NUM2 CHANGING SUM.
    NUM1 = 7. NUM2 = 11.
    PERFORM ADDIT USING NUM1 NUM2 CHANGING SUM.
    FORM ADDIT
           USING ADD_NUM1
                 ADD_NUM2
           CHANGING ADD_SUM.
      ADD_SUM = ADD_NUM1 + ADD_NUM2.
      PERFORM OUT USING ADD_NUM1 ADD_NUM2 ADD_SUM.
    ENDFORM.
    FORM OUT
           USING OUT_NUM1
                 OUT_NUM2
                 OUT_SUM.
      WRITE: / 'Sum of', OUT_NUM1, 'and', OUT_NUM2, 'is', OUT_SUM.
    ENDFORM.
    If your issue is some other can u explain me clearly
    Regards
    Pavan

  • Unable to enter a Division for which I have proper credentials, via the GUI

    I have a Division which I am unable to enter, either as a student or as the full site Administrator, from the GUI.
    When I log into the main Site page, I see the link for the Division (as I should - I have DOWNLOAD permissions for the Division). However when I click the link (the thumbnail image) I am always, 100% of the time, rejected and sent to the login page. Ignoring that, I still have all of my proper credentials and may continue to freely access other parts of the site.
    In the past, I had this exact behavior on (1) a Division "RobotCourses:PSYC" (Psychology), and (2) my main site breadcrumb, which appears at the top of the site page to the right of the "iTunes U" breadcrumb and says "Maiko Covington @ University of Illinois..." For reasons completely unknown to me, this behavior resolved itself yesterday, clicking both of those objects works as expected, although NO one at our site with any edit access did anything on the server.
    However, the same behavior has now reappeared, this time on a Division "RobotCourses:CLCV" (Classical Civilizations). Again, I have not done any editing of that Division, nor had anyone logged into it (these Divisions are in a test area where I am developing automation tools).
    I am, quite frankly, stumped. But I've done some investigation.
    SETUP:
    The Division has identity "RobotCourses:CLCV".
    This Division contains a single Course with identity "RobotCourses:CLCV:CLCV115:CLCV115All-13564".
    Both the Division and the Course are restricted to properly registered academic students. I have developed automation code in a login portal which grants credentials for RobotCourses:CLCV to students registered for courses in the CLCV department (Classical Civilizations) and credentials for RobotCourses:CLCV:CLCV115:CLCV115All-13564 to students registered for CLCV 115 (Classical Civilizations 115 - Mythology of Greece and Rome) specifically.
    The Permissions set on RobotCourses:CLCV in particular are:
    <Permission>
    <Credential>Authenticated@urn:mace:itunesu.com:sites:illinois.edu</Credential>
    <Access>No Access</Access>
    </Permission>
    <Permission>
    <Credential>gakusei@urn:mace:itunesu.com:sites:illinois.edu:RobotCourses:CLCV</C redential>
    <Access>Download</Access>
    </Permission>
    The point is to deny access to Authenticated@ (merely authenticated students) and then specifically grant it for people given a "gakusei" credential for RobotCourses:CLCV in particular.
    (Note here that "gakusei" is a Japanese word meaning "student," I am using it in my credentials to ensure that my credentials and permissions are not affected by other credentials named "student" set at upper levels and used by some live users of the site, as we do not have a segregated development environment. It is our lowest level of access beyond mere Authenticated@..., designed to give students access to download and "surf to" Divisions and Courses.)
    *LOGIN: ISSUING CREDENTIALS:*
    The login portal code works successfully, and so when a student "Jane Doe" logs in, she is in fact given appropriate credentials (as she is actually registered for CLCV 115 here at UIUC). From the code generating her login URL, I see:
    Issued credentials:
    gakusei@urn:mace:itunesu.com:sites:illinois.edu:RobotCourses:CLCV
    gakusei@urn:mace:itunesu.com:sites:illinois.edu:RobotCourses:CLCV:CLCV115:CLCV1 15All-13564
    gakusei@urn:mace:itunesu.com:sites:illinois.edu:RobotCourses:STAT
    gakusei@urn:mace:itunesu.com:sites:illinois.edu:RobotCourses:STAT:STAT100:STAT1 00X1-13570
    (You can see she is also registered for STAT 100).
    With the default login URL thus generated, she is taken to the top level of the Site in iTunes, and in fact sees thumbnail links for both STAT (Statistics) and CLCV (Classical Civilizations). Clicking on STAT takes her to the STAT Division where she can then enter the Course STAT 100 with no problems.
    *PROBLEM: CAN'T GET TO CLCV FROM THE MAIN PAGE IN THE GUI*
    HOWEVER! Clicking on CLCV brings up the login page. If she ignores the login page, she can still access the rest of the site, including STAT, just fine. Logging in again (reissuing her credentials) does not help the situation.
    Note that this is not a problem only for Jane Doe, the same thing happens for anyone in CLCV and in fact happens for me as Administrator of the whole site with full access, even.
    *ACCESS DIRECTLY TO THE DIVISION BY URL WORKS*
    With a slight modification to the login to allow access directly to the RobotCourses:CLCV Division (by adding the handle of the Division to the end of the location), credentials are issued exactly as before:
    Issued credentials:
    gakusei@urn:mace:itunesu.com:sites:illinois.edu:RobotCourses:CLCV
    gakusei@urn:mace:itunesu.com:sites:illinois.edu:RobotCourses:CLCV:CLCV115:CLCV1 15All-13564
    gakusei@urn:mace:itunesu.com:sites:illinois.edu:RobotCourses:STAT
    gakusei@urn:mace:itunesu.com:sites:illinois.edu:RobotCourses:STAT:STAT100:STAT1 00X1-13570
    and she is taken to the Division page, SUCCESSFULLY. So, it seems she actually HAS access, as expected.
    *ACCESS CONFIRMED WITH DEBUGGING:*
    Writing some code to generate not the actual login URL but rather a link that takes me to an "iTunes U Access Debugging" page for the Division (figured this out by reading some other posts! :)) I am taken to a page with the following:
    (at generated URL https://deimos.apple.com/WebObjects/Core.woa/Browse/illinois.edu.1945806043/xxx5 64?credentials=....)
    Received
    Destination illinois.edu.1945806043
    Identity "Jane X Doe" <[email protected]> (jxdoe) [xxxxxxxxx]
    Credentials gakusei@urn:mace:itunesu.com:sites:illinois.edu:RobotCourses:CLCV; ​ gakusei@urn:mace:itunesu.com:sites:illinois.edu:RobotCourses:CLCV:CLCV115:CLCV1 15All-13564; ​gakusei@urn:mace:itunesu.com:sites:illinois.edu:RobotCourses:STAT;​ gakusei@urn:mace:itunesu.com:sites:illinois.edu:RobotCourses:STAT:STAT100:STAT1 00X1-13570
    Time 1236877947
    Signature 42ccef92a3298684a7a09eed45adb6b788a700c01645b8b423d33ace120650b0
    Analysis
    The destination string is valid and the corresponding destination item was found.
    The identity string is valid and provides the following information:
    Display Name Jane X Doe
    Email Address [email protected]
    Username jxdoe
    User Identifier xxxxxxxxx
    The credential string is valid and contains the following 4 recognized credentials:
    1. gakusei@urn:mace:itunesu.com:sites:illinois.edu:RobotCourses:CLCV
    2. gakusei@urn:mace:itunesu.com:sites:illinois.edu:RobotCourses:CLCV:CLCV115:CLCV1 15All-13564
    3. gakusei@urn:mace:itunesu.com:sites:illinois.edu:RobotCourses:STAT
    4. gakusei@urn:mace:itunesu.com:sites:illinois.edu:RobotCourses:STAT:STAT100:STAT1 00X1-13570
    The time string is valid and corresponds to 2009-03-12 17:12:27Z.
    The signature string is valid.
    Access
    Because the received signature and time were valid, the received identity and credentials were accepted by iTunes U.
    In addition, the following 2 credentials were automatically added by iTunes U:
    1. All@urn:mace:itunesu.com:sites:illinois.edu
    2. Authenticated@urn:mace:itunesu.com:sites:illinois.edu
    With these credentials, you have browsing and downloading access to the requested destination.
    (In case you think to check the sums, be aware I've actually changed the student's name for this example.)
    So, as expected, I have access, in fact the student DOES have access, visiting the Division page directly (specifiying its handle as part of the desired location).
    *IT'S ONLY CLICKING THE THUMBNAIL ON THE MAIN PAGE THAT BREAKS*
    Because the problem is only apparent when clicking the icon for the Division on the main Site page, I have no way (that I know of) to get any information about precisely WHAT is going on, what possibly differs in the GUI-click situation from the "generate me a URL that takes me right there" situation.
    At that point I'm fully in the GUI, I'm not sending anything via web services, so I have no idea how I can proceed to debug this from here.
    I'm also quite confused at the sudden appearance of this behavior, and the disappearance of this behavior from RobotCourses:PYSC, another Division that was broken in this same way all last week but which magically resumed allowing me access yesterday.
    Any suggestions, hints, or advice would be very welcome. Has anyone else even seen behavior similar to this?
    Thanks for any information you might have.

    Maiko,
    I'm confess I'm still trying to get a handle on your problem. You do a fantastic job of describing it ... but I'm just trying to picture it accurately in my head.
    I think, were I in your shoes, I'd begin by looking at what the debug page has to say for the specific destination in which you're interested in fixing. In other words, I'm not clear on where, exactly, this destination points ...
    Destination illinois.edu.1945806043
    Is that your site, or the division within your site that you want to fix? "Normally", you do not need to specify a site handle to get to your site within your transfer CGI ... if you say "uillinois.edu", it's enough to transfer your users to iTunes U ... but every site still has a handle, and you could, if you wanted to, actually specify it in your transfer CGI. For example, this:
    Destination uic.edu.1139051993
    is for my entire site ... it's my site handle. Whereas this:
    Destination uic.edu.1991288441
    is for a division within my site ... but it's impossible to tell the difference between "site" and "division" from just the handle (I mean, if I didn't say "this is a site" and "this is a division", there'd be no way for you to know). So when I look at your creds and permissions on your debug page, I can't quite tell if they give you download access for your site, or for the specific division you want to fix. If you could open the debug page with your division as destination (or confirm that that's what we're looking at), it'd rule out some things.

  • How do I use the Notation Declaration table on the Reference Pages in FM10 Win 7?

    I can find no documentation to explain the Notation Declaration table that exists on the reference pages.
    My DTDs (both XML and SGML) call for some specific notations to be used with certain graphic formats. For example, tiff files use the notation "TIF" and cgm files use the notation "CGM-BINARY".  I am not using DITA or S1000D.
    When round-tripping sgml and/or xml to/from FrameMaker I would like to get the graphic entity declarations to use notations that are alloted for in the DTD. I would like to avoid having additional notation statements in the sgml and/or xml.
    I am using FrameMaker 10 on a Windows 7, 64-bit system.
    Is this "Notation Declaration" table the correct place to look? Are there alternative methods to accomplish the notation assignment?
    Thanks,
      Mike

    You can use an extension to set a default font size and page zoom on web pages:
    *Default FullZoom Level: https://addons.mozilla.org/firefox/addon/default-fullzoom-level/
    *NoSquint: https://addons.mozilla.org/firefox/addon/nosquint/

  • Creating a connection between the GUI and a program's back end

    I have created a program (over 50 classes) and am currently a little confused as to how I should connect the back end of my program (the real functionality) to my front end (the GUI). Currently I am thinking about using a list of event listeners in my back end that will announce when certain events have completed and thus front end can handle the updates accordingly.
    But I want to ensure that the back end doesn't "know" about the front end. In other words, I would like to ensure that the back end and the front end are as independent/modular as possible.
    Can anyone make some suggestions besides event listeners?
    Thanks,
    Timmers

    From what I am able to ascertain from your post, you would advocate using EventListeners in the back end (in same VM) to inform the GUI of changes?
    Is this the commonly accepted way of communicating your back end functionality to your front-end (GUI)?
    I've read that all EventListeners are part of a single thread. So what happens if two events occur simulataneously in the back-end. Do those events get queued or do some of them get lost?
    Thanks,
    Tim
    If the back-end changes state asynchronously to the
    front-end GUI (ie does work in background threads and
    then notifies the front-end when something happens),
    then you should make it send events when this happens.
    The basic concept is the same for CORBA, RMI, JINI,
    or running everything in the local VM.
    To do this you define a set of events (or maybe you
    can use the java.beans.PropertyChangeEvent) and
    listener interfaces. The front-end then registers to
    receive events (probably via an addXXXListener()
    method in the back-end). You would have to have a
    class (or classes) in the front-end that implemented
    the event listener interfaces to receive the events.
    If you are using a distributed technology (CORBA, RMI,
    JINI, ...) the concept is the same, but the event
    mechanisms are slightly different.
    To notify the back-end of state changes in the
    front-end you probably can just do plain old method
    calls from the front-end to the back-end.

  • Why does moving the mouse over an IMAQ image display slow the GUI down so much?

    I have a large application with several vi's running simultaneously under labview 8.6.1.  When I mouse over an image display control in one of the vi's, everything slows down a shocking amount in all the other vi's.  The windows task manager does not show a large increase in CPU use.  My pc is has a quad cpu with 4GB of RAM, and the CPU and memory loads do not appear to be terribly taxing to the system.  However, many of my vi's apparently come almost to a standstill if I just move the mouse in a circle around my image control.
    This looks like it is largely a GUI display issue.  If I make a new vi and put a while loop in it that only displays the iteration loop number to an indicator, I can see the iterating occurring, then stopping totally when I mouse inside the image display control.  When I stop moving the mouse inside the control, or when I move it outside the control, the interation loop number jumps up, as if it had been incrementing behind the scenes the whole time.  So only display of the interating was halted.
    This problem occurs even if the vi with the image control is not executing.  If the vi with the image control is open but not running, and I mouse over the image on it, the other guis all come to a screeching halt.
    Does mousing in the image display control really utterly crush all other guis in all other labview windows?  Is this an issue inherent to the image display control?  If so, is there anything I can do about this? 
    Also, this issue is not entirely limited to display.  I started looking at it in greater detail because this issue also exposed what I think is a race condition in my code.  I have a vi that acquires an image from a ccd and puts it into an IMAQ image.ctl.  This image then gets passed up to a vi up the call chain, and is put on a queue and sent over to be de-queued by a vi that has the image display control.  Here's the kicker:  when I mouse over the image display control, the image successfully gets acquired inside the subvi, and if I probe the wire leading to the output IMAQ image display.ctl, I see the image.  If I simultaneously probe the wire coming out of the subvi one level up the call chain, the image gets lost about half the time.  This only happens if I am mousing in the image display control IN A TOTALLY DIFFERENT AND SEPARATE VI.  If I bump up the priority of the ccd image acquisition vi to 'highest priority', the problem only happens about 1% of the time, and I really have to mouse around to make it happen.  Still, it's disturbing that mousing in the GUI in one window results in a failure of a separate subvi to simply pass an image up the call chain.  I understand that IMAQ images are referenced rather than passed by value, but I don't see why there should be a failure to pass the image up the call chain.  I've looked for a race condition, but can't find one.
    Eric

    I have finally been able to replicate the behavior that you are seeing on another computer once the image was large enough.  Here are a few notes about this behavior:
    First. The UI only slows down when the images are large, 16 bit images.  The reason why this is unique to 16 bit images is that they can only be displayed on the front panel as 8 bit images.  The workaround that Weiyuan suggested to change the 16 bit display mapping hints towards the root of the problem...that any time a mouse runs over the indicator, Windows asks the entire image to re-draw (having a separate indicator overlapping the image will create the same behavior).  With a 16 bit image, not only does the image have to re-draw on the screen but the 16 bit pixels need to be mapped to 8 bits.  When setting the 16 bit display mapping to Full Dynamic, this requires mor computation/pixel than 90% dynamic or one of the other mapping schemes.
    This is expected behavior if your program is running and you're trying to display a large 16 bit image.  To fix this behavior there are a couple options:
    Change the 16 bit display mapping to something other than full dynamic.  You can choose which 8 bits to display or if you want to map the bits. 
    Resize the image just for viewing purposes on your front panel (since you aren't going to view every single pixel of you image on the screen). You can use the IMAQ Resample.vi to do this.  This will allow you to take your 1500x1500 pixel image and only display a 500x500 pixel version.
    If you are interested in viewing small details of the large image, consider just displaying a smaller region of interest at a time.
    Let me know if any of these solutions work for you.  Good luck on your application.
    Zach C.
    Field Engineer
    Greater Los Angeles

Maybe you are looking for

  • Purchase Requisition Power List

    Good day Gurus. Please what's the easiest way to create a POWER LIST for PURCHASE REQUISITION awaiting approval?

  • Help, Quite suddenly I am unable to save  files.

    When I went to save a file in Numbers I got the message "Couldn't create file" So I printed the chart and scanned it as a PDfF. still no joy. So I tried producing a Pages file and I couldn't save that either.with the message That I didn't have the Lo

  • I can not open up itunes using the desktop icon

    I have installed, uninstalled and reinstalled the latest version if itunes.  I cannot get itunes to open up by clicking on the desktop icon.  I keep getting the message"Do you want to allow this program to make changes?"  The program is Apple Inc.  I

  • Firefox fails to print to .pdf or paper

    FF is driving me batty... I used to be able to print to .pdf or paper just fine, but around 6 months (or so) ago this functionality vanished. Print dialogue appears, allows me to format layout, pages, etc, but when I click "OK"... no joy. The very fi

  • Iphoto photo enlarges itself in Print

    I editted a photo in iphoto and was ready to print it. But when I clicked on Print, the preview picture it showed me was not the same thing. It appeared that the photo had zoomed in on itself, so that it was enlarged and much of the photo no longer v