Using XMLDB editor

Using XMLDB editor

autor Peter Mott -
Počet odpovědí: 13
If you are just starting the development of a module and want to use the XMLDB editor what is the best way to proceed?

Thanks

Průměr hodnocení: -
V odpovědi na Peter Mott

Re: Using XMLDB editor

autor Tim Hunt -
Obrázek: Core developers Obrázek: Documentation writers Obrázek: Particularly helpful Moodlers Obrázek: Peer reviewers Obrázek: Plugin developers
It should be possible to start from http://docs.moodle.org/en/Development:XMLDB_Documentation.

However, there is a lot of documentation there, and I am not sure how easy it is for a beginner to know where to start.

As you try to understand the documentation, your comments on how it could be improved would be appreciated.
V odpovědi na Tim Hunt

Re: Using XMLDB editor

autor Peter Mott -
Well my present issue is that I want to develop an activity module called, say, myModule. At present no files exist. I want to use the XMLdb editor to create an install.php file for this module. But when I open it in Moodle (1.8) I am presented with a list of existing modules and various option over them. I could not find anything in the docs about starting development. One difficulty is I can't find a distinction between documentation about how to use the XMLdb editor and documentation relating to its development(eg "The next stack shows how Moodle 1.7 code will interact with underlying RDBMS").
V odpovědi na Peter Mott

Re: Using XMLDB editor

autor Tim Hunt -
Obrázek: Core developers Obrázek: Documentation writers Obrázek: Particularly helpful Moodlers Obrázek: Peer reviewers Obrázek: Plugin developers
You need to make sure the mymodule/db folder exists and is readable by the web server, then you should be able to get started.
V odpovědi na Tim Hunt

Re: Using XMLDB editor

autor Scott Karren -
So I am using the XMLDB editor to add fields to a couple of tables. I have followed the documentation and have created the new fields, but I see no where that I can actually save the new structure. I backed out to the main screen and all I have available to me is Edit, the Save link is not active. Am I missing something here?

Scott Karren
V odpovědi na Peter Mott

Re: Using XMLDB editor

autor Angela Roberts -
I am sure that this is the stupidest question on the planet.

But can someone tell me what the XMLDB editor is and how I can make use of it.

I saw it there when I was making a database and I was sure it could e useful....but I am at a loss as to how to leverage it.

Sorry for the "dummies" question. But a real dummies answer that also advances into an advanced answer would really be appreciated.

Thanks!

angela
V odpovědi na Angela Roberts

Re: Using XMLDB editor

autor Valery Fremaux -

The XMLDB editor is a tool to produce as easily as it is possible the messy XML required by the new installation procedure. Considering writing databse scheme with XML is a real pleasure (!!) spending twice to four time the time you needed forextracting your SQL model. So here is the XMLDB Editor that helps you to extract from your DB the ugly and ultra-verbose, largely redundant XML code.

The best way to procede is to make your entire model in MySQL, arrange it, tune it and fix it, then using the XMLDB Editor to make the XML by creating the install.xml, then importing one by one the tables. Care that the first table of the module is imported when creating the XML at first but with a bug that only recognizes the "id" field, forgetting the others. You may import a second table, then delete the first one, and get it back to read all fields. XMLDB Editor allows you to rearrange entities in the order you would like they appear in the XML file.

You should closely check the XML as there are some type miscoding (such as integer turning into text fields, forgotten DEFAULTS, say, some little inconsistencies, but the major part of the work is done). Don't forget writing XML code back when finished arranging fields.

V odpovědi na Angela Roberts

Re: Using XMLDB editor

autor Peter Mott -
The way I used it was to create a folder mod/myModule/db that was writable by the Webserver. Then go into Moodle XMLDB editor and select mod/myModule and use [create] then [load] then [edit]. Then you start creating and editing a table. It is quite intuitive once you are in. There is one gotcha which is that to save your stuff you must backtrack all the way out and use [save]. Moodle will then write your install.xml which you can use. Oh yes, it seems that Moodle requires a Comment for the table.


V odpovědi na Peter Mott

Re: Using XMLDB editor

autor Aaron Wells -
I guess I'm a little late to the conversation sleepy, but I thought I'd mention that I just went through some difficulty figuring out how to get started with the XMLDB Editor as well. After figuring it out from this forum thread, I put up essentially these same instructions on the wiki: http://docs.moodle.org/en/XMLDB_editor#Quick_Start
V odpovědi na Aaron Wells

Re: Using XMLDB editor

autor Souman Mandal -

Hi All,

I am developing an Activity module named rubrics. But I am unable to modify the basic database table of the module. I want to add one filed named 'rowno' into the mdl_rubrics table. So using the XMLDB editor I edited the table and add the field. Then followed the instructions from different tutorial to update the change. And the notification I am getting is rubrics tables have been set up correctly. But when I am viewing the database using the command select * from mdl_rubrics; new field is not showing there. Plz help me how to add this new field.

Thanks,

Souman

V odpovědi na Souman Mandal

Re: Using XMLDB editor

autor Souman Mandal -

May be this is a very basic question, but I am really unable to figure out the purpose of XMLDB editor in Moodle. To be specific I need answers to the following questions

  • Can we use it to add a new field of a existing table?
  • If yes how?
  • Why not use PHPMyAdmin?

Waiting for some replies,

Souman

V odpovědi na Souman Mandal

Re: Using XMLDB editor

autor Tim Hunt -
Obrázek: Core developers Obrázek: Documentation writers Obrázek: Particularly helpful Moodlers Obrázek: Peer reviewers Obrázek: Plugin developers

The XMLDB editor is designed for developers developing new plugins or core functionality. If you read something like the NEWMODULE tutorial, or Development:Installing_and_upgrading_plugin_database_tables it should become clear.

If it is not clear, don't use it mrknout