Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
11
Erster Beitrag:
vor 5 Jahren, 1 Monat
Letzter Beitrag:
vor 4 Jahren, 11 Monaten
Beteiligte Autoren:
Alexandre Leclerc, Victor Diego, GuenterP, RAUL2

Groupware and multiple HF C/S ddbb

Startbeitrag von Victor Diego am 11.06.2013 07:49

Hello:
I am developing an application that will be sold as SaaS. At the moment I do not want to use the SaaS management system of Webdev, because I do not want to control prices, occupations, etc.. Just I want each customer be able to connect to their database where users files are for each database.

The problem I have with Groupware management and database HF C / S (Client / Server) is in the login page because I must ask the customer (or database) , the user and password .

When the "Login" page is activated Groupware does not yet know what database will connect. After fill the three data (customer, user and password) I find in other database the name of the database to connect and connect to it. User tables are independent for each bbdd.

Well, so far the background, now explain the problem:

The "gpwOpen ()" opens the login page and then requesting customer, user and password, but once I use it I cannot change the database which acts groupware. According to the manual I have to use "gpwOpenConnection" to initialize the connection parameters and then make gpwOpen (), but if I call for the second time gpwOpen, again requests the username and password, so that I get a loop .

I have tried not to use "gpwOpen" and instead use "gpwLogin" but that function does not find the user if before I have not call gpwOpen. It's like "gpwOpen" were compulsory.
I want ask the tree data: customer, user and password and that user groupware connect to the correct database.

I do not know if I could explain properly.
Did anyone have a similar experience and could help me?
Thank you very much in advance.

Victor Diego
Santander-Spain

Antworten:

Hi Victor,

You can read the groupware user file without using the groupware. So what I would do is read manually the user file the first time in order to detect which customer it is. Then after, use the groupware commands.

So, create a data source variable and a connection to the genera groupware file. Read the file to validate the user and password. Then use the gpwLogin/Open() function to really connect the groupware to the good database. You can then discard the connection and the data source variable.

This should work with no problems. (In fact the Saas commands are doing exactly that. They query the Saas server to authenticate the user then once it knows the company, it connects your main application to the good database.)

Best regards,
Alexandre Leclerc

von Alexandre Leclerc - am 11.06.2013 14:03
Hi Alexandre. How do you read the groupware files? Do you need HChangeConnection() in order to open gpw analysis? And later use the function again in order to open your own DB?

I don't figure out how to keep both DBs opened.

Kind regards.

von RAUL2 - am 15.06.2013 00:06
Hi RAUL,

Yep, a groupware file is just like an usual file. But do not use gpw* functions (they are only required when you want WX to validate the object's access).

So you can create a connexion to the files and open them just as any other files. You just need to create a datasource for the actual file and set the password.

On top of my head:

GPWUSER is Data Source // By default the ..Name property is the same as the variable name
GPWUSER..Name = "GPWUSER" // Only required if declared inside a class (for example) because the internal name is not the same as the variable name in that case.
HPasss(GPWUSER,"you groupware password, by default: PCSGPW2001")

// ... Make your connexion to the database containing the files (this is an example and it should be adjusted - thing of it as simple HFSQL file)
MyConnection is Connection
MyConnection..User = "USER"
MyConnection..Password = "PASSWORD"
MyConnection..Server = "MYSERVER"
MyConnection..Database = "MyDatabase"
MyConnection..Provider = hAccessHFClientServer
MyConnection..Access = hOReadWrite
HChangeConnection(GPWUSER,MyConnexion)
HOpenConnection(MyConnection)
HChangeDir(GPWUSER, ".\gpw\") // Subfolder in which are the files

// Then simply read the file with standard H* functions...
HReadFirst(GPWUSER)
Trace(GPWUSER.Name)

Then at that point, when you validate the user, you can again change the database and then finally use the gpw* functions to activate the groupware on the good dataset you want.

Best regards,
Alexandre Leclerc

von Alexandre Leclerc - am 17.06.2013 12:27
Alex, thanks a lot! This is really clear explanation.
Kind regards.

von RAUL2 - am 17.06.2013 12:42
Hi Alex:
Thank you for the example. In my case the database is HF C/S, so I need to use gpwOpenConection and it runs if I use the gpw... commands at the beginning of the project, but if I make a pause before the gpwOpenConection (for example with a breakpoint for debugger or I call the login page) the gpwLogin command does not connect to groupware.
I am developing a application where de GPW_login page need three data:
- Customer: (to determine the ddbb to connect, also the gpwuser files)
- User: A user defined on the database selected before.
- Password:

I would like use to the gpw... after press the "connect" button of GPW_login page, but it seems that does not run.

Any help is appreciated

Victor Diego

von Victor Diego - am 05.07.2013 13:15
Quote
Alexandre Leclerc
Hi RAUL,

Yep, a groupware file is just like an usual file. But do not use gpw* functions (they are only required when you want WX to validate the object's access).

So you can create a connexion to the files and open them just as any other files. You just need to create a datasource for the actual file and set the password.

On top of my head:

GPWUSER is Data Source // By default the ..Name property is the same as the variable name
GPWUSER..Name = "GPWUSER" // Only required if declared inside a class (for example) because the internal name is not the same as the variable name in that case.
HPasss(GPWUSER,"you groupware password, by default: PCSGPW2001")

// ... Make your connexion to the database containing the files (this is an example and it should be adjusted - thing of it as simple HFSQL file)
MyConnection is Connection
MyConnection..User = "USER"
MyConnection..Password = "PASSWORD"
MyConnection..Server = "MYSERVER"
MyConnection..Database = "MyDatabase"
MyConnection..Provider = hAccessHFClientServer
MyConnection..Access = hOReadWrite
HChangeConnection(GPWUSER,MyConnexion)
HOpenConnection(MyConnection)
HChangeDir(GPWUSER, ".\gpw\") // Subfolder in which are the files

// Then simply read the file with standard H* functions...
HReadFirst(GPWUSER)
Trace(GPWUSER.Name)

Then at that point, when you validate the user, you can again change the database and then finally use the gpw* functions to activate the groupware on the good dataset you want.

Best regards,
Alexandre Leclerc


Hi Alexandre,

this MAY work if you tell user groupware in the IDE that it will be on HF C/S, but having the analysis for HF Classic and changing connection to the datafiles to HF C/S first and trying to do the same with groupware files will inevitably fail. gpwOpenConnection(MyConnection) simply returns False. No connection made.

I will investigate the problem more thourougly over the weekend and try to find a workaround. e.g. will rights management still work when importing the gpw-files in my project's analysis and connecting to and opening all files together? I hope it will.

von GuenterP - am 05.07.2013 14:23
Nobody has developed an application that connects to the Groupware after press the “connect” button in the GPW_Login page? (not before the page was showed)

Thank you.

von Victor Diego - am 08.07.2013 16:16
Hi Guenter,

(I was in vacation, so sorry for the delay.)

We use the classic analysis of the groupware. We do not change the connection, we directly open the connection on the good database using gpwOpenConnexion(). This works very well.

Best regards,
Alexandre Leclerc

von Alexandre Leclerc - am 12.08.2013 14:14
Hi Alexandre,

meanwhile I do know what's wrong with gpwOpenConnection(..) ! It works with parameters within the command line, but it does not work using a variable of type connection!

MyConnection is connection

MyConnection..User = "Admin"
MyConnection..Password = ""
MyConnection..Database = ""
MyConnection..Server = ""
MyConnection..Provider = hAccessHF7
MyConnection..Access = hOReadWrite
MyConnection..CursorOptions = hServerCursor+hDynamicCursor+hOptimisticCursor
MyConnection..ExtendedInfo = ""
MyConnection..CryptMethod = hCryptNo
MyConnection..Source = NoSpace(MyPathToHFClassic)

gpwOpenConnection(MyConnection)

will not work at all.

von GuenterP - am 12.08.2013 14:34
Hi Guenter,

I must say I never was able to make gpwOpenConnexion with a connexion variable either (and never took time to understand / fix if it was possible -- so I sticked to the "classic syntax", as it worked for you to).

Best regards,
Alexandre Leclerc

von Alexandre Leclerc - am 12.08.2013 14:52
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.