Elxis CMS Forum
Extensions => Components => Topic started by: jimmyz on May 05, 2011, 22:59:01
-
Hello to all fellow guys.
I'd really like someone to help me out with this: I'm trying to make a new component for elxis, but I'm having trouble creating the XML file. How can I make the directory listing in the XML file? It's about a ton of files and folders, so going by hand is out of question. I have so far tryed some solutions, like the tree command, with no luck.
Thanks.
-
If you want a quick command to generate the xml, you can cd to the directory then run
find * -type f -exec echo ‘<filename>’{}’</filename>’ \;
find * -type d -exec echo ‘<folder>’{}’</folder>’ \;
Then you can copy the output from the terminal and paste between the files tags.
-
And for Max depth:
find * -maxdepth 0 -type f -exec echo ”{}” \;
find * -maxdepth 0 -type d -exec echo ”{}” \;
-
Thank you. I think I have what I need, I'm goin' for it! :D
-
I made this for generating template xml, but you can change it to suit your needs.
[attachment deleted by admin]
-
An example on how easy to use and powerful is Elxis Nautilus.
In the upcoming Elxis Nautilus you have the option to put all or some of the files in one or more zip packages and write in your XML file just the zip package(s). Elxis Nautilus will unzip them keeping the internal zip structure. This way you don't have to write the file names one by one. Good? ;D
Example:
<archive>images.zip</archive>
<archive extract="sample/">includes.zip</archive>
-
Thank you people for your suggestions and your precious time. Ivan, I will test your file, carefully. I was experimenting myself with something similar.
In anyways, Sirigos' solution seems to do the job decently. Be sure that after (and if ever) I finish, the file will be here for all of you to test/judje.
Keep it up,
Jim, Thassos