Creating Store Repositories

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Creating Store Repositories

Andre Schnoor
I think there should definately be a menu item in the launcher menu bar
"Store >> Create Repository ...". This is so obvious, I can't believe it
isn't there. Everytime I need to create a new repository, I find myself
browsing the source code(!) of Store for the appropriate steps to take.
Thats's horrible. All I want to do is to enter

* Login information for the SQL server (suitable to create a new database)
* The desired repository name

The name of the associated database could be derived from the repository
name automatically. After the creation, the new store profile should be
added to the Store registry and appear in the Store connection menus (so
saving the image is a good idea).

The creation of new databases works slightly different with each SQL
server model. This specific code (SQL template) should be added to the
respective StoreFor* packages.

Store being the recommended (and only useful) sourcecode management
system for VW, there's absolutely no excuse for hiding its most basic
management procedures somewhere in the PDF manuals or behind the scenes
in the sourec code. This should be intuitive and straight forward, or
otherwise it will put off too many newbies (and disgrantle the
occasional repository maker).

Please ;-)

Andre

BTW: I believe we Smalltalkers are just too busy doing sophisticated and
advanced things, while the primary ("boring") things that make up the
actual user exprience are completely neglected. That's a big mistake.

Reply | Threaded
Open this post in threaded view
|

RE: Creating Store Repositories

Boris Popov, DeepCove Labs (SNN)
Andre,

You can right-click on 'Repository Manager' in the lower right corner of
the launcher and pick 'New'. Also if you just go 'Store' > 'Connect' you
have the option to save the new profile by clicking on 'Save As'.

Hope this helps,

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5
http://tinyurl.com/r7uw4

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]]
> Sent: Thursday, February 15, 2007 12:45 PM
> To: vwnc-list
> Subject: Creating Store Repositories
>
> I think there should definately be a menu item in the launcher menu
bar
> "Store >> Create Repository ...". This is so obvious, I can't believe
it
> isn't there. Everytime I need to create a new repository, I find
myself
> browsing the source code(!) of Store for the appropriate steps to
take.
> Thats's horrible. All I want to do is to enter
>
> * Login information for the SQL server (suitable to create a new
database)
> * The desired repository name
>
> The name of the associated database could be derived from the
repository
> name automatically. After the creation, the new store profile should
be
> added to the Store registry and appear in the Store connection menus
(so
> saving the image is a good idea).
>
> The creation of new databases works slightly different with each SQL
> server model. This specific code (SQL template) should be added to the
> respective StoreFor* packages.
>
> Store being the recommended (and only useful) sourcecode management
> system for VW, there's absolutely no excuse for hiding its most basic
> management procedures somewhere in the PDF manuals or behind the
scenes
> in the sourec code. This should be intuitive and straight forward, or
> otherwise it will put off too many newbies (and disgrantle the
> occasional repository maker).
>
> Please ;-)
>
> Andre
>
> BTW: I believe we Smalltalkers are just too busy doing sophisticated
and
> advanced things, while the primary ("boring") things that make up the
> actual user exprience are completely neglected. That's a big mistake.

Reply | Threaded
Open this post in threaded view
|

Re: Creating Store Repositories

Travis Griggs-3
On Feb 15, 2007, at 12:45, Boris Popov wrote:

Andre,

You can right-click on 'Repository Manager' in the lower right corner of
the launcher and pick 'New'. Also if you just go 'Store' > 'Connect' you
have the option to save the new profile by clicking on 'Save As'.


Andre,

What were you looking for? I read your request as "I want to give it a database ID and have it go create the tables and everything in the DB, not just create a saved login." Or were you just looking for what Boris described?

--
Travis Griggs
Objologist
My Other Machine runs OSX. But then... so does this one.


Reply | Threaded
Open this post in threaded view
|

Re: Creating Store Repositories

Mark Roberts
At 07:03 AM 2/16/2007, Travis Griggs wrote:

>On Feb 15, 2007, at 12:45, Boris Popov wrote:
>
>>Andre,
>>
>>You can right-click on 'Repository Manager' in the lower right corner of
>>the launcher and pick 'New'. Also if you just go 'Store' > 'Connect' you
>>have the option to save the new profile by clicking on 'Save As'.
>
>Andre,
>
>What were you looking for? I read your request as "I want to give it
>a database ID and have it go create the tables and everything in the
>DB, not just create a saved login." Or were you just looking for
>what Boris described?

Travis,

Andre never replied to your question, so I will.

I submit that we should provide a menu pick and better dialog for the
"I want to provide a database ID and have Store create the tables,
etc." Right now, there is seemingly no way to do this except by evaluating:

         Store.DbRegistry installDatabaseTables

If there is a nice tool to do this, please tell me where it is and
I'll fix the documentation. If there isn't, I think we should add one.

I just spent hours today trying to install everything and create a
local Store database for the first time. There are too many small
gotchas and it's really not obvious how to do this unless you have
already done it once or have a certain level of expertise. As usual,
our documentation is vague, and there are a half-dozen different Wiki
pages scattered around that are all wrong in some way. While the PDF
documentation is a bit better, it isn't really adequate either. One
must circle around, reading a bunch of different documents to figure
out the solution.

I have tried to improve on the Wiki documentation, but I would like
to ask that we fix the VisualWorks side of things, too.

The "Repository Manager" tool is the logical place for improvement.
Right now, it contains menu picks and buttons to "Create a New
Repository". Maybe I'm wrong, but these seem to be for creating an
access profile, not a repository, and so for starters we might want
to change their names. Next, there should be some way to initialize a
database, i.e., send #installDatabaseTables. For this, we really need
a better dialog box. The way it works now, you get prompted for
little tidbits of information with a series of FillInTheBlank things.
It should be all in one polished-looking view with an OK button, a
Help button, maybe a status area to indicate validation errors and
progress (instead of dumping a bunch of junk in the Transcript), etc.

To reiterate the last part of Andre's original plea:

>Store being the recommended (and only useful) sourcecode management
>system for VW, there's absolutely no excuse for hiding its most
>basic management procedures somewhere in the PDF manuals or behind
>the scenes in the source code. This should be intuitive and straight
>forward, or otherwise it will put off too many newbies (and
>disgrantle the occasional repository maker).
>
>Please ;-)

[...]

>BTW: I believe we Smalltalkers are just too busy doing sophisticated
>and advanced things, while the primary ("boring") things that make
>up the actual user exprience are completely neglected. That's a big mistake.




Reply | Threaded
Open this post in threaded view
|

Re: Creating Store Repositories

Andre Schnoor


"Andre never replied to your question, so I will. "

Well, I did. But the reply went to Travis only, not to the list. So here it is once more (see below). Sorry.
Andre



Travis Griggs wrote:
On Feb 15, 2007, at 12:45, Boris Popov wrote:

You can right-click on 'Repository Manager' in the lower right corner of
the launcher and pick 'New'. Also if you just go 'Store' > 'Connect' you
have the option to save the new profile by clicking on 'Save As'.


What were you looking for? I read your request as "I want to give it a database ID and have it go create the tables and everything in the DB, not just create a saved login." Or were you just looking for what Boris described?


Thanks Boris and Travis,

actually I was looking for an "all in one go" solution that needs nothing else than a server login and a repository name (not even a database, because that doesn't yet exist). Below is the current code I am using. It is a bad hack, because of the ad-hoc SQL and the fact that Store.DbRegistry>>installDatabaseTables does not work programatically - it prompts for user input.

I feel that Store functionality is way too much cluttered over different menus, dialogs and hidden tools (e.g. the different left and right mouse button menus at the bottom of the transcript window are really a *bad* hack. It's nice to have convenience shortcuts there, but the main management items should be in the Store menu).

Andre

-----------------

MyDBManagement>>spawnRepository: profileName database: databaseName
    "Use this to spawn off a new Store repository in one go."
    "self spawnRepository: 'CGN 15.02.2007' database: 'cgn20070215' "

    | storeProfile |
    #{Store.DBAccess} isDefined
        ifFalse:[ self error: 'Store not loaded' ].
    Store.DbRegistry isConnected
        ifTrue: [ Store.DbRegistry disconnect ].

    "Create the database:"
    "(The receiver is able to login to the server and perform arbitrary SQL)"
    self query: ( 'CREATE DATABASE <1s>
  WITH OWNER = "BERN"
       ENCODING = ''UTF8''
       TABLESPACE = pg_default;
GRANT TEMPORARY ON DATABASE <1s> TO public;
GRANT ALL ON DATABASE <1s> TO "BERN";
GRANT ALL ON DATABASE <1s> TO "VisualWorks";'
        expandMacrosWith: databaseName ).

    self close.

    "Create the Store profile and DB tables:"
    storeProfile := Store.ConnectionProfile new
        name: profileName;
        driverClassName: 'PostgreSQLEXDIConnection';
        environment: self host, '_', databaseName;
        userName: self databaseOwner key;
        password: self databaseOwner value;
        tableOwner: 'BERN';
        yourself.
   
    Store.RepositoryManager repositories
        removeAllSuchThat: [ :p | p name = storeProfile name ].
    Store.RepositoryManager
        addRepository: storeProfile.
   
    "###### This does not work programatically: Prompts for input ######"
    Store.DbRegistry
        installDatabaseTables.

    self log: 'Re-connecting to ', storeProfile name printString.
    Store.DbRegistry connectTo: storeProfile.

Reply | Threaded
Open this post in threaded view
|

Re: Creating Store Repositories

Mark Roberts
At 04:58 PM 4/4/2007, Andre Schnoor wrote:
actually I was looking for an "all in one go" solution that needs nothing else than a server login and a repository name (not even a database, because that doesn't yet exist). Below is the current code I am using. It is a bad hack, because of the ad-hoc SQL and the fact that Store.DbRegistry>>installDatabaseTables does not work programatically - it prompts for user input.

I feel that Store functionality is way too much cluttered over different menus, dialogs and hidden tools (e.g. the different left and right mouse button menus at the bottom of the transcript window are really a *bad* hack. It's nice to have convenience shortcuts there, but the main management items should be in the Store menu).

Hi Andre,

Thanks for sharing your code.

It occurred to me that you might have replied to Travis in private, but only after I sent my message.

Anyway, I strongly agree with both of your points. Right now, the Store functionality is scattered between the Store menu, the Repository Manager, and the lower corner of the Transcript. It's needlessly obtuse for new users.

IMHO, there could be a simplified interface to create a new database, and the functionality could appear on the Store menu, with the bottom of the Transcript window hack as a convenience only. The Store menu in the Launcher toolbar should at the very least have a menu pick for the Repository Manager tool, and this tool should provide a way to initialize new repositories as you describe.

The Repository Manager tool should clearly distinguish between creating a repository (i.e., initializing a database for use by Store) and creating a profile (i.e., to access an existing repository). Its "Repository" menu could contain items for "New Profile..." and "Create Repository..." to eliminate any confusion.

Finally, the procedure for creating a repository should not throw an exception just because you hit "Cancel", as it does now.

Cheers,

M
Reply | Threaded
Open this post in threaded view
|

Re: Creating Store Repositories

Andre Schnoor
I meanwhile figured out all individual steps required for creating a
repository programmatically (no user input). Find the updated code below
(still a quick hack, though).

Maybe this can be helpful as a starting point.

Andre
--

spawnRepository: profileName database: databaseName
    | storeProfile |
    #{Store.DBAccess} isDefined
        ifFalse:[ self error: 'Store not loaded' ].
    Store.DbRegistry isConnected
            ifTrue: [ Store.DbRegistry disconnect ].

    "Create the database. (The receiver is able to run arbitrary SQL on
a DB connection)"
    self query: ( 'CREATE DATABASE <1s>
  WITH OWNER = "BERN"
       ENCODING = ''UTF8''
       TABLESPACE = pg_default;
GRANT TEMPORARY ON DATABASE <1s> TO public;
GRANT ALL ON DATABASE <1s> TO "BERN";
GRANT ALL ON DATABASE <1s> TO "VisualWorks";'
        filled: databaseName ).

    "Closes the database connection"
    self close.

    "Create the Store profile and DB tables:"
    storeProfile := Store.ConnectionProfile new
        name: profileName;
        driverClassName: 'PostgreSQLEXDIConnection';
        environment: self host, '_', databaseName;
        userName: self databaseOwner key;
        password: self databaseOwner value;
        tableOwner: 'BERN';
        yourself.
   
    Store.RepositoryManager repositories
        removeAllSuchThat: [ :p | p name = storeProfile name ].
    Store.RepositoryManager
        addRepository: storeProfile.
    Store.DbRegistry connectedProfileHolder
        value: storeProfile.

    Store.DbRegistry reconnect: false. "don't require existing tables"
    Store.DBObject installPhysicalSpaces isNil
        ifTrue:[ Store.DbRegistry goOffLine.     ^false ].
    Store.Package installPkgs.
    Store.DatabaseIdentifier newDBIdentifier: databaseName.
    Store.DbRegistry databaseIdentifier: databaseName.

    Store.Privileges installUserManagementTables.
    Store.DBUserGroup newGroupNamed: Store.DBUserGroup adminGroupName.
    Store.DBUserGroup newGroupNamed: 'QA'.
    Store.DBUserGroup newUserNamed: self databaseUserPrivileged key
inGroupNamed: Store.DBUserGroup adminGroupName.
    Store.DbRegistry goOffLine. "commit"

    storeProfile
        userName: self databaseUserPrivileged key;
        password: self databaseUserPrivileged value.

    self log: 'Re-connecting to ', storeProfile name printString.
    Store.DbRegistry connectTo: storeProfile.

Reply | Threaded
Open this post in threaded view
|

Re: Creating Store Repositories

MarkPetersen
In reply to this post by Mark Roberts
Just to add my vote, I agree completely that these types of "ease of use" capabilities need to improve.  We haven't started using Store yet in my group, but will probably need to now that our team is growing to more than one or two.  It sounds easy to do if you know the right hoops to jump through.  Kind of like setting the Timezone.  I've always wondered why we don't just have a pulldown similiar to Windows for defining the timezone instead of highlighting the right block of code and using 'do it'.  It was definitely an improvement to put the code in the Settings tool, but should be much more obvious and simple.  I believe a lot of 'ease of use' features could be added/improved without much cost in development.  Much of it is simply organizing and properly labeling capabilities that already exist.

Thanks,
Mark

Mark Roberts-4 wrote
At 04:58 PM 4/4/2007, Andre Schnoor wrote:
>actually I was looking for an "all in one go" solution that needs
>nothing else than a server login and a repository name (not even a
>database, because that doesn't yet exist). Below is the current code
>I am using. It is a bad hack, because of the ad-hoc SQL and the fact
>that Store.DbRegistry>>installDatabaseTables does not work
>programatically - it prompts for user input.
>
>I feel that Store functionality is way too much cluttered over
>different menus, dialogs and hidden tools (e.g. the different left
>and right mouse button menus at the bottom of the transcript window
>are really a *bad* hack. It's nice to have convenience shortcuts
>there, but the main management items should be in the Store menu).

Hi Andre,

Thanks for sharing your code.

It occurred to me that you might have replied to Travis in private,
but only after I sent my message.

Anyway, I strongly agree with both of your points. Right now, the
Store functionality is scattered between the Store menu, the
Repository Manager, and the lower corner of the Transcript. It's
needlessly obtuse for new users.

IMHO, there could be a simplified interface to create a new database,
and the functionality could appear on the Store menu, with the bottom
of the Transcript window hack as a convenience only. The Store menu
in the Launcher toolbar should at the very least have a menu pick for
the Repository Manager tool, and this tool should provide a way to
initialize new repositories as you describe.

The Repository Manager tool should clearly distinguish between
creating a repository (i.e., initializing a database for use by
Store) and creating a profile (i.e., to access an existing
repository). Its "Repository" menu could contain items for "New
Profile..." and "Create Repository..." to eliminate any confusion.

Finally, the procedure for creating a repository should not throw an
exception just because you hit "Cancel", as it does now.

Cheers,

M
Reply | Threaded
Open this post in threaded view
|

Re: Creating Store Repositories

Maarten Mostert-2
In reply to this post by Mark Roberts
Hi,

I am not a store user but maybe you all should have a look at StoreGlorp.

Remember that you can do databases the hard way (step by step) or take a bike ride and use Glorp !


Mark Roberts a écrit :
At 04:58 PM 4/4/2007, Andre Schnoor wrote:
actually I was looking for an "all in one go" solution that needs nothing else than a server login and a repository name (not even a database, because that doesn't yet exist). Below is the current code I am using. It is a bad hack, because of the ad-hoc SQL and the fact that Store.DbRegistry>>installDatabaseTables does not work programatically - it prompts for user input.

I feel that Store functionality is way too much cluttered over different menus, dialogs and hidden tools (e.g. the different left and right mouse button menus at the bottom of the transcript window are really a *bad* hack. It's nice to have convenience shortcuts there, but the main management items should be in the Store menu).

Hi Andre,

Thanks for sharing your code.

It occurred to me that you might have replied to Travis in private, but only after I sent my message.

Anyway, I strongly agree with both of your points. Right now, the Store functionality is scattered between the Store menu, the Repository Manager, and the lower corner of the Transcript. It's needlessly obtuse for new users.

IMHO, there could be a simplified interface to create a new database, and the functionality could appear on the Store menu, with the bottom of the Transcript window hack as a convenience only. The Store menu in the Launcher toolbar should at the very least have a menu pick for the Repository Manager tool, and this tool should provide a way to initialize new repositories as you describe.

The Repository Manager tool should clearly distinguish between creating a repository (i.e., initializing a database for use by Store) and creating a profile (i.e., to access an existing repository). Its "Repository" menu could contain items for "New Profile..." and "Create Repository..." to eliminate any confusion.

Finally, the procedure for creating a repository should not throw an exception just because you hit "Cancel", as it does now.

Cheers,

M

__________ Information NOD32 2156 (20070330) __________

Ce message a ete verifie par NOD32 Antivirus System.
http://www.nod32.com


Reply | Threaded
Open this post in threaded view
|

Re: Creating Store Repositories

Alan Knight-2
Thanks, but I don't know that that would be very helpful as it stands for the desire to have nice menu items and a one-step process for setting up a database.

At 05:26 AM 4/5/2007, Maarten Mostert wrote:
Hi,

I am not a store user but maybe you all should have a look at StoreGlorp.

Remember that you can do databases the hard way (step by step) or take a bike ride and use Glorp !


Mark Roberts a écrit :
At 04:58 PM 4/4/2007, Andre Schnoor wrote:
actually I was looking for an "all in one go" solution that needs nothing else than a server login and a repository name (not even a database, because that doesn't yet exist). Below is the current code I am using. It is a bad hack, because of the ad-hoc SQL and the fact that Store.DbRegistry>>installDatabaseTables does not work programatically - it prompts for user input.

I feel that Store functionality is way too much cluttered over different menus, dialogs and hidden tools (e.g. the different left and right mouse button menus at the bottom of the transcript window are really a *bad* hack. It's nice to have convenience shortcuts there, but the main management items should be in the Store menu).

Hi Andre,

Thanks for sharing your code.

It occurred to me that you might have replied to Travis in private, but only after I sent my message.

Anyway, I strongly agree with both of your points. Right now, the Store functionality is scattered between the Store menu, the Repository Manager, and the lower corner of the Transcript. It's needlessly obtuse for new users.

IMHO, there could be a simplified interface to create a new database, and the functionality could appear on the Store menu, with the bottom of the Transcript window hack as a convenience only. The Store menu in the Launcher toolbar should at the very least have a menu pick for the Repository Manager tool, and this tool should provide a way to initialize new repositories as you describe.

The Repository Manager tool should clearly distinguish between creating a repository (i.e., initializing a database for use by Store) and creating a profile (i.e., to access an existing repository). Its "Repository" menu could contain items for "New Profile..." and "Create Repository..." to eliminate any confusion.

Finally, the procedure for creating a repository should not throw an exception just because you hit "Cancel", as it does now.

Cheers,

M

__________ Information NOD32 2156 (20070330) __________

Ce message a ete verifie par NOD32 Antivirus System.
http://www.nod32.com

--
Alan Knight [|], Cincom Smalltalk Development

"The Static Typing Philosophy: Make it fast. Make it right. Make it run." - Niall Ross