solved Multiple Instances of Documentation Module

Ceri
Ceri
@adolygwr
8 years ago
370 posts
Is there any way to run multiple instances of a module/modules? I have a particular use in mind for the Documentation module but would prefer that entries did not get mixed up with other stuff. It strikes me that the doc module would make a fine wiki and I wanted to develop a dictionary with it (possibly crowd sourced) but keep that completely separate from any other documentation we might need to post.


--
Ceri Shaw - AmeriCymru

updated by @adolygwr: 03/08/17 04:15:43PM
paul
@paul
8 years ago
4,326 posts
Couple of options -

1) Copy the module and all its files and folders to another - jrDocs => xxWiki then systematically go through all the new module files changing instances of 'jrDocs' to 'xxWiki' and the module url from 'documentation' to 'wiki'. As the method is 'manual', its prone to errors so needs to be done and tested on a development system. There may well be other, module specific changes needed to make it work.

2) Add a custom field(s) to the entry form to select the 'type of document' then use that in searches. That would require additional template work.


--
Paul Asher - JR Developer and System Import Specialist
Ceri
Ceri
@adolygwr
8 years ago
370 posts
OK many thanks. Just a couple of quick questions:-

1. If I set up a dev site (I'm sure there are docs somewhere which explain how to do this) does it duplicate all the content on my site or is it just a plain vanilla Jamroom install? Slightly concerned about how much server space it will take up.

2. I have downloaded the module folders and there are 4 of them:- JrDocs and release 1.3.3 , 1.3.4. and 1.4.0 . Do I need to change all instances of 'jrDocs' to 'xxWiki' and the module url from 'documentation' to 'wiki' in all 4 folders or just the most recent release.

3. Is there a batch editor tool (other than sed) which I could use for this? What would you recommend (assuming that this is possible) and bearing in mind that I dont use Windows?


--
Ceri Shaw - AmeriCymru
Strumelia
Strumelia
@strumelia
8 years ago
3,603 posts
Ceri, if you have more than 50% of your current JR server (assuming you are using jr Hosting), then you can make a complete copy of your current site on the same server.
1) If not sufficient room, you can temprarily up your server size in your Server control settings- (it will be only for a day or two so will only cost a few dollars and then you can go back to a smaller server size again)
2) If you have more than 50% of your server still empty, you can create a new domain on your server through your server control settings. The domain doesnt have to be real or live or registered- just something you make up- probably best to choose something that doesnt exist on the web though.
3) once you have the new dummy domain set up, you can then go into the domain control settings and "Import an existing JR site" right into it. It won't be live since the domain won't be live, but you'll want to delete all your members except yourself in the next step.
4) after importing, you'll have a non-live duplicate of your live site, in your test dummy domain. It will have all your current members and all their content- so you'll want to DELETE them and their content so you can reduce the server size again.
Also, you want to delete them and turn off notifications like this:
Quote: Is there an easy way to set a test cloned site to make sure that NO notifications go out to ANY of the (cloned) members I've left in place?
Yes - ACP => Mailer module and select that all emails are dumped into the Debug Log instead of being actually sent. This is the first thing I done on any development/test setup.
5) in acp/developer/tools there is a button to then "reset system"- which will remove ALL content and ALL members EXCEPT you the master admin. Your content will be gone too...but all your customizations and site settings will remain intact. Then you can start your testing and create a few test members. Once all that content is cleared out, you'll then see your empty server space and possibly switch back to the smaller cheaper server size.



--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015

updated by @strumelia: 12/06/16 01:06:13PM
Ceri
Ceri
@adolygwr
8 years ago
370 posts
OK so I went back to the command line and ran the following sed command :-

find . -type f -name \*.php -exec sed -i.bak 's|jrDocs|xxWiki|g' {} +

This changed all instances of jrDocs to xxWiki in all 4 folders in .php files. I realise that I have to do this for the other file types and of course that will answer my question 2 in full ( because I will load all four amended folders to my dev server when I set it up) and it answers question 3 as well.

Still wondering though what how I should alter the url from documentation to wiki?

Also what is the best way to set up dev server. Can I do this on my Jamroom hosted server and if so where is the best guide for this?


--
Ceri Shaw - AmeriCymru
Ceri
Ceri
@adolygwr
8 years ago
370 posts
Many thanks Strumelia.....mulling over your response now :)


--
Ceri Shaw - AmeriCymru
paul
@paul
8 years ago
4,326 posts
Quote: 1. If I set up a dev site (I'm sure there are docs somewhere which explain how to do this) does it duplicate all the content on my site or is it just a plain vanilla Jamroom install? Slightly concerned about how much server space it will take up.
When you create a new JR install on our hosting its 'vanilla' and will not take up much disk space. I'd suggest that that is sufficient for this project.

Quote: 2. I have downloaded the module folders and there are 4 of them:- JrDocs and release 1.3.3 , 1.3.4. and 1.4.0 . Do I need to change all instances of 'jrDocs' to 'xxWiki' and the module url from 'documentation' to 'wiki' in all 4 folders or just the most recent release.
Just create the /modules folder xxWiki then copy the contents of the latest jrDocs to it, then work on those files.

Quote: 3. Is there a batch editor tool (other than sed) which I could use for this? What would you recommend (assuming that this is possible) and bearing in mind that I dont use Windows?
No - I'd just use a text editor and the search/replace tool within.


--
Paul Asher - JR Developer and System Import Specialist
Ceri
Ceri
@adolygwr
8 years ago
370 posts
paul:
No - I'd just use a text editor and the search/replace tool within.

Many thanks Paul & Strumelia for the guidance on the dev server but I am still wondering Is there any particular reason I should NOT use sed? And how do I alter the url fro documentation to wiki? Where would I find the instances of that which I need to change?

Just to confirm....I need the 1.4.0. folder only, right ?


--
Ceri Shaw - AmeriCymru

updated by @adolygwr: 12/06/16 01:29:19PM
paul
@paul
8 years ago
4,326 posts
Quote: Still wondering though what how I should alter the url from documentation to wiki?
include.php jrDocs_meta() function 'url' setting is the immediate place to change this, though it may also be used elsewhere in the module.

Quote: Also what is the best way to set up dev server. Can I do this on my Jamroom hosted server and if so where is the best guide for this?
https://www.jamroom.net/the-jamroom-network/documentation/jamroom-hosting/2541/creating-a-new-domain-on-your-server
You don't have to use a real domain for this, just make one up - ceridevserver.com - say

Use whatever editor works for you.

Please note that I'd be very surprised if just changing the module name instances and its url will work first time (though it might!!). Be prepared for errors, white screens and some debugging!!


--
Paul Asher - JR Developer and System Import Specialist
Ceri
Ceri
@adolygwr
8 years ago
370 posts
OK many thanks.... I think I have enough info to proceed. SO I'm going away to make a fine old mess on my dev server and I'll be back later to ask folks for help sorting it out :)


--
Ceri Shaw - AmeriCymru

updated by @adolygwr: 12/06/16 01:31:09PM
brian
@brian
8 years ago
10,148 posts
Ceri:
Still wondering though what how I should alter the url from documentation to wiki?

You can change the URL for any module in it's "Info" tab. Let me know if that helps.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
SteveX
SteveX
@ultrajam
8 years ago
2,584 posts
It has been a while since I did this, but from memory I think you can just do the following:

Case sensitive searches:
Replace jrDocs with xxWiki
Replace jrdocs with xxwiki

Rename css/jrDocs.css to css/xxWiki.css
Rename js/jrDocs.js to js/xxWiki.js

In include.php jrDocs_meta(), change

'name' => 'Documentation',
'url' => 'documentation',
to
'name' => 'Wiki',
'url' => 'wiki',

Rename the module directory to xxWiki

Go through the language strings and change language to suit (in lang/en-US.php and in the templates)


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
Ceri
Ceri
@adolygwr
8 years ago
370 posts
Many thanks....this works almost perfectly on my dev server. The only problem is that I can't seem to set Quota Config? I get this message when I click the tab:- CRI: unable to retrieve quota settings for module: xxWiki

Any ideas on how to clear that up?

Also....where would I change Documentation to Geriadur/Dictionary ? This doesn't seem to be possible in the Language Editor. (see screenshot below)


--
Ceri Shaw - AmeriCymru

updated by @adolygwr: 12/07/16 11:36:49AM
gary.moncrieff
gary.moncrieff
@garymoncrieff
8 years ago
865 posts
I spent 15 minutes earlier today trying this and get the same error on the quota settings page.
brian
@brian
8 years ago
10,148 posts
Ceri:
Many thanks....this works almost perfectly on my dev server. The only problem is that I can't seem to set Quota Config? I get this message when I click the tab:- CRI: unable to retrieve quota settings for module: xxWiki

Make sure in the include.php init() function that you're using the right module name - i.e.

jrCore_register_module_feature('jrCore', 'quota_support', 'xxWiki', 'on');

Then run an integrity check.

Ceri:
Also....where would I change Documentation to Geriadur/Dictionary ? This doesn't seem to be possible in the Language Editor. (see screenshot below)

This is language id 53 in the Documentation module.

Let me know if that helps.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Ceri
Ceri
@adolygwr
8 years ago
370 posts
Odd....it's working now though :) I changed the line in include.php from xxWiki to xxwiki and there was NO Quota Config tab at all. Then I changed it back to xxWiki and it works ok????

Found the language string....don't know how I managed to miss that :) Anyway I guess I'll load this up to my production site and see if it works ok there.


--
Ceri Shaw - AmeriCymru
Ceri
Ceri
@adolygwr
8 years ago
370 posts
It worked!! Took a little while to 'settle in'..., cache resets and integrity checks etc BUT it appears to work just fine now. Wondering what other modules could duplicated in this way?? :)


--
Ceri Shaw - AmeriCymru
paul
@paul
8 years ago
4,326 posts
Glad you got there in the end :-)
Quote: Wondering what other modules could duplicated in this way??
In theory, all of them.


--
Paul Asher - JR Developer and System Import Specialist
brian
@brian
8 years ago
10,148 posts
Just an FYI on the licensing for the Documentation module - being JCL make sure you don't distribute your custom version :)


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net