Picture of sander van zijl
uploading new component with authoring tool
by sander van zijl - Thursday, 25 June 2015, 9:18 AM
 

I found the confidence slider component on github and would like to use it. but I am unable to install.

I downloaded the zip from github, but this cannot be used in the upload plugin. the authoring tool says it is an unrecognized plugin type.

I opened the zip from github, and found it had another folder in it before the files. So I moved the files to the root of the zip.

the zip is now accepted by the upload plugin page, but when i try to upload i get the message: cannot find module /tmp/some_random_number_unzipped/.bowerrc/bower.json

How can i upload this component from the github with the authoring tool?

Picture of sander van zijl
Re: uploading new component with authoring tool
by sander van zijl - Friday, 26 June 2015, 2:37 PM
 

Some research into the problem shows that in the directory that is referenced there is a .bowerrc file, but there is no .bowerrc directory with a bower.json file in it.

these files and directories are also not in the zip files that you get from github. there is a bower.json, but that is not located in a subdirectory.

so I do nt know why the authoring tool is searching for this directory. maybe some old references or a setup that needs some changes?

Picture of sander van zijl
Re: uploading new component with authoring tool
by sander van zijl - Tuesday, 30 June 2015, 7:50 AM
 

This is beginning to be a conversation with myself :-)

I think I have found the solution. it is a bug in the framework/builder. The github already has a solution, but it is not implemented in the code yet. how can i get that version??

 

the file index.js in /plugins/content/bower is used for uploading a component or plugin from the builder. After unzipping it will start to search for the bower.json file. it sets a directory to search in the line:


var canonicalDir= path.join(outputPath, files[0]);

however the files[0] adds /.bowerrc/ to the path. This is not needed, and the /.bowerrc/ path does not even exist. it is a file, not a directory.

I solved it by replacing the line above with:

var canonicalDir= outputPath;

which is a bit redundant, but i did not want to remove this for fear of breaking something else. off course you could also replace all the canonicalDirs with outputPath in the code.

I did some testing and i was able to upload components. Now I am trying to adapt the accordion component to display an image as well as a text, but sofar i was not able to succeed yet. any tips on that?

 

 

 

 

 

Picture of Curtis Anderson
Re: uploading new component with authoring tool
by Curtis Anderson - Wednesday, 19 August 2015, 2:31 PM
 

You, Sir, are a life saver! This has made developing content and plugins for adapt infinitely easier!

Thanks!

Picture of Helen Bailey
Re: uploading new component with authoring tool
by Helen Bailey - Wednesday, 19 August 2015, 5:17 PM
 

Wow I wonder what else this would work for?!?

 

Helen

Picture of David  Tarrant
Re: uploading new component with authoring tool
by David Tarrant - Wednesday, 27 July 2016, 6:04 PM
 

I'm still having huge issues with uploading plugins to my vagrant installed adapt instance. 

According to the log output i'm still getting the issues with file paths in the current version of the adapt authoring tool.

When trying to find bower.json it is joining together files as directories and trying to look inside theses. 

e.g. /tmp/upload_0e4c9b4230172a6ca4a4da573950329d_unzipped/theme.json/bower.json

clearly the bower.json isn't going to be there!

I have tried to change the paths here and fixed this by changing

var bowerPath =path.join(outputPath, directory, 'bower.json');

to

bowerPath = path.join(outputPath, 'bower.json');

then it does the same for properties.schema.

e.g. /tmp/upload_423997b1de80ee0dee8effde52020c3a_unzipped/LICENSE/properties.schema

so i changed

canonicalDir =path.join(outputPath, directory);

to 

canonicalDir = outputPath;

Even with this however my plugin (https://github.com/davetaz/adapt-theme-odi) fails to install. I creates paths and entries, but when it comes to compiling a course in the new theme it hasn't actually copied over the files. 

Any hints welcome as I'm making a mess of my authoring tool environment. 

Picture of David  Tarrant
Re: uploading new component with authoring tool
by David Tarrant - Friday, 29 July 2016, 3:42 PM
 

Answer my own message.

In framework 0.2.0 fresh install these changes do seem to fix the issue and the plugin installs successfully :)