groupdocs-total / GroupDocs.Total-for-Java-Spring

Moved to https://github.com/groupdocs-total/GroupDocs.Total-for-Java/tree/main/Demos/Spring
https://products.groupdocs.com/total/java
MIT License
0 stars 1 forks source link

Static resources not updating #67

Closed j-harrison closed 5 years ago

j-harrison commented 5 years ago

After pulling down the Total project and spinning it up successfully, I am trying to modify some of the components js and html files. However, when modifying these in the node_modules folder, they get pushed to the target/classes/...folder, but are not reflected once the web server starts.

Is this a cache setting, or am I missing a connecting piece?

egorovpavel commented 5 years ago

Hi @j-harrison, I believe that what you experiencing is caused by the build process we have in this application. In order to preserve your changes, we recommend disabling this behavior by commenting out the following blocks in pom.xml file

                   <execution>
                        <id>gulp build</id>
                        <goals>
                            <goal>gulp</goal>
                        </goals>
                        <configuration>
                            <arguments>build</arguments>
                        </configuration>
                    </execution>
                    <execution>
                        <id>gulp copy</id>
                        <goals>
                            <goal>gulp</goal>
                        </goals>
                        <configuration>
                            <arguments>copy</arguments>
                        </configuration>
                    </execution>

and apply your changes to files located in src/main/resources/static and never in node_modules folder.

Keep in mind that after disabling this behavior future versions of front-end need to be updated manually.

Also, would you mind sharing what type of customizations you are trying to accomplish? Maybe we can add them as configuration options instead?

j-harrison commented 5 years ago

Thank you for the reply. I will try this tomorrow once in the office.

Currently, I am trying to add an OnInit function to the viewer app component to pull Params from the url to pass to the java code that will automatically display a document from a content servlet as soon as the page is loaded. Additionally, we want to hide some of the toolbar options.

I have the java code modified and tested, but needed my mods on the front end to stick to be able to do the front end dev. If there is a better way to do this then please let me know, however, this Parameterized URL approach was similar to what we used with the groupdocs .net v3 modules.

John Harrison

On Mon, Jun 24, 2019 at 12:50 AM Pavel Egorov notifications@github.com wrote:

Hi @j-harrison https://github.com/j-harrison, I believe that what you experiencing is caused by the build process we have in this application. In order to preserve your changes, we recommend disabling this behavior by commenting out the following blocks in pom.xml https://github.com/groupdocs-total/GroupDocs.Total-for-Java-Spring/blob/master/pom.xml#L259 file

               <execution>
                    <id>gulp build</id>
                    <goals>
                        <goal>gulp</goal>
                    </goals>
                    <configuration>
                        <arguments>build</arguments>
                    </configuration>
                </execution>
                <execution>
                    <id>gulp copy</id>
                    <goals>
                        <goal>gulp</goal>
                    </goals>
                    <configuration>
                        <arguments>copy</arguments>
                    </configuration>
                </execution>

and apply your changes to files located in src/main/resources/static and never in node_modules folder.

Keep in mind that after disabling this behavior future versions of front-end need to be updated manually.

Also, would you mind sharing what type of customizations you are trying to accomplish? Maybe we can add them as configuration options instead?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/groupdocs-total/GroupDocs.Total-for-Java-Spring/issues/67?email_source=notifications&email_token=AB4CO27CS7GKUCNAREZDENTP4BODRA5CNFSM4H2SZMQKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYL2UNA#issuecomment-504867380, or mute the thread https://github.com/notifications/unsubscribe-auth/AB4CO2227YJUKPMJSKNYJTDP4BODRANCNFSM4H2SZMQA .

-- Thanks,

John Harrison Forefront Technologies, LLC IT Consultant -- Software Developer (336) 266-4843

j-harrison commented 5 years ago

This did not resolve the issue. After removing the lines from the pom.xml and running the following command in vs code, mvn clean spring-boot:run, the viewer-app.component.js in the webpack sources in chrome is still not updated.

I have verified that the file is properly reflective of the changes in the target/classes folder.

This is critical for me to evaluate the viewer. Please let me know if there are other things for me to try.

egorovpavel commented 5 years ago

Hi @j-harrison sorry for the delay, in order to customize viewer you not only change files under src/main/resources/static/angular/viewer but also compile them into dist folder. Consider the following workflow:

Assuming you have a fresh clone of repository:

  1. You need to fetch the latest version of GroupDocs.Viewer from NPM and copy it to src/main/resources/static/angular. This is done as part of maven build stage.
  2. Once you have the latest version in resources folder you can disable gulp build stage in pom.xml as described in my first reply.
  3. Now you need to install dependencies by executing npm install in src/main/resources/static/angular/viewer folder. At this moment you can make any changes, run the development server with ng serve and finally build VIewer using ng build --vendor-chunk=false command.

The ng build --vendor-chunk=false will compile final application files to dist folder. After that, you can simply build a project using maven and use your own version of Viewer.

Although this workflow allows you to customize the Viewer in every way imaginable, it also means that you will need to manually update and merge your changes with the latest version.

Let me know if this works for you.

j-harrison commented 5 years ago

Hi,

Thank you for the response. I will try this today.

John

From: Pavel Egorov notifications@github.com Sent: Tuesday, July 02, 2019 11:04 AM To: groupdocs-total/GroupDocs.Total-for-Java-Spring GroupDocs.Total-for-Java-Spring@noreply.github.com Cc: j-harrison john.harrison@fftechnologies.com; Mention mention@noreply.github.com Subject: Re: [groupdocs-total/GroupDocs.Total-for-Java-Spring] Static resources not updating (#67)

Hi @j-harrison https://github.com/j-harrison sorry for the delay, in order to customize viewer you not only change files under src/main/resources/static/angular/viewer but also compile them into dist folder. Consider the following workflow:

Assuming you have a fresh clone of repository:

  1. You need to fetch the latest version of GroupDocs.Viewer from NPM and copy it to src/main/resources/static/angular. This is done as part of maven build stage.
  2. Once you have the latest version in resources folder you can disable gulp build stage in pom.xml as described in my first reply.
  3. Now you need to install dependencies by executing npm install in src/main/resources/static/angular/viewer folder. At this moment you can make any changes, run the development server with ng serve and finally build VIewer using ng build --vendor-chunk=false command.

The ng build --vendor-chunk=false will compile final application files to dist folder. After that, you can simply build a project using maven and use your own version of Viewer.

Although this workflow allows you to customize the Viewer in every way imaginable, it also means that you will need to manually update and merge your changes with the latest version.

Let me know if this works for you.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/groupdocs-total/GroupDocs.Total-for-Java-Spring/issues/67?email_source=notifications&email_token=AB4CO24JVAZ4HHIX7BD25CLP5NU6JA5CNFSM4H2SZMQKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZBSPCQ#issuecomment-507717514 , or mute the thread https://github.com/notifications/unsubscribe-auth/AB4CO24JO4UD6ORNQGDLO23P5NU6JANCNFSM4H2SZMQA . https://github.com/notifications/beacon/AB4CO25TU7EFHBEAU5M2JKDP5NU6JA5CNFSM4H2SZMQKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZBSPCQ.gif

egorovpavel commented 5 years ago

@j-harrison we will consider this issue closed. If you still have any problems feel free to open a new issue.