Started working on an actual project
first have to create a remote branch
adrin@adrian-pc:~/projects/admin-web/admin-web$ git pull
From gitlablive.hsenidmobile.com:apptizer/admin-web
* [new branch] feature/S11-APT-609-download-android-app-bundle -> origin/feature/S11-APT-609-download-android-app-bundle
Already up-to-date.
adrin@adrian-pc:~/projects/admin-web/admin-web$ git checkout -b feature/S11-APT-610-product-category-visibility-switch-for-webstore
Switched to a new branch 'feature/S11-APT-610-product-category-visibility-switch-for-webstore'
adrin@adrian-pc:~/projects/admin-web/admin-web$ git push --set-upstream origin feature/S11-APT-610-product-category-visibility-switch-for-webstore
Total 0 (delta 0), reused 0 (delta 0)
To git@gitlablive.hsenidmobile.com:apptizer/admin-web.git
* [new branch] feature/S11-APT-610-product-category-visibility-switch-for-webstore -> feature/S11-APT-610-product-category-visibility-switch-for-webstore
Branch feature/S11-APT-610-product-category-visibility-switch-for-webstore set up to track remote branch feature/S11-APT-610-product-category-visibility-switch-for-webstore from origin.
Learnt on awesome buttons. You need to find the buttons on the web. And the version they used. Otherwise they won't be visible.
These additional hosts had to be added to the etc/hosts file to avoid the admin web from crashing.
127.0.0.1 web.cas
127.0.0.1 mongo.iso.apptizer.io
127.0.0.1 api.iso.apptizer.io
For debugging war files you need a different approach. There is exploded war file build and using a remote server method as well. Nimila taught how to work using a remote server in tomcat.
the following line was added at the beginning of the catalina.sh file
in the intellij IDEA IDE added a configuration under remote server and named it as the remote-server.
JAVA_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005"
30/07/2019
The task was given to make the page loading time less by stopping all the images from loading in to the admin web business home page.
- Add a button to open a tab for the images
- Add a column to show the image size.
- check the code for the controller and the place of data/images
New working branch for this development
feature/S11-APT-615-business-image-section-refactoring
Steps taken to switch to that branch.
adrin@adrian-pc:~/projects/admin-web/admin-web$ git checkout development
Switched to branch 'development'
Your branch is up-to-date with 'origin/development'.
adrin@adrian-pc:~/projects/admin-web/admin-web$ git pull
remote: Counting objects: 17, done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 17 (delta 7), reused 0 (delta 0)
Unpacking objects: 100% (17/17), done.
From gitlablive.hsenidmobile.com:apptizer/admin-web
68df54b..020ddda feature/S11-APT-609-download-android-app-bundle -> origin/feature/S11-APT-609-download-android-app-bundle
* [new branch] feature/S11_APT_612_google_play_bundle_key_generation -> origin/feature/S11_APT_612_google_play_bundle_key_generation
Already up-to-date.
adrin@adrian-pc:~/projects/admin-web/admin-web$ git status
On branch development
Your branch is up-to-date with 'origin/development'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
../.idea/
nothing added to commit but untracked files present (use "git add" to track)
adrin@adrian-pc:~/projects/admin-web/admin-web$ git checkout -b feature/S11-APT-615-business-image-section-refactoring
Switched to a new branch 'feature/S11-APT-615-business-image-section-refactoring'
adrin@adrian-pc:~/projects/admin-web/admin-web$ git push --set-upstream origin feature/S11-APT-615-business-image-section-refactoring
Total 0 (delta 0), reused 0 (delta 0)
To git@gitlablive.hsenidmobile.com:apptizer/admin-web.git
* [new branch] feature/S11-APT-615-business-image-section-refactoring -> feature/S11-APT-615-business-image-section-refactoring
Branch feature/S11-APT-615-business-image-section-refactoring set up to track remote branch feature/S11-APT-615-business-image-section-refactoring from origin.
There were several problems which occured .
- found the place where the form needs to be added
- full_business_view.jsp
- components/business-view/business tabs/settings-tab
- The debugger is running fine.
- the problem was imageUrlList seems to be a null value.
- the setAdditionalImagePath method doesn't get the value of the folder.
- has to figure out what has happened to the name of the folder
- The problem was : the method which finds out the value of the folder name was hard coded to take the 0 th index all the time from a list. So it has been resolved by Nimila by adding a for loop to check the required value. So the bug was fixed.
- Now the modifications needed by apptizer is to add a button at the bottom of the upload images page so that the users can navigate to a seperate page to view the files.
- Advice was to get the business object from postgresql. It will give all the information I need..
- Viewing the url , image, image size in a table
Another problem occurred.
The changes I made in intelliJ IDEA doesn't come to the settings-tab.jsp block in ful-business-view.jsp page.
But one time i ran the git log and git status command to see if the changes are there it is shown as two modified files.
settings-tab.jsp
business-controller.java
Now the changes i made are showing in the page.
Again i went back to intelliJ IDEA to do changes . Now the settings-tab is changed back to the previous version.
It was just a silly mistake. I was changing the code in a conditional statement. The required portion of the code had a same looking block of code in that jsp page. The code which was running on if block was changed by me while the page runs the block of code in the next else statement.
Now the coding part of the controller has begun.
- Added a link to a separate page from the image uploading page.
- Added a button from font awesome.
- Started coding the viewImages controller in the product controller.
- On the way got to know a private declared method in Business controller has to be used in the coding . Changed the view Images controller to the Business controller.
- Modified the setModalObj method to calculate the image file size and send it to the image-viewing page in a list object model. List<List> .. The inner list to hold the image name and image size. Outer list to hold those inner lists for each and every image in the respective folder.
- List<String> imageObj = new ArrayList();
- imgaeObj.add(filename)
- imageObj.add(filesize)
- imageData.add(imageObj)
like wise it has been coded .
view image button modified with wrapper and font awesome icon.
Displaying the image file size and total image file sizes in the top panel.
02/08/2019
Supervisor asked for two changes.
View image button needs to be "View Images"
The aligning problem is due to the scroll bar taking a portion from the table body. Hence the thead and tbody is not getting in line.
when table-fixed class is taken out from the table class the problem is solved partially. But the table is not scrolling with the thead fixed ,instead it scrolls down freely and the headings will be
Adding the modified code after Code review.
adrin@adrian-pc:~/projects/admin-web/admin-web$ git add modules/admin-ui/src/main/java/hms/apptizer/admin/controller/BusinessController.java modules/admin-ui/src/main/webapp/WEB-INF/jsp/components/business-view/business-tabs/settings-tab.jsp
adrin@adrian-pc:~/projects/admin-web/admin-web$ git commit -m "fix : removed unused code and hid the view images button when the image relative location is not available"
[feature/S11-APT-615-business-image-section-refactoring 484587d] fix : removed unused code and hid the view images button when the image relative location is not available
2 files changed, 16 insertions(+), 59 deletions(-)
adrin@adrian-pc:~/projects/admin-web/admin-web$ git push
warning: push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the traditional behavior, use:
because of the warning and operation aborting had to do a git pull
adrin@adrian-pc:~/projects/admin-web/admin-web$ git pull
Auto-merging admin-web/modules/admin-ui/src/main/webapp/WEB-INF/jsp/images-view.jsp
CONFLICT (add/add): Merge conflict in admin-web/modules/admin-ui/src/main/webapp/WEB-INF/jsp/images-view.jsp
Auto-merging admin-web/modules/admin-ui/src/main/webapp/WEB-INF/jsp/components/business-view/business-tabs/settings-tab.jsp
CONFLICT (content): Merge conflict in admin-web/modules/admin-ui/src/main/webapp/WEB-INF/jsp/components/business-view/business-tabs/settings-tab.jsp
Auto-merging admin-web/modules/admin-ui/src/main/java/hms/apptizer/admin/controller/BusinessController.java
CONFLICT (content): Merge conflict in admin-web/modules/admin-ui/src/main/java/hms/apptizer/admin/controller/BusinessController.java
Automatic merge failed; fix conflicts and then commit the result.
Then the conflicts were compared and kept the ones that needs to be preserved. After
adrin@adrian-pc:~/projects/admin-web/admin-web$ git add modules/admin-ui/src/main/java/hms/apptizer/admin/controller/BusinessController.java
adrin@adrian-pc:~/projects/admin-web/admin-web$ git commit -m "fix : resolving merge conflicts "
[feature/S11-APT-615-business-image-section-refactoring 40fdc45] fix : resolving merge conflicts
adrin@adrian-pc:~/projects/admin-web/admin-web$ git push
git push successful
adrin@adrian-pc:~/projects/admin-web/admin-web$ git checkout development
Switched to branch 'development'
Your branch is up-to-date with 'origin/development'.
adrin@adrian-pc:~/projects/admin-web/admin-web$ git pull
Already up-to-date.
adrin@adrian-pc:~/projects/admin-web/admin-web$ git merge feature/S11-APT-615-business-image-section-refactoring
Updating 68df54b..40fdc45
Fast-forward
admin-web/modules/admin-ui/src/main/java/hms/apptizer/admin/controller/BusinessController.java | 66 +++++++++++++---
admin-web/modules/admin-ui/src/main/java/hms/apptizer/admin/controller/ProductController.java | 10 +++
.../modules/admin-ui/src/main/webapp/WEB-INF/jsp/components/business-view/business-tabs/settings-tab.jsp | 107 +++++++++-----------------
admin-web/modules/admin-ui/src/main/webapp/WEB-INF/jsp/images-view.jsp | 232 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 336 insertions(+), 79 deletions(-)
create mode 100644 admin-web/modules/admin-ui/src/main/webapp/WEB-INF/jsp/images-view.jsp
adrin@adrian-pc:~/projects/admin-web/admin-web$ git push
adrin@adrian-pc:~/projects/admin-web/admin-web$ git merge feature/S11-APT-610-product-category-visibility-switch-for-webstore
Merge made by the 'recursive' strategy.
admin-web/0 | 0
admin-web/choco_bis.jpg | Bin 0 -> 306463 bytes
admin-web/modules/admin-ui/src/main/webapp/WEB-INF/jsp/categories.jsp | 9 +++++++++
admin-web/modules/admin-ui/src/main/webapp/WEB-INF/jsp/components/products/merchant-view.jsp | 19 +++++++++++++++----
4 files changed, 24 insertions(+), 4 deletions(-)
create mode 100644 admin-web/0
create mode 100644 admin-web/choco_bis.jpg
adrin@adrian-pc:~/projects/admin-web/admin-web$ git push
Delete a Local GIT branch
git branch -d branch_name
git push <remote name> --delete branch_name
adrin@adrian-pc:~/projects/admin-web$ git push origin --delete feature/S11-APT-615-business-image-section-refactoring
To git@gitlablive.hsenidmobile.com:apptizer/admin-web.git
- [deleted] feature/S11-APT-615-business-image-section-refactoring
adrin@adrian-pc:~/projects/admin-web$ git push origin --delete feature/S11-APT-610-product-category-visibility-switch-for-webstore
To git@gitlablive.hsenidmobile.com:apptizer/admin-web.git
- [deleted] feature/S11-APT-610-product-category-visibility-switch-for-webstore
Deleted branch feature/S11-APT-610-product-category-visibility-switch-for-webstore (was 67ccbab).
Deleted branch feature/S11-APT-615-business-image-section-refactoring (was 40fdc45).
Setting up retail-webstore
Cloning the project retail-webstore
Problems occurred when building the war file :
- [ERROR] Failed to execute goal on project cafeApptizer: Could not resolve dependencies for project io.apptizer.cafe:cafeApptizer:war:1.2.0-SNAPSHOT: Failed to collect dependencies at io.apptizer:apptizer-api:jar:1.2.0-SNAPSHOT: Failed to read artifact descriptor for io.apptizer:apptizer-api:jar:1.2.0-SNAPSHOT: Could not transfer artifact io.apptizer:apptizer-api:pom:1.2.0-SNAPSHOT from/to internal (http://archiva.hsenidmobile.com/repository/internal): Failed to transfer file http://archiva.hsenidmobile.com/repository/internal/io/apptizer/apptizer-api/1.2.0-SNAPSHOT/apptizer-api-1.2.0-SNAPSHOT.pom with status code 500 -> [Help 1]
apptizer, apptizer-api and apptizer-iso.
Then changed the version of the below dependency from 1.2.0-snapshot1.0 to 1.2.0
<dependency> <groupId>io.apptizer</groupId> <artifactId>apptizer-api</artifactId> <version>1.2.0</version></dependency>
Next the building and deploying was successful.
But another json file named business-plugins.json had to be added to the /apptizer/data/admin-web/dynamic-data directory So that the drop down menu at
https://dev.apptizer.lk/admin/business/BIZ_1rke7f5h515 plugins tab new plugin addition works correctly.
After adding that file plugin was added and the web store page https://dev.apptizer.lk/webstore/BIZ_1rke7f5h515?session=1564995280013 could be retrieved.
Only after adding the webstore plugin one can call the webstore/biz id url. Otherwise it wont work.
Comments
Post a Comment