Select to view content in your preferred language

Login Screen for the Flexviewer

42326
121
03-15-2011 10:52 AM
andrewj_ca
Frequent Contributor
Just posted some code for a Flexviewer login screen.  I hope somebody can get some use from this.

http://www.arcgis.com/home/item.html?id=baebcaf317994d63902bc9735c0657e0
Tags (2)
0 Kudos
121 Replies
RobertScheitlin__GISP
MVP Emeritus
Janie,

   You can not make this change if you are only using the compiled Flex Viewer. You have to be using the Source Code version.
0 Kudos
AndyWhitley
Emerging Contributor
I have tried the suggestion in this post related to "Internal Database Error" and I am still having issues.  Even when I run my project in Flash and I am getting the login screen but when I put in the credentials I am getting this error.  Any more suggestions?
0 Kudos
ZacharyHart
Honored Contributor
Janie,

   You can not make this change if you are only using the compiled Flex Viewer. You have to be using the Source Code version.



So....there's no way to integrate login/password into the compiled version of Viewer?

I'm sure all the newb questions must rub you guys the wrong way, but i dont need much out of Viewer...but its gotta be password protected.
0 Kudos
BretAllphin
Deactivated User
Philipp, (and others)

Thanks for the tip. However when I do replace my index.mxml (or whatever your default application .mxml is in your particular project) I can't get the project to run or compile due to an error that says 'Could not resolve <viewer:ViewerContainer> to a component implementation.' The SWC file is properly in the libs directory of this project, so I'm not really sure what that means or how to resolve it.

I sure hope this type of basic login security is added for out of the box use in subsequent versions - this was the beauty of the .net adf - it was so easy.

Thanks again-

B
0 Kudos
MagalyC_
Deactivated User
So....there's no way to integrate login/password into the compiled version of Viewer?


You can maybe use the tomcat security?
http://www.unidata.ucar.edu/projects/THREDDS/tech/reference/TomcatSecurity.html
0 Kudos
ZacharyHart
Honored Contributor
Would anyone be willing to compile a stock version of the viewer plus this login capability?

I'm willing to pay or barter for this simple service.
0 Kudos
JanieGoddard
Frequent Contributor
philipp37;135345 wrote:
Same issue here - works perfect except that the app automatically zooms in as far as possible.  This seems very odd to me.  Can the extent be hardcoded into the index.mxml file instead of the config.xml?


Did anyone figure out how to keep the Login Flexviewer from Zooming in as far as possible?

Thanks Phillip for the installation steps!
Thanks Andy for the Login asp.net.
0 Kudos
JanieGoddard
Frequent Contributor
philipp37;135345 wrote:
Same issue here - works perfect except that the app automatically zooms in as far as possible.  This seems very odd to me.  Can the extent be hardcoded into the index.mxml file instead of the config.xml?

Did anyone figure out how to keep the Login Flexviewer from Zooming in as far as possible?

Thanks Phillip for the installation steps!
Thanks Andy for the Login asp.net.

Thanks Robert for telling me this is the uncompiled src version of Flexviewer.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
All,

   I think I found a workaround for the map scale and other issues when using the Login screen code in Flex Viewer 2.4. Ultimately it is a time issue. I did not actually find the exact issue but this code change to the ViewerContainer.mxml seem to work as a workaround for me (so far). Below are the portions of code in the ViewerContainer.mxml that need to be updated I comment my work

            private function creationCompleteHandler():void
            {
                m_instance = this;

                initLogging();

                //prepare to show error message
                AppEvent.addListener(AppEvent.APP_ERROR, errorHandler);

                setUrlConfigParams();
                setConfigFile();

                startLocalConnection();

                AppEvent.addListener(AppEvent.CONFIG_LOADED, configLoadedHandler);
//Workaround for Login issue in Flex Viewer 2.4
                callLater(waitInitialized);
            }
            
            private var clCount:int = 0;
            private function waitInitialized():void
            {
                clCount += 1;
                if(clCount != 100){
                    callLater(waitInitialized);
                    return;
                }
                //tell the modules it's on business.
                AppEvent.dispatch(ViewerContainer.CONTAINER_INITIALIZED);
            }
//End workaround for Login issue in Flex Viewer 2.4
0 Kudos
JamesFaron
Frequent Contributor
Robert,

Great work once again: my application now loads as expected. What was odd about this was that it would randomly load as expected (mostly the first time, in Firefox, not IE), but on subsequent application loads it would default to the tiles of the lowest scale, in my case, level 8, as opposed to level 0, corresponding to full extent. The map would be centered regardless. Sometimes, if I cleared the cache, it would load correctly for that one time.

Thanks,

Jim Faron
0 Kudos