Page 1 of 1

[SOLVED] Exporting your module to XML (CreateXMLPackage)

Posted: Fri Jan 08, 2016 10:11 am
by Guido
As I'm just beginning with developing for CMSMS, and am now creating the Ace Editor for CMSMS 2.x, I'd like some help on the following function from the main CMSModule class:

Code: Select all

CreateXMLPackage(string &$message, int &$filecount) : string
I understand the two arguments, they're not that hard. But should I place it in an action file? and then create something like:

Code: Select all

{cms_action_url action=MY_XML_EXPORT_ACTION_FILE}
in my admin page? And will this send an XML file to my browser?

Also, I can use it as a method of $this I think? Since it is a CMSModule class method and the module class extends that class?

Re: Exporting your module to XML (CreateXMLPackage)

Posted: Fri Jan 08, 2016 10:26 am
by Jos
You need to add a setting to your config.php
developer_mode
Description: This config variable enables various functionality (Particularly in the ModuleManager) that is intended primarily for module developers.
Status: Optional
Type: boolean
Example: $config['developer_mode'] = true;
Default Value: false
After that you will see buttons in the list with modules. Hit the button and you will get the xml file

Re: Exporting your module to XML (CreateXMLPackage)

Posted: Fri Jan 08, 2016 10:41 am
by Guido
Ah, thanks! Didn't know that, saves me the trouble of manually having to make this.

EDIT

Hmm, weird. Isn't working for me. I cleared the cache several times of course, but no cigar. You mean the module list in the Module Manager right?

Re: Exporting your module to XML (CreateXMLPackage)

Posted: Fri Jan 08, 2016 1:15 pm
by Jos
Yes, after adding $config['developer_mode'] = true; to your config.php you will get a new column "Export" in ModuleManager. No need to clear cache.

Re: Exporting your module to XML (CreateXMLPackage)

Posted: Fri Jan 08, 2016 1:47 pm
by Guido
I have an old install of the 1.12 series, here the column is present by default. But in my fresh 2.1.1 install I set the developer mode in the config file but still no column in the module manager.

Here is the system info:
--------------------------------------------------------------------------------
Cms Version: 2.1.1

Installed Modules:

AdminSearch: 1.0
CMSContentManager: 1.1
DesignManager: 1.1.1
FileManager: 1.5.2
MicroTiny: 2.0.2
ModuleManager: 2.0.1
Navigator: 1.0.2
News: 2.50.3
Search: 1.50.2
TinyMCE: 3.0-alpha1
AceEditor2: 0.1


Config Information:

php_memory_limit:
max_upload_size: 64000000
url_rewriting: none
page_extension:
query_var: page
auto_alias_content: true
locale:
set_names: true
timezone: Europe/Amsterdam
permissive_smarty: false


Php Information:

phpversion: 5.4.45
md5_function: Aan (Waar)
json_function: Aan (Waar)
gd_version: 2
tempnam_function: Aan (Waar)
magic_quotes_runtime: Uit (Onwaar)
E_STRICT: 0
E_DEPRECATED: 0
test_file_timedifference: Geen tijdsverschillen gevonden
test_db_timedifference: Geen tijdsverschillen gevonden
create_dir_and_file: 1
memory_limit: 128M
max_execution_time: 30
register_globals: Uit (Onwaar)
output_buffering: 4096
disable_functions:
open_basedir: /home/majorlabel/:/tmp:/var/tmp:/usr/local/lib/php/:/usr/local/php54/lib/php/:/usr/local/php56/lib/php/
test_remote_url: Succes
file_uploads: Aan (Waar)
post_max_size: 64M
upload_max_filesize: 64M
session_save_path: Geen controle omdat 'open_basedir' actief is
session_use_cookies: Aan (Waar)
xml_function: Aan (Waar)
xmlreader_class: Aan (Waar)
check_ini_set: Aan (Waar)
curl: Aan


Performance Information:

allow_browser_cache: Uit (Onwaar)
browser_cache_expiry: 60
php_opcache: Uit (Onwaar)
smarty_cache: Uit (Onwaar)
smarty_compilecheck: Uit (Onwaar)
smarty_cache_udt: Uit (Onwaar)
auto_clear_cache_age: Aan (Waar)

Server Information:

Server Software: Apache/2
Server Api: apache2handler
Server Os: Linux 2.6.32-573.12.1.el6.x86_64 Aan x86_64
Server Db Type: MySQL (mysqli)
Server Db Version: 5.6.27
Server Db Grants: Er is een "GRAND ALL" permissie gevonden, alles lijkt in orde.

Re: Exporting your module to XML (CreateXMLPackage)

Posted: Fri Jan 08, 2016 3:55 pm
by Jos
Did you look at the tab "Installed" in ModuleManager?

Re: Exporting your module to XML (CreateXMLPackage)

Posted: Fri Jan 08, 2016 4:13 pm
by Rolf
Look for the orange XML button

Re: Exporting your module to XML (CreateXMLPackage)

Posted: Fri Jan 08, 2016 4:56 pm
by Guido
Stupid mistake on my side. I was used to CMSMS 1.12 series, that don't auto set the config.php file to 444 after install. I saved it but never saw the error in FileZilla telling me about the failed upload.

Re: [SOLVED] Exporting your module to XML (CreateXMLPackage)

Posted: Mon Jan 18, 2016 4:01 am
by Jeff
If the XML button isn't visible for the module row, make sure the module directory and all files are writable.

Re: [SOLVED] Exporting your module to XML (CreateXMLPackage)

Posted: Mon Jan 18, 2016 10:24 am
by Guido
Thanks, but my problem was already solved. I edited the config.php file in Filezilla, which was working in the remote server. Before opening the config.php file, I forgot to set it to writeable (since CMSMS 2.x auto-444's it after install now). So I was hitting CTRL+S and missed the error in Filezilla about the file not being writeable.