Giter VIP home page Giter VIP logo

binduwavell / generator-alfresco Goto Github PK

View Code? Open in Web Editor NEW
29.0 13.0 15.0 1.96 MB

A Yeomen generator based on the Alfresco all-in-one Maven archetype with some generators and an opinionated project structure.

Home Page: https://github.com/binduwavell/generator-alfresco#readme

License: Apache License 2.0

JavaScript 81.12% Shell 1.04% Java 14.94% FreeMarker 0.50% Batchfile 0.62% HTML 1.23% CSS 0.55%
alfresco yeoman

generator-alfresco's Introduction

generator-alfresco

Build Status Coverage Status Join the Chat

Getting Started

What is Alfresco?

Alfresco is an open-source content management application. This project provides some tools for setting up and working with Alfresco extension/enhancement projects. It wraps and extends the Alfresco SDK and specifically the All in One maven archetype.

What is Yeoman?

Yeoman is a command line tool that helps you to automate coding tasks. Out of the box, Yeoman doesn't do very much. It relies on a library of thousands of generators to actually perform the coding tasks for you.

Yeoman lives in the npm package repository. Assuming you have a recent version of node.js installed, you can use the following command to install Yeoman.

npm install -g yo

NOTE: that we now require Node 4.5 or above. Information on installing Node is linked from our Supported Platforms / Node Versions wiki page.

Installing and using the generator

You have a couple of options for installing the Alfresco generator for Yeoman. Your choice will depend on if you plan to extend the generator or if you simply want to use it.

Checkout the next section for what to do if you plan to work on the generator code.

You can install the latest published release of the generator from npm with this command:

npm install -g generator-alfresco

WARNING: you will likely need to update this occasionally as the project is under active development.

Now, assuming you have all of the pre-requisites installed (including appropriate versions of node, npm, yeoman, this generator, Java and Maven.) You can create an Alfresco extension project using this generator. First of all you should create a new folder for your project and change into the new folder. Then run the following command:

yo alfresco

This will ask you a number of questions and then generate a project based on your answers. yo alfresco will make sure you have an appropriate version of Java and Maven available for the version of the SDK you select. It will then use the all-in-one Alfresco SDK archetype from the selected version of the SDK to create a project. Finally it will add (and potentially remove) some additional files and folders to the project.

Here is an example of what the top level folder structure might look like:

TODO.md
customizations
debug.sh
modules
pom.xml
repo
run-without-springloaded.sh
run.bat
run.sh
runner
scripts
share
solr-config
source_templates

Notice that for SDK 2 we provide a run-without-springloaded.sh in addition to the default run.sh. The generator automatically makes these executable. There are some other helpful scripts in the scripts folder.

As part of the generation process, we actually copy the repo-amp and share-amp folders to source_templates. That way we have SDK specific instances of these folder structures that we can use later on when you want to add Source AMPS to your project.

One of the questions the we ask is ? Should we remove the default source amps? (Y/n). Notice that the default here is Y and in the project listing above there are no folders for repo-amp or share-amp. Of course if you answer N to this question then the default AMPs will be left in place.

If you accept the default behavior of removing the default source amps, we remove those top level folders. We also, remove them from the top level pom.xml. We remove the references from repo/pom.xml, share/pom.xml and even from the Tomcat context files in the runner module.

yo alfresco --help
yo alfresco:action --help
yo alfresco:amp --help
yo alfresco:behavior --help
yo alfresco:jar --help
yo alfresco:jsrootobject --help
yo alfresco:model --help
yo alfresco:module --help
yo alfresco:webscript --help

Will print out information about cli arguments and options.

alfresco:amp

yo alfresco:amp

This starts by asking if you would like to add source, local, remote or common AMPs. This sub-generator is deprecated starting with SDK3, use yo alfresco:module instead.

alfresco:amp-add-source

When you select Source AMP, we'll ask a few questions and then create additional repo/share source AMPs under the customizations folder (unless you don't have one, in which case they will be created in the project root). These are created by copying the appropriate platform/repo/share folders from source_templates. Of course, we update paths and names appropriately. We also automatically plug them into your project files (including maven and spring/tomcat contexts.)

You can use the following as a shortcut for adding source AMPs:

yo alfresco:amp-add-source
alfresco:amp-add-local

If you have AMP files you'd like to incorporate into your project, you can place repository AMPs into the customizations/amps folder. Similarly you can place your pre-packaged Share AMP files into the customizations/amps_share folder. In order to get these plugged into the project you use the Local AMP option with the yo alfresco:module sub-generator. Here is an example command you could use:

yo alfresco:amp-add-local

When you use this command, we'll go through the amps and amps_share folders and find any AMP files that are not already linked into your project structure. You select the AMP files one at a time, you'll be asked to provide a Maven groupId, artifactId and version for the AMP. If this information is included inside the AMP file, we'll try to provide you with sane default values. At the end of the day, it's not super important what values you provide. Of course you'll probably be happy if you choose meaningful values when you come back to the project in a month or a year.

alfresco:amp-add-remote

The Remote AMP option allows you to specify if an AMP should be installed into the repository or Share. It also asks you to provide Maven groupId, artifactId and version for an AMP file that is in a Maven repository that your build has access to. For example, the Uploader Plus plugin is available in Maven Central, so you can provide information for one of these AMPs and the build will automatically download and install the AMP the next time you run your project.

Here is a sample command line you can use:

yo alfresco:amp-add-remote
alfresco:amp-add-common

The final option for installing AMPs is Common AMPS, this lists AMPs that are available via a public maven repo that we can plug into your project on your behalf. Currently these include:

  • Alfresco Office Services (AOS)
  • Developer Helper
  • JavaMelody
  • JavaScript Console
  • JScript Extensions
  • Order of the Bee Support Tools
  • Records Management (RM)
  • Share Inbound Calendar Invites
  • Share Site Announcements
  • Share Site Creators
  • Share Site Space Templates
  • Support Tools
  • Uploader Plus
  • Xenit Care4Alf
  • Xenit Dynamic Extensions

Here is a summary of which versions of common AMPS are available with each version of the SDK:

SDK 3.0.1
Community
SDK 3.0.1
Enterprise
SDK 2.2.0
Community
SDK 2.2.0
Enterprise
SDK 2.1.1
Community
SDK 2.1.1
Enterprise
SDK 2.1.0
Community
SDK 2.1.0
Enterprise
SDK 2.0.0
Community
SDK 2.0.0
Enterprise
local SDK
Community
local SDK
Enterprise
Alfresco Office Services 1.1.7 1.1.7 1.1.7 1.1.7
Developer Helper 1.0.1 1.0.1 1.0.1 1.0.1 1.0.1 1.0.1 1.0.1 1.0.1 1.0.1 1.0.1 1.0.1 1.0.1
JavaMelody 1.62.0 1.62.0
JavaScript Console 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6
JScript Extensions 1.3 1.3 1.3.1 1.3.1 1.3.1 1.3.1 1.3.1 1.3.1
Order of the Bee Support Tools 1.0.0.0 1.0.0.0 1.0.0.0 1.0.0.0 1.0.0.0 1.0.0.0 1.0.0.0 1.0.0.0 1.0.0.0 1.0.0.0 1.0.0.0 1.0.0.0
Records Management 2.5.a 2.5.0 2.3 2.3 2.3 2.3
Share Inbound Calendar Invites 1.1.0 1.1.0 1.1.0 1.1.0 1.1.0 1.1.0 1.1.0 1.1.0 1.1.0 1.1.0 1.1.0 1.1.0
Share Site Announcements 0.0.2 0.0.2 0.0.2 0.0.2 0.0.2 0.0.2 0.0.2 0.0.2 0.0.2 0.0.2 0.0.2 0.0.2
Share Site Creators 0.0.5 0.0.5 0.0.5 0.0.5
Share Site Space Templates 1.1.2 1.1.2 1.1.2 1.1.2 1.1.2 1.1.2 1.1.2 1.1.2 1.1.2 1.1.2 1.1.2 1.1.2
Support Tools 1.11 1.11 1.11 1.11 1.11
Uploader Plus 1.2 1.2 1.2 1.2 1.2 1.2 1.2 1.2 1.2 1.2 1.2 1.2
Xenit Care4Alf 1.1.0 1.1.0 1.1.0 1.1.0 1.1.0 1.1.0 1.1.0 1.1.0
Xenit Dynamic Extensions 1.5.1 1.5.1 1.5.1 1.5.1 1.5.1 1.5.1 1.5.1 1.5.1

You don't need to worry about this too much as it will automatically detect the SDK version and if you are using Community or Enterprise and even which AMPs you have already applied and only show you ones that are valid for your project.

Here is a sample command line you can use:

yo alfresco:amp-add-common

You can actually specify more than one AMP to install at the same time; we'll even install both repo and share amps if necessary.

alfresco:action

yo alfresco:action

You'll be prompted for some basic information including which repo Source AMP you want to create the action in. We'll create a basic repository action for you. This includes a Java class, a properties file that causes the action and arguments to have pretty labels and a context file with bean definitions for the Java class and the resource bundle for loading the properties file.

alfresco:behavior

yo alfresco:behavior

You'll be prompted for some basic information including which repo Source AMP you want to create the behavior class in. We'll create a class that registers a behavior for the onUpdateProperties policy on all cm:content nodes. We'll also generate a context file that registers a bean for this class and passes in the minimal items you'll need to create behavior code.

alfresco:jar-add-local

If you have JAR files you'd like to incorporate into your project, you can place repository JARs into the customizations/modules/platform folder. Similarly you can place your pre-packaged Share JAR files into the customizations/modules/share folder. In order to get these plugged into the project you use the Local JAR option with the yo alfresco:module sub-generator. Here is an example command you could use:

yo alfresco:jar-add-local

When you use this command, we'll go through the platform and share modules folders and find any JAR files that are not already linked into your project structure. You select the JAR files one at a time, you'll be asked to provide a Maven groupId, artifactId and version for the JAR. If this information is included inside the JAR file, we'll try to provide you with sane default values.

alfresco:jsrootobject

yo alfresco:jsrootobject

You'll be prompted for some basic information including which repo Source Module you want to create the Javascript root object in. We'll create a class with a sample method callMe that can be called from the Javascript root object. We'll also generate a context file that registers a bean for this class and passes in the minimal items you'll need to create the Javascript root object code.

alfresco:model

yo alfresco:model

You'll be prompted for some basic information including which repo Source AMP you want to create the model in. We'll create a very bare model.xml file for you, this file has a bunch of commented out examples in it, so you should be able to create a valid model pretty easily. Of course we also provide a context file that registers the model.

alfresco:module

yo alfresco:module

This starts by asking if you would like to add a source module, a local AMP or JAR, a remote AMP or common AMPs. It delegates to other sub-generators.

alfresco:module-add-source

When you select Source Module, we'll ask a few questions and then create additional repo/share source modules under the customizations folder (unless you don't have one, in which case they will be created in the project root). These are created by copying the appropriate platform/repo/share folders from source_templates. Of course, we update paths and names appropriately. We also automatically plug them into your project files (including maven and spring/tomcat contexts.)

You can use the following as a shortcut for adding source AMPs:

yo alfresco:module-add-source

alfresco:webscript

yo alfresco:webscript

This will ask you a bunch of questions and then produce appropriate repo/share files for your WebScript. If you choose multiple HTTP methods you can in fact scaffold multiple webscripts with one pass through this sub-generator.

future sub-generators

We are planning to add many more sub-generators for things like: jobs, workflows, JavaScript root objects, metadata extractors, content transformers, etc. We may add sub-generators for doing a bunch of common tasks with Share customization.

Try The Project / Contribute

Before reporting issues or working on fixes/enhancements, please make sure you are familiar with and agree to our code of conduct.

If you plan to to make changes to the generator itself, there are detailed instructions in the contributing page.

Check out the generator-alfresco project (or ideally a fork of the same) and then run the following command from the checked out project directory:

npm install
npm link # may need sudo

This is essentially the same as the npm install -g generator-alfresco command above, but you'll have a project directory where you can tweak things, and push updates back to GitHub.

Getting Help

If you find a bug or something is confusing, you can review existing or create a new issue. If you'd like to chat, you can reach out on our Gitter channel.

License

Apache 2.0

generator-alfresco's People

Contributors

binduwavell avatar jonsolove avatar jrosler avatar nwmcneel avatar tmttn avatar yregaieg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

generator-alfresco's Issues

issue when adding a local amp

Created a brand new project with latest alfresco-generator (pulled an hour or two ago) and got the following error when I tried adding this amp as a local amp

? Do you want to add source AMPs, a pre packaged AMP from your amps/amp_share folder or an AMP from a maven repository? Local AMP
Some functionality of the Alfresco content management system is delivered as extra modules, such as Records Management (RM),
Google Docs Integration, and Alfresco Office Services, which provides SharePoint Protocol support. If you have the associated amps
copied to your ./amps and ./amps_share folders in the project here, we can link such modules to your project.

INFO: This sub-generator will update existing POM's and context files. Yeoman will display conflict and ask you if you
want to update each file.
Type "h" when prompted to get details about your choices.
? Which amp would you like include? amps/componize-alfresco-dita-ot-1.8-2.1.0.16.amp

/usr/local/lib/node_modules/yo/node_modules/rx-lite/rx.lite.js:75
    throw e;
          ^
TypeError: Cannot read property 'hasOwnProperty' of undefined
    at Object.<anonymous> (/Users/jrosler/code/generator-alfresco/generators/amp-add-local/index.js:209:65)
    at module.exports (/usr/local/lib/node_modules/yo/node_modules/run-async/index.js:15:21)
    at Object.<anonymous> (/usr/local/lib/node_modules/yo/node_modules/inquirer/lib/utils/utils.js:42:5)
    at module.exports (/usr/local/lib/node_modules/yo/node_modules/run-async/index.js:15:21)
    at AnonymousObservable.__subscribe (/usr/local/lib/node_modules/yo/node_modules/inquirer/lib/utils/utils.js:16:7)
    at AnonymousObservable.tryCatcher (/usr/local/lib/node_modules/yo/node_modules/rx-lite/rx.lite.js:63:31)
    at setDisposable (/usr/local/lib/node_modules/yo/node_modules/rx-lite/rx.lite.js:5741:44)
    at AnonymousObservable.innerSubscribe [as _subscribe] (/usr/local/lib/node_modules/yo/node_modules/rx-lite/rx.lite.js:5755:9)
    at AnonymousObservable.Rx.Observable.observableProto.subscribe.observableProto.forEach (/usr/local/lib/node_modules/yo/node_modules/rx-lite/rx.lite.js:1604:19)
    at AnonymousObservable.__subscribe (/usr/local/lib/node_modules/yo/node_modules/rx-lite/rx.lite.js:2112:21)

create sub-generator to assist with bootstrapping

Even though the following focuses on using the patch service, I feel pretty strongly that we should be using module components. So whoever takes this on, we should discuss (and probably validate with @gravitonian and/or @ohej.)

http://docs.alfresco.com/5.1/references/dev-extension-points-bootstrap.html

My rational briefly (sorry even though I'm trying to be brief, I'm a wind-bag):
Patches are tied to database scheme versions. As such I believe they are highly suited for performing bootstrapping and other business logic as versions of Alfresco are upgraded.

Module components are essentially tied to our AMPs. As such they are tied to the installation and upgrading of our custom code.

I believe that the main aim for this generator to to assist folks with creating projects that extend the shrink wrapped repo. Of course I would be thrilled if folks internally decide to use this as well, and if that happens it would be great if there was a patch sub-generator that offers bootstrapping among other options.

action sub-generator should include resource bundle with title and description

The action sub generator should add a resource bundle bean to the action context file (replace bean id based on action name - below it is foo). This is used within the by share when displaying the action name in folder rules.

  <bean id="foo-action-properties" class="org.alfresco.i18n.ResourceBundleBootstrapComponent">
    <property name="resourceBundles">
      <list>
        <value>alfresco/module/${project.artifactId}/messages/custom-action-config</value>
      </list>
    </property>
  </bean>

This points to a custom-action-config.properties file (in this case under messages folder that would need to be created)

Within the properties file, list the title and description based on the bean id of the action. In the case below the bean id is demo.foo.

demo.foo.title=File SafetyPass Documents
demo.foo.description=Filing action used to file SafetyPass documents when imported by Ephesoft

after adding new repo module dev-log4j.properties not updated

After setting up a new community project with SDK 2.1.1, I added a new module (repo and share) with the yo alfresco:amp command. I noticed that repo/src/main/resources/alfresco/extension/dev-log4j.properties had a line inserted for my project. It was set to

log4j.logger.com.ziaconsulting.demoamp.DemoComponent=${app.log.root.level}

While the group is correct, I didn't name my module demoamp. It would be nice to just have this default to something like the following, where it is just defining debug based on the groupId

log4j.logger.com.ziaconsulting=${app.log.root.level}

webscript: validate is not called when options are passed from command line

I think the below problem is not specific to webscript sub-generator.. I found this issue when I was testing my model sub-generator. I think we should handle this in a common manner rather than calling a 'validate' in every 'when' function.

> yo alfresco:webscript -i -p
     _-----_
    |       |    .--------------------------.
    |--(o)--|    |  Adding webscript to boo |
   `---------´   |         project!         |
    ( _´U`_ )    '--------------------------'
    /___A___\
     |  ~  |
   __'.___.'__
 ´   `  |° ´ Y `

? Which type of module would you like to add a webscript to? repo
INFO:  Using only available source module: org.alfresco:repo-amp:1.0.0-SNAPSHOT:amp:repo:source
INFO:  Using webscript id from command line: true


readline.js:925
            throw err;
            ^

TypeError: pkg.replace is not a function
    at packageFilter (/Users/vijayprince/Work/projects/generator-alfresco/generators/webscript/index.js:933:20)
    at null.<anonymous> (/Users/vijayprince/Work/projects/generator-alfresco/generators/webscript/index.js:70:19)
    at module.exports (/usr/local/lib/node_modules/yo/node_modules/run-async/index.js:15:21)
    at AnonymousObservable.__subscribe (/usr/local/lib/node_modules/yo/node_modules/inquirer/lib/ui/prompt.js:121:7)
    at AnonymousObservable.tryCatcher (/usr/local/lib/node_modules/yo/node_modules/rx-lite/rx.lite.js:63:31)
    at setDisposable (/usr/local/lib/node_modules/yo/node_modules/rx-lite/rx.lite.js:5741:44)
    at AnonymousObservable.innerSubscribe [as _subscribe] (/usr/local/lib/node_modules/yo/node_modules/rx-lite/rx.lite.js:5755:9)
    at AnonymousObservable.Rx.Observable.observableProto.subscribe.observableProto.forEach (/usr/local/lib/node_modules/yo/node_modules/rx-lite/rx.lite.js:1604:19)
    at AnonymousObservable.__subscribe (/usr/local/lib/node_modules/yo/node_modules/rx-lite/rx.lite.js:2112:21)
    at AnonymousObservable.tryCatcher (/usr/local/lib/node_modules/yo/node_modules/rx-lite/rx.lite.js:63:31)
    at setDisposable (/usr/local/lib/node_modules/yo/node_modules/rx-lite/rx.lite.js:5741:44)
    at AnonymousObservable.innerSubscribe [as _subscribe] (/usr/local/lib/node_modules/yo/node_modules/rx-lite/rx.lite.js:5755:9)
    at AnonymousObservable.Rx.Observable.observableProto.subscribe.observableProto.forEach (/usr/local/lib/node_modules/yo/node_modules/rx-lite/rx.lite.js:1604:19)
    at MergeObserver.handleSubscribe (/usr/local/lib/node_modules/yo/node_modules/rx-lite/rx.lite.js:2910:28)
    at MergeObserver.onNext (/usr/local/lib/node_modules/yo/node_modules/rx-lite/rx.lite.js:2916:16)
    at MergeObserver.tryCatcher (/usr/local/lib/node_modules/yo/node_modules/rx-lite/rx.lite.js:63:31)

explode-alf-sources.sh references non-existing projects

If I rename/move the default repo-amp and share-amp, explode doesn't work as it assumes they exist. It might be better to explode based on amps_sources_templates/repo-amp and amps/source_templates/share-amp and then store the exploded files somewhere else as the templates should always be there.

Setting the source module by default in a project with a single module prints the same INFO message twice

This is a minor issue.

When I set the source module type for a project with a single module using the following code in the constructor arguments[1][constants.PROP_WAR] = constants.WAR_TYPE_REPO; , I see the INFO messages in both the prompts being called in source-selecting-subgenerator.js.

yo alfresco:model

     _-----_
    |       |    .--------------------------.
    |--(o)--|    |    Adding model to boo   |
   `---------´   |         project!         |
    ( _´U`_ )    '--------------------------'
    /___A___\
     |  ~  |
   __'.___.'__
 ´   `  |° ´ Y `

INFO:  Using only available source module: org.alfresco:repo-amp:1.0.0-SNAPSHOT:amp:repo:source
INFO:  Using only available source module: org.alfresco:repo-amp:1.0.0-SNAPSHOT:amp:repo:source

Resolve all eslint issues

I'm in the process of adding npm run eslint. We may need to tune the .eslintrc.js and the .eslintignore files appropriately in addition to resolving all of the legit issues.

Once this work is done, we should also add a git commit hook to not allow commits that fail the eslint checks.

yo alfresco:amp is failing for repo or share amp

If you choose to add only a repo or a share amp, the generator fails with the error ERROR: At least one required properties not set: createParent.

~/Work/projects/del/boo1   yo alfresco:amp
INFO:  This sub-generator will update existing POM's and context files. Yeoman will display "conflict <filename>" and ask you if you want to update each file. Type "h" when prompted to get details about
your resolution choices.

     _-----_
    |       |    .--------------------------.
    |--(o)--|    |    Adding amp to boo1    |
   `---------´   |         project!         |
    ( _´U`_ )    '--------------------------'
    /___A___\
     |  ~  |
   __'.___.'__
 ´   `  |° ´ Y `

? Which war would you like to customize? repo
? Project groupId? org.alfresco
? Project artifactId prefix? boo1
? Project version? 1.0.0-SNAPSHOT
? Should we remove the default samples? No
? Name for repo amp? boo1repo1
? Description for repo amp? boo1 repo1
ERROR: At least one required properties not set: createParent

I am attaching the .yo-rc.json file for your reference
yo-rc.txt

create widget sub-generator

project files created in wrong directory

I ran "yo alfresco" and it created all the files/directories in the current working directory. So I cleaned them all up, created a project directory, cd'd into the project directory and re-ran "yo alfresco", but it put the project files up a level in the same place as the first time I ran the generator.

enhance amp sub-generator to support local and remote pre-built amps

Currently yo alfresco:amp can create new source amps and plug them into the project files.

We should be able to pick up .amp files from the /amps and /amps_share folders and plug them into the project files.

We should be able to reference .amp files from an accessible maven repository and plug them into the project files.

create model sub-generator

Get the logic to get the list of modules from the alfresco:webscript sub-generator and generate the model files. It will be nice to also generate the message bundle and the context file in Share

action sub-generator is creating an action that can't be used

It appears that the trick I used to allow the bean id to have a prefix without the action having said prefix is not a complete solution. The action shows up correctly in the UI, but then when we attempt to execute the action there is an error that there is no bean with the given name.

create a content model constants file in the model sub-generator

It is a best practice for each model to have an associated Java interface that lists all of the types, aspects, properties, assocs, etc from the model. Alfresco does this for all of there models, here is the ContentModel.java file that provides this information for the contentModel.xml model file: https://svn.alfresco.com/repos/alfresco-open-mirror/alfresco/HEAD/root/projects/data-model/source/java/org/alfresco/model/ContentModel.java

It would be super amazingly cool if we could actually generate this class (possibly with a peer sub-generator to the model sub-generator.) It would be super cool if it also validated the model. This could be done with a schema validation or even better there is actually some alfresco code we can reference that will do a bunch of Alfresco specific checks. This script is provided in the content modeling course (thanks to Rich McKnight.) If the person that takes this work on wants to add model validation I can provide a copy of said script as a starting point.

yo alfresco for 2.2.0 SDK is producing a project that fails to start

I validated that a project created using the same mvn command as the generator uses produces a project that can be run. Here is the mvn command:

mvn archetype:generate -DinteractiveMode=false -DarchetypeGroupId=org.alfresco.maven.archetype -DarchetypeArtifactId=alfresco-allinone-archetype -DarchetypeVersion=2.2.0 -DgroupId=org.alfresco -DartifactId=yoalf220 -Dversion=1.0.0-SNAPSHOT -Dpackage=org.alfresco

When using yo alfresco and the 2.2.0 SDK, there are multiple issues reported in the logs. I didn't capture them and have to leave where I am so can't reproduce right now.

It appears that some of the changes we make must be breaking the project.

subgenerator fails with a lot of errors when yo alfresco is run with default values

Since the default value is changed to remove default source amps, all subgenerators fail with a bunch of messages. It will be good if we bail as soon as the first error is encountered.

The ideal solution will be to use composeWith in the base generator to call the amp sub-generator.

For example: when I ran yo alfresco:webscript, I got the following output

~/Work/projects/clean-220/boo   yo alfresco:webscript

     _-----_
    |       |    .--------------------------.
    |--(o)--|    |  Adding webscript to boo |
   `---------´   |         project!         |
    ( _´U`_ )    '--------------------------'
    /___A___\
     |  ~  |
   __'.___.'__
 ´   `  |° ´ Y `

ERROR: No source modules available matching your criteria. Try creating a source module with "yo alfresco:amp" before using this sub-generator.
ERROR: At least one required properties not set: id
ERROR: At least one required properties not set: package
ERROR: At least one required properties not set: language
ERROR: At least one required properties not set: methods
ERROR: At least one required properties not set: shortname
ERROR: At least one required properties not set: urlTemplates
ERROR: At least one required properties not set: formatSelector
ERROR: At least one required properties not set: authentication
ERROR: At least one required properties not set: transaction
ERROR: At least one required properties not set: transactionAllow
ERROR: At least one required properties not set: cacheNever
ERROR: At least one required properties not set: cachePublic
ERROR: At least one required properties not set: cacheMustrevalidate
ERROR: At least one required properties not set: negotiations
ERROR: At least one required properties not set: lifecycle
ERROR: At least one required properties not set: formdataMultipartProcessing

The yo-rc.json is as follows

{
  "generator-alfresco": {
    "originalGeneratorVersion": "0.0.1",
    "generatorVersion": "0.0.1",
    "sdkVersion": "2.1.1",
    "archetypeVersion": "2.1.1",
    "projectGroupId": "org.alfresco",
    "projectArtifactId": "boo",
    "projectVersion": "1.0.0-SNAPSHOT",
    "projectPackage": "org.alfresco",
    "communityOrEnterprise": "Community",
    "removeDefaultSourceAmps": true,
    "removeDefaultSourceSamples": false,
    "moduleRegistry": []
  }
}

increase test coverage

I'd like to have as close to 100% coverage as possible. I realize this doesn't even prove the code is valid, but at least it gives us a great basis for refactoring and for knowing that the basic stuff is working. We had super high coverage until I added the amp sub-generator and didn't provide any significant tests for it. But there were a few other cases that could also have had coverage.

Additionally, while we have coverage of lots of our supporting modules, in some cases that coverages is gained by other code calling the modules, let's make sure we have good tests for all of the supporting modules in a stand-alone way.

create module component sub-generator

Ideally this should offer to create a class/bean pair for custom bootstrapping or to setup an appropriate bean so the ootb importer stuff can be used to bring in ACPs or raw files from the classpath via view XML.

refactor source-selecting-subgenerator to allow forced war type affinity

Created some sub-generator base classes in #17 for webscripts. The source-selecting-subgenerator.js base class asks if you want to target the repo or share and then lists the source modules associated with the selected war type.

Refactor this so that an implementation can control which war to target.
Refactor this so that if there is only one appropriate source module it will be selected without prompting.

'yo alfresco' throws error with node 5.7.1

Here is the stacktrace

Vijays-MacBook-Pro% yo alfresco
/usr/local/lib/node_modules/generator-alfresco/node_modules/bindings/bindings.js:91
  throw err
  ^

Error: Could not locate the bindings file. Tried:
 → /usr/local/lib/node_modules/generator-alfresco/node_modules/deasync/build/deasync.node
 → /usr/local/lib/node_modules/generator-alfresco/node_modules/deasync/build/Debug/deasync.node
 → /usr/local/lib/node_modules/generator-alfresco/node_modules/deasync/build/Release/deasync.node
 → /usr/local/lib/node_modules/generator-alfresco/node_modules/deasync/out/Debug/deasync.node
 → /usr/local/lib/node_modules/generator-alfresco/node_modules/deasync/Debug/deasync.node
 → /usr/local/lib/node_modules/generator-alfresco/node_modules/deasync/out/Release/deasync.node
 → /usr/local/lib/node_modules/generator-alfresco/node_modules/deasync/Release/deasync.node
 → /usr/local/lib/node_modules/generator-alfresco/node_modules/deasync/build/default/deasync.node
 → /usr/local/lib/node_modules/generator-alfresco/node_modules/deasync/compiled/5.7.1/darwin/x64/deasync.node
    at bindings (/usr/local/lib/node_modules/generator-alfresco/node_modules/bindings/bindings.js:88:9)
    at Object.<anonymous> (/usr/local/lib/node_modules/generator-alfresco/node_modules/deasync/index.js:23:31)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (/usr/local/lib/node_modules/generator-alfresco/generators/app/dependency-versions.js:2:15)
    at Module._compile (module.js:413:34)

To get around this issue you have to install node-gyp using commands

npm install -g node-gyp
node-gyp rebuild

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.