npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

generator-jhipster-file-handling

v1.1.1

Published

Installs entities and dependencies to enable reading from excel file data

Downloads

83

Readme

generator-jhipster-file-handling

NPM version Build Status Dependency Status

JHipster module, Installs entities and dependencies to enable reading list data from excel files

Introduction

This is a JHipster module, that is meant to be used in a JHipster application.

Using this tool you can install into a project asynchronous reads on data that is in an Excel file using the spring batch tool. The project uses poiji, which is an Apache POI abstraction that converts excel rows to a list of java objects.

Here we are converting data listed in rows of an Excel file into a list of objects which then we populate into respective data models. We assume that the user needs to update some entity of known fields and field types.

So during set up, one has to specify the type of data models, whose data they would read from an Excel file. These are treated as file-type enumerations to distinguish data models from each other.

During runtime, the user will need to create a file type, upload a template of the file containing appropriate columns and specify the enumeration to be associated with a given file-type.

Having done that, the user uploading the Excel file (xlsx currently supported) will input the file-type id when uploading the Excel file.

From there the file-handling is processed by an asynchronous process so soon after the file is persisted by the corresponding service, the user will see a response from the API, which does not mean the file is already deserialized, but nevertheless indicates that the file has been uploaded. The batch process is triggered by the file-notification, and completed asynchronously and only the message token and batch id are indicative of documents processing completion. For these things to work there are a number of interfaces to work and class implementations to complete.

Interfaces

This class uses interface to interact with the batch framework and also to configure the Excel file reader that must be configured by the user. There are also data objects (excel-view-models) which correlate the columns in an Excel file with the fields of a java bean. These further will need mapping interfaces correlate them with the DTO.

Ultimately there is a batch-service that implements an update in the table of a relevant model when the ItemWriter needs to persist some data list.

Caution

This tool is still in active development and has not attained MVP. Lots of changes are happening to the API

Prerequisites

As this is a JHipster module, we expect you have installed or have a working knowledge of JHipster, Spring, Spring batch and their related tools as well as POI:

Installation

With NPM

To install this module:

npm install -g generator-jhipster-file-handling

To update this module:

npm update -g generator-jhipster-file-handling

With Yarn

To install this module:

yarn global add generator-jhipster-file-handling

To update this module:

yarn global upgrade generator-jhipster-file-handling

Configuration

Once installed, there will be issues with configuring the list-size parameters for the list partition algorithm used this is because the FileUploadsProperties may need to be added on the EnableConfigurationProperties declaration like so:

        @SpringBootApplication
        @EnableConfigurationProperties({LiquibaseProperties.class, ApplicationProperties.class, FileUploadsProperties.class})
        public class MyJhipsterApp {

            // Application startup logic ...
        }

Usage

Initiate this module by the yeoman command:

yo jhipster-file-handling

Input the following prompts :

  • folder name (also used as prefix) for file-handling entities on the front end
  • TRUE/FALSE, whether to prefix the entities with the the previous folder name
  • File model types: Input comma separated names of entities, in capital case, with no spaces between them.

Then press return to proceed.

Formerly entered file-model-types become the enumerations for different entity types for data uploaded from the Excel file.

License

Apache-2.0 © Edwin Njeru