Help me complete my first Login of Cairngorm example.

Hello

I'm still fearing to make an application using Cairngorm. Help, please

This will be my sketch of my Caringorm request.

This will is a LoginExample where on a successful connection is displayed as WELCOME or INVALID CONNECTION in the case of a bad connection.

Please go through my code:

It's my hand mxml file


<? XML version = "1.0" encoding = "utf-8"? >
< mx:Application xmlns:controller = "uk.co.clockobj.cairngormdemo.controller. *" >
< controller: AppController / >
< mx:Script >

user: UserDTO var = new UserDTO();
public function login (): void
{
User.UserName = UNAMETI.text;
User.Password = PASSTI.text;
systemManager.dispatchEvent (LoginEvent.LOG_USER_IN, user);

}
< / mx:Script >
< / mx:Application >

It's my UserDTO object:

package dto
{
[Bindable]
[RemoteClass(alias="namespace.to.some.server.dto")]
public class UserDTO
{
public var username: String;
password public var: String;

public void UserDTO()
{
}
}
}

This is my controller class:

controller package
{
SerializableAttribute public class AppController extends FrontController
{
public void AppController()
{
Super();
initialiseCommands();
}

private void initialiseCommands(): void
{
addCommand (LOG_USER_IN, LogUserInCommand);
}
}
}

This is my class of the event:

package events
{
import com.adobe.cairngorm.control.CairngormEvent;

SerializableAttribute public class LoginEvent extends CairngormEvent
{

public static const var LOG_USER_IN:String = "LOG_USER_IN";

the user public var: UserDTO

public void LoginEvent (type: String, user: UserDTO, bubbles: Boolean = false, cancelable: Boolean = false)
{
Super (type, bubbles, cancelable);

This.User = UserDTO;
}

}
}

This is my command class:

package controls
{
public class LogUserInCommand implements ICommand, IResponder
{

Service myremoteservice;
public void LogUserInCommand()
{
}

override public function execute(event:CairngormEvent):void
{

myRemoteService = ServiceLocator.getInstance () .getRemoteObject ("docsServices");
}

public void result(data:Object):void
{

ModelLocator.getInstance (.welcome = property ResultEvent (data));

}

public void fault(info:Object):void
{

ModelLocator.getInstance (.invalid = property ResultEvent (data));


}

}
}

This is my ModelLocator class:

package template
{[Bindable]
/ public class ModelLocator implements IModelLocator
{
private static var _instance:ModelLocator;

Public Shared function getInstance (): {ModelLocator}
If (_instance == null) {}
_instance = new ModelLocator();
}
return _instance;
}

public void ModelLocator()
{
If (_instance! = null)
{
throw (new Error ("class Singleton has already been instantiated"));
} else
{
session = new SessionModel();
}
}

the user public var: UserDTO

public var welcome: String;
public var invalid: String;

}
}


I have my file services.mxml defined in connection with my java file:


< mx:RemoteObject
ID = "docsServices".
destination = "ToRemote.

source = "cairngormcf.com.cf.CairngormJava" > "
< / mx:RemoteObject >

my questions to what is above the code are:

1. How can I call the FrontController of my connection function of the main Application under the container form.

2. after sending my logon function event, who should listen to this event. (How to do here)

3.
3. after obtaining the DTO user details in my Java layer, I validate the data and I sends a string either valid or invalid connection Login as String, here's how my main Application gets it data?

Please help me in all these things, really, it will be a great help.

While waiting for the responses from the experts

Thanks a lot for reading long code.

Hi Kiran, this is your class in place of the stuff as mentioned in the classes below that it's

or if you can change it yourself here I use the custom component and I import this component custom demand... so use custom component to send event cairngorm...

the best practice is to create a display component, and then import this view in your application and which will reduce the file size of your application and file size of download... so if you have any problem using this code let me know

company
------------
1 MyServices
------------

http://www.Adobe.com/2006/mxml '.
   
xmlns:Cairngorm = "" com.adobe.Cairngorm.Business. * ">"
   
   
    <>
destination = "user".
ID = "userRO" >
       
   
   

2 UserDelegate
--------------
business package
{
import com.adobe.cairngorm.business.ServiceLocator;
   
Import mx.rpc.AsyncToken;
Import mx.rpc.IResponder;
Import mx.rpc.remoting.RemoteObject;
   
import Vos. UserVO;
   
public class UserDelegate
{
       
public var myServices:ServiceLocator;
       
public void UserDelegate()
{
TODO: to implement the function
myServices = ServiceLocator.getInstance ();
           
}
       
Create a function to communicate with the server here

public void validateUser(userObj:UserVO,responder:IResponder):void {}
           
Check out the service you want
communicate the servicelocator
           
var userRO:RemoteObject = myServices.getRemoteObject ("userRO");
var resMsg:AsyncToken = userRO.validateUser (userObj);
           
join the answering machine
           
resMsg.addResponder (responder);
           
           
}

}
}

LoginCommand
------------
package controls
{
import business. UserDelegate;
   
import com.adobe.cairngorm.commands.ICommand;
import com.adobe.cairngorm.control.CairngormEvent;
   
How to import events. LoginEvent;
   
Import model. MyModelLocator;
   
Import mx.controls.Alert;
Import mx.rpc.IResponder;
Import mx.rpc.events.ResultEvent;
   
import Vos. UserVO;

public class LoginCommand implements ICommand, IResponder
{
public var myModel:MyModelLocator;
public var userDelegate:UserDelegate;
       
public void LoginCommand()
{
TODO: to implement the function
This allows to manipulate data in the
model
           
myModel = MyModelLocator.getInstace ();
}

public void execute(event:CairngormEvent):void
{
TODO: to implement the function
We will do our logic here
           
var loginEvent:LoginEvent = event as LoginEvent;
var userObj:UserVO = loginEvent.userDtl;
           
/ * If (userObj.userName == "[email protected]" &)
{userObj.password == "naresh") "}
do something
myModel.userDtl = userObj;
myModel.APP_STATE = "login";
               
} else {}
do something else
Alert.Show ("connection failed");
}*/
           
create the delegate user instance
           
userDelegate = new UserDelegate();
userDelegate.validateUser (userObj, this);
            
}
       
public void result(event:Object):void {}
           
var resultEvent:ResultEvent = event as ResultEvent;
           
{if(resultEvent.Result!=null)}

myModel.userDtl = resultEvent.result as UserVO;
myModel.APP_STATE = "login";
            
} else {}
               
Alert.Show ("connection failed");
}
           
}
       
public void fault(event:Object):void {}
           
}
       
       
}
}

LoginPanel
----------

<>
"xmlns:MX ="http://www.adobe.com/2006/mxml"
title = "Login here" >
   
   
        How to import events. LoginEvent;
import Vos. UserVO;
Import model. MyModelLocator;
Import mx.events.ValidationResultEvent;
           
public void loginUser(event:MouseEvent):void {}
               
var emailValEvnt:ValidationResultEvent
= emailVal.validate ();
var pswdValEvnt:ValidationResultEvent
= pswdVal.validate ();
                           
If (emailValEvnt.type is ValidationResultEvent.VALID
(& pswdValEvnt.type == ValidationResultEvent.VALID) {}
                   
as the validation is made
communicate the data on the server
                   
the failure of the value object
var userObj:UserVO = new UserVO();
userObj.userName = userNameTI.text;
userObj.password = passwordTI.text;
                   
var loginEvent:LoginEvent =
new LoginEvent (LoginEvent.LOGIN_EVENT, userObj);
dispatches the event
loginEvent.dispatch ();

CairngormEventDispatcher.getInstance.dispatch (loginEvent);  //Import com.adobe.cairgorm.CairngormEventDispatcher CairngormEventDispathcer
} else {}
display error message
this.errorString = 'Pleae enter valid details';
}
               
}
           
]]>
   
   
<>
source = "{userNameTI}".
property = "text".
ID = "emailVal".
required = "true".
triggerEvent =""
/>

<>
source = "{passwordTI}".
ID = "pswdVal".
maxLength = "16".
minLength = "6".
property = "text".
triggerEvent =""
/>


       

           
       
       
           
       

       
   
       
   

   

MyFrontController
-----------------
controller package
{
import com.adobe.cairngorm.control.FrontController;
   
How to import events. LoginEvent;
import controls. LoginCommand;

SerializableAttribute public class MyFrontController extends FrontController
{
public void MyFrontController()
{
Super();
addCommand (LoginEvent.LOGIN_EVENT, LoginCommand);
           
}
       
}
}

LoginEvent
-----------
package events
{
import com.adobe.cairngorm.control.CairngormEvent;
   
import flash.events.Event;
   
import Vos. UserVO;

SerializableAttribute public class LoginEvent extends CairngormEvent
{
public static const = "loginEvent"; LOGIN_EVENT:String
        
public var userDtl:UserVO;
       
public void LoginEvent (type: String, userObj:UserVO)
{
TODO: to implement the function
Super (type);
this.userDtl = userObj;
}
       
override public function clone (): Event {}
           
return of new LoginEvent (type, userDtl);
}
}
}

MyModelLocator
--------------
package template
{
import com.adobe.cairngorm.CairngormError;
import com.adobe.cairngorm.model.IModelLocator;
   
import Vos. UserVO;
   
[Bindable]
/ public class MyModelLocator implements IModelLocator
{
public static var instance: MyModelLocator;
       
public void MyModelLocator(enforcer:SingletonEnforcer)
{
TODO: to implement the function
{if(Enforcer==null)}
               
trace ("you cannot create more than one instance of ModelLocator");
throw new CairngormError ("initializing Multiple");
                               
}
           
}
       
public static function getInstace (): {MyModelLocator}
           
{if(instance==null)}
create a new instance
Return it
instance = new MyModelLocator (new SingletonEnforcer());
return instance;

} else {}
return the existing instance
return instance;
}
           
}
       
Declare the Variables here
Don't forget to initialize them
       
contains the user data
public var userDtl:UserVO = new UserVO();
check the status of the application
public var APP_STATE:String ="";
       
}
}
Class SingletonEnforcer {}

UserVO
-------
package vo
{
[Bindable]
[RemoteClass(alias="com.test.lcds.vo.UserVO")]
public class UserVO
{
public var userName:String;
password public var: String;
       
public void UserVO()
{
}

}
}

Cairngorm2
-----------

<>
"xmlns:MX ="http://www.adobe.com/2006/mxml"
layout = "absolute".
xmlns:comp = "comp.*.
xmlns:control = "controller.*".
xmlns:vo = "vo.*".
xmlns:business = "mentoring."
Initialize = "initApp () '"
currentState = "{myModel.APP_STATE}" > "
   
   
   
   
   
   
   
   
   
   
        Import model. MyModelLocator;
           
[Bindable]
public var myModel:MyModelLocator;
           
public function initApp (): void {}
               
myModel = MyModelLocator.getInstace ();
               
               
}
           
]]>
   

   
       
           
           
               
text = fontWeight "Congratulation {myModel.userDtl.userName}" = "bold" fontSize = "18" / >
           

       

   

   
    <>
horizontalCenter = "0".
Red = "0" id = "loginpanel1" >
       
   
   

Place these classes in relavent ane packages try it... you must implement service locator in the pakage delegate as well as the UserDelegate class

Tags: Flex

Similar Questions

  • Request: HP Pavilion DV6 2011 first Login wallpaper (6c50Tx)

    Hi everybody, this may seem like a rather silly request but...

    My laptop, after a reformat, in the first login screen would display a pretty blue HP custom login screen where I can click on my account and go into windows 7. The login screen background was something like that, without the big HP logo,

    However, unfortunately, the computer laptop after the first connection, removed by himself and is custom login screen returned to the annoying windows 7 login screen

    I went to C:\Windows\System32\oobe\Info\backgrounds, but could not find the blue login screen background

    Can anyone here download this login screen background? I want this on my login screen

    Too bad everyone, I found after digging through my recovery disk.

    In case someone wants to download those, they can be found here:

    https://docs.Google.com/file/d/0B6xCnhLl8qf8U3NycXZ4Y3JDbHc/edit?USP=sharing

    And that's what it looks like. Soon all the world!

  • Change password after first login

    We configure the user accounts on the local ASA 5510.  Is it possible for the user to set up accounts so that users can change the password after the first login?

    Thank you.

    Laura

    Laura,

    If users are in the local database on the SAA, there are some attributes that you can set, that is to say

    username TEST attributes

    Toggle the password login password-storage on the
    client system

    But what you want is to force the user to change his password, I have seen that you can not set this parameter for local users on the SAA.

    The way to accomplish this will use an external authentication source (ACS, Radius, GANYMEDE + Server server, etc.).

    Federico.

  • Need help to completely remove Adobe Application Manager.

    I just tried to update my Adobe Application Manager, but he told me that the installation has been broken, I went and uninstalled hoping that I could just download the installer again and reinstall.

    It did not work, and now the package install for Adobe Application Manager tried again to update and not to do a fresh install. It gives me the error that it could not initialize when I try.

    I guess the only thing now is to root parts of the registry for this there is no other trace left MAO on my PC.

    Running Windows 8.1 with Photoshop CC, CC Bridge and Lightroom 5.7 installed. As well as the Air and Flash Player.

    HO, Kevin,.

    You can follow the article: use of the cleaning tool CC to resolve installation problems. CC, CS3 - CS6 which helps you completely remove Adobe Application manager on your computer.

    Let us know if you still face problems with this.

    Thank you

    Yann Arora

  • I am trying to transfer the license from a Dreamweaver CS3 Macintosh product. A transfer of license form signed by the person who gave it to me. Can someone help me complete the process?

    I am trying to transfer the license from a Dreamweaver CS3 Macintosh product. A transfer of license form signed by the person who gave it to me. Can someone help me complete the process as cat Adobe say they are unable to help? I was told that the forum is reviewed by a team of experts. Anyone here? Thank you

    Did you follow your form as well?  A form must be completed and signed by both parties and submitted to the Adobe support via a support ticket. Chat support can't help, but should you indicated in section with the instructions.

    Transfer an Adobe product license

  • Change password at the first login

    Hello

    I have an application with an authentication scheme based on a table that contains all users - everything works fine.
    But now I want to force the user to change the password at the first login. Is it possible to get through the property "authentication process after" in the authentication scheme?
    If yes how?

    Thanks in advance.

    Kind regards
    Martin

    Martin,

    You can do it in many places - in the login (in the process of connection) page or homepage (as before the process of the header) or as post authentication process...

    You can redirect to any page using the owa_util.redirect_url procedure. See what Re: Login redirects to pages

    See you soon,.
    Hari

  • I just bought the last Apple TV - I can't seem to connect with the App Store and Siri is completely useless. This is an example of how Apple is unable to produce a useful product?

    I just bought the last Apple TV - I can't seem to connect with the App Store and Siri is completely useless. This is an example of how Apple is unable to produce a useful product?

    Hello

    Be sure to follow the instructions in this article to support > set up your Apple TV (4th generation) - Apple supported

  • urgent need help to get adobe first pro

    Hi, im a student and a freelancer, I really need Adobe first pro software that my problem is that in my country even in my school in multimedia digital, everyone uses a crack version I tried to buy it online, but adobe has stated that this service is not available in my country. I have an urgent job to do and I don't want to fly using a crack version. Anyone have a solution for me?

    Hello

    I see that you have an adobe under the same email account as with the forums.

    The Adobe ID has its country of registration in France and creative cloud is available in France.

    Please see the link below for help:

    Pricing plans and creative Cloud membership | Adobe Creative Cloud

    Let us know if you need more information.

  • Help! Only the first part of my production of exports.

    Hello world. I must begin by saying that I am completely new to the first Pro CC 2015 have switched to Sony Vegas only a week ago.

    I have a difficulty that doesn't seem wise for one big reason. The problem is that my production lasts 5 minutes and I can see it in the preview but very late. Waiting and waiting and waiting for its encode following export command that I find myself disappointed to see that the finished video contains only the first 35 seconds or so my production of all 5 minutes. The video works great, everything in these 35 seconds is how it should be, it is perfect, except the missing 4 minutes and 30 seconds. A fat that is not sensible is because the video, I'm trying to export is just the latest version. It was previously exported twice now. All I've done since then is add additional sounds and a few titles. I made sure that the Begin/End markers to cover the entire timeline on my screen of export

    There was an error that arose on a previous export, which then had to be restarted. The error referred to in audio encoding and suggested I should switch to one pass instead of two during the encoding. I've only seen this error once and honestly do not know if it is related to this problem or not.

    Intel Core i7

    principal of 16 GB of Ram

    2 GB of video Ram

    Windows 8

    Thanks indeed if you can shed some light.

    Thanks for the reply of Bill.

    Do you mean the main timeline? Forgive me, getting used to the Prime Minister. To answer your question, my best... There's no marker for the beginning or end up on the main screen. When you click export that I'm double-checking that the entire Sequence is selected as the Source and the start and end markers are in fact at the beginning and at the end. After four attempts, I had just finished with the first half minute of video rendering, however.

    I found a fix for the problem now, but still did not work what caused (to my slight annoyance).

    As an experiment, I deleted each sound track and the silent video exported now very well. To develop on this I have reinserted all the sounds, made all the sound tracks. Who has also exported very well which means that I have a video in its entirety. I fixed my own problem. I do not understand what may have caused it well.

  • I need help to configure my first meeting

    I've never used the software and I missed the first training meeting virtual today (Monday) where can I get help to get started?

    There are a lot of good resources here to get started with Adobe Connect - Adobe Connect user community

  • Alignments of zone apex 4.2 first Login page

    Hello

    I'm under Apex 4.2 on Oracle Express Edition (Linux). My login page has sometimes the alignments of the connection area of Workspace/name username/password under the image of the Apex as below: http://i.imgur.com/A49qx.png

    It is with the help of Firefox. The police page makes well with other browsers like IE or Chrome. Has anyone else experienced this problem?

    I'm under Apex 4.2 on Oracle Express Edition (Linux). My login page has sometimes the alignments of the connection area of Workspace/name username/password under the image of the Apex as below: http://i.imgur.com/A49qx.png

    It is with the help of Firefox. The police page makes well with other browsers like IE or Chrome. Has anyone else experienced this problem? >

    In FF tools > clear recent history > select Cache, data of the site offline Web and Site preferences > clear now.
    It fixed the problem for us.

    See you soon,.

  • Need help to install the first element 12

    I installed first item 12 by mistake with the 64-bit version. When I uninstall and reinstall it with the 32 bit version, it cannot accept my installation.

    My computer screen keeps popping up with the error message that my computer graphic display cannot support the 64-bit version. I am already installing the 32-bit version, but he refuses always to install and still have the error of the 64-bit display error message. Can anyone help?

    Someone can help me.

    Here are the specs first elements 12 Info:

    • Adobe® first elements Editor runs on Windows 7 and Windows 32-bit on Windows XP and Windows Vista and 64-bit or 32-bit mode 8 & 8/1; all other running applications native on 32-bit OS and systems in 32-bit compatibility mode on a 64-bit operating systems)
    • 2 GB of RAM
  • Error on change of password due to the expiry at the first login - bug?

    Hello

    When I create a new user to the workspace in a workspace by using the default password policy and set their password expires on first use, thus prompting a change of password, if the user specifies a password that violates the strong policy, they returned to the login screen of workspace with no indication that the password change was not accepted because it violates the strong policy. The user must connect with the original (unchanged) password, prompting so a change of password again once and they were beaten in a loop without clear indicator as to why.

    If a password that passes the strong policy is used, there is a message stating that the password has been changed successfully and the user name can now work space with their changed password.

    At this point if a change of password is requested by the user after the notation in the workspace, and a password that violates the strong policy is provided, a message appears saying that it violates the strong policy and why (which is what I expected to see when the password for the first time as described above). If they provide a password that passes the strong political, the password is accepted, a message is provided indicating this.

    We use the Apex Apex listener 1.1.3 and GlassFish 3.1 4.1

    I have reproduced this in our community Dev, stage and Prod. I have not tested with OSH, but am posting this now in case there is a problem?

    Thank you

    Alan

    Hi Alan,

    Thanks for reporting this. I can also reproduce in 4.1.1 and filed a bug.

    A quick glance shows that Apex successfully intercepts the password breach, but try to re - view the 4350:68 with errors inline page. This re - will the Sentinel of the session, which determines the session is invalid and redirects to the login page.

    Kind regards
    Christian

  • Need help to finalize the first Web page...

    Hi - I'm new to dreamweaver and have managed to find something out, but not others.

    I'm building a site with several pages, but I want to get this first page completely ready to go before others (because I want to use as a template on their part).

    I have attached a sample image of what I want the site look like. It's pretty close.

    Website Design Sample Image.jpg

    I have questions:

    The menu at the top of the image bar isn't straight deplaying.  It looks different in Design view, live view and overview.  I tried two different ways (such as columns and a horizontal list)- but it is not filled on the entire width of the page.

    I also have trouble getting the 3 columns to be the same height - perhaps because I have padding on some and not on others?

    I do not know how to show you what I have at the moment - but here's a screen capture zoom.  (looks like small - but only because I have a zoom out to get it all).

    Screen Shot 2013-05-06 at 3.05.06 PM.png

    Also - is there a way to get rid of the very small gap above the header: MICAHEL GABRIEL?

    And is it possible to add a shadow to the text of the header and menu?

    Thank you!

    #1 menu bar '... is not filled on the entire width of the page." They rarely do.  Width of the menu is driven by the amount of content it has, how much CSS & padding margins you put between the links and the text sizes people use in their browsers.

    #2 "having trouble getting the 3 columns have the same height."   Also not surprising given that the height of the div is based entirely on the content.  More content = more long division.  Less content = shorter divisions.   Don't sweat the little things.  No one cares if a column is longer than the others.

    #3 'is there a way to get rid of the very small gap above the header?" Yes. Margins and padding on your body and headers (h1, h2, h3, p) to zero.  Or use the Reset CSS method to remove browser default margins & padding of elements on the page.

    http://cssresetr.com/

    Nancy O.

  • Help! Exporting a first CS5 photo story no video just of JPEG files, trying to resize

    I've seen a heck of a time trying to get this to work. I'm doing a video test in first CS5.  There is no video JPEG only. I need to change the resolution of 640 x 360, but keep image quality.

    When I export files, the media encoder appears, but I can't understand how to change these settings.

    Any help would be fantastic.

    NOTE: There are audio tracks I need. The stills where turned on a T2i can. The parameters of the sequence is 1280 x 720, but the ability to change the resoultion is grayed out?

    Exactly how do you plan to offer the material exported?

    With a sequence set to 1280 x 720 and 640 x 480 still Images, you're looking at one of the two modes of action:

    Leave the black bars around the fixed Images, or

    Step up 640 x 480 still Images to match the size of the image of the sequence - resulting in a loss of quality

    Know how, and you want to deliver, other help to suggest how to configure your sequence and export.

    Good luck

    Hunt

Maybe you are looking for

  • JavaScript command works not in the address bar

    Until FF Version 6.0.2 is supported by the following command via the address bar "javascript:window.resizeTo (1280,1024); In the 7.0.1 version and beta version 8 - it is no longer supported. I use it all day in my role as project manager for testing

  • HP Pavilion 17 Notebook PC: updates Possible for my HP Pavilion 17 graphics card

    Hello I am looking to update my graphics card. I was told to 'memory Express' local that they cannot provide because of limited vendors. I was directed to one myself hope that either the company HP procure, or find one on ebay. I understand that lapt

  • BIOS disable code

    Deactivation of the system code of 88332656. What gurus now?

  • Games of vista disappearing

    Recently, I had all the games that comes with the removal of Vista. I played the titans of chess and Mahjong tiles one night and got up the next morning a cannot find the files anywhere. I can see where I played against them recently but when I click

  • card xD-picture card

    How can I use an xd-picture card, I have a dell studio 1536