Merge remote-tracking branch 'refs/remotes/larshp/master'
|
@ -12,6 +12,7 @@
|
|||
<item>/README.md</item>
|
||||
<item>/package.json</item>
|
||||
<item>/changelog.txt</item>
|
||||
<item>/.gitignore</item>
|
||||
</IGNORE>
|
||||
</DATA>
|
||||
</asx:values>
|
||||
|
|
0
.gitignore
vendored
Normal file
|
@ -1,6 +1,6 @@
|
|||
language: node_js
|
||||
node_js:
|
||||
- "6"
|
||||
- "8"
|
||||
notifications:
|
||||
email: false
|
||||
deploy:
|
||||
|
|
|
@ -10,7 +10,7 @@ Works with: [GitHub](https://github.com/), [GitLab](https://gitlab.com/), [Assem
|
|||
|
||||
ABAP Version: 702 or higher
|
||||
|
||||
Latest build: [zabapgit.abap](http://larshp.github.io/abapGit/build/zabapgit.txt)
|
||||
Latest build: [zabapgit.abap](https://raw.githubusercontent.com/larshp/abapGit/build/zabapgit.abap)
|
||||
|
||||
## Design Goals ##
|
||||
- Easy installation
|
||||
|
@ -19,9 +19,9 @@ Latest build: [zabapgit.abap](http://larshp.github.io/abapGit/build/zabapgit.txt
|
|||
- Code readable in git repository
|
||||
|
||||
## Documentation/Guides ##
|
||||
See [Wiki](https://github.com/larshp/abapGit/wiki/)
|
||||
http://larshp.github.io/abapGit/
|
||||
|
||||
## FAQ ##
|
||||
For questions/comments/bugs/feature requests/wishes please create an [issue](https://github.com/larshp/abapGit/issues)
|
||||
|
||||

|
||||

|
||||
|
|
|
@ -8,6 +8,55 @@ Legend
|
|||
+ : added
|
||||
- : removed
|
||||
|
||||
2017-06-10 v1.37.2
|
||||
------------------
|
||||
* fixed unit tests
|
||||
* fixed dump when calling branch overview page
|
||||
|
||||
2017-06-07 v1.37.1
|
||||
------------------
|
||||
* WDYN package popup
|
||||
* SHI3 diffs
|
||||
|
||||
2017-06-03 v1.37.0
|
||||
------------------
|
||||
+ FORM support
|
||||
* minor performance fixes
|
||||
! XML format changed, initial tables omitted
|
||||
|
||||
2017-05-17 v1.36.1
|
||||
------------------
|
||||
* fixed problem regarding translated texts, PROG I18N_TPOOL
|
||||
|
||||
2017-04-23 v1.36.0
|
||||
------------------
|
||||
+ DCLS support
|
||||
+ STYL support
|
||||
|
||||
2017-04-23 v1.35.1
|
||||
------------------
|
||||
* DDLS jump
|
||||
* XLST jump
|
||||
* WAPA jump
|
||||
* WAPA extra XML fields
|
||||
! abapGit news announcements(only online)
|
||||
|
||||
2017-04-20 v1.35.0
|
||||
------------------
|
||||
+ SAMC support
|
||||
+ SAPC support
|
||||
|
||||
2017-04-15 v1.34.0
|
||||
------------------
|
||||
+ WAPA support
|
||||
+ display abapGit changelog in abapGit
|
||||
* bugfix nested namespace folders
|
||||
|
||||
2017-03-24 v1.33.3
|
||||
------------------
|
||||
* fix dump in transport to branch
|
||||
* fix dump in migration of .abapgit.xml to local state
|
||||
|
||||
2017-03-23 v1.33.2
|
||||
------------------
|
||||
* fix Microsoft TFS zlib decompression error
|
||||
|
|
3
docs/.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
.jekyll-metadata
|
||||
_site
|
||||
Gemfile.lock
|
1
docs/404.md
Normal file
|
@ -0,0 +1 @@
|
|||
404, not found, abapGit
|
2
docs/Gemfile
Normal file
|
@ -0,0 +1,2 @@
|
|||
source 'https://rubygems.org'
|
||||
gem 'github-pages', group: :jekyll_plugins
|
9
docs/_config.yml
Normal file
|
@ -0,0 +1,9 @@
|
|||
title: abapGit Docs
|
||||
keep_files: [explore.html, repos.json]
|
||||
highlighter: rouge
|
||||
defaults:
|
||||
-
|
||||
scope:
|
||||
path: "" # an empty string here means all files in the project
|
||||
values:
|
||||
layout: "default"
|
8
docs/_includes/footer.html
Normal file
|
@ -0,0 +1,8 @@
|
|||
<footer class="nav-footer wrap">
|
||||
<div class="nav-refs">
|
||||
<a href="https://github.com/larshp/abapGit">
|
||||
<span class="mega-octicon octicon-mark-github"></span>
|
||||
</a>
|
||||
</div>
|
||||
<footer>
|
||||
|
7
docs/_includes/head.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link rel="shortcut icon" type="image/png" href="favicon.png">
|
||||
<link rel="stylesheet" href="main.css">
|
||||
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/octicons/4.4.0/font/octicons.min.css">
|
||||
<title>{% if page.title %}{{ site.title }} - {{ page.title }}{% else %}{{ site.title }}{% endif %}</title>
|
||||
</head>
|
5
docs/_includes/header.html
Normal file
|
@ -0,0 +1,5 @@
|
|||
<div class="page-head">
|
||||
<div class="wrap">
|
||||
<a href="./index.html"><img class="head-logo" src="img/logo.svg" height="40" alt="abapGit"></a><span class="head-title">abapGit documentation</span>
|
||||
</div>
|
||||
</div>
|
50
docs/_includes/navigation.html
Normal file
|
@ -0,0 +1,50 @@
|
|||
<!-- Navigation -->
|
||||
<h3>Getting Started</h3>
|
||||
<ul>
|
||||
{% assign pages = site.pages | sort: 'order' %}
|
||||
{% for doc in pages %}
|
||||
{% if doc.category == "getting-started" %}
|
||||
<li><a href=".{{ doc.url }}">{{ doc.title }}</a></li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<h3>Online Projects</h3>
|
||||
<ul>
|
||||
{% assign pages = site.pages | sort: 'order' %}
|
||||
{% for doc in pages %}
|
||||
{% if doc.category == "online projects" %}
|
||||
<li><a href=".{{ doc.url }}">{{ doc.title }}</a></li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<h3>Offline Projects</h3>
|
||||
<ul>
|
||||
{% assign pages = site.pages | sort: 'order' %}
|
||||
{% for doc in pages %}
|
||||
{% if doc.category == "offline projects" %}
|
||||
<li><a href=".{{ doc.url }}">{{ doc.title }}</a></li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<h3>Reference</h3>
|
||||
<ul>
|
||||
{% assign pages = site.pages | sort: 'order' %}
|
||||
{% for doc in pages %}
|
||||
{% if doc.category == "reference" %}
|
||||
<li><a href=".{{ doc.url }}">{{ doc.title }}</a></li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<h3>Other</h3>
|
||||
<ul>
|
||||
{% assign pages = site.pages | sort: 'order' %}
|
||||
{% for doc in pages %}
|
||||
{% if doc.category == "other" %}
|
||||
<li><a href=".{{ doc.url }}">{{ doc.title }}</a></li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
17
docs/_layouts/default.html
Normal file
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
{% include head.html %}
|
||||
<body>
|
||||
{% include header.html %}
|
||||
<div class="container wrap">
|
||||
<div class="nav">
|
||||
{% include navigation.html %}
|
||||
</div>
|
||||
<div class="content">
|
||||
<h1>{{ page.title }}</h1>
|
||||
{{ content }}
|
||||
</div>
|
||||
</div>
|
||||
{% include footer.html %}
|
||||
</body>
|
||||
</html>
|
100
docs/explore.html
Normal file
|
@ -0,0 +1,100 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>abapGit</title>
|
||||
<style type="text/css">
|
||||
body {
|
||||
font-family: Arial,Helvetica,sans-serif;
|
||||
background: #E8E8E8;
|
||||
}
|
||||
a, a:visited {
|
||||
color: #4078c0;
|
||||
text-decoration: none;
|
||||
}
|
||||
a:hover, a:active {
|
||||
text-decoration: underline;
|
||||
}
|
||||
div#header {
|
||||
display: block;
|
||||
margin-top: 0.5em;
|
||||
padding-bottom: 0.5em;
|
||||
border-bottom: 3px double lightgrey;
|
||||
}
|
||||
div#toc {
|
||||
display: block;
|
||||
background-color: #f2f2f2;
|
||||
padding: 1em;
|
||||
}
|
||||
div#footer {
|
||||
display: block;
|
||||
margin-bottom: 1em;
|
||||
padding-top: 0.5em;
|
||||
border-top: 3px double lightgrey;
|
||||
color: grey;
|
||||
text-align: center;
|
||||
}
|
||||
h1 {
|
||||
display: inline;
|
||||
}
|
||||
h2 {
|
||||
display: inline;
|
||||
}
|
||||
h3 {
|
||||
display: inline;
|
||||
color: grey;
|
||||
font-weight:normal;
|
||||
font-size: smaller;
|
||||
}
|
||||
</style>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
|
||||
<script>
|
||||
function goBack() {
|
||||
window.history.back();
|
||||
}
|
||||
|
||||
function shuffle(sourceArray) {
|
||||
|
||||
for (var n = 0; n < sourceArray.length - 1; n++) {
|
||||
var k = n + Math.floor(Math.random() * (sourceArray.length - n));
|
||||
|
||||
var temp = sourceArray[k];
|
||||
sourceArray[k] = sourceArray[n];
|
||||
sourceArray[n] = temp;
|
||||
}
|
||||
}
|
||||
|
||||
function run() {
|
||||
/* global $ */
|
||||
$.getJSON( "repos.json", function( data ) {
|
||||
var items = [];
|
||||
|
||||
$.each( data, function( key, val ) {
|
||||
items.push( "<h2>" +
|
||||
val.title +
|
||||
"</h2> <a href='sapevent:install?" +
|
||||
key +
|
||||
"'>Clone</a><br><h3>" +
|
||||
key +
|
||||
"</h3><br>" +
|
||||
val.description );
|
||||
});
|
||||
|
||||
shuffle(items);
|
||||
|
||||
$('#content').html( items.join("<br><br>") );
|
||||
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="run()">
|
||||
<div id="header">
|
||||
<h1>Explore</h1>
|
||||
</div>
|
||||
<div id="toc">
|
||||
<div id="content"></div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<h3>Add your project? Create an issue in the <a href="https://github.com/larshp/abapGit/issues">tracker</a></h3>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
BIN
docs/favicon.png
Normal file
After Width: | Height: | Size: 764 B |
13
docs/guide-contributing.md
Normal file
|
@ -0,0 +1,13 @@
|
|||
---
|
||||
title: Contributing to a project
|
||||
category: online projects
|
||||
order: 60
|
||||
---
|
||||
|
||||
* Fork the repository
|
||||
* Clone the forked repository into the SAP system
|
||||
* Do changes in SAP
|
||||
* Commit the changes to the forked repository
|
||||
* Submit pull request
|
||||
|
||||
The forked repository can be deleted after the pull request has been closed.
|
15
docs/guide-export-zip.md
Normal file
|
@ -0,0 +1,15 @@
|
|||
---
|
||||
title: Export zip
|
||||
category: offline projects
|
||||
order: 20
|
||||
---
|
||||
|
||||
Assuming the offline project has been created.
|
||||
|
||||
a: Download zip file
|
||||
|
||||
b: Unzip file to appropiate folder
|
||||
|
||||
c: Use your favorite git client to add/update the files in the repository
|
||||
|
||||
Do not rename the files or change folder locations of the files. This way an offline and online abapGit project will contain the same files, and both scenarios will work for all users.
|
21
docs/guide-first-project.md
Normal file
|
@ -0,0 +1,21 @@
|
|||
---
|
||||
title: First project
|
||||
category: online projects
|
||||
order: 40
|
||||
---
|
||||
|
||||
## Repository Setup ##
|
||||
* Create the repsitory on github, make sure it contains someting eg. a README file
|
||||
* Start ZABAPGIT
|
||||
* Clone the repository into abapGit
|
||||
|
||||
## Adding objects ##
|
||||
* Navigate to the repository, click the "add" link
|
||||
* It will ask for which object to add, select the object
|
||||
* The object will be commited to the repository
|
||||
|
||||
## Modifying objects ##
|
||||
After modifying a object, a "commit" link will show up in abapGit, click this to commit the changes to the remote repository.
|
||||
|
||||
## Modifying repository ##
|
||||
If something is changed in the repository, a "pull" link will show up in abapGit. The changes must be pulled before new objects can be changed or added.
|
25
docs/guide-import-zip.md
Normal file
|
@ -0,0 +1,25 @@
|
|||
---
|
||||
title: Import zip
|
||||
category: offline projects
|
||||
order: 10
|
||||
---
|
||||
|
||||
1: Run report ZABAPGIT via SE38 or SA38
|
||||
|
||||
2: Click "New Offline Repo"
|
||||

|
||||
|
||||
3: Enter project name eg. "abapOpenChecks", and an empty package eg. "$AOC"
|
||||

|
||||
|
||||
4: Download the zip archive containing the git files, eg. https://github.com/larshp/abapOpenChecks/archive/master.zip
|
||||
|
||||
On github there is a link to download repository contents as zip:
|
||||

|
||||
|
||||
5: Click "Import ZIP" in abapGit
|
||||

|
||||
|
||||
6: Choose file downloaded in step 4
|
||||
|
||||
7: Activate. If prompted for package choose the package from step 3.
|
57
docs/guide-install.md
Normal file
|
@ -0,0 +1,57 @@
|
|||
---
|
||||
title: Installation
|
||||
category: getting-started
|
||||
order: 10
|
||||
---
|
||||
|
||||
## ABAP Report ##
|
||||
Copy the [ABAP code](https://raw.githubusercontent.com/larshp/abapGit/build/zabapgit.abap) into new report via SE38 or SE80. To update abapGit to a newer version, replace the code in the report with the most recent.
|
||||
|
||||
To use the online feature, SSL must be setup. Offline projects will work behind firewalls and without SSL.
|
||||
|
||||
## STRUST/SSL setup(online projects only) ##
|
||||
|
||||
##### Option A - Chrome #####
|
||||
|
||||
1. On chrome, go to https://github.com
|
||||
2. Click on the locker near the address bar, then click on "Details"
|
||||
3. The developer tools will open at the Security tab. Click on "View certificate"
|
||||
4. Go to the "Details" tab and click on "Copy to file..." to export to a .CER file
|
||||
5. Open the "Certification path" tab and navigate to the parent node at the tree, do this until the root
|
||||
|
||||
|
||||
##### Option B - Firefox #####
|
||||
1. Use Firefox to go to https://github.com
|
||||
2. Click on the lock icon and then "More Information ..." and there "View Certificate"
|
||||
3. Switch to the Details Tab and choose the first certificate of the tree and click Export
|
||||
4. Do the same for the next certificate in the tree
|
||||
|
||||
##### Option C #####
|
||||
1. Goto github, find the certificate that it is using
|
||||
2. Download certificate from https://www.digicert.com/digicert-root-certificates.htm
|
||||
|
||||
##### Then continue here #####
|
||||
1. Install the certificates in STRUST transaction:
|
||||
* Click on the Change button
|
||||
* Open "SSL System Client SSL Client (Anonymous)" folder
|
||||
* In the third box, Certificate, click on the bottom-left button "Import certificate" and "Add to certificate list".
|
||||
* Upload all the downloaded certificates
|
||||
* Save
|
||||
|
||||

|
||||
|
||||
Report [ZABAPGIT_TEST_SSL](https://github.com/larshp/abapGit/wiki/ZABAPGIT_TEST_SSL) can be used to verify that the connection works.
|
||||
|
||||
Also see blogs
|
||||
* http://scn.sap.com/people/jens.gleichmann/blog/2008/10/31/calling-webservices-from-abap-via-httpsssl-with-pfx-certificates
|
||||
* http://scn.sap.com/people/thomas.jung/blog/2004/11/17/bsp-a-developers-journal-part-xiv--consuming-webservices-with-abap
|
||||
|
||||
The certificate list should end up looking something like this:
|
||||

|
||||
|
||||
## Proxy setup(online projects only) ##
|
||||
If your server is behind a proxy, it can be configured under Advanced -> Settings,
|
||||

|
||||
|
||||
## Done ##
|
||||
Run report
|
21
docs/guide-moving-package.md
Normal file
|
@ -0,0 +1,21 @@
|
|||
---
|
||||
title: Moving package into git
|
||||
category: online projects
|
||||
order: 50
|
||||
---
|
||||
|
||||
You have an existing package in your system that you want to copy to a new git repository,
|
||||
|
||||

|
||||
|
||||
Initialize the git repository, make sure it is not emtpy,
|
||||
|
||||

|
||||
|
||||
In abapGit, clone the repository,
|
||||
|
||||

|
||||
|
||||
The existing objects will show up in the worklist making it possible to commit the objects to the git repository,
|
||||
|
||||

|
23
docs/guide-online-install.md
Normal file
|
@ -0,0 +1,23 @@
|
|||
---
|
||||
title: Installing online repo
|
||||
category: online projects
|
||||
order: 10
|
||||
---
|
||||
|
||||
* Start ZABAPGIT
|
||||
|
||||

|
||||
|
||||
* Click the "Clone" link
|
||||
|
||||

|
||||
|
||||
* Enter the url for the github project, eg https://github.com/larshp/Datamatrix.git along with a package name, eg. $DATAMATRIX
|
||||
|
||||

|
||||
|
||||
* Click ok
|
||||
|
||||
* It will now copy all objects from the git repository into the SAP system
|
||||
|
||||

|
16
docs/guide-online-uninstall.md
Normal file
|
@ -0,0 +1,16 @@
|
|||
---
|
||||
title: Uninstall repository
|
||||
category: online projects
|
||||
order: 30
|
||||
---
|
||||
|
||||
* Start ZABAPGIT
|
||||
* Navigate to the repository
|
||||
|
||||

|
||||
|
||||
* Click the "uninstall" link
|
||||
|
||||

|
||||
|
||||
* It will now delete all objects in the package specified when installing the repository
|
15
docs/guide-online-update.md
Normal file
|
@ -0,0 +1,15 @@
|
|||
---
|
||||
title: Keeping code up to date
|
||||
category: online projects
|
||||
order: 20
|
||||
---
|
||||
|
||||
* Start ZABAPGIT, it will automatically compare local and remote code. If code is updated in the remote repository a "pull" link will appear
|
||||
|
||||

|
||||
|
||||
* Click the "pull" link and it will update the local code
|
||||
|
||||
* After the update, no links should appear,
|
||||
|
||||

|
33
docs/guide-regular-backup.md
Normal file
|
@ -0,0 +1,33 @@
|
|||
---
|
||||
title: Regular backup
|
||||
category: other
|
||||
order: 10
|
||||
---
|
||||
|
||||
Editing Using abapGit and abapGitServer for regular backup
|
||||
|
||||
Steps:
|
||||
|
||||
1. Install abapGit
|
||||
|
||||
2. Use abapGit to install [abapGitServer](https://github.com/larshp/abapGitServer)
|
||||
|
||||
3. Create repository in abapGitServer via the web interface
|
||||
|
||||
4. Clone the repository using abapGit, into the package that should be backed up. abapGit will not delete any objects in the package
|
||||
|
||||
5. [Enable write protection](ref-write-protect.html)
|
||||
|
||||
6. Test backup by staging + commit + pushing from abapGit manually
|
||||
|
||||
7. Configure "background mode" for repository, Advanced -> Background mode.
|
||||
|
||||
7a. Set to "Automatic push",
|
||||
|
||||
7b. Enter username and password(note: password will be stored in clear text). If abapGit and abapGitServer runs on the same ABAP server, then no password is required, as it will automatically use logon tickets.
|
||||
|
||||
7c. Set commit author = "Automatic" this will find the user which last changed the objects and use these in the commits.
|
||||
|
||||
8. On the background mode page: click "Run background logic" to test the setup works
|
||||
|
||||
9. Configure ZABAPGIT to run as background job(SM36/SM37). Note: a dummy variant has to be created for the program, use SE38 to create the variant, values in the variant are not used for anything in background mode.
|
9
docs/guide-saplink.md
Normal file
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
title: Migrating from SAPlink
|
||||
category: other
|
||||
order: 20
|
||||
---
|
||||
|
||||
1: Install the slinkee/nuggets into the ABAP system using saplink
|
||||
|
||||
2: Use abapGit to export the objects as normal, see https://github.com/larshp/abapGit/wiki/Moving-existing-package-contents-into-git
|
11
docs/guide-uninstall.md
Normal file
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
title: Uninstalling
|
||||
category: getting-started
|
||||
order: 30
|
||||
---
|
||||
|
||||
* Delete ABAP reports ZABAPGIT* using SE38 or SE80
|
||||
* Delete EZABAPGIT enqueue object via SE11
|
||||
* Delete ZABAPGIT transparent table via SE11
|
||||
* Delete all standard texts named ZABAPGIT* via SO10 (only relevant for old versions of abapGit)
|
||||
* Delete mime objects ZABAPGIT_CSS_COMMON + ZABAPGIT_JS_COMMON in transaction SMW0
|
16
docs/guide-upgrade.md
Normal file
|
@ -0,0 +1,16 @@
|
|||
---
|
||||
title: Upgrading
|
||||
category: getting-started
|
||||
order: 20
|
||||
---
|
||||
|
||||
|
||||
### Manually
|
||||
Copy the code from [zabapgit.abap](https://raw.githubusercontent.com/larshp/abapGit/build/zabapgit.abap) into the ZABAPGIT report
|
||||
|
||||
### Online project
|
||||
If the abapGit report is installed in a separate package(eg. $ABAPGIT), a online project can be created. Which will help updating the abapGit code, a "pull" link will appear under the project when there are updates to abapGit.
|
||||
|
||||
### Offline project
|
||||
If the abapGit report is installed in a separate package(eg. $ABAPGIT), a offline project can be created.
|
||||
Download the zip file from https://github.com/larshp/abapGit/archive/master.zip, and click "Import Zip" under the project.
|
BIN
docs/img/abapgit_1_16_1.png
Normal file
After Width: | Height: | Size: 58 KiB |
BIN
docs/img/abapgit_1_17_17.png
Normal file
After Width: | Height: | Size: 58 KiB |
BIN
docs/img/abapgit_1_33_3.png
Normal file
After Width: | Height: | Size: 52 KiB |
BIN
docs/img/abapgit_1_9_15.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
docs/img/clone1.png
Normal file
After Width: | Height: | Size: 7.2 KiB |
BIN
docs/img/clone2.png
Normal file
After Width: | Height: | Size: 9.1 KiB |
BIN
docs/img/code_new.png
Normal file
After Width: | Height: | Size: 39 KiB |
BIN
docs/img/code_no_new.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
docs/img/download_zip.png
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
docs/img/existing_clone.png
Normal file
After Width: | Height: | Size: 9.0 KiB |
BIN
docs/img/existing_package.png
Normal file
After Width: | Height: | Size: 50 KiB |
BIN
docs/img/existing_repo.png
Normal file
After Width: | Height: | Size: 111 KiB |
BIN
docs/img/existing_result.png
Normal file
After Width: | Height: | Size: 38 KiB |
20
docs/img/favicon.svg
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
<svg width="14.811mm" height="14.811mm" version="1.1" viewBox="0 0 14.810531 14.810531" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
||||
<metadata>
|
||||
<rdf:RDF>
|
||||
<cc:Work rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
|
||||
<dc:title/>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g transform="translate(-149.08 -30.303)">
|
||||
<rect x="149.08" y="30.303" width="14.811" height="14.811" ry="7.4053" fill="#f03c2e"/>
|
||||
<g fill="#fff" stroke-width=".26458" style="font-feature-settings:normal;font-variant-caps:normal;font-variant-ligatures:normal;font-variant-numeric:normal" aria-label="ag">
|
||||
<path d="m156.23 39.846v-0.83608l-0.508-0.08467c-0.15875-0.02117-0.16934-0.04233-0.16934-0.21167v-2.5718c0-1.4817-0.64558-1.9156-2.2542-1.9156-0.97366 0-2.2754 0.20108-2.2754 1.6298l1.4922 0.127c0-0.635 0.26458-0.70908 0.77258-0.70908 0.65617 0 0.70908 0.33867 0.70908 0.83608v0.58208l-1.2171 0.08467c-1.3229 0.08467-1.9791 0.5715-1.9791 1.6298 0 0.65617 0.21166 1.5663 1.5452 1.5663 0.84667 0 1.3758-0.3175 1.778-0.70908l0.0529 0.01058 0.10583 0.5715zm-2.2331-1.397c-0.24341 0.17992-0.60325 0.381-0.96308 0.381-0.34925 0-0.60325-0.15875-0.60325-0.58208s0.22225-0.58208 0.84667-0.62442l0.71966-0.05292z" style="font-feature-settings:normal;font-variant-caps:normal;font-variant-ligatures:normal;font-variant-numeric:normal"/>
|
||||
<path d="m162.16 35.232v-0.89958h-2.0638c-0.24342-0.0635-0.51858-0.10583-0.97367-0.10583-1.6192 0-2.4236 0.83608-2.4236 2.0532 0 0.78317 0.39158 1.3335 0.91017 1.5875-0.254 0.23283-0.46567 0.43392-0.65617 0.635s-0.30692 0.41275-0.30692 0.64558c0 0.28575 0.11642 0.55033 0.46567 0.6985-0.37042 0.34925-0.58208 0.60325-0.58208 1.0795 0 0.83608 0.73025 1.3229 2.6458 1.3229 1.8415 0 2.9104-0.68792 2.9104-1.905 0-1.4076-1.0795-1.4605-2.9104-1.5769l-1.0372-0.0635 0.34925-0.56092c0.1905 0.05292 0.49742 0.09525 0.83609 0.09525 1.3335 0 2.2542-0.68792 2.2542-1.8627 0-0.48683-0.20109-0.8255-0.39159-1.0689zm-1.9791 0.99483c0 0.55033-0.40217 0.89958-0.99484 0.89958-0.6985 0-0.98425-0.35983-0.98425-0.87842 0-0.68792 0.43392-0.97367 1.016-0.97367 0.60325 0 0.96309 0.32808 0.96309 0.9525zm-0.58209 4.0111c0.508 0.03175 0.91017 0.05292 0.91017 0.39158 0 0.5715-0.83608 0.61383-1.4499 0.61383-0.74083 0-1.2806-0.127-1.2806-0.55033 0-0.21167 0.13758-0.39158 0.27517-0.56092z" style="font-feature-settings:normal;font-variant-caps:normal;font-variant-ligatures:normal;font-variant-numeric:normal"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.7 KiB |
BIN
docs/img/installed.png
Normal file
After Width: | Height: | Size: 39 KiB |
68
docs/img/logo.svg
Normal file
|
@ -0,0 +1,68 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
version="1.1"
|
||||
width="543.99414"
|
||||
height="133.58577"
|
||||
id="svg3046">
|
||||
<defs
|
||||
id="defs3048" />
|
||||
<metadata
|
||||
id="metadata3051">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
transform="translate(-102.15709,-476.64789)"
|
||||
id="layer1">
|
||||
<path
|
||||
d="m 214.93698,529.53539 -49.74501,-49.7389 c -2.8622,-2.8648 -7.5082,-2.8648 -10.374,0 l -10.329,10.33 13.102,13.102 c 3.0459,-1.0284 6.5371,-0.33888 8.9639,2.0884 2.4394,2.4424 3.124,5.9634 2.0698,9.0195 l 12.628,12.628 c 3.0551,-1.0528 6.58,-0.37262 9.0195,2.0712 3.4106,3.4096 3.4106,8.9345 0,12.345 -3.4111,3.4116 -8.936,3.4116 -12.349,0 -2.5645,-2.5665 -3.1988,-6.3345 -1.8999,-9.4942 l -11.777,-11.777 -0.001,30.991 c 0.8315,0.41162 1.6162,0.961 2.3091,1.6509 3.4096,3.4092 3.4096,8.9331 0,12.348 -3.4106,3.4091 -8.938,3.4091 -12.345,0 -3.4101,-3.4146 -3.4101,-8.9385 0,-12.348 0.84275,-0.84125 1.8179,-1.478 2.8584,-1.9048 v -31.279 c -1.041,-0.425 -2.015,-1.057 -2.859,-1.905 -2.583,-2.581 -3.2051,-6.372 -1.8804,-9.5439 l -12.916,-12.918 -34.106,34.105 c -2.8657,2.867 -2.8657,7.513 0,10.378 l 49.742,49.739 c 2.8638,2.8648 7.5082,2.8648 10.376,0 l 49.512,-49.504 c 2.86481,-2.8662 2.86481,-7.5136 0,-10.379"
|
||||
id="path3006"
|
||||
style="fill:#f03c2e" />
|
||||
<g
|
||||
id="text3008"
|
||||
style="font-size:108.98693085px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#362701;fill-opacity:1;stroke:none;font-family:HelveticaNeueCyr;-inkscape-font-specification:HelveticaNeueCyr">
|
||||
<path
|
||||
d="m 294.80411,586.33795 0,-8.53189 -5.18393,-0.86399 c -0.7808,-0.0765 -1.27129,-0.24748 -1.47149,-0.51299 -0.2003,-0.26549 -0.2858,-0.81448 -0.25649,-1.64698 l 0,-26.24366 c 0.0675,-7.42936 -1.71453,-12.57729 -5.34593,-15.4438 -3.6315,-2.86641 -9.51742,-4.23439 -17.65778,-4.10395 -5.31445,-0.21819 -10.42638,0.7313 -15.3358,2.84846 -4.90945,2.11728 -7.53741,6.71171 -7.8839,13.78333 l 15.22781,1.29598 c 0.004,-3.13642 0.67047,-5.15239 1.99797,-6.04792 1.32746,-0.89545 3.28943,-1.29144 5.88593,-1.18799 3.23092,0.0383 5.27389,0.82579 6.12892,2.36247 0.85495,1.53678 1.22394,3.59325 1.10698,6.16942 l 0,5.93993 -12.41984,0.86398 c -6.74768,0.39603 -11.80111,1.92601 -15.1603,4.58994 -3.35922,2.66399 -5.03769,6.67794 -5.03544,12.04185 -0.1935,3.59546 0.73349,7.09641 2.78097,10.50286 2.04746,3.40646 6.3764,5.23344 12.98683,5.48093 4.27942,-0.0517 7.87037,-0.75824 10.77286,-2.11947 2.90243,-1.36123 5.3594,-3.06671 7.37091,-5.11643 l 0.53999,0.108 1.07998,5.83192 z M 272.0164,572.08214 c -1.26677,0.96525 -2.75625,1.84273 -4.46844,2.63246 -1.71226,0.78975 -3.49873,1.20824 -5.35943,1.25549 -1.81575,0.0225 -3.28723,-0.42749 -4.41444,-1.34999 -1.12726,-0.92248 -1.70775,-2.45245 -1.74148,-4.58994 -0.0383,-2.12845 0.60522,-3.67643 1.93047,-4.64394 1.32521,-0.96746 3.56168,-1.54346 6.70942,-1.72798 l 7.3439,-0.53999 z"
|
||||
id="path2986"
|
||||
style="font-size:108px;font-weight:bold;fill:#362701;font-family:Adelle Basic Rg;-inkscape-font-specification:Adelle Basic Rg Bold" />
|
||||
<path
|
||||
d="m 318.09377,586.33795 0.75599,-5.39993 0.53999,-0.108 c 1.68071,1.93723 3.85418,3.54371 6.52042,4.81944 2.66618,1.27573 5.78464,1.93722 9.35538,1.98447 6.75662,0.099 12.19704,-2.28597 16.32129,-7.1549 4.12414,-4.86893 6.24361,-12.81582 6.35842,-23.8407 -0.13956,-9.94033 -2.15553,-17.05923 -6.04792,-21.35672 -3.89251,-4.29739 -8.82444,-6.39436 -14.79581,-6.29092 -3.2715,0.007 -6.23246,0.5063 -8.88289,1.49848 -2.6505,0.99229 -5.12546,2.43677 -7.4249,4.33344 l -0.432,-0.10799 0,-29.91562 -22.24771,0 -1.18799,8.74789 5.93993,2.05197 c 0.53098,0.16207 0.89998,0.43207 1.10698,0.80999 0.20699,0.37807 0.30599,0.86406 0.297,1.45798 l 0,52.70332 c -0.0203,2.66848 -0.19576,5.35044 -0.52649,8.0459 -0.33076,2.69547 -0.69525,5.26944 -1.09349,7.7219 z m 2.37597,-40.82347 c 1.32746,-0.91345 2.91144,-1.75944 4.75194,-2.53797 1.84044,-0.77845 3.74842,-1.19244 5.72393,-1.24198 3.57966,0.13054 6.14012,1.70552 7.6814,4.72494 1.54118,3.01949 2.29267,6.70044 2.25447,11.04285 0.009,5.45396 -0.84604,9.7199 -2.56497,12.79784 -1.71902,3.07797 -4.35598,4.64395 -7.9109,4.69794 -1.91251,-0.0337 -3.73048,-0.45223 -5.45393,-1.25549 -1.7235,-0.80322 -3.21748,-1.78871 -4.48194,-2.95646 z"
|
||||
id="path2988"
|
||||
style="font-size:108px;font-weight:bold;fill:#362701;font-family:Adelle Basic Rg;-inkscape-font-specification:Adelle Basic Rg Bold" />
|
||||
<path
|
||||
d="m 420.7338,586.33795 0,-8.53189 -5.18394,-0.86399 c -0.78079,-0.0765 -1.27129,-0.24748 -1.47148,-0.51299 -0.2003,-0.26549 -0.2858,-0.81448 -0.25649,-1.64698 l 0,-26.24366 c 0.0674,-7.42936 -1.71453,-12.57729 -5.34594,-15.4438 -3.63149,-2.86641 -9.51741,-4.23439 -17.65777,-4.10395 -5.31445,-0.21819 -10.42638,0.7313 -15.3358,2.84846 -4.90945,2.11728 -7.53741,6.71171 -7.8839,13.78333 l 15.2278,1.29598 c 0.004,-3.13642 0.67047,-5.15239 1.99798,-6.04792 1.32746,-0.89545 3.28943,-1.29144 5.88592,-1.18799 3.23093,0.0383 5.2739,0.82579 6.12892,2.36247 0.85496,1.53678 1.22395,3.59325 1.10699,6.16942 l 0,5.93993 -12.41984,0.86398 c -6.74768,0.39603 -11.80111,1.92601 -15.16031,4.58994 -3.35921,2.66399 -5.03769,6.67794 -5.03543,12.04185 -0.1935,3.59546 0.73349,7.09641 2.78097,10.50286 2.04746,3.40646 6.3764,5.23344 12.98683,5.48093 4.27942,-0.0517 7.87037,-0.75824 10.77286,-2.11947 2.90243,-1.36123 5.3594,-3.06671 7.3709,-5.11643 l 0.54,0.108 1.07998,5.83192 z m -22.78771,-14.25581 c -1.26677,0.96525 -2.75625,1.84273 -4.46844,2.63246 -1.71226,0.78975 -3.49874,1.20824 -5.35943,1.25549 -1.81575,0.0225 -3.28723,-0.42749 -4.41445,-1.34999 -1.12725,-0.92248 -1.70775,-2.45245 -1.74147,-4.58994 -0.0383,-2.12845 0.60522,-3.67643 1.93047,-4.64394 1.32521,-0.96746 3.56168,-1.54346 6.70941,-1.72798 l 7.34391,-0.53999 z"
|
||||
id="path2990"
|
||||
style="font-size:108px;font-weight:bold;fill:#362701;font-family:Adelle Basic Rg;-inkscape-font-specification:Adelle Basic Rg Bold" />
|
||||
<path
|
||||
d="m 459.79126,609.23366 0,-8.53189 -11.23186,-0.97199 c -0.78077,-0.0293 -1.27126,-0.18676 -1.47148,-0.4725 -0.20028,-0.28576 -0.28577,-0.84825 -0.2565,-1.68747 l 0,-15.4438 c 2.27695,1.83597 4.71591,3.21295 7.31691,4.13094 2.60093,0.91799 5.30989,1.37698 8.12689,1.37698 5.88455,-0.14266 10.44715,-1.86131 13.68782,-5.15593 3.24057,-3.29462 5.49121,-7.30923 6.75192,-12.04385 1.26059,-4.73458 1.86324,-9.33318 1.80798,-13.79582 -0.10806,-9.94033 -2.05204,-17.05923 -5.83193,-21.35672 -3.78,-4.29739 -8.74793,-6.39436 -14.90381,-6.29092 -3.13425,0.0203 -6.3157,0.6278 -9.54438,1.82248 -3.22873,1.19479 -6.16719,2.85526 -8.81538,4.98143 l -0.53999,-0.21599 -0.97199,-5.50793 -19.00776,0 -1.18798,8.74788 5.72393,2.05198 c 0.53098,0.16204 0.89997,0.43203 1.10698,0.80999 0.20699,0.37803 0.30599,0.86403 0.297,1.45798 l 0,54.5393 c 0.0135,0.78972 -0.12151,1.34321 -0.405,1.66047 -0.2835,0.31724 -0.7965,0.51973 -1.53898,0.6075 l -4.31994,0.64799 0,8.63989 z m -12.74384,-63.50319 c 1.22396,-0.87069 2.82593,-1.72118 4.80594,-2.55147 1.97994,-0.83019 4.12191,-1.27568 6.42591,-1.33648 2.74493,-0.0427 4.9499,1.17678 6.61492,3.65846 1.66493,2.48175 2.51992,6.4822 2.56497,12.00134 0.0247,5.35946 -0.78079,9.5984 -2.41647,12.71684 -1.63577,3.11847 -4.25024,4.71145 -7.8434,4.77894 -2.02276,-0.0427 -3.91723,-0.47023 -5.68343,-1.28249 -1.76625,-0.81222 -3.25573,-1.75271 -4.46844,-2.82146 z"
|
||||
id="path2992"
|
||||
style="font-size:108px;font-weight:bold;fill:#362701;font-family:Adelle Basic Rg;-inkscape-font-specification:Adelle Basic Rg Bold" />
|
||||
<path
|
||||
d="m 565.33206,557.28633 0,-8.63989 -33.15557,0 -1.51198,9.71987 11.98785,0 0,14.14782 c 0.002,0.68175 -0.1373,1.15425 -0.4185,1.41748 -0.2813,0.26326 -0.71779,0.43876 -1.30948,0.52649 -1.27804,0.22051 -2.71802,0.40051 -4.31995,0.54 -1.60202,0.13951 -3.15,0.21151 -4.64394,0.21599 -7.71518,-0.0697 -13.4796,-2.5762 -17.29327,-7.5194 -3.81373,-4.94316 -5.7172,-11.90457 -5.71043,-20.88423 0.0562,-8.56559 2.0227,-15.275 5.89943,-20.12824 3.87667,-4.85313 9.32609,-7.32359 16.34828,-7.4114 1.70994,0.0113 3.44691,0.15081 5.21094,0.41849 1.76393,0.26781 3.3389,0.59631 4.72494,0.98549 0.47694,0.0901 0.84593,0.28806 1.10698,0.59399 0.26094,0.30606 0.46794,0.82805 0.62099,1.56598 l 1.61998,9.71987 11.98785,0.86399 0,-20.41173 c -3.41327,-2.1509 -7.33272,-3.73488 -11.75835,-4.75194 -4.42575,-1.01691 -8.64219,-1.52091 -12.64934,-1.51198 -13.59435,0.23407 -23.74621,4.05902 -30.45561,11.47485 -6.70942,7.41596 -10.05737,17.01883 -10.04387,28.80863 -0.19125,11.85062 2.72921,21.52099 8.76139,29.01112 6.03216,7.49016 16.32351,11.35561 30.8741,11.59635 4.57415,0.027 9.33058,-0.35099 14.26932,-1.13398 4.93862,-0.78299 9.50606,-2.13297 13.70232,-4.04995 l 0,-23.2197 c -0.009,-0.52872 0.11693,-0.90221 0.378,-1.12049 0.26092,-0.21822 0.71092,-0.34871 1.34998,-0.39149 z"
|
||||
id="path2994"
|
||||
style="font-size:108px;font-weight:bold;fill:#362701;font-family:Adelle Basic Rg;-inkscape-font-specification:Adelle Basic Rg Bold" />
|
||||
<path
|
||||
d="m 592.2956,511.71091 c -0.018,-3.08913 -0.87302,-5.4426 -2.56497,-7.06041 -1.692,-1.61765 -4.11297,-2.43213 -7.26291,-2.44347 -3.09822,0.0113 -5.48769,0.82583 -7.16841,2.44348 -1.68073,1.61781 -2.53122,3.97127 -2.55146,7.0604 0.0202,3.09828 0.87073,5.48775 2.55147,7.16841 1.68072,1.68079 4.07018,2.53128 7.1684,2.55147 3.14994,-0.0202 5.57091,-0.87068 7.26291,-2.55147 1.69195,-1.68066 2.54694,-4.07013 2.56497,-7.16841 z m 7.01991,74.62704 0,-8.53189 -5.50793,-0.75599 c -0.78077,-0.0765 -1.27126,-0.24749 -1.47149,-0.51299 -0.20027,-0.26549 -0.28577,-0.81448 -0.25649,-1.64698 l 0,-44.81942 -22.35571,0 -1.18799,8.74788 5.83193,2.05198 c 0.53098,0.16204 0.89998,0.43203 1.10698,0.80999 0.20699,0.37803 0.30599,0.86403 0.297,1.45798 l 0,31.75159 c 0.0225,0.78525 -0.0765,1.32074 -0.297,1.60648 -0.2205,0.28575 -0.6975,0.47025 -1.43098,0.55349 l -5.50793,0.75599 0,8.53189 z"
|
||||
id="path2996"
|
||||
style="font-size:108px;font-weight:bold;fill:#362701;font-family:Adelle Basic Rg;-inkscape-font-specification:Adelle Basic Rg Bold" />
|
||||
<path
|
||||
d="m 642.23527,573.81011 c -1.30952,0.49726 -2.7135,0.90675 -4.21195,1.22848 -1.49851,0.32176 -3.01049,0.48826 -4.53594,0.4995 -2.85749,0.0293 -4.81047,-0.65023 -5.85893,-2.03847 -1.04851,-1.38822 -1.5435,-3.66069 -1.48497,-6.81742 l 0,-25.81166 16.09179,0 0,-10.79986 -15.2278,0 c -0.41402,0.002 -0.66602,-0.0832 -0.756,-0.2565 -0.09,-0.17319 -0.12602,-0.44769 -0.10799,-0.82349 l 0,-15.3358 -10.25987,0 c -0.52876,5.81624 -1.90124,10.08668 -4.11745,12.81133 -2.21623,2.72477 -5.66768,4.32225 -10.35437,4.79244 l 0,9.61188 7.55991,0 c 0.41398,0.005 0.66598,0.10354 0.75599,0.29699 0.09,0.19355 0.12599,0.45454 0.108,0.78299 l 0,28.29564 c -0.0653,6.06368 1.28022,10.48712 4.03644,13.27033 2.7562,2.78321 7.31464,4.15569 13.67533,4.11744 3.13643,-0.0382 6.25938,-0.47474 9.36888,-1.30948 3.10942,-0.83474 5.85438,-1.83822 8.23489,-3.01046 z"
|
||||
id="path2998"
|
||||
style="font-size:108px;font-weight:bold;fill:#362701;font-family:Adelle Basic Rg;-inkscape-font-specification:Adelle Basic Rg Bold" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 11 KiB |
BIN
docs/img/offline1.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
docs/img/offline2.png
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
docs/img/offline3.png
Normal file
After Width: | Height: | Size: 6.5 KiB |
BIN
docs/img/proxy.png
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
docs/img/start.png
Normal file
After Width: | Height: | Size: 54 KiB |
BIN
docs/img/strust.png
Normal file
After Width: | Height: | Size: 8.4 KiB |
BIN
docs/img/strust1.png
Normal file
After Width: | Height: | Size: 83 KiB |
BIN
docs/img/uninstall1.png
Normal file
After Width: | Height: | Size: 45 KiB |
BIN
docs/img/uninstall2.png
Normal file
After Width: | Height: | Size: 7.8 KiB |
11
docs/index.md
Normal file
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
title: Welcome
|
||||
---
|
||||
|
||||
abapGit is a git client for ABAP developed in ABAP. It requires SAP BASIS version 702 or higher.
|
||||
|
||||
Latest build: [zabapgit.abap](https://raw.githubusercontent.com/larshp/abapGit/build/zabapgit.abap)
|
||||
|
||||
For questions/comments/bugs/feature requests/wishes please create an [issue](https://github.com/larshp/abapGit/issues)
|
||||
|
||||

|
88
docs/main.css
Normal file
|
@ -0,0 +1,88 @@
|
|||
body {
|
||||
font-family: Arial,Helvetica,sans-serif;
|
||||
background: #F8F8F8;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
a, a:visited {
|
||||
color: #4078c0;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:hover, a:active {
|
||||
cursor: pointer;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
h1, h2, h3 {
|
||||
margin: 10px 0;
|
||||
font-family: inherit;
|
||||
font-weight: bold;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.container {
|
||||
padding-top: 1em;
|
||||
padding-bottom: 1em;
|
||||
}
|
||||
|
||||
.container:after {
|
||||
content: "";
|
||||
display: table;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.nav {
|
||||
float: left;
|
||||
width: 300px;
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
.content {
|
||||
float: right;
|
||||
width: 100%;
|
||||
max-width: 650px;
|
||||
}
|
||||
|
||||
.content img {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
}
|
||||
|
||||
.page-head {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
background-color: #E8E8E8;
|
||||
padding-top: 8px;
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
|
||||
.head-title {
|
||||
font-weight: bold;
|
||||
font-size: 22pt;
|
||||
color: #bbb;
|
||||
padding-left: 0.4em;
|
||||
position: absolute;
|
||||
bottom: 12px;
|
||||
}
|
||||
|
||||
.wrap {
|
||||
max-width: 960px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
padding-left: 20px;
|
||||
padding-right: 20px;
|
||||
}
|
||||
|
||||
footer.nav-footer {
|
||||
padding-top: 1em;
|
||||
padding-bottom: 1em;
|
||||
}
|
||||
|
||||
.nav-refs {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.nav-refs a {
|
||||
color: #808080;
|
||||
}
|
44
docs/other-articles-and-presentations.md
Normal file
|
@ -0,0 +1,44 @@
|
|||
---
|
||||
title: Articles and Presentations
|
||||
category: other
|
||||
order: 30
|
||||
---
|
||||
|
||||
### 2014
|
||||
|
||||
[Git client for ABAP – alpha release](http://blogs.sap.com/2014/07/17/git-client-for-abap-alpha-release/)
|
||||
-Lars Hvam
|
||||
|
||||
### 2016
|
||||
|
||||
[How can I use Git and GitHub for SAP software development?](http://searchsap.techtarget.com/answer/How-can-I-use-Git-and-GitHub-for-SAP-software-development)
|
||||
-Ethan Jewett
|
||||
|
||||
[Implementing modern practices in an ABAP development shop](http://searchsap.techtarget.com/tip/Implementing-modern-practices-in-an-ABAP-development-shop)
|
||||
-Ethan Jewett
|
||||
|
||||
[SAP Inside Track Hamburg](https://larshp.github.io/sithh2016/)
|
||||
-Lars Hvam
|
||||
|
||||
[SAP Teched Barcelona](https://larshp.github.io/teched-2016-emea/)
|
||||
-Lars Hvam
|
||||
|
||||
### 2017
|
||||
|
||||
[SAP d-kom Karlsruhe](https://larshp.github.io/dkom2017/)
|
||||
-Lars Hvam
|
||||
|
||||
[First look at ABAPGit & ideas on a feature](https://themanmountain.github.io/2017/04/19/first_look_at_abapgit.html)
|
||||
-Alex Cook
|
||||
|
||||
[SAP Inside Track Ballerup](https://larshp.github.io/sitbal2017/), May 6th
|
||||
-Lars Hvam
|
||||
|
||||
[ABAP – Using git for safety and transparency](https://blogs.sap.com/2017/05/07/abap-using-git-for-safety-and-transparency/)
|
||||
-Lars Hvam
|
||||
|
||||
Mastering SAP Technologies, Melbourne, May 23rd
|
||||
-Graham Robinson
|
||||
|
||||
SAP Teched Las Vegas
|
||||
-Graham Robinson
|
24
docs/other-file-formats.md
Normal file
|
@ -0,0 +1,24 @@
|
|||
---
|
||||
title: Object File Formats
|
||||
category: other
|
||||
order: 40
|
||||
---
|
||||
|
||||
# CLAS
|
||||
One ABAP file, corresponding to the editable parts in source based class builder or ABAP in Eclipse:
|
||||
|
||||
* `zcl_example.clas.abap`
|
||||
* `zcl_example.clas.locals_def.abap`
|
||||
* `zcl_example.clas.locals_imp.abap`
|
||||
* `zcl_example.clas.testclasses.abap`
|
||||
* `zcl_example.clas.macros.abap`
|
||||
|
||||
Files does not exist if empty
|
||||
|
||||
One XML file `zcl_example.clas.xml` containing:
|
||||
|
||||
* VSEOCLASS information
|
||||
* TPOOL information
|
||||
* SOTR information
|
||||
* LINES from DOKU
|
||||
* Descriptions from SEOCOMPOTX
|
38
docs/other-technical-links.md
Normal file
|
@ -0,0 +1,38 @@
|
|||
---
|
||||
title: Technical Links
|
||||
category: other
|
||||
order: 50
|
||||
---
|
||||
|
||||
Collection of links to various git related documentation,
|
||||
|
||||
[https://gist.github.com/schacon/6092633](https://gist.github.com/schacon/6092633)
|
||||
|
||||
[https://github.com/git/git/blob/master/Documentation/technical/pack-protocol.txt](https://github.com/git/git/blob/master/Documentation/technical/pack-protocol.txt)
|
||||
|
||||
[https://github.com/git/git/blob/master/Documentation/technical/http-protocol.txt](https://github.com/git/git/blob/master/Documentation/technical/http-protocol.txt)
|
||||
|
||||
[https://github.com/git/git/blob/master/Documentation/technical/protocol-capabilities.txt](https://github.com/git/git/blob/master/Documentation/technical/protocol-capabilities.txt)
|
||||
|
||||
[https://github.com/git/git/blob/master/Documentation/technical/pack-format.txt](https://github.com/git/git/blob/master/Documentation/technical/pack-format.txt)
|
||||
|
||||
[https://github.com/git/git/tree/master/Documentation/technical](https://github.com/git/git/tree/master/Documentation/technical)
|
||||
|
||||
[http://schacon.github.io/gitbook/7_the_packfile.html](http://schacon.github.io/gitbook/7_the_packfile.html)
|
||||
|
||||
[http://alblue.bandlem.com/2011/08/git-tip-of-week-objects.html](http://alblue.bandlem.com/2011/08/git-tip-of-week-objects.html)
|
||||
|
||||
[https://git-scm.herokuapp.com/book/en/Git-Internals-Transfer-Protocols](https://git-scm.herokuapp.com/book/en/Git-Internals-Transfer-Protocols)
|
||||
|
||||
[https://github.com/git/git/blob/master/builtin/receive-pack.c](https://github.com/git/git/blob/master/builtin/receive-pack.c)
|
||||
|
||||
[http://stefan.saasen.me/articles/git-clone-in-haskell-from-the-bottom-up/](http://stefan.saasen.me/articles/git-clone-in-haskell-from-the-bottom-up/)
|
||||
|
||||
```bash
|
||||
set GIT_CURL_VERBOSE=1
|
||||
$env:GIT_CURL_VERBOSE=1
|
||||
$env:GIT_TRACE=1
|
||||
git config --global http.proxy %HTTP_PROXY%
|
||||
git config --global --unset http.proxy
|
||||
git config --global http.sslVerify false
|
||||
```
|
72
docs/other-test-ssl.md
Normal file
|
@ -0,0 +1,72 @@
|
|||
---
|
||||
title: ZABAPGIT_TEST_SSL
|
||||
category: other
|
||||
order: 60
|
||||
---
|
||||
|
||||
Following report can be used to test SSL connection to github,
|
||||
|
||||
```abap
|
||||
REPORT zabapgit_test_ssl.
|
||||
|
||||
* See https://github.com/larshp/abapGit/
|
||||
|
||||
PARAMETERS: p_url TYPE swc_value DEFAULT 'https://github.com',
|
||||
p_proxy TYPE string,
|
||||
p_pxport TYPE string.
|
||||
|
||||
START-OF-SELECTION.
|
||||
PERFORM run.
|
||||
|
||||
FORM run.
|
||||
|
||||
DATA: lv_code TYPE i,
|
||||
lv_url TYPE string,
|
||||
li_client TYPE REF TO if_http_client,
|
||||
lv_error_message TYPE string.
|
||||
|
||||
lv_url = p_url.
|
||||
cl_http_client=>create_by_url(
|
||||
EXPORTING
|
||||
url = lv_url
|
||||
ssl_id = 'ANONYM'
|
||||
proxy_host = p_proxy
|
||||
proxy_service = p_pxport
|
||||
IMPORTING
|
||||
client = li_client ).
|
||||
|
||||
* enter username and password for proxy authentication if needed
|
||||
* li_client->authenticate(
|
||||
* proxy_authentication = abap_true
|
||||
* username = ''
|
||||
* password = '' ).
|
||||
|
||||
li_client->send( ).
|
||||
li_client->receive(
|
||||
EXCEPTIONS
|
||||
http_communication_failure = 1
|
||||
http_invalid_state = 2
|
||||
http_processing_failed = 3
|
||||
OTHERS = 4 ).
|
||||
IF sy-subrc <> 0.
|
||||
WRITE: / 'Error Number', sy-subrc.
|
||||
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
|
||||
li_client->get_last_error(
|
||||
IMPORTING
|
||||
message = lv_error_message ).
|
||||
WRITE: / `Error message: ` && lv_error_message.
|
||||
WRITE: / 'Also check transaction SMICM -> Goto -> Trace File -> Display End'.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
|
||||
li_client->response->get_status(
|
||||
IMPORTING
|
||||
code = lv_code ).
|
||||
IF lv_code = 200.
|
||||
WRITE: / 'Success, it works'.
|
||||
ELSE.
|
||||
WRITE: / 'Error', lv_code.
|
||||
ENDIF.
|
||||
|
||||
ENDFORM.
|
||||
```
|
32
docs/other-xml-mismatch.md
Normal file
|
@ -0,0 +1,32 @@
|
|||
---
|
||||
title: XML Mismatch
|
||||
category: other
|
||||
order: 70
|
||||
---
|
||||
|
||||
### For end-users
|
||||
Make sure you have the latest version of abapGit installed, see [upgrading](guide-upgrade.html), after updating try again.
|
||||
|
||||
If the error persists, submit an issue to the maintainer of the repository requesting to update to latest version of abapGit serialized files pointing to the guide below.
|
||||
|
||||
Or alternatively install an old version of abapGit to allow for installing the files, see next section "For maintainers"
|
||||
|
||||
### For maintainers
|
||||
If the latest version of abapGit is installed and the erorr message is shown, then the serialized files should be updated to the latest version.
|
||||
|
||||
The steps are:
|
||||
|
||||
1. Install old abapGit version, matching the serialized files
|
||||
|
||||
2. Install objects into the ABAP system
|
||||
|
||||
3. Install newest abapGit version
|
||||
|
||||
4. Use the new abapGit to save the files to the git repository
|
||||
|
||||
This will overwrite the files in the repository to have the latest format, compatible with the newest abapGit release.
|
||||
|
||||
| abapGit | Download | XML Serialization |
|
||||
| :------------- |:------------- |:-------------|
|
||||
| v1.0.0 to current | [Link](https://raw.githubusercontent.com/larshp/abapGit/build/zabapgit.abap) | v1.0.0 |
|
||||
| v0.0.0 to v0.113.0 | [Link](https://raw.githubusercontent.com/larshp/abapGit/v0.113.0/zabapgit.prog.abap) | v0.2-alpha |
|
72
docs/ref-dot-abapgit.md
Normal file
|
@ -0,0 +1,72 @@
|
|||
---
|
||||
title: .abapgit.xml
|
||||
category: reference
|
||||
order: 10
|
||||
---
|
||||
|
||||
**.abapgit.xml** is a special abapGit file. It contains meta information of the abapGit project.
|
||||
|
||||
Example: abapGit own .abapgit.xml
|
||||
|
||||
```xml
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
||||
<asx:values>
|
||||
<DATA>
|
||||
<MASTER_LANGUAGE>E</MASTER_LANGUAGE>
|
||||
<STARTING_FOLDER>/src/</STARTING_FOLDER>
|
||||
<FOLDER_LOGIC>PREFIX</FOLDER_LOGIC>
|
||||
<IGNORE>
|
||||
<item>/.travis.yml</item>
|
||||
<item>/CONTRIBUTING.md</item>
|
||||
<item>/LICENSE</item>
|
||||
<item>/README.md</item>
|
||||
<item>/package.json</item>
|
||||
<item>/changelog.txt</item>
|
||||
</IGNORE>
|
||||
</DATA>
|
||||
</asx:values>
|
||||
</asx:abap>
|
||||
```
|
||||
|
||||
# Description
|
||||
|
||||
## Master Language
|
||||
|
||||
The language in which all documentation and dictionary elements texts will be created. Follows SAP `sy-langu` values.
|
||||
|
||||
## Starting Folder
|
||||
|
||||
The Git repository folder that defines the root folder where deserialization starts.
|
||||
|
||||
## Folder Logic
|
||||
|
||||
abapGit follows two folder logics: PREFIX and FULL
|
||||
|
||||
### PREFIX
|
||||
|
||||
A package name must contain its parent package name as a prefix. Examples:
|
||||
|
||||
Valid prefix:
|
||||
* ZFOO
|
||||
* **ZFOO**_BAR
|
||||
* **ZFOO_BAR**_QUX
|
||||
|
||||
will give folder structure /foo/bar/qux/
|
||||
|
||||
Invalid prefix:
|
||||
* ZFOO
|
||||
* ZBAR
|
||||
|
||||
### FULL
|
||||
|
||||
Any package name is accepted
|
||||
|
||||
* ZSOMETHING
|
||||
* ZHELLO
|
||||
|
||||
will give folder structure /zsomething/zhello/
|
||||
|
||||
## Ignore
|
||||
|
||||
Files which abapGit will not download into your ABAP system.
|
80
docs/ref-supported.md
Normal file
|
@ -0,0 +1,80 @@
|
|||
---
|
||||
title: Supported object types
|
||||
category: reference
|
||||
order: 20
|
||||
---
|
||||
|
||||
|
||||
Type | Description | Supported
|
||||
:------------ | :------------ | ------------:
|
||||
ACID | Checkpoint Group | Yes
|
||||
AUTH | Authorization Check Fields | Yes
|
||||
BOBF | BOPF: Business Object Model | [Plugin](https://github.com/larshp/abapGit-Plugins)
|
||||
CLAS | Class (ABAP Objects) | Yes
|
||||
CMOD | Customer enhancement projects | [#151](https://github.com/larshp/abapGit/issues/151)
|
||||
DCLS | ABAP Data Control Language Sources | Yes
|
||||
DDLS | Data Definition Language Source | Yes
|
||||
DOCT | General Text | Yes
|
||||
DOCV | Documentation (Independent) | Yes
|
||||
DOMA | Domain | Yes
|
||||
DTEL | Data Element | Yes
|
||||
ECAT | eCATT Test Script | [#163](https://github.com/larshp/abapGit/issues/163)
|
||||
ECTD | eCATT Test Data Container | [#105](https://github.com/larshp/abapGit/issues/105)
|
||||
ENHC | Composite Enhancement Implementation | Yes
|
||||
ENHO | Enhancement Implementation | Partial [#113](https://github.com/larshp/abapGit/issues/113)
|
||||
ENHS | Enhancement Spot | Yes
|
||||
ENQU | Lock Object | Yes
|
||||
FORM | SAPscript form | Yes
|
||||
FUGR | Function Group | Yes
|
||||
IAMU | Language-Independent IAC Binary Data | [#81](https://github.com/larshp/abapGit/issues/81)
|
||||
IARP | Parameters of IAC Language Resource | Yes
|
||||
IASP | Parameters of an IAC service | Yes
|
||||
IATU | Language-Independent IAC Templates | Yes
|
||||
IWPR | Gateway Business Suite Enablement - Service Builder Project | [#75](https://github.com/larshp/abapGit/issues/75)
|
||||
LPDC | Launchpad short texts | [#107](https://github.com/larshp/abapGit/issues/107)
|
||||
MSAG | Message Class | Yes
|
||||
NROB | Number Range Objects | Yes
|
||||
PARA | SPA/GPA Parameters | Yes
|
||||
PDTS | Standard Task | [#153](https://github.com/larshp/abapGit/issues/153)
|
||||
PDWS | Workflow templates | [#154](https://github.com/larshp/abapGit/issues/154)
|
||||
PINF | Package interface | Yes
|
||||
PROG | Program | Yes
|
||||
SAMC | ABAP Messaging Channels | Yes
|
||||
SAPC | ABAP Push Channels | Yes
|
||||
SFBF | Business Function + Assignment | Yes
|
||||
SFBS | Business Function Set + Assignment | Yes
|
||||
SFSW | Switch + Assignment of Objects to the Switch | Yes
|
||||
SHI3 | General structure storage: Definition of a structure | Yes
|
||||
SHLP | Search Help | Yes
|
||||
SICF | ICF Service | Yes
|
||||
SPLO | Format Types | Yes
|
||||
SRFC | RFC Service | [#155](https://github.com/larshp/abapGit/issues/155)
|
||||
SSFO | SAP Smart Form | Yes
|
||||
SSST | SAP Smart Style | Yes
|
||||
SFPI | Form Object: Interface | Yes
|
||||
SFPF | Form Object: Form | Yes
|
||||
SHMA | Shared Objects: Defined Area Attributes | [#85](https://github.com/larshp/abapGit/issues/85)
|
||||
SMIM | Info Object from the MIME Repository | Yes
|
||||
SPRX | Proxy Object | [#87](https://github.com/larshp/abapGit/issues/87)
|
||||
STYL | SAPscript style | Yes
|
||||
SUSC | Authorization object class | Yes
|
||||
SUSO | Authorization object | Yes
|
||||
SXCI | Business Add-Ins - Implementations | [#156](https://github.com/larshp/abapGit/issues/156)
|
||||
TABL | Table | Yes
|
||||
TOBJ | Definition of a Maintenance and Transport Object | Yes
|
||||
TRAN | Transaction | Yes
|
||||
TTYP | Table Type | Yes
|
||||
TYPE | Type Group | Yes
|
||||
VCLS | View cluster | Yes
|
||||
VIEW | View | Yes
|
||||
W3HT | Web Reporting/Internet Transaction Server HTML Templates | Yes
|
||||
W3MI | Web Reporting/Internet Transaction Server MIME Types(binary | Yes
|
||||
WAPA | BSP (Business Server Pages) Application | Yes
|
||||
WDCA | Web Dynpro Application Configuration | [#79](https://github.com/larshp/abapGit/issues/79)
|
||||
WDCC | Web Dynpro Component Configuration | [#78](https://github.com/larshp/abapGit/issues/78)
|
||||
WDYA | Web Dynpro Application | Yes
|
||||
WDYN | Web Dynpro Component | Yes
|
||||
WEBI | Virtual End Point | Yes
|
||||
XSLT | Transformation | Yes
|
||||
|
||||
Also see https://github.com/larshp/abapGit-Plugins
|
19
docs/ref-write-protect.md
Normal file
|
@ -0,0 +1,19 @@
|
|||
---
|
||||
title: Write protect
|
||||
category: reference
|
||||
order: 30
|
||||
---
|
||||
|
||||
The write protected repository feature will make sure users cannot overwrite objects in the SAP system with objects from the git repository. So it helps enforcing that data can only go from the SAP system to the Git repository.
|
||||
|
||||
The feature disables pulls, uninstall of all objects, switching branches etc.
|
||||
|
||||
To enable:
|
||||
|
||||
1. from the abapGit main screen: Advanced -> Database util
|
||||
|
||||
2. find the repository, click "Edit"
|
||||
|
||||
3. find the value `<WRITE_PROTECT/>` and replace with `<WRITE_PROTECT>X</WRITE_PROTECT>`
|
||||
|
||||
4. restart abapGit(just to make sure caches are cleared)
|
77
docs/repos.json
Normal file
|
@ -0,0 +1,77 @@
|
|||
{
|
||||
"https://github.com/ivanfemia/abap2xlsx.git":
|
||||
{
|
||||
"title": "abap2xlsx",
|
||||
"description": "Generate your professional Excel spreadsheet from ABAP"
|
||||
},
|
||||
"https://github.com/larshp/abapCov.git":
|
||||
{
|
||||
"title": "abapCov",
|
||||
"description": "Upload ABAP unit test code coverage to codecov.io"
|
||||
},
|
||||
"https://github.com/flaiker/abap-log.git":
|
||||
{
|
||||
"title": "abap-log",
|
||||
"description": "Logging library for ABAP"
|
||||
},
|
||||
"https://github.com/sbcgua/mockup_loader.git":
|
||||
{
|
||||
"title": "mockup_loader",
|
||||
"description": "SAP ABAP tool for unit testing"
|
||||
},
|
||||
"https://github.com/koemaeda/abap-markdown.git":
|
||||
{
|
||||
"title": "abap-markdown",
|
||||
"description": "ABAP markdown parser"
|
||||
},
|
||||
"https://github.com/RainerWinkler/Moose-FAMIX-SAP-Extractor.git":
|
||||
{
|
||||
"title": "Moose-FAMIX-SAP-Extractor",
|
||||
"description": "An project to extract model data from a SAP system with FAMIX and Moose"
|
||||
},
|
||||
"https://github.com/larshp/abapOpenChecks.git":
|
||||
{
|
||||
"title": "abapOpenChecks",
|
||||
"description": "Open source checks for SAP Code Inspector / ABAP Test Cockpit"
|
||||
},
|
||||
"https://github.com/larshp/abapOrion.git":
|
||||
{
|
||||
"title": "abapOrion",
|
||||
"description": "Client implementation of Eclipse Orion protocol in ABAP for use with SAP HANA"
|
||||
},
|
||||
"https://github.com/larshp/abapOpenReview.git":
|
||||
{
|
||||
"title": "abapOpenReview",
|
||||
"description": "ABAP Review Tool"
|
||||
},
|
||||
"https://github.com/larshp/upDOWNci.git":
|
||||
{
|
||||
"title": "upDOWNci",
|
||||
"description": "Upload and download SAP Code Inspector variants in XML format"
|
||||
},
|
||||
"https://github.com/larshp/FORMfactor.git":
|
||||
{
|
||||
"title": "FORMfactor",
|
||||
"description": "Refactor FORMs to local classes"
|
||||
},
|
||||
"https://github.com/gregorwolf/ebid-abap-client.git":
|
||||
{
|
||||
"title": "ebid-abap-client",
|
||||
"description": "ABAP Client for the http://www.unternehmensverzeichnis.org REST API"
|
||||
},
|
||||
"https://github.com/Sumu-Ning/AES.git":
|
||||
{
|
||||
"title": "AES",
|
||||
"description": "ABAP Utilities for AES/Rijndael encryption, decryption"
|
||||
},
|
||||
"https://github.com/fidley/falv.git":
|
||||
{
|
||||
"title": "falv",
|
||||
"description": "FALV - Fast ALV Grid"
|
||||
},
|
||||
"https://github.com/larshp/Datamatrix.git":
|
||||
{
|
||||
"title": "Datamatrix",
|
||||
"description": "Datamatrix implemented in ABAP using smartforms"
|
||||
}
|
||||
}
|
|
@ -2,9 +2,6 @@ REPORT zabapgit LINE-SIZE 100.
|
|||
|
||||
* See http://www.abapgit.org
|
||||
|
||||
CONSTANTS: gc_xml_version TYPE string VALUE 'v1.0.0', "#EC NOTEXT
|
||||
gc_abap_version TYPE string VALUE 'v1.33.2'. "#EC NOTEXT
|
||||
|
||||
********************************************************************************
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
|
@ -50,10 +47,12 @@ INCLUDE zabapgit_persistence.
|
|||
INCLUDE zabapgit_sap_package.
|
||||
INCLUDE zabapgit_folder_logic.
|
||||
INCLUDE zabapgit_requirements.
|
||||
INCLUDE zabapgit_authorizations.
|
||||
|
||||
INCLUDE zabapgit_stage.
|
||||
INCLUDE zabapgit_git_helpers.
|
||||
INCLUDE zabapgit_repo.
|
||||
INCLUDE zabapgit_news.
|
||||
INCLUDE zabapgit_stage_logic.
|
||||
INCLUDE zabapgit_2fa.
|
||||
INCLUDE zabapgit_http.
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
<LDBNAME>D$S</LDBNAME>
|
||||
<UCCHECK>X</UCCHECK>
|
||||
</PROGDIR>
|
||||
<DYNPROS/>
|
||||
<TPOOL>
|
||||
<item>
|
||||
<ID>R</ID>
|
||||
|
|
|
@ -50,13 +50,13 @@ CLASS lcx_2fa_auth_failed IMPLEMENTATION.
|
|||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
|
||||
CLASS lcx_2fa_token_gen_failed DEFINITION INHERITING FROM lcx_2fa_error FINAL.
|
||||
CLASS lcx_2fa_gen_failed DEFINITION INHERITING FROM lcx_2fa_error FINAL.
|
||||
PROTECTED SECTION.
|
||||
METHODS:
|
||||
get_default_text REDEFINITION.
|
||||
ENDCLASS.
|
||||
|
||||
CLASS lcx_2fa_token_gen_failed IMPLEMENTATION.
|
||||
CLASS lcx_2fa_gen_failed IMPLEMENTATION.
|
||||
METHOD get_default_text.
|
||||
rv_text = 'Two factor access token generation failed.' ##NO_TEXT.
|
||||
ENDMETHOD.
|
||||
|
@ -74,25 +74,25 @@ CLASS lcx_2fa_unsupported IMPLEMENTATION.
|
|||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
|
||||
CLASS lcx_2fa_token_del_failed DEFINITION INHERITING FROM lcx_2fa_error FINAL.
|
||||
CLASS lcx_2fa_del_failed DEFINITION INHERITING FROM lcx_2fa_error FINAL.
|
||||
PROTECTED SECTION.
|
||||
METHODS:
|
||||
get_default_text REDEFINITION.
|
||||
ENDCLASS.
|
||||
|
||||
CLASS lcx_2fa_token_del_failed IMPLEMENTATION.
|
||||
CLASS lcx_2fa_del_failed IMPLEMENTATION.
|
||||
METHOD get_default_text.
|
||||
rv_text = 'Deleting previous access tokens failed.' ##NO_TEXT.
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
|
||||
CLASS lcx_2fa_communication_error DEFINITION INHERITING FROM lcx_2fa_error FINAL.
|
||||
CLASS lcx_2fa_comm_error DEFINITION INHERITING FROM lcx_2fa_error FINAL.
|
||||
PROTECTED SECTION.
|
||||
METHODS:
|
||||
get_default_text REDEFINITION.
|
||||
ENDCLASS.
|
||||
|
||||
CLASS lcx_2fa_communication_error IMPLEMENTATION.
|
||||
CLASS lcx_2fa_comm_error IMPLEMENTATION.
|
||||
METHOD get_default_text.
|
||||
rv_text = 'Communication error.' ##NO_TEXT.
|
||||
ENDMETHOD.
|
||||
|
@ -143,8 +143,8 @@ INTERFACE lif_2fa_authenticator.
|
|||
iv_2fa_token TYPE string
|
||||
RETURNING VALUE(rv_access_token) TYPE string
|
||||
RAISING lcx_2fa_auth_failed
|
||||
lcx_2fa_token_gen_failed
|
||||
lcx_2fa_communication_error,
|
||||
lcx_2fa_gen_failed
|
||||
lcx_2fa_comm_error,
|
||||
"! Check if this authenticator instance supports the give repository url
|
||||
"! @parameter iv_url | Repository url
|
||||
"! @parameter rv_supported | Is supported
|
||||
|
@ -166,7 +166,7 @@ INTERFACE lif_2fa_authenticator.
|
|||
iv_username TYPE string
|
||||
iv_password TYPE string
|
||||
RETURNING VALUE(rv_required) TYPE abap_bool
|
||||
RAISING lcx_2fa_communication_error,
|
||||
RAISING lcx_2fa_comm_error,
|
||||
"! Delete all previously created access tokens for abapGit
|
||||
"! @parameter iv_url | Repository url
|
||||
"! @parameter iv_username | Username
|
||||
|
@ -178,8 +178,8 @@ INTERFACE lif_2fa_authenticator.
|
|||
iv_username TYPE string
|
||||
iv_password TYPE string
|
||||
iv_2fa_token TYPE string
|
||||
RAISING lcx_2fa_token_del_failed
|
||||
lcx_2fa_communication_error
|
||||
RAISING lcx_2fa_del_failed
|
||||
lcx_2fa_comm_error
|
||||
lcx_2fa_auth_failed,
|
||||
"! Begin an authenticator session that uses internal caching for authorizations
|
||||
"! @raising lcx_2fa_illegal_state | Session already started
|
||||
|
@ -190,7 +190,7 @@ INTERFACE lif_2fa_authenticator.
|
|||
ENDINTERFACE.
|
||||
|
||||
"! Default <em>LIF_2FA-AUTHENTICATOR</em> implememtation
|
||||
CLASS lcl_2fa_authenticator_base DEFINITION
|
||||
CLASS lcl_2fa_auth_base DEFINITION
|
||||
ABSTRACT
|
||||
CREATE PUBLIC.
|
||||
|
||||
|
@ -216,7 +216,7 @@ CLASS lcl_2fa_authenticator_base DEFINITION
|
|||
"! <p>
|
||||
"! <em>sy-msg...</em> must be set right before calling!
|
||||
"! </p>
|
||||
raise_comm_error_from_sy RAISING lcx_2fa_communication_error.
|
||||
raise_comm_error_from_sy RAISING lcx_2fa_comm_error.
|
||||
METHODS:
|
||||
"! @parameter rv_running | Internal session is currently active
|
||||
is_session_running RETURNING VALUE(rv_running) TYPE abap_bool.
|
||||
|
@ -226,7 +226,7 @@ CLASS lcl_2fa_authenticator_base DEFINITION
|
|||
mv_session_running TYPE abap_bool.
|
||||
ENDCLASS.
|
||||
|
||||
CLASS lcl_2fa_authenticator_base IMPLEMENTATION.
|
||||
CLASS lcl_2fa_auth_base IMPLEMENTATION.
|
||||
METHOD constructor.
|
||||
CREATE OBJECT mo_url_regex
|
||||
EXPORTING
|
||||
|
@ -251,7 +251,7 @@ CLASS lcl_2fa_authenticator_base IMPLEMENTATION.
|
|||
ENDMETHOD.
|
||||
|
||||
METHOD delete_access_tokens.
|
||||
RAISE EXCEPTION TYPE lcx_2fa_token_del_failed. " Needs to be overwritten in subclasses
|
||||
RAISE EXCEPTION TYPE lcx_2fa_del_failed. " Needs to be overwritten in subclasses
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD raise_comm_error_from_sy.
|
||||
|
@ -260,7 +260,7 @@ CLASS lcl_2fa_authenticator_base IMPLEMENTATION.
|
|||
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
|
||||
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
|
||||
INTO lv_error_msg.
|
||||
RAISE EXCEPTION TYPE lcx_2fa_communication_error
|
||||
RAISE EXCEPTION TYPE lcx_2fa_comm_error
|
||||
EXPORTING
|
||||
iv_error_text = |Communication error: { lv_error_msg }| ##NO_TEXT.
|
||||
ENDMETHOD.
|
||||
|
@ -286,10 +286,8 @@ CLASS lcl_2fa_authenticator_base IMPLEMENTATION.
|
|||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
|
||||
CLASS lcl_2fa_github_authenticator DEFINITION
|
||||
INHERITING FROM lcl_2fa_authenticator_base
|
||||
FINAL
|
||||
CREATE PUBLIC.
|
||||
CLASS lcl_2fa_github_auth DEFINITION INHERITING FROM lcl_2fa_auth_base
|
||||
FINAL CREATE PUBLIC.
|
||||
|
||||
PUBLIC SECTION.
|
||||
METHODS:
|
||||
|
@ -309,8 +307,6 @@ CLASS lcl_2fa_github_authenticator DEFINITION
|
|||
set_new_token_request IMPORTING ii_request TYPE REF TO if_http_request,
|
||||
get_token_from_response IMPORTING ii_response TYPE REF TO if_http_response
|
||||
RETURNING VALUE(rv_token) TYPE string,
|
||||
parse_repo_from_url IMPORTING iv_url TYPE string
|
||||
RETURNING VALUE(rv_repo_name) TYPE string,
|
||||
set_list_token_request IMPORTING ii_request TYPE REF TO if_http_request,
|
||||
get_tobedel_tokens_from_resp IMPORTING ii_response TYPE REF TO if_http_response
|
||||
RETURNING VALUE(rt_ids) TYPE stringtab,
|
||||
|
@ -322,12 +318,12 @@ CLASS lcl_2fa_github_authenticator DEFINITION
|
|||
iv_2fa_token TYPE string
|
||||
RETURNING VALUE(ri_client) TYPE REF TO if_http_client
|
||||
RAISING lcx_2fa_auth_failed
|
||||
lcx_2fa_communication_error.
|
||||
lcx_2fa_comm_error.
|
||||
DATA:
|
||||
mi_authenticated_session TYPE REF TO if_http_client.
|
||||
ENDCLASS.
|
||||
|
||||
CLASS lcl_2fa_github_authenticator IMPLEMENTATION.
|
||||
CLASS lcl_2fa_github_auth IMPLEMENTATION.
|
||||
METHOD constructor.
|
||||
super->constructor( '^https?://(www\.)?github.com.*$' ).
|
||||
ENDMETHOD.
|
||||
|
@ -362,14 +358,14 @@ CLASS lcl_2fa_github_authenticator IMPLEMENTATION.
|
|||
code = lv_http_code
|
||||
reason = lv_http_code_description ).
|
||||
IF lv_http_code <> 201.
|
||||
RAISE EXCEPTION TYPE lcx_2fa_token_gen_failed
|
||||
RAISE EXCEPTION TYPE lcx_2fa_gen_failed
|
||||
EXPORTING
|
||||
iv_error_text = |Token generation failed: { lv_http_code } { lv_http_code_description }|.
|
||||
ENDIF.
|
||||
|
||||
rv_access_token = get_token_from_response( li_http_client->response ).
|
||||
IF rv_access_token IS INITIAL.
|
||||
RAISE EXCEPTION TYPE lcx_2fa_token_gen_failed
|
||||
RAISE EXCEPTION TYPE lcx_2fa_gen_failed
|
||||
EXPORTING
|
||||
iv_error_text = 'Token generation failed: parser error' ##NO_TEXT.
|
||||
ENDIF.
|
||||
|
@ -445,25 +441,6 @@ CLASS lcl_2fa_github_authenticator IMPLEMENTATION.
|
|||
ENDWHILE.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD parse_repo_from_url.
|
||||
* method not used?
|
||||
ASSERT 0 = 1.
|
||||
* CONSTANTS: lc_search_regex TYPE string VALUE 'https?:\/\/(www\.)?github.com\/(.*)$'.
|
||||
* DATA: lo_regex TYPE REF TO cl_abap_regex,
|
||||
* lo_matcher TYPE REF TO cl_abap_matcher.
|
||||
*
|
||||
* CREATE OBJECT lo_regex
|
||||
* EXPORTING
|
||||
* pattern = lc_search_regex.
|
||||
*
|
||||
* lo_matcher = lo_regex->create_matcher( text = iv_url ).
|
||||
* IF lo_matcher->match( ) = abap_true.
|
||||
* rv_repo_name = lo_matcher->get_submatch( 1 ).
|
||||
* ELSE.
|
||||
* rv_repo_name = '???' ##NO_TEXT.
|
||||
* ENDIF.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD get_service_id_from_url.
|
||||
rv_id = 'github'.
|
||||
ENDMETHOD.
|
||||
|
@ -546,7 +523,7 @@ CLASS lcl_2fa_github_authenticator IMPLEMENTATION.
|
|||
code = lv_http_code
|
||||
reason = lv_http_code_description ).
|
||||
IF lv_http_code <> 200.
|
||||
RAISE EXCEPTION TYPE lcx_2fa_token_del_failed
|
||||
RAISE EXCEPTION TYPE lcx_2fa_del_failed
|
||||
EXPORTING
|
||||
iv_error_text = |Could not fetch current 2FA authorizations: | &&
|
||||
|{ lv_http_code } { lv_http_code_description }|.
|
||||
|
@ -571,7 +548,7 @@ CLASS lcl_2fa_github_authenticator IMPLEMENTATION.
|
|||
code = lv_http_code
|
||||
reason = lv_http_code_description ).
|
||||
IF lv_http_code <> 204.
|
||||
RAISE EXCEPTION TYPE lcx_2fa_token_del_failed
|
||||
RAISE EXCEPTION TYPE lcx_2fa_del_failed
|
||||
EXPORTING
|
||||
iv_error_text = |Could not delete token '{ <lv_id> }': | &&
|
||||
|{ lv_http_code } { lv_http_code_description }|.
|
||||
|
@ -651,7 +628,7 @@ CLASS lcl_2fa_github_authenticator IMPLEMENTATION.
|
|||
ENDCLASS.
|
||||
|
||||
"! Static registry class to find <em>LIF_2FA_AUTHENTICATOR</em> instances
|
||||
CLASS lcl_2fa_authenticator_registry DEFINITION
|
||||
CLASS lcl_2fa_auth_registry DEFINITION
|
||||
FINAL
|
||||
CREATE PRIVATE.
|
||||
|
||||
|
@ -689,7 +666,6 @@ CLASS lcl_2fa_authenticator_registry DEFINITION
|
|||
"! All authenticators managed by the registry
|
||||
gt_registered_authenticators TYPE HASHED TABLE OF REF TO lif_2fa_authenticator
|
||||
WITH UNIQUE KEY table_line READ-ONLY.
|
||||
PROTECTED SECTION.
|
||||
PRIVATE SECTION.
|
||||
CLASS-METHODS:
|
||||
popup_token
|
||||
|
@ -697,9 +673,9 @@ CLASS lcl_2fa_authenticator_registry DEFINITION
|
|||
RAISING lcx_exception.
|
||||
ENDCLASS.
|
||||
|
||||
CLASS lcl_2fa_authenticator_registry IMPLEMENTATION.
|
||||
CLASS lcl_2fa_auth_registry IMPLEMENTATION.
|
||||
METHOD class_constructor.
|
||||
DEFINE register.
|
||||
DEFINE _register.
|
||||
CREATE OBJECT li_authenticator TYPE &1.
|
||||
INSERT li_authenticator INTO TABLE gt_registered_authenticators.
|
||||
END-OF-DEFINITION.
|
||||
|
@ -709,7 +685,7 @@ CLASS lcl_2fa_authenticator_registry IMPLEMENTATION.
|
|||
" If there are new authenticators these need to be added here manually.
|
||||
" I do not think there is an equivalent to SEO_INTERFACE_IMPLEM_GET_ALL for local classes
|
||||
" without invoking the compiler directly.
|
||||
register: lcl_2fa_github_authenticator.
|
||||
_register: lcl_2fa_github_auth.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD get_authenticator_for_url.
|
||||
|
|
|
@ -6,7 +6,7 @@ CLASS lcl_gui DEFINITION DEFERRED.
|
|||
CLASS lcl_persistence_user DEFINITION DEFERRED.
|
||||
CLASS lcl_repo_srv DEFINITION DEFERRED.
|
||||
CLASS lcl_persistence_db DEFINITION DEFERRED.
|
||||
CLASS lcl_persistence_settings DEFINITION DEFERRED.
|
||||
CLASS lcl_persist_settings DEFINITION DEFERRED.
|
||||
|
||||
*----------------------------------------------------------------------*
|
||||
* CLASS lcl_app DEFINITION
|
||||
|
@ -14,9 +14,6 @@ CLASS lcl_persistence_settings DEFINITION DEFERRED.
|
|||
CLASS lcl_app DEFINITION FINAL.
|
||||
PUBLIC SECTION.
|
||||
|
||||
CLASS-METHODS run
|
||||
RAISING lcx_exception.
|
||||
|
||||
CLASS-METHODS gui
|
||||
RETURNING VALUE(ro_gui) TYPE REF TO lcl_gui
|
||||
RAISING lcx_exception.
|
||||
|
@ -33,13 +30,13 @@ CLASS lcl_app DEFINITION FINAL.
|
|||
RETURNING VALUE(ro_db) TYPE REF TO lcl_persistence_db.
|
||||
|
||||
CLASS-METHODS settings
|
||||
RETURNING VALUE(ro_settings) TYPE REF TO lcl_persistence_settings.
|
||||
RETURNING VALUE(ro_settings) TYPE REF TO lcl_persist_settings.
|
||||
|
||||
PRIVATE SECTION.
|
||||
CLASS-DATA: go_gui TYPE REF TO lcl_gui,
|
||||
go_current_user TYPE REF TO lcl_persistence_user,
|
||||
go_db TYPE REF TO lcl_persistence_db,
|
||||
go_repo_srv TYPE REF TO lcl_repo_srv,
|
||||
go_settings TYPE REF TO lcl_persistence_settings.
|
||||
go_settings TYPE REF TO lcl_persist_settings.
|
||||
|
||||
ENDCLASS. "lcl_app
|
||||
|
|
|
@ -7,17 +7,6 @@
|
|||
*----------------------------------------------------------------------*
|
||||
CLASS lcl_app IMPLEMENTATION.
|
||||
|
||||
METHOD run.
|
||||
|
||||
IF sy-batch = abap_true.
|
||||
lcl_background=>run( ).
|
||||
ELSE.
|
||||
gui( )->go_home( ).
|
||||
CALL SELECTION-SCREEN 1001. " trigger screen
|
||||
ENDIF.
|
||||
|
||||
ENDMETHOD. "run
|
||||
|
||||
METHOD gui.
|
||||
|
||||
IF go_gui IS NOT BOUND.
|
||||
|
|
52
src/zabapgit_authorizations.prog.abap
Normal file
|
@ -0,0 +1,52 @@
|
|||
*&---------------------------------------------------------------------*
|
||||
*& Include ZABAPGIT_AUTHORIZATIONS
|
||||
*&---------------------------------------------------------------------*
|
||||
|
||||
INTERFACE lif_auth.
|
||||
TYPES: ty_authorization TYPE string.
|
||||
|
||||
CONSTANTS: BEGIN OF gc_authorization,
|
||||
uninstall TYPE ty_authorization VALUE 'UNINSTALL',
|
||||
END OF gc_authorization.
|
||||
|
||||
METHODS:
|
||||
is_allowed
|
||||
IMPORTING iv_authorization TYPE ty_authorization
|
||||
iv_param TYPE string OPTIONAL
|
||||
RETURNING VALUE(rv_allowed) TYPE abap_bool.
|
||||
ENDINTERFACE.
|
||||
|
||||
* implement class LCL_AUTH_EXIT implementing LIF_AUTH in following include,
|
||||
* place the include in a different package than ZABAPGIT
|
||||
INCLUDE zabapgit_authorizations_exit IF FOUND.
|
||||
|
||||
*******************
|
||||
|
||||
CLASS lcl_auth DEFINITION FINAL.
|
||||
|
||||
PUBLIC SECTION.
|
||||
CLASS-METHODS:
|
||||
is_allowed
|
||||
IMPORTING iv_authorization TYPE lif_auth=>ty_authorization
|
||||
iv_param TYPE string OPTIONAL
|
||||
RETURNING VALUE(rv_allowed) TYPE abap_bool.
|
||||
|
||||
ENDCLASS.
|
||||
|
||||
CLASS lcl_auth IMPLEMENTATION.
|
||||
|
||||
METHOD is_allowed.
|
||||
|
||||
DATA: li_auth TYPE REF TO lif_auth.
|
||||
|
||||
TRY.
|
||||
CREATE OBJECT li_auth TYPE ('LCL_AUTH_EXIT').
|
||||
rv_allowed = li_auth->is_allowed( iv_authorization = iv_authorization
|
||||
iv_param = iv_param ).
|
||||
CATCH cx_sy_create_object_error.
|
||||
rv_allowed = abap_true.
|
||||
ENDTRY.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
ENDCLASS.
|
22
src/zabapgit_authorizations.prog.xml
Normal file
|
@ -0,0 +1,22 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
||||
<asx:values>
|
||||
<PROGDIR>
|
||||
<NAME>ZABAPGIT_AUTHORIZATIONS</NAME>
|
||||
<STATE>A</STATE>
|
||||
<VARCL>X</VARCL>
|
||||
<SUBC>I</SUBC>
|
||||
<RLOAD>E</RLOAD>
|
||||
<UCCHECK>X</UCCHECK>
|
||||
</PROGDIR>
|
||||
<TPOOL>
|
||||
<item>
|
||||
<ID>R</ID>
|
||||
<ENTRY>Include ZABAPGIT_AUTHORIZATIONS</ENTRY>
|
||||
<LENGTH>31</LENGTH>
|
||||
</item>
|
||||
</TPOOL>
|
||||
</asx:values>
|
||||
</asx:abap>
|
||||
</abapGit>
|
|
@ -12,15 +12,15 @@ CLASS lcl_background DEFINITION FINAL.
|
|||
PRIVATE SECTION.
|
||||
CLASS-METHODS:
|
||||
build_comment
|
||||
IMPORTING is_files TYPE ty_stage_files
|
||||
IMPORTING is_files TYPE lif_defs=>ty_stage_files
|
||||
RETURNING VALUE(rv_comment) TYPE string,
|
||||
push
|
||||
IMPORTING io_repo TYPE REF TO lcl_repo_online
|
||||
is_settings TYPE lcl_persistence_background=>ty_background
|
||||
is_settings TYPE lcl_persist_background=>ty_background
|
||||
RAISING lcx_exception,
|
||||
push_fixed
|
||||
IMPORTING io_repo TYPE REF TO lcl_repo_online
|
||||
is_settings TYPE lcl_persistence_background=>ty_background
|
||||
is_settings TYPE lcl_persist_background=>ty_background
|
||||
RAISING lcx_exception,
|
||||
push_auto
|
||||
IMPORTING io_repo TYPE REF TO lcl_repo_online
|
||||
|
@ -38,10 +38,10 @@ CLASS lcl_background IMPLEMENTATION.
|
|||
ENDIF.
|
||||
|
||||
CASE is_settings-amethod.
|
||||
WHEN lcl_persistence_background=>c_amethod-fixed.
|
||||
WHEN lcl_persist_background=>c_amethod-fixed.
|
||||
push_fixed( io_repo = io_repo
|
||||
is_settings = is_settings ).
|
||||
WHEN lcl_persistence_background=>c_amethod-auto.
|
||||
WHEN lcl_persist_background=>c_amethod-auto.
|
||||
push_auto( io_repo ).
|
||||
WHEN OTHERS.
|
||||
lcx_exception=>raise( 'unknown push method' ).
|
||||
|
@ -51,8 +51,8 @@ CLASS lcl_background IMPLEMENTATION.
|
|||
|
||||
METHOD push_fixed.
|
||||
|
||||
DATA: ls_comment TYPE ty_comment,
|
||||
ls_files TYPE ty_stage_files,
|
||||
DATA: ls_comment TYPE lif_defs=>ty_comment,
|
||||
ls_files TYPE lif_defs=>ty_stage_files,
|
||||
lo_stage TYPE REF TO lcl_stage.
|
||||
|
||||
FIELD-SYMBOLS: <ls_local> LIKE LINE OF ls_files-local.
|
||||
|
@ -105,7 +105,7 @@ CLASS lcl_background IMPLEMENTATION.
|
|||
ELSE.
|
||||
rv_comment = 'BG: Multiple objects'.
|
||||
LOOP AT lt_objects INTO lv_str.
|
||||
CONCATENATE rv_comment gc_newline lv_str INTO rv_comment.
|
||||
CONCATENATE rv_comment lif_defs=>gc_newline lv_str INTO rv_comment.
|
||||
ENDLOOP.
|
||||
ENDIF.
|
||||
|
||||
|
@ -113,8 +113,8 @@ CLASS lcl_background IMPLEMENTATION.
|
|||
|
||||
METHOD push_auto.
|
||||
|
||||
DATA: ls_comment TYPE ty_comment,
|
||||
ls_files TYPE ty_stage_files,
|
||||
DATA: ls_comment TYPE lif_defs=>ty_comment,
|
||||
ls_files TYPE lif_defs=>ty_stage_files,
|
||||
ls_user_files LIKE ls_files,
|
||||
lo_stage TYPE REF TO lcl_stage.
|
||||
|
||||
|
@ -171,9 +171,9 @@ CLASS lcl_background IMPLEMENTATION.
|
|||
|
||||
CONSTANTS: c_enq_type TYPE c LENGTH 12 VALUE 'BACKGROUND'.
|
||||
|
||||
DATA: lo_per TYPE REF TO lcl_persistence_background,
|
||||
DATA: lo_per TYPE REF TO lcl_persist_background,
|
||||
lo_repo TYPE REF TO lcl_repo_online,
|
||||
lt_list TYPE lcl_persistence_background=>tt_background,
|
||||
lt_list TYPE lcl_persist_background=>tt_background,
|
||||
lv_repo_name TYPE string.
|
||||
|
||||
FIELD-SYMBOLS: <ls_list> LIKE LINE OF lt_list.
|
||||
|
@ -209,9 +209,9 @@ CLASS lcl_background IMPLEMENTATION.
|
|||
iv_password = <ls_list>-password ).
|
||||
|
||||
CASE <ls_list>-method.
|
||||
WHEN lcl_persistence_background=>c_method-pull.
|
||||
WHEN lcl_persist_background=>c_method-pull.
|
||||
lo_repo->deserialize( ).
|
||||
WHEN lcl_persistence_background=>c_method-push.
|
||||
WHEN lcl_persist_background=>c_method-push.
|
||||
push( io_repo = lo_repo
|
||||
is_settings = <ls_list> ).
|
||||
WHEN OTHERS.
|
||||
|
|
|
@ -24,7 +24,7 @@ img { border: 0px; vertical-align: middle; }
|
|||
table { border-collapse: collapse; }
|
||||
pre { display: inline; }
|
||||
sup {
|
||||
vertical-align: baseline;
|
||||
vertical-align: top;
|
||||
position: relative;
|
||||
top: -0.5em;
|
||||
font-size: 75%;
|
||||
|
@ -42,6 +42,7 @@ input:focus, textarea:focus {
|
|||
/* COLOR PALETTE */
|
||||
.grey { color: lightgrey !important; }
|
||||
.grey70 { color: #b3b3b3 !important; }
|
||||
.grey80 { color: #ccc !important; }
|
||||
.bgorange { background-color: orange; }
|
||||
.darkgrey { color: #808080 !important; }
|
||||
.attention { color: red !important; }
|
||||
|
@ -49,6 +50,7 @@ input:focus, textarea:focus {
|
|||
.warning { color: #efb301 !important; }
|
||||
.blue { color: #5e8dc9 !important; }
|
||||
.red { color: red !important; }
|
||||
.white { color: white !important; }
|
||||
|
||||
/* MODIFIERS */
|
||||
.emphasis { font-weight: bold !important; }
|
||||
|
@ -62,6 +64,8 @@ input:focus, textarea:focus {
|
|||
.pad4px { padding: 4px; }
|
||||
.w100 { width: 100%; }
|
||||
.w40 { width: 40%; }
|
||||
.float-right { float: right; }
|
||||
.pad-right { padding-right: 6px; }
|
||||
|
||||
/* STRUCTURE DIVS, HEADER & FOOTER */
|
||||
div#header {
|
||||
|
@ -126,6 +130,7 @@ div.repo {
|
|||
margin-top: 3px;
|
||||
background-color: #f2f2f2;
|
||||
padding: 0.5em 1em 0.5em 1em;
|
||||
position: relative;
|
||||
}
|
||||
.repo_name span.name {
|
||||
font-weight: bold;
|
||||
|
@ -532,8 +537,8 @@ table.db_tab th {
|
|||
}
|
||||
table.db_tab td {
|
||||
color: #333;
|
||||
padding: 0.5em;
|
||||
vertical-align: top;
|
||||
padding: 4px 8px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
table.db_tab td.data {
|
||||
color: #888;
|
||||
|
@ -742,3 +747,70 @@ div.tutorial h2 {
|
|||
}
|
||||
.nav-container ul ul li.separator:first-child { border-top: none; }
|
||||
.nav-container ul ul li.separator:hover { background-color: inherit; }
|
||||
|
||||
/* News Announcement */
|
||||
|
||||
div.news {
|
||||
position: absolute;
|
||||
z-index: 99;
|
||||
top: 36px;
|
||||
left: 50%;
|
||||
width: 40em;
|
||||
margin-left: -20em;
|
||||
background-color: white;
|
||||
box-shadow: 1px 1px 3px 2px #dcdcdc;
|
||||
}
|
||||
|
||||
div.news div.headbar {
|
||||
text-transform: uppercase;
|
||||
font-size: small;
|
||||
padding: 4px 6px;
|
||||
}
|
||||
|
||||
div.news div.title {
|
||||
color: #f8f8f8;
|
||||
background-color: #888;
|
||||
}
|
||||
|
||||
div.news div.title a.close-btn {
|
||||
color: #d8d8d8;
|
||||
padding-left: 12px;
|
||||
padding-right: 2px;
|
||||
position: relative;
|
||||
bottom: 1px;
|
||||
}
|
||||
|
||||
div.news div.important { color: #aaa; }
|
||||
div.news div.newslist {
|
||||
padding: 0.5em 0.7em;
|
||||
color: #444;
|
||||
}
|
||||
|
||||
div.news li {
|
||||
padding-left: 10px;
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
div.news h1:first-child { margin: auto; }
|
||||
div.news h1 {
|
||||
font-size: inherit;
|
||||
padding: 6px 4px;
|
||||
margin: 4px auto auto;
|
||||
text-decoration: underline;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
div.news .version-marker {
|
||||
color: white;
|
||||
display: inline-block;
|
||||
margin-left: 20px;
|
||||
border-radius: 3px;
|
||||
padding: 0px 6px;
|
||||
border: #c0c0c0 1px solid;
|
||||
background-color: #ccc;
|
||||
}
|
||||
|
||||
div.news .update {
|
||||
border: #e8ba30 1px solid;
|
||||
background-color: #f5c538;
|
||||
}
|
||||
|
|
|
@ -4,247 +4,255 @@
|
|||
|
||||
TYPE-POOLS seop.
|
||||
|
||||
TYPES: ty_type TYPE c LENGTH 6,
|
||||
ty_bitbyte TYPE c LENGTH 8,
|
||||
ty_sha1 TYPE c LENGTH 40.
|
||||
INTERFACE lif_defs.
|
||||
|
||||
TYPES: BEGIN OF ty_file_signature,
|
||||
path TYPE string,
|
||||
filename TYPE string,
|
||||
sha1 TYPE ty_sha1,
|
||||
END OF ty_file_signature.
|
||||
CONSTANTS: gc_xml_version TYPE string VALUE 'v1.0.0', "#EC NOTEXT
|
||||
gc_abap_version TYPE string VALUE 'v1.37.2'. "#EC NOTEXT
|
||||
|
||||
TYPES: ty_file_signatures_tt TYPE STANDARD TABLE OF
|
||||
ty_file_signature WITH DEFAULT KEY.
|
||||
TYPES: ty_type TYPE c LENGTH 6,
|
||||
ty_bitbyte TYPE c LENGTH 8,
|
||||
ty_sha1 TYPE c LENGTH 40.
|
||||
|
||||
TYPES: ty_file_signatures_ts TYPE SORTED TABLE OF
|
||||
ty_file_signature WITH UNIQUE KEY path filename.
|
||||
TYPES: BEGIN OF ty_file_signature,
|
||||
path TYPE string,
|
||||
filename TYPE string,
|
||||
sha1 TYPE lif_defs=>ty_sha1,
|
||||
END OF ty_file_signature.
|
||||
|
||||
TYPES: BEGIN OF ty_file.
|
||||
INCLUDE TYPE ty_file_signature.
|
||||
TYPES: data TYPE xstring,
|
||||
END OF ty_file.
|
||||
TYPES: ty_files_tt TYPE STANDARD TABLE OF ty_file WITH DEFAULT KEY.
|
||||
TYPES: ty_file_signatures_tt TYPE STANDARD TABLE OF
|
||||
ty_file_signature WITH DEFAULT KEY.
|
||||
|
||||
TYPES: ty_string_tt TYPE STANDARD TABLE OF string WITH DEFAULT KEY.
|
||||
TYPES: ty_file_signatures_ts TYPE SORTED TABLE OF
|
||||
ty_file_signature WITH UNIQUE KEY path filename.
|
||||
|
||||
TYPES:
|
||||
BEGIN OF ty_git_user,
|
||||
name TYPE string,
|
||||
email TYPE string,
|
||||
END OF ty_git_user.
|
||||
TYPES: BEGIN OF ty_file.
|
||||
INCLUDE TYPE ty_file_signature.
|
||||
TYPES: data TYPE xstring,
|
||||
END OF ty_file.
|
||||
TYPES: ty_files_tt TYPE STANDARD TABLE OF ty_file WITH DEFAULT KEY.
|
||||
|
||||
TYPES:
|
||||
BEGIN OF ty_comment,
|
||||
committer TYPE ty_git_user,
|
||||
author TYPE ty_git_user,
|
||||
comment TYPE string,
|
||||
END OF ty_comment.
|
||||
TYPES: ty_string_tt TYPE STANDARD TABLE OF string WITH DEFAULT KEY.
|
||||
|
||||
TYPES: BEGIN OF ty_item,
|
||||
obj_type TYPE tadir-object,
|
||||
obj_name TYPE tadir-obj_name,
|
||||
devclass TYPE devclass,
|
||||
END OF ty_item,
|
||||
ty_items_tt TYPE STANDARD TABLE OF ty_item WITH DEFAULT KEY,
|
||||
ty_items_ts TYPE SORTED TABLE OF ty_item WITH UNIQUE KEY obj_type obj_name.
|
||||
TYPES:
|
||||
BEGIN OF ty_git_user,
|
||||
name TYPE string,
|
||||
email TYPE string,
|
||||
END OF ty_git_user.
|
||||
|
||||
TYPES: BEGIN OF ty_file_item,
|
||||
file TYPE ty_file,
|
||||
item TYPE ty_item,
|
||||
END OF ty_file_item.
|
||||
TYPES: ty_files_item_tt TYPE STANDARD TABLE OF ty_file_item WITH DEFAULT KEY.
|
||||
TYPES:
|
||||
BEGIN OF ty_comment,
|
||||
committer TYPE ty_git_user,
|
||||
author TYPE ty_git_user,
|
||||
comment TYPE string,
|
||||
END OF ty_comment.
|
||||
|
||||
TYPES: BEGIN OF ty_metadata,
|
||||
class TYPE string,
|
||||
version TYPE string,
|
||||
late_deser TYPE abap_bool,
|
||||
delete_tadir TYPE abap_bool,
|
||||
ddic TYPE abap_bool,
|
||||
END OF ty_metadata.
|
||||
TYPES: BEGIN OF ty_item,
|
||||
obj_type TYPE tadir-object,
|
||||
obj_name TYPE tadir-obj_name,
|
||||
devclass TYPE devclass,
|
||||
END OF ty_item,
|
||||
ty_items_tt TYPE STANDARD TABLE OF ty_item WITH DEFAULT KEY,
|
||||
ty_items_ts TYPE SORTED TABLE OF ty_item WITH UNIQUE KEY obj_type obj_name.
|
||||
|
||||
TYPES: BEGIN OF ty_web_asset,
|
||||
url TYPE w3url,
|
||||
base64 TYPE string,
|
||||
content TYPE xstring,
|
||||
END OF ty_web_asset.
|
||||
TYPES tt_web_assets TYPE STANDARD TABLE OF ty_web_asset WITH DEFAULT KEY.
|
||||
TYPES: BEGIN OF ty_file_item,
|
||||
file TYPE lif_defs=>ty_file,
|
||||
item TYPE ty_item,
|
||||
END OF ty_file_item.
|
||||
TYPES: ty_files_item_tt TYPE STANDARD TABLE OF ty_file_item WITH DEFAULT KEY.
|
||||
|
||||
TYPES: BEGIN OF ty_repo_file,
|
||||
path TYPE string,
|
||||
filename TYPE string,
|
||||
is_changed TYPE abap_bool,
|
||||
rstate TYPE char1,
|
||||
lstate TYPE char1,
|
||||
END OF ty_repo_file.
|
||||
TYPES tt_repo_files TYPE STANDARD TABLE OF ty_repo_file WITH DEFAULT KEY.
|
||||
TYPES: BEGIN OF ty_metadata,
|
||||
class TYPE string,
|
||||
version TYPE string,
|
||||
late_deser TYPE abap_bool,
|
||||
delete_tadir TYPE abap_bool,
|
||||
ddic TYPE abap_bool,
|
||||
END OF ty_metadata.
|
||||
|
||||
TYPES: BEGIN OF ty_stage_files,
|
||||
local TYPE ty_files_item_tt,
|
||||
remote TYPE ty_files_tt,
|
||||
END OF ty_stage_files.
|
||||
TYPES: BEGIN OF ty_web_asset,
|
||||
url TYPE w3url,
|
||||
base64 TYPE string,
|
||||
content TYPE xstring,
|
||||
END OF ty_web_asset.
|
||||
TYPES tt_web_assets TYPE STANDARD TABLE OF ty_web_asset WITH DEFAULT KEY.
|
||||
|
||||
CONSTANTS: BEGIN OF gc_type,
|
||||
commit TYPE ty_type VALUE 'commit', "#EC NOTEXT
|
||||
tree TYPE ty_type VALUE 'tree', "#EC NOTEXT
|
||||
ref_d TYPE ty_type VALUE 'ref_d', "#EC NOTEXT
|
||||
blob TYPE ty_type VALUE 'blob', "#EC NOTEXT
|
||||
END OF gc_type.
|
||||
TYPES: BEGIN OF ty_repo_file,
|
||||
path TYPE string,
|
||||
filename TYPE string,
|
||||
is_changed TYPE abap_bool,
|
||||
rstate TYPE char1,
|
||||
lstate TYPE char1,
|
||||
END OF ty_repo_file.
|
||||
TYPES tt_repo_files TYPE STANDARD TABLE OF ty_repo_file WITH DEFAULT KEY.
|
||||
|
||||
TYPES: ty_chmod TYPE c LENGTH 6.
|
||||
TYPES: BEGIN OF ty_stage_files,
|
||||
local TYPE lif_defs=>ty_files_item_tt,
|
||||
remote TYPE lif_defs=>ty_files_tt,
|
||||
END OF ty_stage_files.
|
||||
|
||||
TYPES: BEGIN OF ty_object,
|
||||
sha1 TYPE ty_sha1,
|
||||
type TYPE ty_type,
|
||||
data TYPE xstring,
|
||||
END OF ty_object.
|
||||
TYPES: ty_objects_tt TYPE STANDARD TABLE OF ty_object WITH DEFAULT KEY.
|
||||
CONSTANTS: BEGIN OF gc_type,
|
||||
commit TYPE lif_defs=>ty_type VALUE 'commit', "#EC NOTEXT
|
||||
tree TYPE lif_defs=>ty_type VALUE 'tree', "#EC NOTEXT
|
||||
ref_d TYPE lif_defs=>ty_type VALUE 'ref_d', "#EC NOTEXT
|
||||
blob TYPE lif_defs=>ty_type VALUE 'blob', "#EC NOTEXT
|
||||
END OF gc_type.
|
||||
|
||||
TYPES: BEGIN OF ty_tadir,
|
||||
pgmid TYPE tadir-pgmid,
|
||||
object TYPE tadir-object,
|
||||
obj_name TYPE tadir-obj_name,
|
||||
devclass TYPE tadir-devclass,
|
||||
korrnum TYPE tadir-korrnum,
|
||||
path TYPE string,
|
||||
END OF ty_tadir.
|
||||
TYPES: ty_tadir_tt TYPE STANDARD TABLE OF ty_tadir WITH DEFAULT KEY.
|
||||
TYPES: ty_chmod TYPE c LENGTH 6.
|
||||
|
||||
TYPES: BEGIN OF ty_result,
|
||||
obj_type TYPE tadir-object,
|
||||
obj_name TYPE tadir-obj_name,
|
||||
path TYPE string,
|
||||
filename TYPE string,
|
||||
package TYPE devclass,
|
||||
match TYPE sap_bool,
|
||||
lstate TYPE char1,
|
||||
rstate TYPE char1,
|
||||
END OF ty_result.
|
||||
TYPES: ty_results_tt TYPE STANDARD TABLE OF ty_result WITH DEFAULT KEY.
|
||||
TYPES: BEGIN OF ty_object,
|
||||
sha1 TYPE lif_defs=>ty_sha1,
|
||||
type TYPE lif_defs=>ty_type,
|
||||
data TYPE xstring,
|
||||
END OF ty_object.
|
||||
TYPES: ty_objects_tt TYPE STANDARD TABLE OF ty_object WITH DEFAULT KEY.
|
||||
|
||||
TYPES: ty_sval_tt TYPE STANDARD TABLE OF sval WITH DEFAULT KEY.
|
||||
TYPES: BEGIN OF ty_tadir,
|
||||
pgmid TYPE tadir-pgmid,
|
||||
object TYPE tadir-object,
|
||||
obj_name TYPE tadir-obj_name,
|
||||
devclass TYPE tadir-devclass,
|
||||
korrnum TYPE tadir-korrnum,
|
||||
path TYPE string,
|
||||
END OF ty_tadir.
|
||||
TYPES: ty_tadir_tt TYPE STANDARD TABLE OF ty_tadir WITH DEFAULT KEY.
|
||||
|
||||
TYPES: ty_seocompotx_tt TYPE STANDARD TABLE OF seocompotx WITH DEFAULT KEY.
|
||||
TYPES: BEGIN OF ty_result,
|
||||
obj_type TYPE tadir-object,
|
||||
obj_name TYPE tadir-obj_name,
|
||||
path TYPE string,
|
||||
filename TYPE string,
|
||||
package TYPE devclass,
|
||||
match TYPE sap_bool,
|
||||
lstate TYPE char1,
|
||||
rstate TYPE char1,
|
||||
END OF ty_result.
|
||||
TYPES: ty_results_tt TYPE STANDARD TABLE OF ty_result WITH DEFAULT KEY.
|
||||
|
||||
TYPES: BEGIN OF ty_tpool.
|
||||
INCLUDE TYPE textpool.
|
||||
TYPES: split TYPE c LENGTH 8.
|
||||
TYPES: END OF ty_tpool.
|
||||
TYPES: ty_sval_tt TYPE STANDARD TABLE OF sval WITH DEFAULT KEY.
|
||||
|
||||
TYPES: ty_tpool_tt TYPE STANDARD TABLE OF ty_tpool WITH DEFAULT KEY.
|
||||
TYPES: ty_seocompotx_tt TYPE STANDARD TABLE OF seocompotx WITH DEFAULT KEY.
|
||||
|
||||
TYPES: BEGIN OF ty_sotr,
|
||||
header TYPE sotr_head,
|
||||
entries TYPE sotr_text_tt,
|
||||
END OF ty_sotr.
|
||||
TYPES: BEGIN OF ty_tpool.
|
||||
INCLUDE TYPE textpool.
|
||||
TYPES: split TYPE c LENGTH 8.
|
||||
TYPES: END OF ty_tpool.
|
||||
|
||||
TYPES: ty_sotr_tt TYPE STANDARD TABLE OF ty_sotr WITH DEFAULT KEY.
|
||||
TYPES: ty_tpool_tt TYPE STANDARD TABLE OF ty_tpool WITH DEFAULT KEY.
|
||||
|
||||
TYPES:
|
||||
BEGIN OF ty_transport_to_branch,
|
||||
branch_name TYPE string,
|
||||
commit_text TYPE string,
|
||||
END OF ty_transport_to_branch.
|
||||
TYPES: BEGIN OF ty_sotr,
|
||||
header TYPE sotr_head,
|
||||
entries TYPE sotr_text_tt,
|
||||
END OF ty_sotr.
|
||||
|
||||
CONSTANTS: BEGIN OF gc_state, " https://git-scm.com/docs/git-status
|
||||
unchanged TYPE char1 VALUE '',
|
||||
added TYPE char1 VALUE 'A',
|
||||
modified TYPE char1 VALUE 'M',
|
||||
deleted TYPE char1 VALUE 'D', "For future use
|
||||
mixed TYPE char1 VALUE '*',
|
||||
END OF gc_state.
|
||||
TYPES: ty_sotr_tt TYPE STANDARD TABLE OF ty_sotr WITH DEFAULT KEY.
|
||||
|
||||
CONSTANTS: BEGIN OF gc_chmod,
|
||||
file TYPE ty_chmod VALUE '100644',
|
||||
executable TYPE ty_chmod VALUE '100755',
|
||||
dir TYPE ty_chmod VALUE '40000 ',
|
||||
END OF gc_chmod.
|
||||
TYPES:
|
||||
BEGIN OF ty_transport_to_branch,
|
||||
branch_name TYPE string,
|
||||
commit_text TYPE string,
|
||||
END OF ty_transport_to_branch.
|
||||
|
||||
CONSTANTS: BEGIN OF gc_event_state,
|
||||
not_handled VALUE 0,
|
||||
re_render VALUE 1,
|
||||
new_page VALUE 2,
|
||||
go_back VALUE 3,
|
||||
no_more_act VALUE 4,
|
||||
new_page_w_bookmark VALUE 5,
|
||||
go_back_to_bookmark VALUE 6,
|
||||
new_page_replacing VALUE 7,
|
||||
END OF gc_event_state.
|
||||
CONSTANTS: BEGIN OF gc_state, " https://git-scm.com/docs/git-status
|
||||
unchanged TYPE char1 VALUE '',
|
||||
added TYPE char1 VALUE 'A',
|
||||
modified TYPE char1 VALUE 'M',
|
||||
deleted TYPE char1 VALUE 'D', "For future use
|
||||
mixed TYPE char1 VALUE '*',
|
||||
END OF gc_state.
|
||||
|
||||
CONSTANTS: BEGIN OF gc_html_opt,
|
||||
strong TYPE c VALUE 'E',
|
||||
cancel TYPE c VALUE 'C',
|
||||
crossout TYPE c VALUE 'X',
|
||||
END OF gc_html_opt.
|
||||
CONSTANTS: BEGIN OF gc_chmod,
|
||||
file TYPE ty_chmod VALUE '100644',
|
||||
executable TYPE ty_chmod VALUE '100755',
|
||||
dir TYPE ty_chmod VALUE '40000 ',
|
||||
END OF gc_chmod.
|
||||
|
||||
CONSTANTS: BEGIN OF gc_action_type,
|
||||
sapevent TYPE c VALUE 'E',
|
||||
url TYPE c VALUE 'U',
|
||||
onclick TYPE c VALUE 'C',
|
||||
separator TYPE c VALUE 'S',
|
||||
dummy TYPE c VALUE '_',
|
||||
END OF gc_action_type.
|
||||
CONSTANTS: BEGIN OF gc_event_state,
|
||||
not_handled VALUE 0,
|
||||
re_render VALUE 1,
|
||||
new_page VALUE 2,
|
||||
go_back VALUE 3,
|
||||
no_more_act VALUE 4,
|
||||
new_page_w_bookmark VALUE 5,
|
||||
go_back_to_bookmark VALUE 6,
|
||||
new_page_replacing VALUE 7,
|
||||
END OF gc_event_state.
|
||||
|
||||
CONSTANTS: gc_newline TYPE abap_char1 VALUE cl_abap_char_utilities=>newline.
|
||||
CONSTANTS: BEGIN OF gc_html_opt,
|
||||
strong TYPE c VALUE 'E',
|
||||
cancel TYPE c VALUE 'C',
|
||||
crossout TYPE c VALUE 'X',
|
||||
END OF gc_html_opt.
|
||||
|
||||
CONSTANTS: gc_english TYPE spras VALUE 'E'.
|
||||
CONSTANTS: BEGIN OF gc_action_type,
|
||||
sapevent TYPE c VALUE 'E',
|
||||
url TYPE c VALUE 'U',
|
||||
onclick TYPE c VALUE 'C',
|
||||
separator TYPE c VALUE 'S',
|
||||
dummy TYPE c VALUE '_',
|
||||
END OF gc_action_type.
|
||||
|
||||
CONSTANTS: gc_root_dir TYPE string VALUE '/',
|
||||
gc_dot_abapgit TYPE string VALUE '.abapgit.xml' ##NO_TEXT,
|
||||
gc_author_regex TYPE string VALUE '^([\w\s\.@\-_1-9]+) <(.*)> (\d{10}) .\d{4}$' ##NO_TEXT.
|
||||
CONSTANTS: gc_crlf TYPE abap_cr_lf VALUE cl_abap_char_utilities=>cr_lf.
|
||||
CONSTANTS: gc_newline TYPE abap_char1 VALUE cl_abap_char_utilities=>newline.
|
||||
|
||||
CONSTANTS: BEGIN OF gc_action,
|
||||
repo_clone TYPE string VALUE 'repo_clone',
|
||||
repo_refresh TYPE string VALUE 'repo_refresh',
|
||||
repo_remove TYPE string VALUE 'repo_remove',
|
||||
repo_settings TYPE string VALUE 'repo_settings',
|
||||
repo_purge TYPE string VALUE 'repo_purge',
|
||||
repo_newoffline TYPE string VALUE 'repo_newoffline',
|
||||
repo_remote_attach TYPE string VALUE 'repo_remote_attach',
|
||||
repo_remote_detach TYPE string VALUE 'repo_remote_detach',
|
||||
repo_remote_change TYPE string VALUE 'repo_remote_change',
|
||||
repo_refresh_checksums TYPE string VALUE 'repo_refresh_checksums',
|
||||
repo_toggle_fav TYPE string VALUE 'repo_toggle_fav',
|
||||
repo_transport_to_branch TYPE string VALUE 'repo_transport_to_branch',
|
||||
CONSTANTS: gc_english TYPE spras VALUE 'E'.
|
||||
|
||||
abapgit_home TYPE string VALUE 'abapgit_home',
|
||||
abapgit_wiki TYPE string VALUE 'abapgit_wiki',
|
||||
abapgit_install TYPE string VALUE 'abapgit_install',
|
||||
abapgit_install_pi TYPE string VALUE 'abapgit_install_pi',
|
||||
CONSTANTS: gc_root_dir TYPE string VALUE '/',
|
||||
gc_dot_abapgit TYPE string VALUE '.abapgit.xml' ##NO_TEXT,
|
||||
gc_author_regex TYPE string VALUE '^([\w\s\.@\-_1-9]+) <(.*)> (\d{10})\s?.\d{4}$' ##NO_TEXT.
|
||||
|
||||
zip_import TYPE string VALUE 'zip_import',
|
||||
zip_export TYPE string VALUE 'zip_export',
|
||||
zip_package TYPE string VALUE 'zip_package',
|
||||
zip_transport TYPE string VALUE 'zip_transport',
|
||||
zip_object TYPE string VALUE 'zip_object',
|
||||
CONSTANTS: BEGIN OF gc_action,
|
||||
repo_clone TYPE string VALUE 'repo_clone',
|
||||
repo_refresh TYPE string VALUE 'repo_refresh',
|
||||
repo_remove TYPE string VALUE 'repo_remove',
|
||||
repo_settings TYPE string VALUE 'repo_settings',
|
||||
repo_purge TYPE string VALUE 'repo_purge',
|
||||
repo_newoffline TYPE string VALUE 'repo_newoffline',
|
||||
repo_remote_attach TYPE string VALUE 'repo_remote_attach',
|
||||
repo_remote_detach TYPE string VALUE 'repo_remote_detach',
|
||||
repo_remote_change TYPE string VALUE 'repo_remote_change',
|
||||
repo_refresh_checksums TYPE string VALUE 'repo_refresh_checksums',
|
||||
repo_toggle_fav TYPE string VALUE 'repo_toggle_fav',
|
||||
repo_transport_to_branch TYPE string VALUE 'repo_transport_to_branch',
|
||||
|
||||
git_pull TYPE string VALUE 'git_pull',
|
||||
git_reset TYPE string VALUE 'git_reset',
|
||||
git_branch_create TYPE string VALUE 'git_branch_create',
|
||||
git_branch_switch TYPE string VALUE 'git_branch_switch',
|
||||
git_branch_delete TYPE string VALUE 'git_branch_delete',
|
||||
git_commit TYPE string VALUE 'git_commit',
|
||||
abapgit_home TYPE string VALUE 'abapgit_home',
|
||||
abapgit_wiki TYPE string VALUE 'abapgit_wiki',
|
||||
abapgit_install TYPE string VALUE 'abapgit_install',
|
||||
abapgit_install_pi TYPE string VALUE 'abapgit_install_pi',
|
||||
|
||||
db_delete TYPE string VALUE 'db_delete',
|
||||
db_update TYPE string VALUE 'db_update',
|
||||
db_display TYPE string VALUE 'db_display',
|
||||
db_edit TYPE string VALUE 'db_edit',
|
||||
bg_update TYPE string VALUE 'bg_update',
|
||||
zip_import TYPE string VALUE 'zip_import',
|
||||
zip_export TYPE string VALUE 'zip_export',
|
||||
zip_package TYPE string VALUE 'zip_package',
|
||||
zip_transport TYPE string VALUE 'zip_transport',
|
||||
zip_object TYPE string VALUE 'zip_object',
|
||||
|
||||
go_main TYPE string VALUE 'go_main',
|
||||
go_explore TYPE string VALUE 'go_explore',
|
||||
go_db TYPE string VALUE 'go_db',
|
||||
go_background TYPE string VALUE 'go_background',
|
||||
go_background_run TYPE string VALUE 'go_background_run',
|
||||
go_diff TYPE string VALUE 'go_diff',
|
||||
go_stage TYPE string VALUE 'go_stage',
|
||||
go_commit TYPE string VALUE 'go_commit',
|
||||
go_branch_overview TYPE string VALUE 'go_branch_overview',
|
||||
go_playground TYPE string VALUE 'go_playground',
|
||||
go_debuginfo TYPE string VALUE 'go_debuginfo',
|
||||
go_settings TYPE string VALUE 'go_settings',
|
||||
go_tutorial TYPE string VALUE 'go_tutorial',
|
||||
git_pull TYPE string VALUE 'git_pull',
|
||||
git_reset TYPE string VALUE 'git_reset',
|
||||
git_branch_create TYPE string VALUE 'git_branch_create',
|
||||
git_branch_switch TYPE string VALUE 'git_branch_switch',
|
||||
git_branch_delete TYPE string VALUE 'git_branch_delete',
|
||||
git_commit TYPE string VALUE 'git_commit',
|
||||
|
||||
jump TYPE string VALUE 'jump',
|
||||
jump_pkg TYPE string VALUE 'jump_pkg',
|
||||
END OF gc_action.
|
||||
db_delete TYPE string VALUE 'db_delete',
|
||||
db_update TYPE string VALUE 'db_update',
|
||||
db_display TYPE string VALUE 'db_display',
|
||||
db_edit TYPE string VALUE 'db_edit',
|
||||
bg_update TYPE string VALUE 'bg_update',
|
||||
|
||||
go_main TYPE string VALUE 'go_main',
|
||||
go_explore TYPE string VALUE 'go_explore',
|
||||
go_db TYPE string VALUE 'go_db',
|
||||
go_background TYPE string VALUE 'go_background',
|
||||
go_background_run TYPE string VALUE 'go_background_run',
|
||||
go_diff TYPE string VALUE 'go_diff',
|
||||
go_stage TYPE string VALUE 'go_stage',
|
||||
go_commit TYPE string VALUE 'go_commit',
|
||||
go_branch_overview TYPE string VALUE 'go_branch_overview',
|
||||
go_playground TYPE string VALUE 'go_playground',
|
||||
go_debuginfo TYPE string VALUE 'go_debuginfo',
|
||||
go_settings TYPE string VALUE 'go_settings',
|
||||
go_tutorial TYPE string VALUE 'go_tutorial',
|
||||
|
||||
jump TYPE string VALUE 'jump',
|
||||
jump_pkg TYPE string VALUE 'jump_pkg',
|
||||
END OF gc_action.
|
||||
|
||||
ENDINTERFACE.
|
||||
|
|
|
@ -15,7 +15,7 @@ CLASS lcl_dot_abapgit DEFINITION FINAL FRIENDS ltcl_dot_abapgit.
|
|||
TYPES: BEGIN OF ty_requirement,
|
||||
component TYPE dlvunit,
|
||||
min_release TYPE saprelease,
|
||||
min_patch TYPE sappatchlv,
|
||||
min_patch TYPE sappatchlv,
|
||||
END OF ty_requirement,
|
||||
ty_requirement_tt TYPE STANDARD TABLE OF ty_requirement WITH DEFAULT KEY,
|
||||
BEGIN OF ty_dot_abapgit,
|
||||
|
@ -65,7 +65,7 @@ CLASS lcl_dot_abapgit DEFINITION FINAL FRIENDS ltcl_dot_abapgit.
|
|||
* set_master_language
|
||||
* IMPORTING iv_language TYPE spras,
|
||||
get_signature
|
||||
RETURNING VALUE(rs_signature) TYPE ty_file_signature
|
||||
RETURNING VALUE(rs_signature) TYPE lif_defs=>ty_file_signature
|
||||
RAISING lcx_exception.
|
||||
|
||||
PRIVATE SECTION.
|
||||
|
@ -199,14 +199,26 @@ CLASS lcl_dot_abapgit IMPLEMENTATION.
|
|||
|
||||
METHOD is_ignored.
|
||||
|
||||
DATA: lv_name TYPE string,
|
||||
lv_ignore TYPE string.
|
||||
DATA: lv_name TYPE string,
|
||||
lv_starting TYPE string,
|
||||
lv_dot TYPE string,
|
||||
lv_count TYPE i,
|
||||
lv_ignore TYPE string.
|
||||
|
||||
|
||||
lv_name = iv_path && iv_filename.
|
||||
|
||||
CONCATENATE ms_data-starting_folder '*' INTO lv_starting.
|
||||
CONCATENATE '/' lif_defs=>gc_dot_abapgit INTO lv_dot.
|
||||
|
||||
LOOP AT ms_data-ignore INTO lv_ignore.
|
||||
IF lv_name CP lv_ignore.
|
||||
FIND ALL OCCURRENCES OF '/' IN lv_name MATCH COUNT lv_count.
|
||||
|
||||
IF lv_name CP lv_ignore
|
||||
OR ( ms_data-starting_folder <> '/'
|
||||
AND lv_count > 1
|
||||
AND NOT lv_name CP lv_starting
|
||||
AND NOT lv_name = lv_dot ).
|
||||
rv_ignored = abap_true.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
|
@ -245,15 +257,11 @@ CLASS lcl_dot_abapgit IMPLEMENTATION.
|
|||
rv_language = ms_data-master_language.
|
||||
ENDMETHOD.
|
||||
|
||||
* METHOD set_master_language.
|
||||
* ms_data-master_language = iv_language.
|
||||
* ENDMETHOD.
|
||||
|
||||
METHOD get_signature.
|
||||
|
||||
rs_signature-path = gc_root_dir.
|
||||
rs_signature-filename = gc_dot_abapgit.
|
||||
rs_signature-sha1 = lcl_hash=>sha1( iv_type = gc_type-blob
|
||||
rs_signature-path = lif_defs=>gc_root_dir.
|
||||
rs_signature-filename = lif_defs=>gc_dot_abapgit.
|
||||
rs_signature-sha1 = lcl_hash=>sha1( iv_type = lif_defs=>gc_type-blob
|
||||
iv_data = serialize( ) ).
|
||||
|
||||
ENDMETHOD. "get_signature
|
||||
|
|
|
@ -16,7 +16,7 @@ CLASS lcl_file_status DEFINITION FINAL
|
|||
CLASS-METHODS status
|
||||
IMPORTING io_repo TYPE REF TO lcl_repo
|
||||
io_log TYPE REF TO lcl_log OPTIONAL
|
||||
RETURNING VALUE(rt_results) TYPE ty_results_tt
|
||||
RETURNING VALUE(rt_results) TYPE lif_defs=>ty_results_tt
|
||||
RAISING lcx_exception.
|
||||
|
||||
PRIVATE SECTION.
|
||||
|
@ -24,33 +24,33 @@ CLASS lcl_file_status DEFINITION FINAL
|
|||
CLASS-METHODS:
|
||||
calculate_status
|
||||
IMPORTING iv_devclass TYPE devclass
|
||||
it_local TYPE ty_files_item_tt
|
||||
it_remote TYPE ty_files_tt
|
||||
it_cur_state TYPE ty_file_signatures_tt
|
||||
RETURNING VALUE(rt_results) TYPE ty_results_tt,
|
||||
it_local TYPE lif_defs=>ty_files_item_tt
|
||||
it_remote TYPE lif_defs=>ty_files_tt
|
||||
it_cur_state TYPE lif_defs=>ty_file_signatures_tt
|
||||
RETURNING VALUE(rt_results) TYPE lif_defs=>ty_results_tt,
|
||||
run_checks
|
||||
IMPORTING io_log TYPE REF TO lcl_log
|
||||
it_results TYPE ty_results_tt
|
||||
it_results TYPE lif_defs=>ty_results_tt
|
||||
io_dot TYPE REF TO lcl_dot_abapgit
|
||||
iv_top TYPE devclass
|
||||
RAISING lcx_exception,
|
||||
build_existing
|
||||
IMPORTING is_local TYPE ty_file_item
|
||||
is_remote TYPE ty_file
|
||||
it_state TYPE ty_file_signatures_ts
|
||||
RETURNING VALUE(rs_result) TYPE ty_result,
|
||||
IMPORTING is_local TYPE lif_defs=>ty_file_item
|
||||
is_remote TYPE lif_defs=>ty_file
|
||||
it_state TYPE lif_defs=>ty_file_signatures_ts
|
||||
RETURNING VALUE(rs_result) TYPE lif_defs=>ty_result,
|
||||
build_new_local
|
||||
IMPORTING is_local TYPE ty_file_item
|
||||
RETURNING VALUE(rs_result) TYPE ty_result,
|
||||
IMPORTING is_local TYPE lif_defs=>ty_file_item
|
||||
RETURNING VALUE(rs_result) TYPE lif_defs=>ty_result,
|
||||
build_new_remote
|
||||
IMPORTING iv_devclass TYPE devclass
|
||||
is_remote TYPE ty_file
|
||||
it_items TYPE ty_items_ts
|
||||
it_state TYPE ty_file_signatures_ts
|
||||
RETURNING VALUE(rs_result) TYPE ty_result,
|
||||
is_remote TYPE lif_defs=>ty_file
|
||||
it_items TYPE lif_defs=>ty_items_ts
|
||||
it_state TYPE lif_defs=>ty_file_signatures_ts
|
||||
RETURNING VALUE(rs_result) TYPE lif_defs=>ty_result,
|
||||
identify_object
|
||||
IMPORTING iv_filename TYPE string
|
||||
EXPORTING es_item TYPE ty_item
|
||||
EXPORTING es_item TYPE lif_defs=>ty_item
|
||||
ev_is_xml TYPE abap_bool.
|
||||
|
||||
ENDCLASS. "lcl_file_status DEFINITION
|
||||
|
@ -63,8 +63,8 @@ CLASS lcl_file_status IMPLEMENTATION.
|
|||
METHOD run_checks.
|
||||
|
||||
DATA: lv_path TYPE string,
|
||||
ls_item TYPE ty_item,
|
||||
ls_file TYPE ty_file_signature,
|
||||
ls_item TYPE lif_defs=>ty_item,
|
||||
ls_file TYPE lif_defs=>ty_file_signature,
|
||||
lt_res_sort LIKE it_results,
|
||||
lt_item_idx LIKE it_results.
|
||||
|
||||
|
@ -99,8 +99,8 @@ CLASS lcl_file_status IMPLEMENTATION.
|
|||
BINARY SEARCH. " Sorted above
|
||||
|
||||
IF sy-subrc <> 0 OR <ls_res1>-path <> <ls_res2>-path. " All paths are same
|
||||
io_log->add( iv_msg = |Files for object { <ls_res1>-obj_type }{
|
||||
<ls_res1>-obj_name }are not placed in the same folder|
|
||||
io_log->add( iv_msg = |Files for object { <ls_res1>-obj_type } {
|
||||
<ls_res1>-obj_name } are not placed in the same folder|
|
||||
iv_type = 'W'
|
||||
iv_rc = '1' ) ##no_text.
|
||||
ENDIF.
|
||||
|
@ -179,11 +179,11 @@ CLASS lcl_file_status IMPLEMENTATION.
|
|||
METHOD calculate_status.
|
||||
|
||||
DATA: lt_remote LIKE it_remote,
|
||||
lt_items TYPE ty_items_tt,
|
||||
lt_items TYPE lif_defs=>ty_items_tt,
|
||||
ls_item LIKE LINE OF lt_items,
|
||||
lv_is_xml TYPE abap_bool,
|
||||
lt_items_idx TYPE ty_items_ts,
|
||||
lt_state_idx TYPE ty_file_signatures_ts. " Sorted by path+filename
|
||||
lt_items_idx TYPE lif_defs=>ty_items_ts,
|
||||
lt_state_idx TYPE lif_defs=>ty_file_signatures_ts. " Sorted by path+filename
|
||||
|
||||
FIELD-SYMBOLS: <ls_remote> LIKE LINE OF it_remote,
|
||||
<ls_result> LIKE LINE OF rt_results,
|
||||
|
@ -292,10 +292,10 @@ CLASS lcl_file_status IMPLEMENTATION.
|
|||
|
||||
IF sy-subrc = 0.
|
||||
IF ls_file_sig-sha1 <> is_local-file-sha1.
|
||||
rs_result-lstate = gc_state-modified.
|
||||
rs_result-lstate = lif_defs=>gc_state-modified.
|
||||
ENDIF.
|
||||
IF ls_file_sig-sha1 <> is_remote-sha1.
|
||||
rs_result-rstate = gc_state-modified.
|
||||
rs_result-rstate = lif_defs=>gc_state-modified.
|
||||
ENDIF.
|
||||
rs_result-match = boolc( rs_result-lstate IS INITIAL
|
||||
AND rs_result-rstate IS INITIAL ).
|
||||
|
@ -306,8 +306,8 @@ CLASS lcl_file_status IMPLEMENTATION.
|
|||
" the user will presumably decide what to do after checking the actual diff
|
||||
rs_result-match = boolc( is_local-file-sha1 = is_remote-sha1 ).
|
||||
IF rs_result-match = abap_false.
|
||||
rs_result-lstate = gc_state-modified.
|
||||
rs_result-rstate = gc_state-modified.
|
||||
rs_result-lstate = lif_defs=>gc_state-modified.
|
||||
rs_result-rstate = lif_defs=>gc_state-modified.
|
||||
ENDIF.
|
||||
ENDIF.
|
||||
|
||||
|
@ -326,7 +326,7 @@ CLASS lcl_file_status IMPLEMENTATION.
|
|||
|
||||
" Match
|
||||
rs_result-match = abap_false.
|
||||
rs_result-lstate = gc_state-added.
|
||||
rs_result-lstate = lif_defs=>gc_state-added.
|
||||
|
||||
ENDMETHOD. "build_new_local
|
||||
|
||||
|
@ -339,7 +339,7 @@ CLASS lcl_file_status IMPLEMENTATION.
|
|||
rs_result-path = is_remote-path.
|
||||
rs_result-filename = is_remote-filename.
|
||||
rs_result-match = abap_false.
|
||||
rs_result-rstate = gc_state-added.
|
||||
rs_result-rstate = lif_defs=>gc_state-added.
|
||||
|
||||
identify_object( EXPORTING iv_filename = is_remote-filename
|
||||
IMPORTING es_item = ls_item ).
|
||||
|
@ -367,14 +367,14 @@ CLASS lcl_file_status IMPLEMENTATION.
|
|||
rs_result-match = abap_true.
|
||||
CLEAR rs_result-rstate.
|
||||
ELSE.
|
||||
rs_result-rstate = gc_state-modified.
|
||||
rs_result-rstate = lif_defs=>gc_state-modified.
|
||||
ENDIF.
|
||||
|
||||
" Item is in state and in cache but with no package - it was deleted
|
||||
" OR devclass is the same as repo package (see #532)
|
||||
IF ls_item-devclass IS INITIAL OR ls_item-devclass = iv_devclass.
|
||||
rs_result-match = abap_false.
|
||||
rs_result-lstate = gc_state-deleted.
|
||||
rs_result-lstate = lif_defs=>gc_state-deleted.
|
||||
ENDIF.
|
||||
ENDIF.
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@ CLASS lcl_folder_logic IMPLEMENTATION.
|
|||
lv_parentcl = lcl_sap_package=>get( iv_package )->read_parent( ).
|
||||
|
||||
IF lv_parentcl IS INITIAL.
|
||||
lcx_exception=>raise( 'error, expected parent package' ).
|
||||
lcx_exception=>raise( |error, expected parent package, { iv_package }| ).
|
||||
ELSE.
|
||||
CASE io_dot->get_folder_logic( ).
|
||||
WHEN lcl_dot_abapgit=>c_folder_logic-full.
|
||||
|
@ -274,7 +274,7 @@ CLASS ltcl_folder_logic IMPLEMENTATION.
|
|||
iv_package = '$FOOBAR'
|
||||
iv_path = '/src/' ).
|
||||
cl_abap_unit_assert=>fail( 'Error expected' ).
|
||||
CATCH lcx_exception.
|
||||
CATCH lcx_exception ##NO_HANDLER.
|
||||
ENDTRY.
|
||||
ENDMETHOD.
|
||||
|
||||
|
|
|
@ -22,13 +22,24 @@ FORM run.
|
|||
|
||||
TRY.
|
||||
lcl_migrations=>run( ).
|
||||
lcl_app=>run( ).
|
||||
PERFORM open_gui.
|
||||
CATCH lcx_exception INTO lx_exception.
|
||||
MESSAGE lx_exception->mv_text TYPE 'E'.
|
||||
ENDTRY.
|
||||
|
||||
ENDFORM. "run
|
||||
|
||||
FORM open_gui RAISING lcx_exception.
|
||||
|
||||
IF sy-batch = abap_true.
|
||||
lcl_background=>run( ).
|
||||
ELSE.
|
||||
lcl_app=>gui( )->go_home( ).
|
||||
CALL SELECTION-SCREEN 1001. " trigger screen
|
||||
ENDIF.
|
||||
|
||||
ENDFORM.
|
||||
|
||||
*&---------------------------------------------------------------------*
|
||||
*& Form branch_popup
|
||||
*&---------------------------------------------------------------------*
|
||||
|
@ -43,7 +54,7 @@ ENDFORM. "run
|
|||
* -->##CALLED text
|
||||
* -->##NEEDED text
|
||||
*----------------------------------------------------------------------*
|
||||
FORM branch_popup TABLES tt_fields TYPE ty_sval_tt
|
||||
FORM branch_popup TABLES tt_fields TYPE lif_defs=>ty_sval_tt
|
||||
USING pv_code TYPE clike
|
||||
CHANGING cs_error TYPE svale
|
||||
cv_show_popup TYPE c
|
||||
|
@ -105,7 +116,7 @@ FORM branch_popup TABLES tt_fields TYPE ty_sval_tt
|
|||
|
||||
ENDFORM. "branch_popup
|
||||
|
||||
FORM package_popup TABLES tt_fields TYPE ty_sval_tt
|
||||
FORM package_popup TABLES tt_fields TYPE lif_defs=>ty_sval_tt
|
||||
USING pv_code TYPE clike
|
||||
CHANGING cs_error TYPE svale
|
||||
cv_show_popup TYPE c
|
||||
|
|
|
@ -16,15 +16,15 @@ CLASS lcl_git_transport DEFINITION FINAL.
|
|||
IMPORTING io_repo TYPE REF TO lcl_repo_online
|
||||
iv_deepen TYPE abap_bool DEFAULT abap_true
|
||||
it_branches TYPE lcl_git_branch_list=>ty_git_branch_list_tt OPTIONAL
|
||||
EXPORTING et_objects TYPE ty_objects_tt
|
||||
ev_branch TYPE ty_sha1
|
||||
EXPORTING et_objects TYPE lif_defs=>ty_objects_tt
|
||||
ev_branch TYPE lif_defs=>ty_sha1
|
||||
RAISING lcx_exception.
|
||||
|
||||
* local to remote
|
||||
CLASS-METHODS receive_pack
|
||||
IMPORTING iv_url TYPE string
|
||||
iv_old TYPE ty_sha1
|
||||
iv_new TYPE ty_sha1
|
||||
iv_old TYPE lif_defs=>ty_sha1
|
||||
iv_new TYPE lif_defs=>ty_sha1
|
||||
iv_branch_name TYPE string
|
||||
iv_pack TYPE xstring
|
||||
RAISING lcx_exception.
|
||||
|
@ -52,7 +52,7 @@ CLASS lcl_git_transport DEFINITION FINAL.
|
|||
iv_service TYPE string
|
||||
iv_branch_name TYPE string
|
||||
EXPORTING eo_client TYPE REF TO lcl_http_client
|
||||
ev_branch TYPE ty_sha1
|
||||
ev_branch TYPE lif_defs=>ty_sha1
|
||||
RAISING lcx_exception.
|
||||
|
||||
CLASS-METHODS parse
|
||||
|
@ -71,16 +71,16 @@ CLASS lcl_git_pack DEFINITION FINAL FRIENDS ltcl_git_pack.
|
|||
|
||||
PUBLIC SECTION.
|
||||
TYPES: BEGIN OF ty_node,
|
||||
chmod TYPE ty_chmod,
|
||||
chmod TYPE lif_defs=>ty_chmod,
|
||||
name TYPE string,
|
||||
sha1 TYPE ty_sha1,
|
||||
sha1 TYPE lif_defs=>ty_sha1,
|
||||
END OF ty_node.
|
||||
TYPES: ty_nodes_tt TYPE STANDARD TABLE OF ty_node WITH DEFAULT KEY.
|
||||
|
||||
TYPES: BEGIN OF ty_commit,
|
||||
tree TYPE ty_sha1,
|
||||
parent TYPE ty_sha1,
|
||||
parent2 TYPE ty_sha1,
|
||||
tree TYPE lif_defs=>ty_sha1,
|
||||
parent TYPE lif_defs=>ty_sha1,
|
||||
parent2 TYPE lif_defs=>ty_sha1,
|
||||
author TYPE string,
|
||||
committer TYPE string,
|
||||
body TYPE string,
|
||||
|
@ -88,7 +88,7 @@ CLASS lcl_git_pack DEFINITION FINAL FRIENDS ltcl_git_pack.
|
|||
|
||||
CLASS-METHODS decode
|
||||
IMPORTING iv_data TYPE xstring
|
||||
RETURNING VALUE(rt_objects) TYPE ty_objects_tt
|
||||
RETURNING VALUE(rt_objects) TYPE lif_defs=>ty_objects_tt
|
||||
RAISING lcx_exception.
|
||||
|
||||
CLASS-METHODS decode_tree
|
||||
|
@ -102,7 +102,7 @@ CLASS lcl_git_pack DEFINITION FINAL FRIENDS ltcl_git_pack.
|
|||
RAISING lcx_exception.
|
||||
|
||||
CLASS-METHODS encode
|
||||
IMPORTING it_objects TYPE ty_objects_tt
|
||||
IMPORTING it_objects TYPE lif_defs=>ty_objects_tt
|
||||
RETURNING VALUE(rv_data) TYPE xstring
|
||||
RAISING lcx_exception.
|
||||
|
||||
|
@ -121,17 +121,17 @@ CLASS lcl_git_pack DEFINITION FINAL FRIENDS ltcl_git_pack.
|
|||
c_version TYPE x LENGTH 4 VALUE '00000002'.
|
||||
|
||||
CLASS-METHODS decode_deltas
|
||||
CHANGING ct_objects TYPE ty_objects_tt
|
||||
CHANGING ct_objects TYPE lif_defs=>ty_objects_tt
|
||||
RAISING lcx_exception.
|
||||
|
||||
CLASS-METHODS type_and_length
|
||||
IMPORTING is_object TYPE ty_object
|
||||
IMPORTING is_object TYPE lif_defs=>ty_object
|
||||
RETURNING VALUE(rv_xstring) TYPE xstring
|
||||
RAISING lcx_exception.
|
||||
|
||||
CLASS-METHODS delta
|
||||
IMPORTING is_object TYPE ty_object
|
||||
CHANGING ct_objects TYPE ty_objects_tt
|
||||
IMPORTING is_object TYPE lif_defs=>ty_object
|
||||
CHANGING ct_objects TYPE lif_defs=>ty_objects_tt
|
||||
RAISING lcx_exception.
|
||||
|
||||
CLASS-METHODS delta_header
|
||||
|
@ -144,7 +144,7 @@ CLASS lcl_git_pack DEFINITION FINAL FRIENDS ltcl_git_pack.
|
|||
|
||||
CLASS-METHODS get_type
|
||||
IMPORTING iv_x TYPE x
|
||||
RETURNING VALUE(rv_type) TYPE ty_type
|
||||
RETURNING VALUE(rv_type) TYPE lif_defs=>ty_type
|
||||
RAISING lcx_exception.
|
||||
|
||||
CLASS-METHODS get_length
|
||||
|
@ -251,7 +251,7 @@ CLASS lcl_git_transport IMPLEMENTATION.
|
|||
lcl_git_utils=>get_null( ) &&
|
||||
` ` &&
|
||||
lv_cap_list &&
|
||||
gc_newline. "#EC NOTEXT
|
||||
lif_defs=>gc_newline. "#EC NOTEXT
|
||||
lv_cmd_pkt = lcl_git_utils=>pkt_string( lv_line ).
|
||||
|
||||
lv_buffer = lv_cmd_pkt && '0000'.
|
||||
|
@ -347,22 +347,22 @@ CLASS lcl_git_transport IMPLEMENTATION.
|
|||
lv_capa = 'side-band-64k no-progress multi_ack agent='
|
||||
&& lcl_http=>get_agent( ) ##NO_TEXT.
|
||||
lv_line = 'want' && ` ` && <ls_branch>-sha1
|
||||
&& ` ` && lv_capa && gc_newline. "#EC NOTEXT
|
||||
&& ` ` && lv_capa && lif_defs=>gc_newline. "#EC NOTEXT
|
||||
ELSE.
|
||||
lv_line = 'want' && ` ` && <ls_branch>-sha1
|
||||
&& gc_newline. "#EC NOTEXT
|
||||
&& lif_defs=>gc_newline. "#EC NOTEXT
|
||||
ENDIF.
|
||||
lv_buffer = lv_buffer && lcl_git_utils=>pkt_string( lv_line ).
|
||||
ENDLOOP.
|
||||
|
||||
IF iv_deepen = abap_true.
|
||||
lv_buffer = lv_buffer && lcl_git_utils=>pkt_string( 'deepen 1'
|
||||
&& gc_newline ). "#EC NOTEXT
|
||||
&& lif_defs=>gc_newline ). "#EC NOTEXT
|
||||
ENDIF.
|
||||
|
||||
lv_buffer = lv_buffer
|
||||
&& '0000'
|
||||
&& '0009done' && gc_newline.
|
||||
&& '0009done' && lif_defs=>gc_newline.
|
||||
|
||||
lv_xstring = lo_client->send_receive_close(
|
||||
lcl_convert=>string_to_xstring_utf8( lv_buffer ) ).
|
||||
|
@ -402,7 +402,7 @@ CLASS lcl_git_pack IMPLEMENTATION.
|
|||
|
||||
LOOP AT it_nodes ASSIGNING <ls_node>.
|
||||
APPEND INITIAL LINE TO lt_sort ASSIGNING <ls_sort>.
|
||||
IF <ls_node>-chmod = gc_chmod-dir.
|
||||
IF <ls_node>-chmod = lif_defs=>gc_chmod-dir.
|
||||
CONCATENATE <ls_node>-name '/' INTO <ls_sort>-sort.
|
||||
ELSE.
|
||||
<ls_sort>-sort = <ls_node>-name.
|
||||
|
@ -431,13 +431,13 @@ CLASS lcl_git_pack IMPLEMENTATION.
|
|||
|
||||
|
||||
CASE is_object-type.
|
||||
WHEN gc_type-commit.
|
||||
WHEN lif_defs=>gc_type-commit.
|
||||
lv_type = '001'.
|
||||
WHEN gc_type-tree.
|
||||
WHEN lif_defs=>gc_type-tree.
|
||||
lv_type = '010'.
|
||||
WHEN gc_type-blob.
|
||||
WHEN lif_defs=>gc_type-blob.
|
||||
lv_type = '011'.
|
||||
WHEN gc_type-ref_d.
|
||||
WHEN lif_defs=>gc_type-ref_d.
|
||||
lv_type = '111'.
|
||||
WHEN OTHERS.
|
||||
lcx_exception=>raise( 'Unexpected object type while encoding pack' ).
|
||||
|
@ -487,7 +487,7 @@ CLASS lcl_git_pack IMPLEMENTATION.
|
|||
|
||||
DATA: lv_x TYPE x,
|
||||
lv_length_bits TYPE string,
|
||||
lv_bitbyte TYPE ty_bitbyte.
|
||||
lv_bitbyte TYPE lif_defs=>ty_bitbyte.
|
||||
|
||||
|
||||
lv_x = cv_data(1).
|
||||
|
@ -549,7 +549,7 @@ CLASS lcl_git_pack IMPLEMENTATION.
|
|||
lv_string = ''.
|
||||
|
||||
CONCATENATE 'tree' lv_tree_lower INTO lv_tmp SEPARATED BY space. "#EC NOTEXT
|
||||
CONCATENATE lv_string lv_tmp gc_newline INTO lv_string.
|
||||
CONCATENATE lv_string lv_tmp lif_defs=>gc_newline INTO lv_string.
|
||||
|
||||
IF NOT is_commit-parent IS INITIAL.
|
||||
lv_parent_lower = is_commit-parent.
|
||||
|
@ -557,7 +557,7 @@ CLASS lcl_git_pack IMPLEMENTATION.
|
|||
|
||||
CONCATENATE 'parent' lv_parent_lower
|
||||
INTO lv_tmp SEPARATED BY space. "#EC NOTEXT
|
||||
CONCATENATE lv_string lv_tmp gc_newline INTO lv_string.
|
||||
CONCATENATE lv_string lv_tmp lif_defs=>gc_newline INTO lv_string.
|
||||
ENDIF.
|
||||
|
||||
IF NOT is_commit-parent2 IS INITIAL.
|
||||
|
@ -566,18 +566,18 @@ CLASS lcl_git_pack IMPLEMENTATION.
|
|||
|
||||
CONCATENATE 'parent' lv_parent_lower
|
||||
INTO lv_tmp SEPARATED BY space. "#EC NOTEXT
|
||||
CONCATENATE lv_string lv_tmp gc_newline INTO lv_string.
|
||||
CONCATENATE lv_string lv_tmp lif_defs=>gc_newline INTO lv_string.
|
||||
ENDIF.
|
||||
|
||||
CONCATENATE 'author' is_commit-author
|
||||
INTO lv_tmp SEPARATED BY space. "#EC NOTEXT
|
||||
CONCATENATE lv_string lv_tmp gc_newline INTO lv_string.
|
||||
CONCATENATE lv_string lv_tmp lif_defs=>gc_newline INTO lv_string.
|
||||
|
||||
CONCATENATE 'committer' is_commit-committer
|
||||
INTO lv_tmp SEPARATED BY space. "#EC NOTEXT
|
||||
CONCATENATE lv_string lv_tmp gc_newline INTO lv_string.
|
||||
CONCATENATE lv_string lv_tmp lif_defs=>gc_newline INTO lv_string.
|
||||
|
||||
CONCATENATE lv_string gc_newline is_commit-body INTO lv_string.
|
||||
CONCATENATE lv_string lif_defs=>gc_newline is_commit-body INTO lv_string.
|
||||
|
||||
rv_data = lcl_convert=>string_to_xstring_utf8( lv_string ).
|
||||
|
||||
|
@ -586,7 +586,7 @@ CLASS lcl_git_pack IMPLEMENTATION.
|
|||
METHOD get_type.
|
||||
|
||||
DATA: lv_char3 TYPE c LENGTH 3,
|
||||
lv_bitbyte TYPE ty_bitbyte.
|
||||
lv_bitbyte TYPE lif_defs=>ty_bitbyte.
|
||||
|
||||
|
||||
lv_bitbyte = lcl_convert=>x_to_bitbyte( iv_x ).
|
||||
|
@ -594,13 +594,13 @@ CLASS lcl_git_pack IMPLEMENTATION.
|
|||
|
||||
CASE lv_char3.
|
||||
WHEN '001'.
|
||||
rv_type = gc_type-commit.
|
||||
rv_type = lif_defs=>gc_type-commit.
|
||||
WHEN '010'.
|
||||
rv_type = gc_type-tree.
|
||||
rv_type = lif_defs=>gc_type-tree.
|
||||
WHEN '011'.
|
||||
rv_type = gc_type-blob.
|
||||
rv_type = lif_defs=>gc_type-blob.
|
||||
WHEN '111'.
|
||||
rv_type = gc_type-ref_d.
|
||||
rv_type = lif_defs=>gc_type-ref_d.
|
||||
WHEN OTHERS.
|
||||
lcx_exception=>raise( 'Todo, unknown type' ).
|
||||
ENDCASE.
|
||||
|
@ -619,12 +619,12 @@ CLASS lcl_git_pack IMPLEMENTATION.
|
|||
|
||||
lv_string = lcl_convert=>xstring_to_string_utf8( iv_data ).
|
||||
|
||||
SPLIT lv_string AT gc_newline INTO TABLE lt_string.
|
||||
SPLIT lv_string AT lif_defs=>gc_newline INTO TABLE lt_string.
|
||||
|
||||
LOOP AT lt_string ASSIGNING <lv_string>.
|
||||
IF NOT rs_commit-committer IS INITIAL.
|
||||
CONCATENATE rs_commit-body <lv_string> INTO rs_commit-body
|
||||
SEPARATED BY gc_newline.
|
||||
SEPARATED BY lif_defs=>gc_newline.
|
||||
ELSE.
|
||||
SPLIT <lv_string> AT space INTO lv_word lv_trash.
|
||||
CASE lv_word.
|
||||
|
@ -661,7 +661,7 @@ CLASS lcl_git_pack IMPLEMENTATION.
|
|||
|
||||
METHOD delta_header.
|
||||
|
||||
DATA: lv_bitbyte TYPE ty_bitbyte,
|
||||
DATA: lv_bitbyte TYPE lif_defs=>ty_bitbyte,
|
||||
lv_bits TYPE string,
|
||||
lv_x TYPE x.
|
||||
|
||||
|
@ -685,82 +685,84 @@ CLASS lcl_git_pack IMPLEMENTATION.
|
|||
DATA: lv_delta TYPE xstring,
|
||||
lv_base TYPE xstring,
|
||||
lv_result TYPE xstring,
|
||||
lv_bitbyte TYPE ty_bitbyte,
|
||||
* lv_bitbyte TYPE ty_bitbyte,
|
||||
lv_offset TYPE i,
|
||||
lv_message TYPE string,
|
||||
lv_sha1 TYPE ty_sha1,
|
||||
lv_sha1 TYPE lif_defs=>ty_sha1,
|
||||
ls_object LIKE LINE OF ct_objects,
|
||||
lv_len TYPE i,
|
||||
lv_org TYPE x,
|
||||
* lv_i TYPE i,
|
||||
lv_x TYPE x.
|
||||
|
||||
FIELD-SYMBOLS: <ls_object> LIKE LINE OF ct_objects.
|
||||
|
||||
DEFINE _eat_byte.
|
||||
lv_x = lv_delta(1).
|
||||
lv_delta = lv_delta+1.
|
||||
END-OF-DEFINITION.
|
||||
|
||||
lv_delta = is_object-data.
|
||||
|
||||
* find base
|
||||
READ TABLE ct_objects ASSIGNING <ls_object> WITH KEY sha1 = is_object-sha1.
|
||||
IF sy-subrc <> 0.
|
||||
CONCATENATE 'Base not found,' is_object-sha1 INTO lv_message
|
||||
SEPARATED BY space. "#EC NOTEXT
|
||||
lcx_exception=>raise( lv_message ).
|
||||
ELSE.
|
||||
lv_base = <ls_object>-data.
|
||||
ENDIF.
|
||||
|
||||
lcx_exception=>raise( |Base not found, { is_object-sha1 }| ).
|
||||
ELSEIF <ls_object>-type = lif_defs=>gc_type-ref_d.
|
||||
* sanity check
|
||||
IF <ls_object>-type = gc_type-ref_d.
|
||||
lcx_exception=>raise( 'Delta, base eq delta' ).
|
||||
ENDIF.
|
||||
|
||||
lv_base = <ls_object>-data.
|
||||
|
||||
* skip the 2 headers
|
||||
delta_header( CHANGING cv_delta = lv_delta ).
|
||||
delta_header( CHANGING cv_delta = lv_delta ).
|
||||
|
||||
CONSTANTS: lc_1 TYPE x VALUE '01',
|
||||
lc_2 TYPE x VALUE '02',
|
||||
lc_4 TYPE x VALUE '04',
|
||||
lc_8 TYPE x VALUE '08',
|
||||
lc_16 TYPE x VALUE '10',
|
||||
lc_32 TYPE x VALUE '20',
|
||||
lc_64 TYPE x VALUE '40',
|
||||
lc_128 TYPE x VALUE '80'.
|
||||
|
||||
WHILE xstrlen( lv_delta ) > 0.
|
||||
|
||||
lv_x = lv_delta(1).
|
||||
lv_delta = lv_delta+1.
|
||||
lv_bitbyte = lcl_convert=>x_to_bitbyte( lv_x ).
|
||||
_eat_byte.
|
||||
lv_org = lv_x.
|
||||
|
||||
IF lv_bitbyte(1) = '1'. " MSB
|
||||
IF lv_x BIT-AND lc_128 = lc_128. " MSB = 1
|
||||
|
||||
lv_offset = 0.
|
||||
IF lv_bitbyte+7(1) = '1'.
|
||||
lv_x = lv_delta(1).
|
||||
lv_delta = lv_delta+1.
|
||||
IF lv_org BIT-AND lc_1 = lc_1.
|
||||
_eat_byte.
|
||||
lv_offset = lv_x.
|
||||
ENDIF.
|
||||
IF lv_bitbyte+6(1) = '1'.
|
||||
lv_x = lv_delta(1).
|
||||
lv_delta = lv_delta+1.
|
||||
IF lv_org BIT-AND lc_2 = lc_2.
|
||||
_eat_byte.
|
||||
lv_offset = lv_offset + lv_x * 256.
|
||||
ENDIF.
|
||||
IF lv_bitbyte+5(1) = '1'.
|
||||
lv_x = lv_delta(1).
|
||||
lv_delta = lv_delta+1.
|
||||
IF lv_org BIT-AND lc_4 = lc_4.
|
||||
_eat_byte.
|
||||
lv_offset = lv_offset + lv_x * 65536.
|
||||
ENDIF.
|
||||
IF lv_bitbyte+4(1) = '1'.
|
||||
lv_x = lv_delta(1).
|
||||
lv_delta = lv_delta+1.
|
||||
IF lv_org BIT-AND lc_8 = lc_8.
|
||||
_eat_byte.
|
||||
lv_offset = lv_offset + lv_x * 16777216. " hmm, overflow?
|
||||
ENDIF.
|
||||
|
||||
lv_len = 0.
|
||||
IF lv_bitbyte+3(1) = '1'.
|
||||
lv_x = lv_delta(1).
|
||||
lv_delta = lv_delta+1.
|
||||
IF lv_org BIT-AND lc_16 = lc_16.
|
||||
_eat_byte.
|
||||
lv_len = lv_x.
|
||||
ENDIF.
|
||||
IF lv_bitbyte+2(1) = '1'.
|
||||
lv_x = lv_delta(1).
|
||||
lv_delta = lv_delta+1.
|
||||
IF lv_org BIT-AND lc_32 = lc_32.
|
||||
_eat_byte.
|
||||
lv_len = lv_len + lv_x * 256.
|
||||
ENDIF.
|
||||
IF lv_bitbyte+1(1) = '1'.
|
||||
lv_x = lv_delta(1).
|
||||
lv_delta = lv_delta+1.
|
||||
IF lv_org BIT-AND lc_64 = lc_64.
|
||||
_eat_byte.
|
||||
lv_len = lv_len + lv_x * 65536.
|
||||
ENDIF.
|
||||
|
||||
|
@ -795,7 +797,12 @@ CLASS lcl_git_pack IMPLEMENTATION.
|
|||
lt_deltas LIKE ct_objects.
|
||||
|
||||
|
||||
LOOP AT ct_objects INTO ls_object WHERE type = gc_type-ref_d.
|
||||
lcl_progress=>show( iv_key = 'Decode'
|
||||
iv_current = 1
|
||||
iv_total = 1
|
||||
iv_text = 'Deltas' ) ##NO_TEXT.
|
||||
|
||||
LOOP AT ct_objects INTO ls_object WHERE type = lif_defs=>gc_type-ref_d.
|
||||
DELETE ct_objects INDEX sy-tabix.
|
||||
APPEND ls_object TO lt_deltas.
|
||||
ENDLOOP.
|
||||
|
@ -813,7 +820,7 @@ CLASS lcl_git_pack IMPLEMENTATION.
|
|||
lc_null TYPE x VALUE '00'.
|
||||
|
||||
DATA: lv_xstring TYPE xstring,
|
||||
lv_chmod TYPE ty_chmod,
|
||||
lv_chmod TYPE lif_defs=>ty_chmod,
|
||||
lv_name TYPE string,
|
||||
lv_string TYPE string,
|
||||
lv_len TYPE i,
|
||||
|
@ -839,9 +846,9 @@ CLASS lcl_git_pack IMPLEMENTATION.
|
|||
|
||||
CLEAR ls_node.
|
||||
ls_node-chmod = lv_chmod.
|
||||
IF ls_node-chmod <> gc_chmod-dir
|
||||
AND ls_node-chmod <> gc_chmod-file
|
||||
AND ls_node-chmod <> gc_chmod-executable.
|
||||
IF ls_node-chmod <> lif_defs=>gc_chmod-dir
|
||||
AND ls_node-chmod <> lif_defs=>gc_chmod-file
|
||||
AND ls_node-chmod <> lif_defs=>gc_chmod-executable.
|
||||
lcx_exception=>raise( 'Unknown chmod' ).
|
||||
ENDIF.
|
||||
|
||||
|
@ -896,8 +903,8 @@ CLASS lcl_git_pack IMPLEMENTATION.
|
|||
lv_zlib TYPE x LENGTH 2,
|
||||
lv_objects TYPE i,
|
||||
lv_len TYPE i,
|
||||
lv_sha1 TYPE ty_sha1,
|
||||
lv_ref_delta TYPE ty_sha1,
|
||||
lv_sha1 TYPE lif_defs=>ty_sha1,
|
||||
lv_ref_delta TYPE lif_defs=>ty_sha1,
|
||||
lv_compressed_len TYPE i,
|
||||
lv_compressed TYPE xstring,
|
||||
lv_decompressed TYPE xstring,
|
||||
|
@ -935,7 +942,7 @@ CLASS lcl_git_pack IMPLEMENTATION.
|
|||
get_length( IMPORTING ev_length = lv_expected
|
||||
CHANGING cv_data = lv_data ).
|
||||
|
||||
IF lv_type = gc_type-ref_d.
|
||||
IF lv_type = lif_defs=>gc_type-ref_d.
|
||||
lv_ref_delta = lv_data(20).
|
||||
lv_data = lv_data+20.
|
||||
ENDIF.
|
||||
|
@ -991,7 +998,7 @@ CLASS lcl_git_pack IMPLEMENTATION.
|
|||
*************************
|
||||
|
||||
CLEAR ls_object.
|
||||
IF lv_type = gc_type-ref_d.
|
||||
IF lv_type = lif_defs=>gc_type-ref_d.
|
||||
ls_object-sha1 = lv_ref_delta.
|
||||
TRANSLATE ls_object-sha1 TO LOWER CASE.
|
||||
ELSE.
|
||||
|
@ -1074,31 +1081,31 @@ CLASS lcl_git_porcelain DEFINITION FINAL FRIENDS ltcl_git_porcelain.
|
|||
TYPES: BEGIN OF ty_expanded,
|
||||
path TYPE string,
|
||||
name TYPE string,
|
||||
sha1 TYPE ty_sha1,
|
||||
chmod TYPE ty_chmod,
|
||||
sha1 TYPE lif_defs=>ty_sha1,
|
||||
chmod TYPE lif_defs=>ty_chmod,
|
||||
END OF ty_expanded.
|
||||
|
||||
TYPES: ty_expanded_tt TYPE STANDARD TABLE OF ty_expanded WITH DEFAULT KEY.
|
||||
|
||||
CLASS-METHODS pull
|
||||
IMPORTING io_repo TYPE REF TO lcl_repo_online
|
||||
EXPORTING et_files TYPE ty_files_tt
|
||||
et_objects TYPE ty_objects_tt
|
||||
ev_branch TYPE ty_sha1
|
||||
EXPORTING et_files TYPE lif_defs=>ty_files_tt
|
||||
et_objects TYPE lif_defs=>ty_objects_tt
|
||||
ev_branch TYPE lif_defs=>ty_sha1
|
||||
RAISING lcx_exception.
|
||||
|
||||
CLASS-METHODS push
|
||||
IMPORTING io_repo TYPE REF TO lcl_repo_online
|
||||
is_comment TYPE ty_comment
|
||||
is_comment TYPE lif_defs=>ty_comment
|
||||
io_stage TYPE REF TO lcl_stage
|
||||
EXPORTING ev_branch TYPE ty_sha1
|
||||
et_updated_files TYPE ty_file_signatures_tt
|
||||
EXPORTING ev_branch TYPE lif_defs=>ty_sha1
|
||||
et_updated_files TYPE lif_defs=>ty_file_signatures_tt
|
||||
RAISING lcx_exception.
|
||||
|
||||
CLASS-METHODS create_branch
|
||||
IMPORTING io_repo TYPE REF TO lcl_repo_online
|
||||
iv_name TYPE string
|
||||
iv_from TYPE ty_sha1
|
||||
iv_from TYPE lif_defs=>ty_sha1
|
||||
RAISING lcx_exception.
|
||||
|
||||
CLASS-METHODS delete_branch
|
||||
|
@ -1107,8 +1114,8 @@ CLASS lcl_git_porcelain DEFINITION FINAL FRIENDS ltcl_git_porcelain.
|
|||
RAISING lcx_exception.
|
||||
|
||||
CLASS-METHODS full_tree
|
||||
IMPORTING it_objects TYPE ty_objects_tt
|
||||
iv_branch TYPE ty_sha1
|
||||
IMPORTING it_objects TYPE lif_defs=>ty_objects_tt
|
||||
iv_branch TYPE lif_defs=>ty_sha1
|
||||
RETURNING VALUE(rt_expanded) TYPE ty_expanded_tt
|
||||
RAISING lcx_exception.
|
||||
|
||||
|
@ -1117,7 +1124,7 @@ CLASS lcl_git_porcelain DEFINITION FINAL FRIENDS ltcl_git_porcelain.
|
|||
TYPES: BEGIN OF ty_tree,
|
||||
path TYPE string,
|
||||
data TYPE xstring,
|
||||
sha1 TYPE ty_sha1,
|
||||
sha1 TYPE lif_defs=>ty_sha1,
|
||||
END OF ty_tree.
|
||||
|
||||
TYPES: ty_trees_tt TYPE STANDARD TABLE OF ty_tree WITH DEFAULT KEY.
|
||||
|
@ -1125,12 +1132,12 @@ CLASS lcl_git_porcelain DEFINITION FINAL FRIENDS ltcl_git_porcelain.
|
|||
TYPES: BEGIN OF ty_folder,
|
||||
path TYPE string,
|
||||
count TYPE i,
|
||||
sha1 TYPE ty_sha1,
|
||||
sha1 TYPE lif_defs=>ty_sha1,
|
||||
END OF ty_folder.
|
||||
|
||||
TYPES: ty_folders_tt TYPE STANDARD TABLE OF ty_folder WITH DEFAULT KEY.
|
||||
|
||||
CONSTANTS: c_zero TYPE ty_sha1 VALUE '0000000000000000000000000000000000000000'.
|
||||
CONSTANTS: c_zero TYPE lif_defs=>ty_sha1 VALUE '0000000000000000000000000000000000000000'.
|
||||
|
||||
CLASS-METHODS build_trees
|
||||
IMPORTING it_expanded TYPE ty_expanded_tt
|
||||
|
@ -1142,26 +1149,26 @@ CLASS lcl_git_porcelain DEFINITION FINAL FRIENDS ltcl_git_porcelain.
|
|||
RETURNING VALUE(rt_folders) TYPE ty_folders_tt.
|
||||
|
||||
CLASS-METHODS walk
|
||||
IMPORTING it_objects TYPE ty_objects_tt
|
||||
iv_sha1 TYPE ty_sha1
|
||||
IMPORTING it_objects TYPE lif_defs=>ty_objects_tt
|
||||
iv_sha1 TYPE lif_defs=>ty_sha1
|
||||
iv_path TYPE string
|
||||
CHANGING ct_files TYPE ty_files_tt
|
||||
CHANGING ct_files TYPE lif_defs=>ty_files_tt
|
||||
RAISING lcx_exception.
|
||||
|
||||
CLASS-METHODS walk_tree
|
||||
IMPORTING it_objects TYPE ty_objects_tt
|
||||
iv_tree TYPE ty_sha1
|
||||
IMPORTING it_objects TYPE lif_defs=>ty_objects_tt
|
||||
iv_tree TYPE lif_defs=>ty_sha1
|
||||
iv_base TYPE string
|
||||
RETURNING VALUE(rt_expanded) TYPE ty_expanded_tt
|
||||
RAISING lcx_exception.
|
||||
|
||||
CLASS-METHODS receive_pack
|
||||
IMPORTING is_comment TYPE ty_comment
|
||||
IMPORTING is_comment TYPE lif_defs=>ty_comment
|
||||
io_repo TYPE REF TO lcl_repo_online
|
||||
it_trees TYPE ty_trees_tt
|
||||
it_blobs TYPE ty_files_tt
|
||||
it_blobs TYPE lif_defs=>ty_files_tt
|
||||
io_stage TYPE REF TO lcl_stage
|
||||
RETURNING VALUE(rv_branch) TYPE ty_sha1
|
||||
RETURNING VALUE(rv_branch) TYPE lif_defs=>ty_sha1
|
||||
RAISING lcx_exception.
|
||||
|
||||
ENDCLASS. "lcl_porcelain DEFINITION
|
||||
|
@ -1177,7 +1184,7 @@ CLASS lcl_git_porcelain IMPLEMENTATION.
|
|||
|
||||
DATA: lv_time TYPE lcl_time=>ty_unixtime,
|
||||
lv_commit TYPE xstring,
|
||||
lt_objects TYPE ty_objects_tt,
|
||||
lt_objects TYPE lif_defs=>ty_objects_tt,
|
||||
lv_pack TYPE xstring,
|
||||
ls_object LIKE LINE OF lt_objects,
|
||||
ls_commit TYPE lcl_git_pack=>ty_commit.
|
||||
|
@ -1208,31 +1215,31 @@ CLASS lcl_git_porcelain IMPLEMENTATION.
|
|||
lv_commit = lcl_git_pack=>encode_commit( ls_commit ).
|
||||
|
||||
CLEAR ls_object.
|
||||
ls_object-sha1 = lcl_hash=>sha1( iv_type = gc_type-commit iv_data = lv_commit ).
|
||||
ls_object-type = gc_type-commit.
|
||||
ls_object-sha1 = lcl_hash=>sha1( iv_type = lif_defs=>gc_type-commit iv_data = lv_commit ).
|
||||
ls_object-type = lif_defs=>gc_type-commit.
|
||||
ls_object-data = lv_commit.
|
||||
APPEND ls_object TO lt_objects.
|
||||
|
||||
LOOP AT it_trees ASSIGNING <ls_tree>.
|
||||
CLEAR ls_object.
|
||||
ls_object-sha1 = <ls_tree>-sha1.
|
||||
ls_object-type = gc_type-tree.
|
||||
ls_object-type = lif_defs=>gc_type-tree.
|
||||
ls_object-data = <ls_tree>-data.
|
||||
APPEND ls_object TO lt_objects.
|
||||
ENDLOOP.
|
||||
|
||||
LOOP AT it_blobs ASSIGNING <ls_blob>.
|
||||
CLEAR ls_object.
|
||||
ls_object-sha1 = lcl_hash=>sha1( iv_type = gc_type-blob iv_data = <ls_blob>-data ).
|
||||
ls_object-sha1 = lcl_hash=>sha1( iv_type = lif_defs=>gc_type-blob iv_data = <ls_blob>-data ).
|
||||
|
||||
READ TABLE lt_objects WITH KEY type = gc_type-blob sha1 = ls_object-sha1
|
||||
READ TABLE lt_objects WITH KEY type = lif_defs=>gc_type-blob sha1 = ls_object-sha1
|
||||
TRANSPORTING NO FIELDS.
|
||||
IF sy-subrc = 0.
|
||||
* two identical files added at the same time, only add one blob to the pack
|
||||
CONTINUE.
|
||||
ENDIF.
|
||||
|
||||
ls_object-type = gc_type-blob.
|
||||
ls_object-type = lif_defs=>gc_type-blob.
|
||||
ASSERT NOT <ls_blob>-data IS INITIAL.
|
||||
ls_object-data = <ls_blob>-data.
|
||||
APPEND ls_object TO lt_objects.
|
||||
|
@ -1241,7 +1248,7 @@ CLASS lcl_git_porcelain IMPLEMENTATION.
|
|||
lv_pack = lcl_git_pack=>encode( lt_objects ).
|
||||
|
||||
rv_branch = lcl_hash=>sha1(
|
||||
iv_type = gc_type-commit
|
||||
iv_type = lif_defs=>gc_type-commit
|
||||
iv_data = lv_commit ).
|
||||
|
||||
lcl_git_transport=>receive_pack(
|
||||
|
@ -1255,7 +1262,7 @@ CLASS lcl_git_porcelain IMPLEMENTATION.
|
|||
|
||||
METHOD delete_branch.
|
||||
|
||||
DATA: lt_objects TYPE ty_objects_tt,
|
||||
DATA: lt_objects TYPE lif_defs=>ty_objects_tt,
|
||||
lv_pack TYPE xstring.
|
||||
|
||||
|
||||
|
@ -1274,7 +1281,7 @@ CLASS lcl_git_porcelain IMPLEMENTATION.
|
|||
|
||||
METHOD create_branch.
|
||||
|
||||
DATA: lt_objects TYPE ty_objects_tt,
|
||||
DATA: lt_objects TYPE lif_defs=>ty_objects_tt,
|
||||
lv_pack TYPE xstring.
|
||||
|
||||
IF iv_name CS ` `.
|
||||
|
@ -1297,10 +1304,10 @@ CLASS lcl_git_porcelain IMPLEMENTATION.
|
|||
METHOD push.
|
||||
|
||||
DATA: lt_expanded TYPE ty_expanded_tt,
|
||||
lt_blobs TYPE ty_files_tt,
|
||||
lv_sha1 TYPE ty_sha1,
|
||||
lt_blobs TYPE lif_defs=>ty_files_tt,
|
||||
lv_sha1 TYPE lif_defs=>ty_sha1,
|
||||
lt_trees TYPE ty_trees_tt,
|
||||
lt_objects TYPE ty_objects_tt,
|
||||
lt_objects TYPE lif_defs=>ty_objects_tt,
|
||||
lt_branches TYPE lcl_git_branch_list=>ty_git_branch_list_tt,
|
||||
lt_stage TYPE lcl_stage=>ty_stage_tt.
|
||||
|
||||
|
@ -1347,10 +1354,10 @@ CLASS lcl_git_porcelain IMPLEMENTATION.
|
|||
APPEND INITIAL LINE TO lt_expanded ASSIGNING <ls_exp>.
|
||||
<ls_exp>-name = <ls_stage>-file-filename.
|
||||
<ls_exp>-path = <ls_stage>-file-path.
|
||||
<ls_exp>-chmod = gc_chmod-file.
|
||||
<ls_exp>-chmod = lif_defs=>gc_chmod-file.
|
||||
ENDIF.
|
||||
|
||||
lv_sha1 = lcl_hash=>sha1( iv_type = gc_type-blob
|
||||
lv_sha1 = lcl_hash=>sha1( iv_type = lif_defs=>gc_type-blob
|
||||
iv_data = <ls_stage>-file-data ).
|
||||
IF <ls_exp>-sha1 <> lv_sha1.
|
||||
<ls_exp>-sha1 = lv_sha1.
|
||||
|
@ -1393,7 +1400,7 @@ CLASS lcl_git_porcelain IMPLEMENTATION.
|
|||
|
||||
READ TABLE it_objects INTO ls_object
|
||||
WITH KEY sha1 = iv_tree
|
||||
type = gc_type-tree.
|
||||
type = lif_defs=>gc_type-tree.
|
||||
IF sy-subrc <> 0.
|
||||
lcx_exception=>raise( 'tree not found' ).
|
||||
ENDIF.
|
||||
|
@ -1401,14 +1408,14 @@ CLASS lcl_git_porcelain IMPLEMENTATION.
|
|||
|
||||
LOOP AT lt_nodes ASSIGNING <ls_node>.
|
||||
CASE <ls_node>-chmod.
|
||||
WHEN gc_chmod-file
|
||||
OR gc_chmod-executable.
|
||||
WHEN lif_defs=>gc_chmod-file
|
||||
OR lif_defs=>gc_chmod-executable.
|
||||
APPEND INITIAL LINE TO rt_expanded ASSIGNING <ls_exp>.
|
||||
<ls_exp>-path = iv_base.
|
||||
<ls_exp>-name = <ls_node>-name.
|
||||
<ls_exp>-sha1 = <ls_node>-sha1.
|
||||
<ls_exp>-chmod = <ls_node>-chmod.
|
||||
WHEN gc_chmod-dir.
|
||||
WHEN lif_defs=>gc_chmod-dir.
|
||||
lt_expanded = walk_tree(
|
||||
it_objects = it_objects
|
||||
iv_tree = <ls_node>-sha1
|
||||
|
@ -1427,7 +1434,7 @@ CLASS lcl_git_porcelain IMPLEMENTATION.
|
|||
ls_commit TYPE lcl_git_pack=>ty_commit.
|
||||
|
||||
|
||||
READ TABLE it_objects INTO ls_object WITH KEY sha1 = iv_branch type = gc_type-commit.
|
||||
READ TABLE it_objects INTO ls_object WITH KEY sha1 = iv_branch type = lif_defs=>gc_type-commit.
|
||||
IF sy-subrc <> 0.
|
||||
lcx_exception=>raise( 'commit not found' ).
|
||||
ENDIF.
|
||||
|
@ -1453,7 +1460,7 @@ CLASS lcl_git_porcelain IMPLEMENTATION.
|
|||
IMPORTING et_objects = et_objects
|
||||
ev_branch = ev_branch ).
|
||||
|
||||
READ TABLE et_objects INTO ls_object WITH KEY sha1 = ev_branch type = gc_type-commit.
|
||||
READ TABLE et_objects INTO ls_object WITH KEY sha1 = ev_branch type = lif_defs=>gc_type-commit.
|
||||
IF sy-subrc <> 0.
|
||||
lcx_exception=>raise( 'Commit/branch not found' ).
|
||||
ENDIF.
|
||||
|
@ -1510,7 +1517,6 @@ CLASS lcl_git_porcelain IMPLEMENTATION.
|
|||
|
||||
DATA: lt_nodes TYPE lcl_git_pack=>ty_nodes_tt,
|
||||
ls_tree LIKE LINE OF rt_trees,
|
||||
lv_sub TYPE string,
|
||||
lv_len TYPE i,
|
||||
lt_folders TYPE ty_folders_tt.
|
||||
|
||||
|
@ -1537,25 +1543,25 @@ CLASS lcl_git_porcelain IMPLEMENTATION.
|
|||
ENDLOOP.
|
||||
|
||||
* folders
|
||||
lv_sub = <ls_folder>-path && '+*'.
|
||||
LOOP AT lt_folders ASSIGNING <ls_sub>
|
||||
WHERE count = <ls_folder>-count + 1 AND path CP lv_sub.
|
||||
APPEND INITIAL LINE TO lt_nodes ASSIGNING <ls_node>.
|
||||
<ls_node>-chmod = gc_chmod-dir.
|
||||
LOOP AT lt_folders ASSIGNING <ls_sub> WHERE count = <ls_folder>-count + 1.
|
||||
lv_len = strlen( <ls_folder>-path ).
|
||||
IF strlen( <ls_sub>-path ) > lv_len AND <ls_sub>-path(lv_len) = <ls_folder>-path.
|
||||
APPEND INITIAL LINE TO lt_nodes ASSIGNING <ls_node>.
|
||||
<ls_node>-chmod = lif_defs=>gc_chmod-dir.
|
||||
|
||||
* extract folder name, this can probably be done easier using regular expressions
|
||||
lv_len = strlen( <ls_folder>-path ).
|
||||
<ls_node>-name = <ls_sub>-path+lv_len.
|
||||
lv_len = strlen( <ls_node>-name ) - 1.
|
||||
<ls_node>-name = <ls_node>-name(lv_len).
|
||||
<ls_node>-name = <ls_sub>-path+lv_len.
|
||||
lv_len = strlen( <ls_node>-name ) - 1.
|
||||
<ls_node>-name = <ls_node>-name(lv_len).
|
||||
|
||||
<ls_node>-sha1 = <ls_sub>-sha1.
|
||||
<ls_node>-sha1 = <ls_sub>-sha1.
|
||||
ENDIF.
|
||||
ENDLOOP.
|
||||
|
||||
CLEAR ls_tree.
|
||||
ls_tree-path = <ls_folder>-path.
|
||||
ls_tree-data = lcl_git_pack=>encode_tree( lt_nodes ).
|
||||
ls_tree-sha1 = lcl_hash=>sha1( iv_type = gc_type-tree iv_data = ls_tree-data ).
|
||||
ls_tree-sha1 = lcl_hash=>sha1( iv_type = lif_defs=>gc_type-tree iv_data = ls_tree-data ).
|
||||
APPEND ls_tree TO rt_trees.
|
||||
|
||||
<ls_folder>-sha1 = ls_tree-sha1.
|
||||
|
@ -1574,7 +1580,7 @@ CLASS lcl_git_porcelain IMPLEMENTATION.
|
|||
<ls_node> LIKE LINE OF lt_nodes.
|
||||
|
||||
|
||||
READ TABLE it_objects ASSIGNING <ls_tree> WITH KEY sha1 = iv_sha1 type = gc_type-tree.
|
||||
READ TABLE it_objects ASSIGNING <ls_tree> WITH KEY sha1 = iv_sha1 type = lif_defs=>gc_type-tree.
|
||||
IF sy-subrc <> 0.
|
||||
lcx_exception=>raise( 'Walk, tree not found' ).
|
||||
ENDIF.
|
||||
|
@ -1582,9 +1588,9 @@ CLASS lcl_git_porcelain IMPLEMENTATION.
|
|||
lt_nodes = lcl_git_pack=>decode_tree( <ls_tree>-data ).
|
||||
|
||||
LOOP AT lt_nodes ASSIGNING <ls_node>.
|
||||
IF <ls_node>-chmod = gc_chmod-file.
|
||||
IF <ls_node>-chmod = lif_defs=>gc_chmod-file.
|
||||
READ TABLE it_objects ASSIGNING <ls_blob>
|
||||
WITH KEY sha1 = <ls_node>-sha1 type = gc_type-blob.
|
||||
WITH KEY sha1 = <ls_node>-sha1 type = lif_defs=>gc_type-blob.
|
||||
IF sy-subrc <> 0.
|
||||
lcx_exception=>raise( 'Walk, blob not found' ).
|
||||
ENDIF.
|
||||
|
@ -1598,7 +1604,7 @@ CLASS lcl_git_porcelain IMPLEMENTATION.
|
|||
ENDIF.
|
||||
ENDLOOP.
|
||||
|
||||
LOOP AT lt_nodes ASSIGNING <ls_node> WHERE chmod = gc_chmod-dir.
|
||||
LOOP AT lt_nodes ASSIGNING <ls_node> WHERE chmod = lif_defs=>gc_chmod-dir.
|
||||
CONCATENATE iv_path <ls_node>-name '/' INTO lv_path.
|
||||
walk( EXPORTING it_objects = it_objects
|
||||
iv_sha1 = <ls_node>-sha1
|
||||
|
|
|
@ -98,7 +98,7 @@ CLASS lcl_git_branch_list DEFINITION FINAL.
|
|||
PUBLIC SECTION.
|
||||
TYPES: ty_git_branch_type TYPE char2.
|
||||
TYPES: BEGIN OF ty_git_branch,
|
||||
sha1 TYPE ty_sha1,
|
||||
sha1 TYPE lif_defs=>ty_sha1,
|
||||
name TYPE string,
|
||||
type TYPE ty_git_branch_type,
|
||||
is_head TYPE abap_bool,
|
||||
|
@ -216,7 +216,7 @@ CLASS lcl_git_branch_list IMPLEMENTATION.
|
|||
METHOD parse_branch_list.
|
||||
|
||||
DATA: lt_result TYPE TABLE OF string,
|
||||
lv_hash TYPE ty_sha1,
|
||||
lv_hash TYPE lif_defs=>ty_sha1,
|
||||
lv_name TYPE string,
|
||||
lv_head_params TYPE string,
|
||||
lv_char TYPE c,
|
||||
|
@ -226,7 +226,7 @@ CLASS lcl_git_branch_list IMPLEMENTATION.
|
|||
|
||||
CLEAR: et_list, ev_head_symref.
|
||||
|
||||
SPLIT iv_data AT gc_newline INTO TABLE lt_result.
|
||||
SPLIT iv_data AT lif_defs=>gc_newline INTO TABLE lt_result.
|
||||
|
||||
LOOP AT lt_result INTO lv_data.
|
||||
IF sy-tabix = 1.
|
||||
|
|
|
@ -115,19 +115,19 @@ CLASS lcl_gui IMPLEMENTATION.
|
|||
ENDIF.
|
||||
|
||||
CASE lv_state.
|
||||
WHEN gc_event_state-re_render.
|
||||
WHEN lif_defs=>gc_event_state-re_render.
|
||||
render( ).
|
||||
WHEN gc_event_state-new_page.
|
||||
WHEN lif_defs=>gc_event_state-new_page.
|
||||
call_page( li_page ).
|
||||
WHEN gc_event_state-new_page_w_bookmark.
|
||||
WHEN lif_defs=>gc_event_state-new_page_w_bookmark.
|
||||
call_page( ii_page = li_page iv_with_bookmark = abap_true ).
|
||||
WHEN gc_event_state-new_page_replacing.
|
||||
WHEN lif_defs=>gc_event_state-new_page_replacing.
|
||||
call_page( ii_page = li_page iv_replacing = abap_true ).
|
||||
WHEN gc_event_state-go_back.
|
||||
WHEN lif_defs=>gc_event_state-go_back.
|
||||
back( ).
|
||||
WHEN gc_event_state-go_back_to_bookmark.
|
||||
WHEN lif_defs=>gc_event_state-go_back_to_bookmark.
|
||||
back( iv_to_bookmark = abap_true ).
|
||||
WHEN gc_event_state-no_more_act.
|
||||
WHEN lif_defs=>gc_event_state-no_more_act.
|
||||
" Do nothing, handling completed
|
||||
WHEN OTHERS.
|
||||
lcx_exception=>raise( |Unknown action: { action }| ).
|
||||
|
@ -186,7 +186,7 @@ CLASS lcl_gui IMPLEMENTATION.
|
|||
|
||||
METHOD call_page.
|
||||
|
||||
DATA: ls_stack TYPE ty_page_stack.
|
||||
DATA: ls_stack TYPE ty_page_stack.
|
||||
|
||||
IF iv_replacing = abap_false AND NOT mi_cur_page IS INITIAL.
|
||||
ls_stack-page = mi_cur_page.
|
||||
|
@ -201,7 +201,7 @@ CLASS lcl_gui IMPLEMENTATION.
|
|||
|
||||
METHOD go_home.
|
||||
|
||||
on_event( action = |{ gc_action-go_main }| ). " doesn't accept strings directly
|
||||
on_event( action = |{ lif_defs=>gc_action-go_main }| ). " doesn't accept strings directly
|
||||
|
||||
ENDMETHOD. "go_home
|
||||
|
||||
|
@ -209,7 +209,7 @@ CLASS lcl_gui IMPLEMENTATION.
|
|||
|
||||
DATA: lt_events TYPE cntl_simple_events,
|
||||
ls_event LIKE LINE OF lt_events,
|
||||
lt_assets TYPE tt_web_assets.
|
||||
lt_assets TYPE lif_defs=>tt_web_assets.
|
||||
|
||||
FIELD-SYMBOLS <ls_asset> LIKE LINE OF lt_assets.
|
||||
|
||||
|
@ -281,11 +281,11 @@ CLASS lcl_gui IMPLEMENTATION.
|
|||
|
||||
CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
|
||||
EXPORTING
|
||||
text = iv_text
|
||||
text = iv_text
|
||||
IMPORTING
|
||||
buffer = lv_xstr
|
||||
buffer = lv_xstr
|
||||
EXCEPTIONS
|
||||
OTHERS = 1.
|
||||
OTHERS = 1.
|
||||
ASSERT sy-subrc = 0.
|
||||
|
||||
ELSE. " Raw input
|
||||
|
|
|
@ -11,7 +11,7 @@ CLASS lcl_gui_asset_manager DEFINITION FINAL CREATE PRIVATE FRIENDS lcl_gui.
|
|||
RAISING lcx_exception.
|
||||
|
||||
METHODS get_images
|
||||
RETURNING VALUE(rt_images) TYPE tt_web_assets.
|
||||
RETURNING VALUE(rt_images) TYPE lif_defs=>tt_web_assets.
|
||||
|
||||
CLASS-METHODS get_webfont_link
|
||||
RETURNING VALUE(rv_link) TYPE string.
|
||||
|
@ -29,7 +29,7 @@ CLASS lcl_gui_asset_manager DEFINITION FINAL CREATE PRIVATE FRIENDS lcl_gui.
|
|||
RAISING lcx_exception.
|
||||
|
||||
METHODS get_inline_images
|
||||
RETURNING VALUE(rt_images) TYPE tt_web_assets.
|
||||
RETURNING VALUE(rt_images) TYPE lif_defs=>tt_web_assets.
|
||||
|
||||
ENDCLASS. "lcl_gui_asset_manager
|
||||
|
||||
|
@ -136,13 +136,14 @@ CLASS lcl_gui_asset_manager IMPLEMENTATION.
|
|||
|
||||
ENDMETHOD. " get_images.
|
||||
|
||||
DEFINE _inline.
|
||||
APPEND &1 TO lt_data.
|
||||
END-OF-DEFINITION.
|
||||
|
||||
METHOD get_inline_asset.
|
||||
|
||||
DATA: lt_data TYPE ty_string_tt,
|
||||
* used by abapmerge
|
||||
DEFINE _inline.
|
||||
APPEND &1 TO lt_data.
|
||||
END-OF-DEFINITION.
|
||||
|
||||
DATA: lt_data TYPE lif_defs=>ty_string_tt,
|
||||
lv_str TYPE string.
|
||||
|
||||
CASE iv_asset_name.
|
||||
|
@ -154,7 +155,7 @@ CLASS lcl_gui_asset_manager IMPLEMENTATION.
|
|||
lcx_exception=>raise( |No inline resource: { iv_asset_name }| ).
|
||||
ENDCASE.
|
||||
|
||||
CONCATENATE LINES OF lt_data INTO lv_str SEPARATED BY gc_newline.
|
||||
CONCATENATE LINES OF lt_data INTO lv_str SEPARATED BY lif_defs=>gc_newline.
|
||||
|
||||
CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
|
||||
EXPORTING
|
||||
|
@ -169,7 +170,7 @@ CLASS lcl_gui_asset_manager IMPLEMENTATION.
|
|||
|
||||
METHOD get_inline_images.
|
||||
|
||||
DATA ls_image TYPE ty_web_asset.
|
||||
DATA ls_image TYPE lif_defs=>ty_web_asset.
|
||||
|
||||
* see https://github.com/larshp/abapGit/issues/201 for source SVG
|
||||
ls_image-url = 'img/logo' ##NO_TEXT.
|
||||
|
@ -262,7 +263,7 @@ CLASS lcl_gui_asset_manager IMPLEMENTATION.
|
|||
rv_link = '<link rel="stylesheet"'
|
||||
&& ' type="text/css" href="'
|
||||
&& 'https://cdnjs.cloudflare.com/ajax/libs/octicons/4.4.0/font/octicons.min.css'
|
||||
&& '">'. "#EC NOTEXT
|
||||
&& '">'. "#EC NOTEXT
|
||||
|
||||
ENDMETHOD. " get_webfont_link
|
||||
|
||||
|
|
|
@ -67,167 +67,174 @@ CLASS lcl_gui_router IMPLEMENTATION.
|
|||
DATA: lv_url TYPE string,
|
||||
lv_key TYPE lcl_persistence_repo=>ty_repo-key,
|
||||
ls_db TYPE lcl_persistence_db=>ty_content,
|
||||
ls_item TYPE ty_item.
|
||||
ls_item TYPE lif_defs=>ty_item.
|
||||
|
||||
lv_key = iv_getdata. " TODO refactor
|
||||
lv_url = iv_getdata. " TODO refactor
|
||||
|
||||
CASE iv_action.
|
||||
" General PAGE routing
|
||||
WHEN gc_action-go_main " Go Main page
|
||||
OR gc_action-go_explore " Go Explore page
|
||||
OR gc_action-go_db " Go DB util page
|
||||
OR gc_action-go_background_run " Go background run page
|
||||
OR gc_action-go_debuginfo " Go debug info page
|
||||
OR gc_action-go_settings. " Go settings page
|
||||
WHEN lif_defs=>gc_action-go_main " Go Main page
|
||||
OR lif_defs=>gc_action-go_explore " Go Explore page
|
||||
OR lif_defs=>gc_action-go_db " Go DB util page
|
||||
OR lif_defs=>gc_action-go_debuginfo " Go debug info page
|
||||
OR lif_defs=>gc_action-go_settings. " Go settings page
|
||||
ei_page = get_page_by_name( iv_action ).
|
||||
ev_state = gc_event_state-new_page.
|
||||
WHEN gc_action-go_background. " Go Background page
|
||||
ev_state = lif_defs=>gc_event_state-new_page.
|
||||
WHEN lif_defs=>gc_action-go_background_run. " Go background run page
|
||||
CREATE OBJECT ei_page TYPE lcl_gui_page_bkg_run.
|
||||
ev_state = lif_defs=>gc_event_state-new_page.
|
||||
WHEN lif_defs=>gc_action-go_background. " Go Background page
|
||||
ei_page = get_page_background( lv_key ).
|
||||
ev_state = gc_event_state-new_page.
|
||||
WHEN gc_action-go_diff. " Go Diff page
|
||||
ev_state = lif_defs=>gc_event_state-new_page.
|
||||
WHEN lif_defs=>gc_action-go_diff. " Go Diff page
|
||||
ei_page = get_page_diff(
|
||||
iv_getdata = iv_getdata
|
||||
iv_prev_page = iv_prev_page ).
|
||||
ev_state = gc_event_state-new_page_w_bookmark.
|
||||
WHEN gc_action-go_stage. " Go Staging page
|
||||
ev_state = lif_defs=>gc_event_state-new_page_w_bookmark.
|
||||
WHEN lif_defs=>gc_action-go_stage. " Go Staging page
|
||||
ei_page = get_page_stage( iv_getdata ).
|
||||
IF iv_prev_page = 'PAGE_DIFF'.
|
||||
ev_state = gc_event_state-new_page.
|
||||
ev_state = lif_defs=>gc_event_state-new_page.
|
||||
ELSE.
|
||||
ev_state = gc_event_state-new_page_w_bookmark.
|
||||
ev_state = lif_defs=>gc_event_state-new_page_w_bookmark.
|
||||
ENDIF.
|
||||
WHEN gc_action-go_branch_overview. " Go repo branch overview
|
||||
WHEN lif_defs=>gc_action-go_branch_overview. " Go repo branch overview
|
||||
ei_page = get_page_branch_overview( iv_getdata ).
|
||||
ev_state = gc_event_state-new_page.
|
||||
WHEN gc_action-go_playground. " Create playground page
|
||||
ev_state = lif_defs=>gc_event_state-new_page.
|
||||
WHEN lif_defs=>gc_action-go_playground. " Create playground page
|
||||
ei_page = get_page_playground( ).
|
||||
ev_state = gc_event_state-new_page.
|
||||
WHEN gc_action-go_tutorial. " Go to tutorial
|
||||
ev_state = lif_defs=>gc_event_state-new_page.
|
||||
WHEN lif_defs=>gc_action-go_tutorial. " Go to tutorial
|
||||
lcl_app=>user( )->set_repo_show( '' ). " Clear show_id
|
||||
ev_state = gc_event_state-re_render. " Assume we are on main page
|
||||
ev_state = lif_defs=>gc_event_state-re_render. " Assume we are on main page
|
||||
|
||||
" SAP GUI actions
|
||||
WHEN gc_action-jump. " Open object editor
|
||||
WHEN lif_defs=>gc_action-jump. " Open object editor
|
||||
lcl_html_action_utils=>jump_decode(
|
||||
EXPORTING iv_string = iv_getdata
|
||||
IMPORTING ev_obj_type = ls_item-obj_type
|
||||
ev_obj_name = ls_item-obj_name ).
|
||||
lcl_objects=>jump( ls_item ).
|
||||
ev_state = gc_event_state-no_more_act.
|
||||
WHEN gc_action-jump_pkg. " Open SE80
|
||||
ev_state = lif_defs=>gc_event_state-no_more_act.
|
||||
WHEN lif_defs=>gc_action-jump_pkg. " Open SE80
|
||||
lcl_services_repo=>open_se80( |{ iv_getdata }| ).
|
||||
ev_state = gc_event_state-no_more_act.
|
||||
ev_state = lif_defs=>gc_event_state-no_more_act.
|
||||
|
||||
" DB actions
|
||||
WHEN gc_action-db_display OR gc_action-db_edit. " DB Display/Edit
|
||||
ei_page = get_page_db_by_name( iv_name = iv_action iv_getdata = iv_getdata ).
|
||||
ev_state = gc_event_state-new_page.
|
||||
IF iv_prev_page = 'PAGE_DB_DISPLAY'.
|
||||
ev_state = gc_event_state-new_page_replacing.
|
||||
WHEN lif_defs=>gc_action-db_edit.
|
||||
ei_page = get_page_db_by_name( iv_name = iv_action
|
||||
iv_getdata = iv_getdata ).
|
||||
ev_state = lif_defs=>gc_event_state-new_page.
|
||||
IF iv_prev_page = 'PAGE_DB_DIS'.
|
||||
ev_state = lif_defs=>gc_event_state-new_page_replacing.
|
||||
ENDIF.
|
||||
WHEN gc_action-db_delete. " DB Delete
|
||||
WHEN lif_defs=>gc_action-db_display.
|
||||
ei_page = get_page_db_by_name( iv_name = 'DB_DIS'
|
||||
iv_getdata = iv_getdata ).
|
||||
ev_state = lif_defs=>gc_event_state-new_page.
|
||||
WHEN lif_defs=>gc_action-db_delete. " DB Delete
|
||||
ls_db = lcl_html_action_utils=>dbkey_decode( iv_getdata ).
|
||||
lcl_services_db=>delete( ls_db ).
|
||||
ev_state = gc_event_state-re_render.
|
||||
WHEN gc_action-db_update. " DB Update
|
||||
ev_state = lif_defs=>gc_event_state-re_render.
|
||||
WHEN lif_defs=>gc_action-db_update. " DB Update
|
||||
ls_db = lcl_html_action_utils=>dbcontent_decode( it_postdata ).
|
||||
lcl_services_db=>update( ls_db ).
|
||||
ev_state = gc_event_state-go_back.
|
||||
ev_state = lif_defs=>gc_event_state-go_back.
|
||||
|
||||
" ABAPGIT services actions
|
||||
WHEN gc_action-abapgit_home. " Go abapGit homepage
|
||||
WHEN lif_defs=>gc_action-abapgit_home. " Go abapGit homepage
|
||||
lcl_services_abapgit=>open_abapgit_homepage( ).
|
||||
ev_state = gc_event_state-no_more_act.
|
||||
WHEN gc_action-abapgit_wiki. " Go abapGit wikipage
|
||||
ev_state = lif_defs=>gc_event_state-no_more_act.
|
||||
WHEN lif_defs=>gc_action-abapgit_wiki. " Go abapGit wikipage
|
||||
lcl_services_abapgit=>open_abapgit_wikipage( ).
|
||||
ev_state = gc_event_state-no_more_act.
|
||||
WHEN gc_action-abapgit_install. " Install abapGit
|
||||
ev_state = lif_defs=>gc_event_state-no_more_act.
|
||||
WHEN lif_defs=>gc_action-abapgit_install. " Install abapGit
|
||||
lcl_services_abapgit=>install_abapgit( ).
|
||||
ev_state = gc_event_state-re_render.
|
||||
WHEN gc_action-abapgit_install_pi. " Install abapGit plugins
|
||||
ev_state = lif_defs=>gc_event_state-re_render.
|
||||
WHEN lif_defs=>gc_action-abapgit_install_pi. " Install abapGit plugins
|
||||
lcl_services_abapgit=>install_abapgit_pi( ).
|
||||
ev_state = gc_event_state-re_render.
|
||||
ev_state = lif_defs=>gc_event_state-re_render.
|
||||
|
||||
" REPOSITORY services actions
|
||||
WHEN gc_action-repo_newoffline. " New offline repo
|
||||
WHEN lif_defs=>gc_action-repo_newoffline. " New offline repo
|
||||
lcl_services_repo=>new_offline( ).
|
||||
ev_state = gc_event_state-re_render.
|
||||
WHEN gc_action-repo_refresh. " Repo refresh
|
||||
ev_state = lif_defs=>gc_event_state-re_render.
|
||||
WHEN lif_defs=>gc_action-repo_refresh. " Repo refresh
|
||||
lcl_services_repo=>refresh( lv_key ).
|
||||
ev_state = gc_event_state-re_render.
|
||||
WHEN gc_action-repo_purge. " Repo remove & purge all objects
|
||||
ev_state = lif_defs=>gc_event_state-re_render.
|
||||
WHEN lif_defs=>gc_action-repo_purge. " Repo remove & purge all objects
|
||||
lcl_services_repo=>purge( lv_key ).
|
||||
ev_state = gc_event_state-re_render.
|
||||
WHEN gc_action-repo_remove. " Repo remove
|
||||
ev_state = lif_defs=>gc_event_state-re_render.
|
||||
WHEN lif_defs=>gc_action-repo_remove. " Repo remove
|
||||
lcl_services_repo=>remove( lv_key ).
|
||||
ev_state = gc_event_state-re_render.
|
||||
WHEN gc_action-repo_clone OR 'install'. " Repo clone, 'install' is for explore page
|
||||
ev_state = lif_defs=>gc_event_state-re_render.
|
||||
WHEN lif_defs=>gc_action-repo_clone OR 'install'. " Repo clone, 'install' is for explore page
|
||||
lcl_services_repo=>clone( lv_url ).
|
||||
ev_state = gc_event_state-re_render.
|
||||
WHEN gc_action-repo_refresh_checksums. " Rebuil local checksums
|
||||
ev_state = lif_defs=>gc_event_state-re_render.
|
||||
WHEN lif_defs=>gc_action-repo_refresh_checksums. " Rebuil local checksums
|
||||
lcl_services_repo=>refresh_local_checksums( lv_key ).
|
||||
ev_state = gc_event_state-re_render.
|
||||
WHEN gc_action-repo_toggle_fav. " Toggle repo as favorite
|
||||
ev_state = lif_defs=>gc_event_state-re_render.
|
||||
WHEN lif_defs=>gc_action-repo_toggle_fav. " Toggle repo as favorite
|
||||
lcl_services_repo=>toggle_favorite( lv_key ).
|
||||
ev_state = gc_event_state-re_render.
|
||||
WHEN gc_action-repo_transport_to_branch.
|
||||
ev_state = lif_defs=>gc_event_state-re_render.
|
||||
WHEN lif_defs=>gc_action-repo_transport_to_branch.
|
||||
lcl_services_repo=>transport_to_branch( iv_repository_key = lv_key ).
|
||||
ev_state = gc_event_state-re_render.
|
||||
WHEN gc_action-repo_settings.
|
||||
CREATE OBJECT ei_page TYPE lcl_gui_page_repo_settings
|
||||
ev_state = lif_defs=>gc_event_state-re_render.
|
||||
WHEN lif_defs=>gc_action-repo_settings.
|
||||
CREATE OBJECT ei_page TYPE lcl_gui_page_repo_sett
|
||||
EXPORTING
|
||||
io_repo = lcl_app=>repo_srv( )->get( lv_key ).
|
||||
ev_state = gc_event_state-new_page.
|
||||
ev_state = lif_defs=>gc_event_state-new_page.
|
||||
|
||||
" ZIP services actions
|
||||
WHEN gc_action-zip_import. " Import repo from ZIP
|
||||
WHEN lif_defs=>gc_action-zip_import. " Import repo from ZIP
|
||||
lcl_zip=>import( lv_key ).
|
||||
ev_state = gc_event_state-re_render.
|
||||
WHEN gc_action-zip_export. " Export repo as ZIP
|
||||
ev_state = lif_defs=>gc_event_state-re_render.
|
||||
WHEN lif_defs=>gc_action-zip_export. " Export repo as ZIP
|
||||
lcl_zip=>export( lcl_app=>repo_srv( )->get( lv_key ) ).
|
||||
ev_state = gc_event_state-no_more_act.
|
||||
WHEN gc_action-zip_package. " Export package as ZIP
|
||||
ev_state = lif_defs=>gc_event_state-no_more_act.
|
||||
WHEN lif_defs=>gc_action-zip_package. " Export package as ZIP
|
||||
lcl_zip=>export_package( ).
|
||||
ev_state = gc_event_state-no_more_act.
|
||||
WHEN gc_action-zip_transport. " Export transport as ZIP
|
||||
ev_state = lif_defs=>gc_event_state-no_more_act.
|
||||
WHEN lif_defs=>gc_action-zip_transport. " Export transport as ZIP
|
||||
lcl_transport=>zip( ).
|
||||
ev_state = gc_event_state-no_more_act.
|
||||
WHEN gc_action-zip_object. " Export object as ZIP
|
||||
ev_state = lif_defs=>gc_event_state-no_more_act.
|
||||
WHEN lif_defs=>gc_action-zip_object. " Export object as ZIP
|
||||
lcl_zip=>export_object( ).
|
||||
ev_state = gc_event_state-no_more_act.
|
||||
ev_state = lif_defs=>gc_event_state-no_more_act.
|
||||
|
||||
" Remote ORIGIN manipulations
|
||||
WHEN gc_action-repo_remote_attach. " Remote attach
|
||||
WHEN lif_defs=>gc_action-repo_remote_attach. " Remote attach
|
||||
lcl_services_repo=>remote_attach( lv_key ).
|
||||
ev_state = gc_event_state-re_render.
|
||||
WHEN gc_action-repo_remote_detach. " Remote detach
|
||||
ev_state = lif_defs=>gc_event_state-re_render.
|
||||
WHEN lif_defs=>gc_action-repo_remote_detach. " Remote detach
|
||||
lcl_services_repo=>remote_detach( lv_key ).
|
||||
ev_state = gc_event_state-re_render.
|
||||
WHEN gc_action-repo_remote_change. " Remote change
|
||||
ev_state = lif_defs=>gc_event_state-re_render.
|
||||
WHEN lif_defs=>gc_action-repo_remote_change. " Remote change
|
||||
lcl_services_repo=>remote_change( lv_key ).
|
||||
ev_state = gc_event_state-re_render.
|
||||
ev_state = lif_defs=>gc_event_state-re_render.
|
||||
|
||||
" GIT actions
|
||||
WHEN gc_action-git_pull. " GIT Pull
|
||||
WHEN lif_defs=>gc_action-git_pull. " GIT Pull
|
||||
lcl_services_git=>pull( lv_key ).
|
||||
ev_state = gc_event_state-re_render.
|
||||
WHEN gc_action-git_reset. " GIT Reset
|
||||
ev_state = lif_defs=>gc_event_state-re_render.
|
||||
WHEN lif_defs=>gc_action-git_reset. " GIT Reset
|
||||
lcl_services_git=>reset( lv_key ).
|
||||
ev_state = gc_event_state-re_render.
|
||||
WHEN gc_action-git_branch_create. " GIT Create new branch
|
||||
ev_state = lif_defs=>gc_event_state-re_render.
|
||||
WHEN lif_defs=>gc_action-git_branch_create. " GIT Create new branch
|
||||
lcl_services_git=>create_branch( lv_key ).
|
||||
ev_state = gc_event_state-re_render.
|
||||
WHEN gc_action-git_branch_delete. " GIT Delete remote branch
|
||||
ev_state = lif_defs=>gc_event_state-re_render.
|
||||
WHEN lif_defs=>gc_action-git_branch_delete. " GIT Delete remote branch
|
||||
lcl_services_git=>delete_branch( lv_key ).
|
||||
ev_state = gc_event_state-re_render.
|
||||
WHEN gc_action-git_branch_switch. " GIT Switch branch
|
||||
ev_state = lif_defs=>gc_event_state-re_render.
|
||||
WHEN lif_defs=>gc_action-git_branch_switch. " GIT Switch branch
|
||||
lcl_services_git=>switch_branch( lv_key ).
|
||||
ev_state = gc_event_state-re_render.
|
||||
ev_state = lif_defs=>gc_event_state-re_render.
|
||||
|
||||
"Others
|
||||
WHEN OTHERS.
|
||||
ev_state = gc_event_state-not_handled.
|
||||
ev_state = lif_defs=>gc_event_state-not_handled.
|
||||
ENDCASE.
|
||||
|
||||
ENDMETHOD. " on_event
|
||||
|
@ -273,7 +280,7 @@ CLASS lcl_gui_router IMPLEMENTATION.
|
|||
METHOD get_page_branch_overview.
|
||||
|
||||
DATA: lo_repo TYPE REF TO lcl_repo_online,
|
||||
lo_page TYPE REF TO lcl_gui_page_branch_overview,
|
||||
lo_page TYPE REF TO lcl_gui_page_boverview,
|
||||
lv_key TYPE lcl_persistence_repo=>ty_repo-key.
|
||||
|
||||
|
||||
|
@ -291,8 +298,8 @@ CLASS lcl_gui_router IMPLEMENTATION.
|
|||
|
||||
METHOD get_page_diff.
|
||||
|
||||
DATA: ls_file TYPE ty_file,
|
||||
ls_object TYPE ty_item,
|
||||
DATA: ls_file TYPE lif_defs=>ty_file,
|
||||
ls_object TYPE lif_defs=>ty_item,
|
||||
lo_page TYPE REF TO lcl_gui_page_diff,
|
||||
lv_key TYPE lcl_persistence_repo=>ty_repo-key.
|
||||
|
||||
|
@ -346,7 +353,7 @@ CLASS lcl_gui_router IMPLEMENTATION.
|
|||
|
||||
METHOD get_page_background.
|
||||
|
||||
CREATE OBJECT ri_page TYPE lcl_gui_page_background
|
||||
CREATE OBJECT ri_page TYPE lcl_gui_page_bkg
|
||||
EXPORTING
|
||||
iv_key = iv_key.
|
||||
|
||||
|
|
|
@ -2,10 +2,6 @@
|
|||
*& Include ZABAPGIT_HTML
|
||||
*&---------------------------------------------------------------------*
|
||||
|
||||
DEFINE _add.
|
||||
ro_html->add( &1 ) ##NO_TEXT.
|
||||
END-OF-DEFINITION.
|
||||
|
||||
*----------------------------------------------------------------------*
|
||||
* CLASS lcl_html DEFINITION
|
||||
*----------------------------------------------------------------------*
|
||||
|
@ -28,7 +24,7 @@ CLASS lcl_html DEFINITION FINAL.
|
|||
IMPORTING
|
||||
iv_txt TYPE string
|
||||
iv_act TYPE string
|
||||
iv_typ TYPE char1 DEFAULT gc_action_type-sapevent
|
||||
iv_typ TYPE char1 DEFAULT lif_defs=>gc_action_type-sapevent
|
||||
iv_opt TYPE clike OPTIONAL
|
||||
iv_class TYPE string OPTIONAL
|
||||
iv_id TYPE string OPTIONAL
|
||||
|
@ -38,31 +34,30 @@ CLASS lcl_html DEFINITION FINAL.
|
|||
IMPORTING
|
||||
iv_name TYPE string
|
||||
iv_hint TYPE string OPTIONAL
|
||||
iv_alt TYPE string OPTIONAL
|
||||
iv_class TYPE string OPTIONAL.
|
||||
|
||||
CLASS-METHODS a
|
||||
IMPORTING
|
||||
iv_txt TYPE string
|
||||
iv_act TYPE string
|
||||
iv_typ TYPE char1 DEFAULT gc_action_type-sapevent
|
||||
iv_opt TYPE clike OPTIONAL
|
||||
iv_class TYPE string OPTIONAL
|
||||
iv_id TYPE string OPTIONAL
|
||||
iv_style TYPE string OPTIONAL
|
||||
iv_txt TYPE string
|
||||
iv_act TYPE string
|
||||
iv_typ TYPE char1 DEFAULT lif_defs=>gc_action_type-sapevent
|
||||
iv_opt TYPE clike OPTIONAL
|
||||
iv_class TYPE string OPTIONAL
|
||||
iv_id TYPE string OPTIONAL
|
||||
iv_style TYPE string OPTIONAL
|
||||
RETURNING VALUE(rv_str) TYPE string.
|
||||
|
||||
CLASS-METHODS icon
|
||||
IMPORTING
|
||||
iv_name TYPE string
|
||||
iv_hint TYPE string OPTIONAL
|
||||
iv_alt TYPE string OPTIONAL
|
||||
iv_class TYPE string OPTIONAL
|
||||
iv_name TYPE string
|
||||
iv_hint TYPE string OPTIONAL
|
||||
iv_class TYPE string OPTIONAL
|
||||
RETURNING VALUE(rv_str) TYPE string.
|
||||
|
||||
PRIVATE SECTION.
|
||||
CLASS-DATA go_single_tags_re TYPE REF TO cl_abap_regex.
|
||||
DATA mt_buffer TYPE string_table.
|
||||
CLASS-DATA: go_single_tags_re TYPE REF TO cl_abap_regex.
|
||||
|
||||
DATA: mt_buffer TYPE string_table.
|
||||
|
||||
TYPES:
|
||||
BEGIN OF ty_indent_context,
|
||||
|
@ -74,15 +69,15 @@ CLASS lcl_html DEFINITION FINAL.
|
|||
END OF ty_indent_context,
|
||||
|
||||
BEGIN OF ty_study_result,
|
||||
style_open TYPE abap_bool,
|
||||
style_close TYPE abap_bool,
|
||||
script_open TYPE abap_bool,
|
||||
script_close TYPE abap_bool,
|
||||
tag_close TYPE abap_bool,
|
||||
curly_close TYPE abap_bool,
|
||||
openings TYPE i,
|
||||
closings TYPE i,
|
||||
singles TYPE i,
|
||||
style_open TYPE abap_bool,
|
||||
style_close TYPE abap_bool,
|
||||
script_open TYPE abap_bool,
|
||||
script_close TYPE abap_bool,
|
||||
tag_close TYPE abap_bool,
|
||||
curly_close TYPE abap_bool,
|
||||
openings TYPE i,
|
||||
closings TYPE i,
|
||||
singles TYPE i,
|
||||
END OF ty_study_result.
|
||||
|
||||
METHODS indent_line
|
||||
|
@ -91,9 +86,8 @@ CLASS lcl_html DEFINITION FINAL.
|
|||
cv_line TYPE string.
|
||||
|
||||
METHODS study_line
|
||||
IMPORTING
|
||||
iv_line TYPE string
|
||||
is_context TYPE ty_indent_context
|
||||
IMPORTING iv_line TYPE string
|
||||
is_context TYPE ty_indent_context
|
||||
RETURNING VALUE(rs_result) TYPE ty_study_result.
|
||||
|
||||
ENDCLASS. "lcl_html DEFINITION
|
||||
|
@ -108,8 +102,7 @@ CLASS lcl_html IMPLEMENTATION.
|
|||
DATA: lv_type TYPE c,
|
||||
lo_html TYPE REF TO lcl_html.
|
||||
|
||||
FIELD-SYMBOLS: <tab> TYPE string_table,
|
||||
<str> LIKE LINE OF <tab>.
|
||||
FIELD-SYMBOLS: <tab> TYPE string_table.
|
||||
|
||||
DESCRIBE FIELD iv_chunk TYPE lv_type. " Describe is faster than RTTI classes
|
||||
|
||||
|
@ -268,7 +261,7 @@ CLASS lcl_html IMPLEMENTATION.
|
|||
indent_line( CHANGING cs_context = ls_context cv_line = <line_c> ).
|
||||
ENDLOOP.
|
||||
|
||||
CONCATENATE LINES OF lt_temp INTO rv_html SEPARATED BY gc_newline.
|
||||
CONCATENATE LINES OF lt_temp INTO rv_html SEPARATED BY lif_defs=>gc_newline.
|
||||
|
||||
ENDMETHOD. "render
|
||||
|
||||
|
@ -294,13 +287,13 @@ CLASS lcl_html IMPLEMENTATION.
|
|||
|
||||
lv_class = iv_class.
|
||||
|
||||
IF iv_opt CA gc_html_opt-strong.
|
||||
IF iv_opt CA lif_defs=>gc_html_opt-strong.
|
||||
lv_class = lv_class && ' emphasis' ##NO_TEXT.
|
||||
ENDIF.
|
||||
IF iv_opt CA gc_html_opt-cancel.
|
||||
IF iv_opt CA lif_defs=>gc_html_opt-cancel.
|
||||
lv_class = lv_class && ' attention' ##NO_TEXT.
|
||||
ENDIF.
|
||||
IF iv_opt CA gc_html_opt-crossout.
|
||||
IF iv_opt CA lif_defs=>gc_html_opt-crossout.
|
||||
lv_class = lv_class && ' crossout grey' ##NO_TEXT.
|
||||
ENDIF.
|
||||
IF lv_class IS NOT INITIAL.
|
||||
|
@ -309,16 +302,16 @@ CLASS lcl_html IMPLEMENTATION.
|
|||
ENDIF.
|
||||
|
||||
lv_href = ' href="#"'. " Default, dummy
|
||||
IF iv_act IS NOT INITIAL OR iv_typ = gc_action_type-dummy.
|
||||
IF iv_act IS NOT INITIAL OR iv_typ = lif_defs=>gc_action_type-dummy.
|
||||
CASE iv_typ.
|
||||
WHEN gc_action_type-url.
|
||||
WHEN lif_defs=>gc_action_type-url.
|
||||
lv_href = | href="{ iv_act }"|.
|
||||
WHEN gc_action_type-sapevent.
|
||||
WHEN lif_defs=>gc_action_type-sapevent.
|
||||
lv_href = | href="sapevent:{ iv_act }"|.
|
||||
WHEN gc_action_type-onclick.
|
||||
WHEN lif_defs=>gc_action_type-onclick.
|
||||
lv_href = ' href="#"'.
|
||||
lv_click = | onclick="{ iv_act }"|.
|
||||
WHEN gc_action_type-dummy.
|
||||
WHEN lif_defs=>gc_action_type-dummy.
|
||||
lv_href = ' href="#"'.
|
||||
ENDCASE.
|
||||
ENDIF.
|
||||
|
@ -339,7 +332,6 @@ CLASS lcl_html IMPLEMENTATION.
|
|||
|
||||
add( icon( iv_name = iv_name
|
||||
iv_class = iv_class
|
||||
iv_alt = iv_alt
|
||||
iv_hint = iv_hint ) ).
|
||||
|
||||
ENDMETHOD. "add_icon
|
||||
|
@ -383,7 +375,7 @@ CLASS lcl_html_toolbar DEFINITION FINAL.
|
|||
IMPORTING
|
||||
iv_txt TYPE string
|
||||
io_sub TYPE REF TO lcl_html_toolbar OPTIONAL
|
||||
iv_typ TYPE c DEFAULT gc_action_type-sapevent
|
||||
iv_typ TYPE c DEFAULT lif_defs=>gc_action_type-sapevent
|
||||
iv_act TYPE string OPTIONAL
|
||||
iv_ico TYPE string OPTIONAL
|
||||
iv_cur TYPE abap_bool OPTIONAL
|
||||
|
@ -395,18 +387,18 @@ CLASS lcl_html_toolbar DEFINITION FINAL.
|
|||
RETURNING VALUE(rv_count) TYPE i,
|
||||
render
|
||||
IMPORTING
|
||||
iv_right TYPE abap_bool OPTIONAL
|
||||
iv_sort TYPE abap_bool OPTIONAL
|
||||
iv_right TYPE abap_bool OPTIONAL
|
||||
iv_sort TYPE abap_bool OPTIONAL
|
||||
RETURNING
|
||||
VALUE(ro_html) TYPE REF TO lcl_html,
|
||||
VALUE(ro_html) TYPE REF TO lcl_html,
|
||||
render_as_droplist
|
||||
IMPORTING
|
||||
iv_label TYPE string
|
||||
iv_right TYPE abap_bool OPTIONAL
|
||||
iv_sort TYPE abap_bool OPTIONAL
|
||||
iv_corner TYPE abap_bool OPTIONAL
|
||||
iv_label TYPE string
|
||||
iv_right TYPE abap_bool OPTIONAL
|
||||
iv_sort TYPE abap_bool OPTIONAL
|
||||
iv_corner TYPE abap_bool OPTIONAL
|
||||
RETURNING
|
||||
VALUE(ro_html) TYPE REF TO lcl_html.
|
||||
VALUE(ro_html) TYPE REF TO lcl_html.
|
||||
|
||||
PRIVATE SECTION.
|
||||
TYPES:
|
||||
|
@ -431,9 +423,9 @@ CLASS lcl_html_toolbar DEFINITION FINAL.
|
|||
METHODS:
|
||||
render_items
|
||||
IMPORTING
|
||||
iv_sort TYPE abap_bool OPTIONAL
|
||||
iv_sort TYPE abap_bool OPTIONAL
|
||||
RETURNING
|
||||
VALUE(ro_html) TYPE REF TO lcl_html.
|
||||
VALUE(ro_html) TYPE REF TO lcl_html.
|
||||
|
||||
ENDCLASS. "lcl_html_toolbar DEFINITION
|
||||
|
||||
|
@ -453,9 +445,9 @@ CLASS lcl_html_toolbar IMPLEMENTATION.
|
|||
METHOD add.
|
||||
DATA ls_item TYPE ty_item.
|
||||
|
||||
ASSERT iv_typ = gc_action_type-separator " sep doesn't have action
|
||||
OR iv_typ = gc_action_type-onclick " click may have no action (assigned in JS)
|
||||
OR iv_typ = gc_action_type-dummy " dummy may have no action
|
||||
ASSERT iv_typ = lif_defs=>gc_action_type-separator " sep doesn't have action
|
||||
OR iv_typ = lif_defs=>gc_action_type-onclick " click may have no action (assigned in JS)
|
||||
OR iv_typ = lif_defs=>gc_action_type-dummy " dummy may have no action
|
||||
OR iv_act IS INITIAL AND io_sub IS NOT INITIAL
|
||||
OR iv_act IS NOT INITIAL AND io_sub IS INITIAL. " Only one supplied
|
||||
|
||||
|
@ -510,7 +502,7 @@ CLASS lcl_html_toolbar IMPLEMENTATION.
|
|||
ro_html->add( |<div class="{ lv_class }">| ).
|
||||
ro_html->add( '<ul><li>' ).
|
||||
ro_html->add_a( iv_txt = iv_label
|
||||
iv_typ = gc_action_type-dummy
|
||||
iv_typ = lif_defs=>gc_action_type-dummy
|
||||
iv_act = '' ).
|
||||
ro_html->add( '<div class="minizone"></div>' ).
|
||||
ro_html->add( render_items( iv_sort = iv_sort ) ).
|
||||
|
@ -553,7 +545,7 @@ CLASS lcl_html_toolbar IMPLEMENTATION.
|
|||
LOOP AT mt_items ASSIGNING <item>.
|
||||
CLEAR: lv_class, lv_icon.
|
||||
|
||||
IF <item>-typ = gc_action_type-separator.
|
||||
IF <item>-typ = lif_defs=>gc_action_type-separator.
|
||||
ro_html->add( |<li class="separator">{ <item>-txt }</li>| ).
|
||||
CONTINUE.
|
||||
ENDIF.
|
||||
|
@ -587,7 +579,7 @@ CLASS lcl_html_toolbar IMPLEMENTATION.
|
|||
iv_opt = <item>-opt ).
|
||||
ELSE.
|
||||
ro_html->add_a( iv_txt = lv_icon && <item>-txt
|
||||
iv_typ = gc_action_type-dummy
|
||||
iv_typ = lif_defs=>gc_action_type-dummy
|
||||
iv_act = ''
|
||||
iv_id = <item>-id
|
||||
iv_opt = <item>-opt ).
|
||||
|
|
|
@ -80,7 +80,7 @@ CLASS lcl_html_action_utils DEFINITION FINAL.
|
|||
|
||||
CLASS-METHODS decode_bg_update
|
||||
IMPORTING iv_getdata TYPE clike
|
||||
RETURNING VALUE(rs_fields) TYPE lcl_persistence_background=>ty_background.
|
||||
RETURNING VALUE(rs_fields) TYPE lcl_persist_background=>ty_background.
|
||||
|
||||
CLASS-METHODS stage_decode
|
||||
IMPORTING iv_getdata TYPE clike
|
||||
|
@ -302,7 +302,8 @@ CLASS lcl_html_action_utils IMPLEMENTATION.
|
|||
CLEAR es_fields.
|
||||
|
||||
CONCATENATE LINES OF it_postdata INTO lv_string.
|
||||
REPLACE ALL OCCURRENCES OF gc_newline IN lv_string WITH lc_replace.
|
||||
REPLACE ALL OCCURRENCES OF lif_defs=>gc_crlf IN lv_string WITH lc_replace.
|
||||
REPLACE ALL OCCURRENCES OF lif_defs=>gc_newline IN lv_string WITH lc_replace.
|
||||
lt_fields = parse_fields( lv_string ).
|
||||
|
||||
get_field( EXPORTING name = 'COMMITTER_NAME' it = lt_fields CHANGING cv = es_fields ).
|
||||
|
@ -314,7 +315,7 @@ CLASS lcl_html_action_utils IMPLEMENTATION.
|
|||
|
||||
ASSIGN COMPONENT 'BODY' OF STRUCTURE es_fields TO <body>.
|
||||
ASSERT <body> IS ASSIGNED.
|
||||
REPLACE ALL OCCURRENCES OF lc_replace IN <body> WITH gc_newline.
|
||||
REPLACE ALL OCCURRENCES OF lc_replace IN <body> WITH lif_defs=>gc_newline.
|
||||
|
||||
ASSERT es_fields IS NOT INITIAL.
|
||||
|
||||
|
|
|
@ -7,9 +7,9 @@ CLASS lcl_gui_chunk_lib DEFINITION FINAL.
|
|||
PUBLIC SECTION.
|
||||
|
||||
CLASS-METHODS render_error
|
||||
IMPORTING ix_error TYPE REF TO lcx_exception OPTIONAL
|
||||
iv_error TYPE string OPTIONAL
|
||||
RETURNING VALUE(ro_html) TYPE REF TO lcl_html.
|
||||
IMPORTING ix_error TYPE REF TO lcx_exception OPTIONAL
|
||||
iv_error TYPE string OPTIONAL
|
||||
RETURNING VALUE(ro_html) TYPE REF TO lcl_html.
|
||||
|
||||
CLASS-METHODS render_repo_top
|
||||
IMPORTING io_repo TYPE REF TO lcl_repo
|
||||
|
@ -17,13 +17,14 @@ CLASS lcl_gui_chunk_lib DEFINITION FINAL.
|
|||
iv_show_branch TYPE abap_bool DEFAULT abap_true
|
||||
iv_interactive_branch TYPE abap_bool DEFAULT abap_false
|
||||
iv_branch TYPE string OPTIONAL
|
||||
io_news TYPE REF TO lcl_news OPTIONAL
|
||||
RETURNING VALUE(ro_html) TYPE REF TO lcl_html
|
||||
RAISING lcx_exception.
|
||||
|
||||
CLASS-METHODS render_item_state
|
||||
IMPORTING iv1 TYPE char1
|
||||
iv2 TYPE char1
|
||||
RETURNING VALUE(rv_html) TYPE string.
|
||||
IMPORTING iv1 TYPE char1
|
||||
iv2 TYPE char1
|
||||
RETURNING VALUE(rv_html) TYPE string.
|
||||
|
||||
CLASS-METHODS render_branch_span
|
||||
IMPORTING iv_branch TYPE string
|
||||
|
@ -36,6 +37,12 @@ CLASS lcl_gui_chunk_lib DEFINITION FINAL.
|
|||
RETURNING VALUE(ro_html) TYPE REF TO lcl_html
|
||||
RAISING lcx_exception.
|
||||
|
||||
CLASS-METHODS render_news
|
||||
IMPORTING
|
||||
io_news TYPE REF TO lcl_news
|
||||
RETURNING VALUE(ro_html) TYPE REF TO lcl_html
|
||||
RAISING lcx_exception.
|
||||
|
||||
ENDCLASS. "lcl_gui_chunk_lib
|
||||
|
||||
CLASS lcl_gui_chunk_lib IMPLEMENTATION.
|
||||
|
@ -43,7 +50,7 @@ CLASS lcl_gui_chunk_lib IMPLEMENTATION.
|
|||
METHOD render_repo_top.
|
||||
|
||||
DATA: lo_repo_online TYPE REF TO lcl_repo_online,
|
||||
lo_pback TYPE REF TO lcl_persistence_background,
|
||||
lo_pback TYPE REF TO lcl_persist_background,
|
||||
lv_hint TYPE string,
|
||||
lv_icon TYPE string.
|
||||
|
||||
|
@ -62,34 +69,54 @@ CLASS lcl_gui_chunk_lib IMPLEMENTATION.
|
|||
ro_html->add( '<table class="w100"><tr>' ).
|
||||
|
||||
ro_html->add( '<td class="repo_name">' ).
|
||||
|
||||
" Repo type and name
|
||||
ro_html->add_icon( iv_name = lv_icon iv_hint = lv_hint ).
|
||||
ro_html->add( |<span class="name">{ io_repo->get_name( ) }</span>| ).
|
||||
IF io_repo->is_offline( ) = abap_false.
|
||||
lo_repo_online ?= io_repo.
|
||||
ro_html->add( |<span class="url">{ lo_repo_online->get_url( ) }</span>| ).
|
||||
ENDIF.
|
||||
|
||||
" News
|
||||
IF io_news IS BOUND AND io_news->has_news( ) = abap_true.
|
||||
IF io_news->has_updates( ) = abap_true.
|
||||
lv_icon = 'arrow-up/warning'.
|
||||
ELSE.
|
||||
lv_icon = 'arrow-up/grey80'.
|
||||
ENDIF.
|
||||
ro_html->add_a( iv_act = 'displayNews()'
|
||||
iv_typ = lif_defs=>gc_action_type-onclick
|
||||
iv_txt = lcl_html=>icon( iv_name = lv_icon
|
||||
iv_class = 'pad-sides'
|
||||
iv_hint = 'Display changelog' ) ).
|
||||
ENDIF.
|
||||
ro_html->add( '</td>' ).
|
||||
|
||||
ro_html->add( '<td class="repo_attr right">' ).
|
||||
|
||||
" Fav
|
||||
IF abap_true = lcl_app=>user( )->is_favorite_repo( io_repo->get_key( ) ).
|
||||
lv_icon = 'star/blue' ##NO_TEXT.
|
||||
ELSE.
|
||||
lv_icon = 'star/grey' ##NO_TEXT.
|
||||
ENDIF.
|
||||
ro_html->add_a( iv_act = |{ gc_action-repo_toggle_fav }?{ io_repo->get_key( ) }|
|
||||
ro_html->add_a( iv_act = |{ lif_defs=>gc_action-repo_toggle_fav }?{ io_repo->get_key( ) }|
|
||||
iv_txt = lcl_html=>icon( iv_name = lv_icon
|
||||
iv_class = 'pad-sides'
|
||||
iv_hint = 'Click to toggle favorite' ) ).
|
||||
|
||||
" BG
|
||||
IF lo_pback->exists( io_repo->get_key( ) ) = abap_true.
|
||||
ro_html->add( '<span class="bg_marker" title="background">BG</span>' ).
|
||||
ENDIF.
|
||||
|
||||
" Write protect
|
||||
IF io_repo->is_write_protected( ) = abap_true.
|
||||
ro_html->add_icon( iv_name = 'lock/darkgrey' iv_hint = 'Locked from pulls' ).
|
||||
ENDIF.
|
||||
|
||||
" Branch
|
||||
IF io_repo->is_offline( ) = abap_false.
|
||||
lo_repo_online ?= io_repo.
|
||||
IF iv_show_branch = abap_true.
|
||||
|
@ -105,11 +132,12 @@ CLASS lcl_gui_chunk_lib IMPLEMENTATION.
|
|||
ENDIF.
|
||||
ENDIF.
|
||||
|
||||
" Package
|
||||
IF iv_show_package = abap_true.
|
||||
ro_html->add_icon( iv_name = 'package/darkgrey' iv_hint = 'SAP package' ).
|
||||
ro_html->add( '<span>' ).
|
||||
ro_html->add_a( iv_txt = io_repo->get_package( )
|
||||
iv_act = |{ gc_action-jump_pkg }?{ io_repo->get_package( ) }| ).
|
||||
iv_act = |{ lif_defs=>gc_action-jump_pkg }?{ io_repo->get_package( ) }| ).
|
||||
ro_html->add( '</span>' ).
|
||||
ENDIF.
|
||||
|
||||
|
@ -138,19 +166,19 @@ CLASS lcl_gui_chunk_lib IMPLEMENTATION.
|
|||
ENDCASE.
|
||||
|
||||
CASE <state>.
|
||||
WHEN gc_state-unchanged. "None or unchanged
|
||||
IF iv1 = gc_state-added OR iv2 = gc_state-added.
|
||||
WHEN lif_defs=>gc_state-unchanged. "None or unchanged
|
||||
IF iv1 = lif_defs=>gc_state-added OR iv2 = lif_defs=>gc_state-added.
|
||||
rv_html = rv_html && |<span class="none" title="{ lv_system } Not exists">X</span>|.
|
||||
ELSE.
|
||||
rv_html = rv_html && |<span class="none" title="{ lv_system } No changes"> </span>|.
|
||||
ENDIF.
|
||||
WHEN gc_state-modified. "Changed
|
||||
WHEN lif_defs=>gc_state-modified. "Changed
|
||||
rv_html = rv_html && |<span class="changed" title="{ lv_system } Modified">M</span>|.
|
||||
WHEN gc_state-added. "Added new
|
||||
WHEN lif_defs=>gc_state-added. "Added new
|
||||
rv_html = rv_html && |<span class="added" title="{ lv_system } Added new">A</span>|.
|
||||
WHEN gc_state-mixed. "Multiple changes (multifile)
|
||||
WHEN lif_defs=>gc_state-mixed. "Multiple changes (multifile)
|
||||
rv_html = rv_html && |<span class="mixed" title="{ lv_system } Multiple changes">■</span>|.
|
||||
WHEN gc_state-deleted. "Deleted
|
||||
WHEN lif_defs=>gc_state-deleted. "Deleted
|
||||
rv_html = rv_html && |<span class="deleted" title="{ lv_system } Deleted">D</span>|.
|
||||
ENDCASE.
|
||||
ENDDO.
|
||||
|
@ -179,7 +207,7 @@ CLASS lcl_gui_chunk_lib IMPLEMENTATION.
|
|||
ro_html->add( |<span class="{ lv_class }">| ).
|
||||
ro_html->add_icon( iv_name = 'git-branch/darkgrey' iv_hint = 'Current branch' ).
|
||||
IF iv_interactive = abap_true.
|
||||
ro_html->add_a( iv_act = |{ gc_action-git_branch_switch }?{ io_repo->get_key( ) }|
|
||||
ro_html->add_a( iv_act = |{ lif_defs=>gc_action-git_branch_switch }?{ io_repo->get_key( ) }|
|
||||
iv_txt = lv_text ).
|
||||
ELSE.
|
||||
ro_html->add( lv_text ).
|
||||
|
@ -215,4 +243,64 @@ CLASS lcl_gui_chunk_lib IMPLEMENTATION.
|
|||
ro_html->add( '</div>' ).
|
||||
ENDMETHOD. "render_js_error_stub
|
||||
|
||||
METHOD render_news.
|
||||
|
||||
DATA: lv_text TYPE string,
|
||||
lv_display TYPE string,
|
||||
lt_log TYPE lcl_news=>tt_log.
|
||||
|
||||
FIELD-SYMBOLS: <line> LIKE LINE OF lt_log.
|
||||
|
||||
CREATE OBJECT ro_html.
|
||||
|
||||
IF io_news IS NOT BOUND OR io_news->has_news( ) = abap_false.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
|
||||
lt_log = io_news->get_log( ).
|
||||
|
||||
IF io_news->has_unseen( ) = abap_false.
|
||||
lv_display = 'display:none'.
|
||||
ENDIF.
|
||||
|
||||
ro_html->add( |<div id="news" class="news" style="{ lv_display }">| ).
|
||||
|
||||
ro_html->add( '<div class="headbar title">Announcement of the latest changes'
|
||||
&& '<div class="float-right">'
|
||||
&& lcl_html=>a(
|
||||
iv_txt = '❌'
|
||||
iv_typ = lif_defs=>gc_action_type-onclick
|
||||
iv_act = 'displayNews()'
|
||||
iv_class = 'close-btn' )
|
||||
&& '</div></div>' ).
|
||||
|
||||
IF io_news->has_important( ) = abap_true.
|
||||
ro_html->add( '<div class="headbar important">'
|
||||
&& lcl_html=>icon( iv_name = 'alert' iv_class = 'pad-right' )
|
||||
&& 'Please note changes marked with "!"'
|
||||
&& '</div>' ).
|
||||
ENDIF.
|
||||
|
||||
" Generate news
|
||||
ro_html->add( |<div class="newslist">| ).
|
||||
LOOP AT lt_log ASSIGNING <line>.
|
||||
IF <line>-is_header = abap_true.
|
||||
IF <line>-pos_to_cur > 0.
|
||||
lv_text = <line>-text && '<span class="version-marker update">update</span>'.
|
||||
ELSEIF <line>-pos_to_cur = 0.
|
||||
lv_text = <line>-text && '<span class="version-marker">current</span>'.
|
||||
ELSE. " < 0
|
||||
lv_text = <line>-text.
|
||||
ENDIF.
|
||||
ro_html->add( |<h1>{ lv_text }</h1>| ).
|
||||
ELSE.
|
||||
ro_html->add( |<li>{ <line>-text }</li>| ).
|
||||
ENDIF.
|
||||
ENDLOOP.
|
||||
ro_html->add( '</div>' ).
|
||||
|
||||
ro_html->add( '</div>' ).
|
||||
|
||||
ENDMETHOD. "render_news
|
||||
|
||||
ENDCLASS. "lcl_gui_chunk_lib
|
||||
|
|
|
@ -2,20 +2,68 @@
|
|||
*& Include ZABAPGIT_HTTP
|
||||
*&---------------------------------------------------------------------*
|
||||
|
||||
CLASS lcl_proxy_auth DEFINITION FINAL.
|
||||
|
||||
PUBLIC SECTION.
|
||||
CLASS-METHODS:
|
||||
run
|
||||
IMPORTING ii_client TYPE REF TO if_http_client
|
||||
RAISING lcx_exception.
|
||||
|
||||
PRIVATE SECTION.
|
||||
CLASS-DATA: gv_username TYPE string,
|
||||
gv_password TYPE string.
|
||||
|
||||
CLASS-METHODS: enter RAISING lcx_exception.
|
||||
|
||||
ENDCLASS.
|
||||
|
||||
CLASS lcl_proxy_auth IMPLEMENTATION.
|
||||
|
||||
METHOD run.
|
||||
|
||||
IF gv_username IS INITIAL OR gv_password IS INITIAL.
|
||||
enter( ).
|
||||
ENDIF.
|
||||
|
||||
ii_client->authenticate(
|
||||
proxy_authentication = abap_true
|
||||
username = gv_username
|
||||
password = gv_password ).
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD enter.
|
||||
|
||||
lcl_password_dialog=>popup(
|
||||
EXPORTING
|
||||
iv_repo_url = 'Proxy Authentication'
|
||||
CHANGING
|
||||
cv_user = gv_username
|
||||
cv_pass = gv_password ).
|
||||
|
||||
IF gv_username IS INITIAL OR gv_password IS INITIAL.
|
||||
lcx_exception=>raise( 'Proxy auth failed' ).
|
||||
ENDIF.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
ENDCLASS.
|
||||
|
||||
CLASS lcl_http_digest DEFINITION FINAL.
|
||||
|
||||
PUBLIC SECTION.
|
||||
METHODS:
|
||||
constructor
|
||||
IMPORTING
|
||||
ii_client TYPE REF TO if_http_client
|
||||
iv_username TYPE string
|
||||
iv_password TYPE string
|
||||
RAISING lcx_exception,
|
||||
ii_client TYPE REF TO if_http_client
|
||||
iv_username TYPE string
|
||||
iv_password TYPE string
|
||||
RAISING lcx_exception,
|
||||
run
|
||||
IMPORTING
|
||||
ii_client TYPE REF TO if_http_client
|
||||
RAISING lcx_exception.
|
||||
ii_client TYPE REF TO if_http_client
|
||||
RAISING lcx_exception.
|
||||
|
||||
PRIVATE SECTION.
|
||||
DATA: mv_ha1 TYPE string,
|
||||
|
@ -29,22 +77,22 @@ CLASS lcl_http_digest DEFINITION FINAL.
|
|||
CLASS-METHODS:
|
||||
md5
|
||||
IMPORTING
|
||||
iv_data TYPE string
|
||||
iv_data TYPE string
|
||||
RETURNING
|
||||
VALUE(rv_hash) TYPE string
|
||||
RAISING lcx_exception.
|
||||
VALUE(rv_hash) TYPE string
|
||||
RAISING lcx_exception.
|
||||
|
||||
METHODS:
|
||||
hash
|
||||
IMPORTING
|
||||
iv_qop TYPE string
|
||||
iv_nonce TYPE string
|
||||
iv_uri TYPE string
|
||||
iv_method TYPE string
|
||||
iv_cnonse TYPE string
|
||||
iv_qop TYPE string
|
||||
iv_nonce TYPE string
|
||||
iv_uri TYPE string
|
||||
iv_method TYPE string
|
||||
iv_cnonse TYPE string
|
||||
RETURNING
|
||||
VALUE(rv_response) TYPE string
|
||||
RAISING lcx_exception,
|
||||
VALUE(rv_response) TYPE string
|
||||
RAISING lcx_exception,
|
||||
parse
|
||||
IMPORTING
|
||||
ii_client TYPE REF TO if_http_client.
|
||||
|
@ -63,16 +111,16 @@ CLASS lcl_http_client DEFINITION FINAL.
|
|||
IMPORTING io_digest TYPE REF TO lcl_http_digest,
|
||||
send_receive_close
|
||||
IMPORTING
|
||||
iv_data TYPE xstring
|
||||
iv_data TYPE xstring
|
||||
RETURNING
|
||||
VALUE(rv_data) TYPE xstring
|
||||
RAISING lcx_exception,
|
||||
VALUE(rv_data) TYPE xstring
|
||||
RAISING lcx_exception,
|
||||
get_cdata
|
||||
RETURNING VALUE(rv_value) TYPE string,
|
||||
check_http_200
|
||||
RAISING lcx_exception,
|
||||
RAISING lcx_exception,
|
||||
send_receive
|
||||
RAISING lcx_exception,
|
||||
RAISING lcx_exception,
|
||||
set_headers
|
||||
IMPORTING iv_url TYPE string
|
||||
iv_service TYPE string
|
||||
|
@ -347,9 +395,9 @@ CLASS lcl_http DEFINITION FINAL.
|
|||
IMPORTING iv_url TYPE string
|
||||
RETURNING VALUE(rv_bool) TYPE abap_bool,
|
||||
acquire_login_details
|
||||
IMPORTING ii_client TYPE REF TO if_http_client
|
||||
io_client TYPE REF TO lcl_http_client
|
||||
iv_url TYPE string
|
||||
IMPORTING ii_client TYPE REF TO if_http_client
|
||||
io_client TYPE REF TO lcl_http_client
|
||||
iv_url TYPE string
|
||||
RETURNING VALUE(rv_scheme) TYPE string
|
||||
RAISING lcx_exception.
|
||||
|
||||
|
@ -360,7 +408,7 @@ CLASS lcl_http IMPLEMENTATION.
|
|||
METHOD get_agent.
|
||||
|
||||
* bitbucket require agent prefix = "git/"
|
||||
rv_agent = 'git/abapGit-' && gc_abap_version.
|
||||
rv_agent = 'git/abapGit-' && lif_defs=>gc_abap_version.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
@ -369,7 +417,8 @@ CLASS lcl_http IMPLEMENTATION.
|
|||
DATA: lv_uri TYPE string,
|
||||
lv_scheme TYPE string,
|
||||
li_client TYPE REF TO if_http_client,
|
||||
lo_settings TYPE REF TO lcl_settings.
|
||||
lo_settings TYPE REF TO lcl_settings,
|
||||
lv_text TYPE string.
|
||||
|
||||
|
||||
lo_settings = lcl_app=>settings( )->read( ).
|
||||
|
@ -381,7 +430,28 @@ CLASS lcl_http IMPLEMENTATION.
|
|||
proxy_host = lo_settings->get_proxy_url( )
|
||||
proxy_service = lo_settings->get_proxy_port( )
|
||||
IMPORTING
|
||||
client = li_client ).
|
||||
client = li_client
|
||||
EXCEPTIONS
|
||||
argument_not_found = 1
|
||||
plugin_not_active = 2
|
||||
internal_error = 3
|
||||
OTHERS = 4 ).
|
||||
IF sy-subrc <> 0.
|
||||
CASE sy-subrc.
|
||||
WHEN 1.
|
||||
" make sure:
|
||||
" a) SSL is setup properly in STRUST
|
||||
lv_text = 'HTTPS ARGUMENT_NOT_FOUND | STRUST/SSL Setup correct?'.
|
||||
WHEN OTHERS.
|
||||
lv_text = 'While creating HTTP Client'. "#EC NOTEXT
|
||||
|
||||
ENDCASE.
|
||||
lcx_exception=>raise( lv_text ).
|
||||
ENDIF.
|
||||
|
||||
IF lo_settings->get_proxy_authentication( ) = abap_true.
|
||||
lcl_proxy_auth=>run( li_client ).
|
||||
ENDIF.
|
||||
|
||||
CREATE OBJECT ro_client
|
||||
EXPORTING
|
||||
|
@ -469,10 +539,10 @@ CLASS lcl_http IMPLEMENTATION.
|
|||
|
||||
METHOD acquire_login_details.
|
||||
|
||||
DATA: lv_default_user TYPE string,
|
||||
lv_user TYPE string,
|
||||
lv_pass TYPE string,
|
||||
lo_digest TYPE REF TO lcl_http_digest.
|
||||
DATA: lv_default_user TYPE string,
|
||||
lv_user TYPE string,
|
||||
lv_pass TYPE string,
|
||||
lo_digest TYPE REF TO lcl_http_digest.
|
||||
|
||||
|
||||
lv_default_user = lcl_app=>user( )->get_repo_login( iv_url ).
|
||||
|
@ -495,7 +565,7 @@ CLASS lcl_http IMPLEMENTATION.
|
|||
ENDIF.
|
||||
|
||||
" Offer two factor authentication if it is available and required
|
||||
lcl_2fa_authenticator_registry=>use_2fa_if_required(
|
||||
lcl_2fa_auth_registry=>use_2fa_if_required(
|
||||
EXPORTING
|
||||
iv_url = iv_url
|
||||
CHANGING
|
||||
|
|
|
@ -499,3 +499,13 @@ DiffHelper.prototype.highlightButton = function(state) {
|
|||
this.dom.filterButton.classList.remove("bgorange");
|
||||
}
|
||||
};
|
||||
|
||||
/**********************************************************
|
||||
* Other functions
|
||||
**********************************************************/
|
||||
|
||||
// News announcement
|
||||
function displayNews() {
|
||||
var div = document.getElementById("news");
|
||||
div.style.display = (div.style.display)?'':'none';
|
||||
}
|
||||
|
|
|
@ -1,23 +1,3 @@
|
|||
*&---------------------------------------------------------------------*
|
||||
*& Include ZABAPGIT_MACROS
|
||||
*&---------------------------------------------------------------------*
|
||||
|
||||
* Macros
|
||||
|
||||
DEFINE _object_check_timestamp.
|
||||
IF sy-subrc = 0 AND &1 IS NOT INITIAL AND &2 IS NOT INITIAL.
|
||||
cl_abap_tstmp=>systemtstmp_syst2utc(
|
||||
EXPORTING syst_date = &1
|
||||
syst_time = &2
|
||||
IMPORTING utc_tstmp = lv_ts ).
|
||||
IF lv_ts < iv_timestamp.
|
||||
rv_changed = abap_false. " Unchanged
|
||||
ELSE.
|
||||
rv_changed = abap_true.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
ELSE. " Not found? => changed
|
||||
rv_changed = abap_true.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
END-OF-DEFINITION.
|
||||
|
|
|
@ -21,7 +21,7 @@ CLASS lcl_migrations IMPLEMENTATION.
|
|||
METHOD run.
|
||||
|
||||
" Migrate STDTEXT to TABLE
|
||||
lcl_persistence_migrate=>run( ).
|
||||
lcl_persist_migrate=>run( ).
|
||||
|
||||
" Rebuild local file checksums
|
||||
rebuild_local_checksums_161112( ).
|
||||
|
@ -34,8 +34,10 @@ CLASS lcl_migrations IMPLEMENTATION.
|
|||
METHOD local_dot_abapgit.
|
||||
|
||||
DATA: lt_repos TYPE lcl_repo_srv=>ty_repo_tt,
|
||||
lv_msg TYPE string,
|
||||
lv_shown TYPE abap_bool,
|
||||
lo_dot_abapgit TYPE REF TO lcl_dot_abapgit.
|
||||
lo_dot_abapgit TYPE REF TO lcl_dot_abapgit,
|
||||
lx_exception TYPE REF TO lcx_exception.
|
||||
|
||||
FIELD-SYMBOLS: <lo_repo> LIKE LINE OF lt_repos.
|
||||
|
||||
|
@ -56,8 +58,28 @@ CLASS lcl_migrations IMPLEMENTATION.
|
|||
txt2 = 'Login to remote repositories if needed'.
|
||||
lv_shown = abap_true.
|
||||
ENDIF.
|
||||
<lo_repo>->refresh( ).
|
||||
|
||||
" Skip repos that cannot be fetched.
|
||||
" Particuarly useful on systems where users do not allow
|
||||
" everybody to fetch their repos.
|
||||
TRY.
|
||||
<lo_repo>->refresh( ).
|
||||
CATCH lcx_exception INTO lx_exception.
|
||||
lv_msg = |Please do not use the "{ <lo_repo>->get_name( ) }" repository until migrated|.
|
||||
CALL FUNCTION 'POPUP_TO_INFORM'
|
||||
EXPORTING
|
||||
titel = 'Migration has failed'
|
||||
txt1 = lx_exception->mv_text
|
||||
txt2 = lv_msg
|
||||
txt3 = 'You will be prompted to migrate the repository every time you run abapGit.'
|
||||
txt4 = 'You can safely remove the repository in its ''Advanced -> Remove'' menu.'.
|
||||
CONTINUE.
|
||||
ENDTRY.
|
||||
|
||||
lo_dot_abapgit = <lo_repo>->find_remote_dot_abapgit( ).
|
||||
IF lo_dot_abapgit IS INITIAL. " .abapgit.xml is not in the remote repo yet
|
||||
lo_dot_abapgit = lcl_dot_abapgit=>build_default( ).
|
||||
ENDIF.
|
||||
ENDIF.
|
||||
<lo_repo>->set_dot_abapgit( lo_dot_abapgit ).
|
||||
ENDIF.
|
||||
|
|
529
src/zabapgit_news.prog.abap
Normal file
|
@ -0,0 +1,529 @@
|
|||
*&---------------------------------------------------------------------*
|
||||
*& Include ZABAPGIT_NEWS
|
||||
*&---------------------------------------------------------------------*
|
||||
CLASS ltcl_news DEFINITION DEFERRED.
|
||||
|
||||
*&---------------------------------------------------------------------*
|
||||
*& Class lcl_news
|
||||
*&---------------------------------------------------------------------*
|
||||
* Class responsible for preparation of data for news announcements
|
||||
*----------------------------------------------------------------------*
|
||||
CLASS lcl_news DEFINITION CREATE PRIVATE FRIENDS ltcl_news.
|
||||
|
||||
PUBLIC SECTION.
|
||||
|
||||
CONSTANTS: c_tail_length TYPE i VALUE 5. " Number of versions to display if no updates
|
||||
|
||||
TYPES:
|
||||
BEGIN OF ty_log,
|
||||
version TYPE string,
|
||||
pos_to_cur TYPE i,
|
||||
is_header TYPE abap_bool,
|
||||
is_important TYPE abap_bool,
|
||||
text TYPE string,
|
||||
END OF ty_log,
|
||||
tt_log TYPE STANDARD TABLE OF ty_log WITH DEFAULT KEY.
|
||||
|
||||
CLASS-METHODS:
|
||||
create " TODO REFACTOR
|
||||
IMPORTING io_repo TYPE REF TO lcl_repo
|
||||
RETURNING VALUE(ro_instance) TYPE REF TO lcl_news
|
||||
RAISING lcx_exception.
|
||||
|
||||
METHODS:
|
||||
get_log
|
||||
RETURNING VALUE(rt_log) TYPE tt_log,
|
||||
latest_version
|
||||
RETURNING VALUE(rv_version) TYPE string,
|
||||
has_news
|
||||
RETURNING VALUE(rv_boolean) TYPE abap_bool,
|
||||
has_important
|
||||
RETURNING VALUE(rv_boolean) TYPE abap_bool,
|
||||
has_updates
|
||||
RETURNING VALUE(rv_boolean) TYPE abap_bool,
|
||||
has_unseen
|
||||
RETURNING VALUE(rv_boolean) TYPE abap_bool.
|
||||
|
||||
PRIVATE SECTION.
|
||||
DATA: mt_log TYPE tt_log,
|
||||
mv_current_version TYPE string,
|
||||
mv_lastseen_version TYPE string,
|
||||
mv_latest_version TYPE string.
|
||||
|
||||
METHODS:
|
||||
constructor
|
||||
IMPORTING iv_rawdata TYPE xstring
|
||||
iv_lastseen_version TYPE string
|
||||
iv_current_version TYPE string.
|
||||
|
||||
CLASS-METHODS:
|
||||
version_to_numeric
|
||||
IMPORTING iv_version TYPE string
|
||||
RETURNING VALUE(rv_version) TYPE i,
|
||||
normalize_version
|
||||
IMPORTING iv_version TYPE string
|
||||
RETURNING VALUE(rv_version) TYPE string,
|
||||
compare_versions
|
||||
IMPORTING iv_a TYPE string
|
||||
iv_b TYPE string
|
||||
RETURNING VALUE(rv_result) TYPE i,
|
||||
parse_line
|
||||
IMPORTING iv_line TYPE string
|
||||
iv_current_version TYPE string
|
||||
RETURNING VALUE(rs_log) TYPE ty_log,
|
||||
parse
|
||||
IMPORTING it_lines TYPE string_table
|
||||
iv_current_version TYPE string
|
||||
RETURNING VALUE(rt_log) TYPE tt_log.
|
||||
|
||||
ENDCLASS. "lcl_news
|
||||
|
||||
*----------------------------------------------------------------------*
|
||||
* CLASS lcl_news IMPLEMENTATION
|
||||
*----------------------------------------------------------------------*
|
||||
*
|
||||
*----------------------------------------------------------------------*
|
||||
CLASS lcl_news IMPLEMENTATION.
|
||||
|
||||
METHOD create. " TODO REFACTOR !
|
||||
|
||||
CONSTANTS: " TODO refactor
|
||||
lc_log_path TYPE string VALUE '/',
|
||||
lc_log_filename TYPE string VALUE 'changelog.txt'.
|
||||
|
||||
DATA: lt_remote TYPE lif_defs=>ty_files_tt,
|
||||
lv_last_seen TYPE string,
|
||||
lv_url TYPE string,
|
||||
lo_repo_online TYPE REF TO lcl_repo_online.
|
||||
|
||||
FIELD-SYMBOLS <file> LIKE LINE OF lt_remote.
|
||||
|
||||
IF io_repo->is_offline( ) = abap_true.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
|
||||
lo_repo_online ?= io_repo.
|
||||
lv_url = lo_repo_online->get_url( ).
|
||||
|
||||
" News announcement temporary restricted to abapGit only
|
||||
IF lv_url NS '/abapGit.git'. " TODO refactor
|
||||
RETURN.
|
||||
ENDIF.
|
||||
|
||||
lv_last_seen = lcl_app=>user( )->get_repo_last_change_seen( lv_url ).
|
||||
|
||||
" Find changelog
|
||||
lt_remote = io_repo->get_files_remote( ).
|
||||
READ TABLE lt_remote ASSIGNING <file>
|
||||
WITH KEY path = lc_log_path filename = lc_log_filename.
|
||||
|
||||
IF sy-subrc = 0.
|
||||
CREATE OBJECT ro_instance
|
||||
EXPORTING
|
||||
iv_rawdata = <file>-data
|
||||
iv_current_version = lif_defs=>gc_abap_version " TODO refactor
|
||||
iv_lastseen_version = normalize_version( lv_last_seen ).
|
||||
ENDIF.
|
||||
|
||||
IF ro_instance IS BOUND.
|
||||
lcl_app=>user( )->set_repo_last_change_seen(
|
||||
iv_url = lv_url
|
||||
iv_version = ro_instance->latest_version( ) ).
|
||||
ENDIF.
|
||||
|
||||
ENDMETHOD. "create
|
||||
|
||||
METHOD constructor.
|
||||
|
||||
DATA: lt_lines TYPE string_table,
|
||||
lv_string TYPE string,
|
||||
ls_log_line LIKE LINE OF mt_log.
|
||||
|
||||
" Validate params
|
||||
mv_current_version = normalize_version( iv_current_version ).
|
||||
mv_lastseen_version = normalize_version( iv_lastseen_version ).
|
||||
IF mv_current_version IS INITIAL.
|
||||
RETURN. " Internal format of program version is not correct -> abort parsing
|
||||
ENDIF.
|
||||
|
||||
lv_string = lcl_convert=>xstring_to_string_utf8( iv_rawdata ).
|
||||
lt_lines = lcl_convert=>split_string( lv_string ).
|
||||
mt_log = parse( it_lines = lt_lines iv_current_version = mv_current_version ).
|
||||
|
||||
READ TABLE mt_log INTO ls_log_line INDEX 1.
|
||||
mv_latest_version = ls_log_line-version. " Empty if not found
|
||||
|
||||
ENDMETHOD. "constructor
|
||||
|
||||
METHOD parse.
|
||||
|
||||
DATA: lv_tail TYPE i,
|
||||
lv_first_version_found TYPE abap_bool,
|
||||
lv_version TYPE string,
|
||||
ls_log LIKE LINE OF rt_log.
|
||||
|
||||
FIELD-SYMBOLS: <line> LIKE LINE OF it_lines.
|
||||
|
||||
LOOP AT it_lines ASSIGNING <line>.
|
||||
ls_log = parse_line( iv_line = <line> iv_current_version = iv_current_version ).
|
||||
|
||||
" Skip until first version head and Skip empty lines
|
||||
CHECK ls_log IS NOT INITIAL AND
|
||||
( lv_first_version_found = abap_true OR ls_log-version IS NOT INITIAL ).
|
||||
|
||||
IF lv_first_version_found = abap_false.
|
||||
lv_first_version_found = abap_true.
|
||||
IF compare_versions( iv_a = ls_log-version iv_b = iv_current_version ) <= 0.
|
||||
lv_tail = c_tail_length. " Display some last versions if no updates
|
||||
ENDIF.
|
||||
ENDIF.
|
||||
|
||||
IF ls_log-is_header = abap_true.
|
||||
"Skip everything below current version or show tail news
|
||||
IF compare_versions( iv_a = ls_log-version iv_b = iv_current_version ) <= 0.
|
||||
IF lv_tail > 0.
|
||||
lv_tail = lv_tail - 1.
|
||||
ELSE.
|
||||
EXIT.
|
||||
ENDIF.
|
||||
ENDIF.
|
||||
lv_version = ls_log-version. " Save to fill news lines
|
||||
ELSE.
|
||||
ls_log-version = lv_version.
|
||||
ENDIF.
|
||||
|
||||
APPEND ls_log TO rt_log.
|
||||
ENDLOOP.
|
||||
|
||||
ENDMETHOD. "parse
|
||||
|
||||
METHOD parse_line.
|
||||
|
||||
CONSTANTS: lc_header_pattern TYPE string
|
||||
VALUE '^\d{4}-\d{2}-\d{2}\s+v(\d{1,3}\.\d{1,3}\.\d{1,3})\s*$'.
|
||||
|
||||
DATA: lv_version TYPE string.
|
||||
|
||||
IF iv_line IS INITIAL OR iv_line CO ' -='.
|
||||
RETURN. " Skip empty and markup lines
|
||||
ENDIF.
|
||||
|
||||
" Check if line is a header line
|
||||
FIND FIRST OCCURRENCE OF REGEX lc_header_pattern IN iv_line SUBMATCHES lv_version.
|
||||
IF sy-subrc IS INITIAL.
|
||||
lv_version = normalize_version( lv_version ).
|
||||
rs_log-version = lv_version.
|
||||
rs_log-is_header = abap_true.
|
||||
rs_log-pos_to_cur = compare_versions( iv_a = lv_version iv_b = iv_current_version ).
|
||||
ELSE.
|
||||
FIND FIRST OCCURRENCE OF REGEX '^\s*!' IN iv_line.
|
||||
rs_log-is_important = boolc( sy-subrc IS INITIAL ). " Change is important
|
||||
ENDIF.
|
||||
|
||||
rs_log-text = iv_line.
|
||||
|
||||
ENDMETHOD. "parse_line
|
||||
|
||||
METHOD get_log.
|
||||
rt_log = me->mt_log.
|
||||
ENDMETHOD. "get_log
|
||||
|
||||
METHOD latest_version.
|
||||
rv_version = me->mv_latest_version.
|
||||
ENDMETHOD. "latest_version
|
||||
|
||||
METHOD has_news.
|
||||
rv_boolean = boolc( lines( mt_log ) > 0 ).
|
||||
ENDMETHOD. "has_news
|
||||
|
||||
METHOD has_important.
|
||||
READ TABLE mt_log WITH KEY is_important = abap_true TRANSPORTING NO FIELDS.
|
||||
rv_boolean = boolc( sy-subrc IS INITIAL ).
|
||||
ENDMETHOD. "has_important_news
|
||||
|
||||
METHOD has_updates.
|
||||
rv_boolean = boolc( compare_versions(
|
||||
iv_a = mv_latest_version
|
||||
iv_b = mv_current_version ) > 0 ).
|
||||
ENDMETHOD. "has_updates
|
||||
|
||||
METHOD has_unseen.
|
||||
rv_boolean = boolc( compare_versions(
|
||||
iv_a = mv_latest_version
|
||||
iv_b = mv_lastseen_version ) > 0 ).
|
||||
ENDMETHOD. "has_unseen
|
||||
|
||||
METHOD compare_versions.
|
||||
|
||||
DATA: lv_version_a TYPE i,
|
||||
lv_version_b TYPE i.
|
||||
|
||||
" Convert versions to numeric
|
||||
lv_version_a = version_to_numeric( iv_a ).
|
||||
lv_version_b = version_to_numeric( iv_b ).
|
||||
|
||||
" Compare versions
|
||||
IF lv_version_a > lv_version_b.
|
||||
rv_result = 1.
|
||||
ELSEIF lv_version_a < lv_version_b.
|
||||
rv_result = -1.
|
||||
ELSE.
|
||||
rv_result = 0.
|
||||
ENDIF.
|
||||
|
||||
ENDMETHOD. "compare_versions
|
||||
|
||||
METHOD normalize_version.
|
||||
|
||||
" Internal program version should be in format "XXX.XXX.XXX" or "vXXX.XXX.XXX"
|
||||
CONSTANTS: lc_version_pattern TYPE string VALUE '^v?(\d{1,3}\.\d{1,3}\.\d{1,3})\s*$'.
|
||||
|
||||
FIND FIRST OCCURRENCE OF REGEX lc_version_pattern
|
||||
IN iv_version SUBMATCHES rv_version.
|
||||
|
||||
ENDMETHOD. "normalize_version
|
||||
|
||||
METHOD version_to_numeric.
|
||||
|
||||
DATA: lv_major TYPE numc4,
|
||||
lv_minor TYPE numc4,
|
||||
lv_release TYPE numc4.
|
||||
|
||||
SPLIT iv_version AT '.' INTO lv_major lv_minor lv_release.
|
||||
|
||||
" Calculated value of version number, empty version will become 0 which is OK
|
||||
rv_version = lv_major * 1000000 + lv_minor * 1000 + lv_release.
|
||||
|
||||
ENDMETHOD. "convert_version_to_numeric
|
||||
|
||||
ENDCLASS. "lcl_news
|
||||
|
||||
*----------------------------------------------------------------------*
|
||||
* CLASS ltcl_news DEFINITION
|
||||
*----------------------------------------------------------------------*
|
||||
* Definition of test class for news announcement
|
||||
*----------------------------------------------------------------------*
|
||||
CLASS ltcl_news DEFINITION FINAL FOR TESTING RISK LEVEL HARMLESS DURATION SHORT.
|
||||
|
||||
PRIVATE SECTION.
|
||||
|
||||
METHODS:
|
||||
version_to_numeric FOR TESTING,
|
||||
compare_versions FOR TESTING,
|
||||
normalize_version FOR TESTING,
|
||||
parse_line FOR TESTING,
|
||||
parse FOR TESTING.
|
||||
|
||||
ENDCLASS. "ltcl_news DEFINITION
|
||||
|
||||
*----------------------------------------------------------------------*
|
||||
* CLASS ltcl_news IMPLEMENTATION
|
||||
*----------------------------------------------------------------------*
|
||||
* Implementation of test class for news announcement
|
||||
*----------------------------------------------------------------------*
|
||||
CLASS ltcl_news IMPLEMENTATION.
|
||||
|
||||
METHOD version_to_numeric.
|
||||
|
||||
DATA: lv_version_exp TYPE i VALUE 1023010,
|
||||
lv_version_act TYPE i.
|
||||
|
||||
lv_version_act = lcl_news=>version_to_numeric( '1.23.10' ).
|
||||
|
||||
cl_abap_unit_assert=>assert_equals( exp = lv_version_exp
|
||||
act = lv_version_act
|
||||
msg = ' Error during conversion of version to numeric value' ).
|
||||
|
||||
ENDMETHOD. "convert_version_to_numeric
|
||||
|
||||
METHOD compare_versions.
|
||||
|
||||
DATA lv_result TYPE i.
|
||||
|
||||
" Case 1: version A > version B
|
||||
lv_result = lcl_news=>compare_versions( iv_a = '1.28.10' iv_b = '1.23.10' ).
|
||||
|
||||
cl_abap_unit_assert=>assert_equals( exp = 1
|
||||
act = lv_result
|
||||
msg = ' Error during comparison of versions. Case: A > B' ).
|
||||
|
||||
CLEAR: lv_result.
|
||||
|
||||
" Case 2: version A < version B
|
||||
lv_result = lcl_news=>compare_versions( iv_a = '1.28.10' iv_b = '2.23.10' ).
|
||||
|
||||
cl_abap_unit_assert=>assert_equals( exp = -1
|
||||
act = lv_result
|
||||
msg = ' Error during comparison of versions. Case: A < B' ).
|
||||
|
||||
CLEAR: lv_result.
|
||||
|
||||
" Case 3: version A = version B
|
||||
lv_result = lcl_news=>compare_versions( iv_a = '1.28.10' iv_b = '1.28.10' ).
|
||||
|
||||
cl_abap_unit_assert=>assert_equals( exp = 0
|
||||
act = lv_result
|
||||
msg = ' Error during comparison of versions. Case: A = B' ).
|
||||
|
||||
ENDMETHOD. "compare_versions
|
||||
|
||||
METHOD normalize_version.
|
||||
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
act = lcl_news=>normalize_version( '1.28.10' )
|
||||
exp = '1.28.10' ).
|
||||
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
act = lcl_news=>normalize_version( 'v1.28.10' )
|
||||
exp = '1.28.10' ).
|
||||
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
act = lcl_news=>normalize_version( 'b1.28.10' )
|
||||
exp = '' ).
|
||||
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
act = lcl_news=>normalize_version( 'x.y.z' )
|
||||
exp = '' ).
|
||||
|
||||
ENDMETHOD. "normalize_version
|
||||
|
||||
METHOD parse_line.
|
||||
|
||||
DATA: ls_log TYPE lcl_news=>ty_log.
|
||||
|
||||
ls_log = lcl_news=>parse_line(
|
||||
iv_line = '======'
|
||||
iv_current_version = '1.26.01' ).
|
||||
cl_abap_unit_assert=>assert_initial( ls_log ).
|
||||
|
||||
ls_log = lcl_news=>parse_line(
|
||||
iv_line = ''
|
||||
iv_current_version = '1.26.01' ).
|
||||
cl_abap_unit_assert=>assert_initial( ls_log ).
|
||||
|
||||
ls_log = lcl_news=>parse_line(
|
||||
iv_line = '------'
|
||||
iv_current_version = '1.26.01' ).
|
||||
cl_abap_unit_assert=>assert_initial( ls_log ).
|
||||
|
||||
CLEAR ls_log.
|
||||
ls_log = lcl_news=>parse_line(
|
||||
iv_line = '2017-02-13 v1.28.0'
|
||||
iv_current_version = '1.26.01' ).
|
||||
cl_abap_unit_assert=>assert_equals( act = ls_log-version exp = '1.28.0' ).
|
||||
cl_abap_unit_assert=>assert_equals( act = ls_log-is_header exp = abap_true ).
|
||||
cl_abap_unit_assert=>assert_equals( act = ls_log-pos_to_cur exp = 1 ).
|
||||
|
||||
CLEAR ls_log.
|
||||
ls_log = lcl_news=>parse_line(
|
||||
iv_line = '2017-02-13 v1.26.0'
|
||||
iv_current_version = '1.26.01' ).
|
||||
cl_abap_unit_assert=>assert_equals( act = ls_log-version exp = '1.26.0' ).
|
||||
cl_abap_unit_assert=>assert_equals( act = ls_log-is_header exp = abap_true ).
|
||||
cl_abap_unit_assert=>assert_equals( act = ls_log-pos_to_cur exp = -1 ).
|
||||
|
||||
CLEAR ls_log.
|
||||
ls_log = lcl_news=>parse_line(
|
||||
iv_line = 'news'
|
||||
iv_current_version = '1.26.01' ).
|
||||
cl_abap_unit_assert=>assert_equals( act = ls_log-version exp = '' ).
|
||||
cl_abap_unit_assert=>assert_equals( act = ls_log-is_header exp = abap_false ).
|
||||
cl_abap_unit_assert=>assert_equals( act = ls_log-pos_to_cur exp = 0 ).
|
||||
cl_abap_unit_assert=>assert_equals( act = ls_log-is_important exp = abap_false ).
|
||||
cl_abap_unit_assert=>assert_equals( act = ls_log-text exp = 'news' ).
|
||||
|
||||
CLEAR ls_log.
|
||||
ls_log = lcl_news=>parse_line(
|
||||
iv_line = ' ! important news'
|
||||
iv_current_version = '1.26.01' ).
|
||||
cl_abap_unit_assert=>assert_equals( act = ls_log-version exp = '' ).
|
||||
cl_abap_unit_assert=>assert_equals( act = ls_log-is_header exp = abap_false ).
|
||||
cl_abap_unit_assert=>assert_equals( act = ls_log-pos_to_cur exp = 0 ).
|
||||
cl_abap_unit_assert=>assert_equals( act = ls_log-is_important exp = abap_true ).
|
||||
cl_abap_unit_assert=>assert_equals( act = ls_log-text exp = ' ! important news' ).
|
||||
|
||||
ENDMETHOD. "parse_line
|
||||
|
||||
METHOD parse.
|
||||
|
||||
DEFINE _add_news_log_entry.
|
||||
CLEAR: ls_log.
|
||||
ls_log-version = &1.
|
||||
ls_log-is_header = &2.
|
||||
ls_log-is_important = &3.
|
||||
ls_log-pos_to_cur = &4.
|
||||
ls_log-text = &5.
|
||||
APPEND ls_log TO lt_log_exp.
|
||||
END-OF-DEFINITION.
|
||||
|
||||
DEFINE _add_news_txt_entry.
|
||||
APPEND &1 TO lt_lines.
|
||||
END-OF-DEFINITION.
|
||||
|
||||
DATA: lt_log_exp TYPE lcl_news=>tt_log,
|
||||
lt_log_act TYPE lcl_news=>tt_log,
|
||||
ls_log LIKE LINE OF lt_log_exp,
|
||||
lt_lines TYPE string_table.
|
||||
|
||||
" Generate test data
|
||||
_add_news_txt_entry '======'.
|
||||
_add_news_txt_entry '------'.
|
||||
_add_news_txt_entry ` `.
|
||||
_add_news_txt_entry 'abapGit changelog'.
|
||||
_add_news_txt_entry '2017-02-13 v1.28.0'.
|
||||
_add_news_txt_entry '------------------'.
|
||||
_add_news_txt_entry '+ Staging page redesigned'.
|
||||
_add_news_txt_entry '! Support for core data services'.
|
||||
_add_news_txt_entry ` `.
|
||||
_add_news_txt_entry '2017-01-25 v1.27.0'.
|
||||
_add_news_txt_entry '------------------'.
|
||||
_add_news_txt_entry '+ Two factor authentication with github.com'.
|
||||
_add_news_txt_entry '2017-01-25 v1.26.0'.
|
||||
|
||||
" Case 1
|
||||
" Generate expected results
|
||||
" VERSION HEAD IMP POS TEXT
|
||||
_add_news_log_entry '1.28.0' 'X' '' 1 '2017-02-13 v1.28.0'.
|
||||
_add_news_log_entry '1.28.0' '' '' 0 '+ Staging page redesigned'.
|
||||
_add_news_log_entry '1.28.0' '' 'X' 0 '! Support for core data services'.
|
||||
_add_news_log_entry '1.27.0' 'X' '' 1 '2017-01-25 v1.27.0'.
|
||||
_add_news_log_entry '1.27.0' '' '' 0 '+ Two factor authentication with github.com'.
|
||||
|
||||
lt_log_act = lcl_news=>parse( it_lines = lt_lines iv_current_version = '1.26.01' ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = lt_log_exp
|
||||
act = lt_log_act
|
||||
msg = ' Error during parsing: Case 1.' ).
|
||||
|
||||
|
||||
" Case 2 (exect version match)
|
||||
CLEAR lt_log_exp.
|
||||
" VERSION HEAD IMP UPD TEXT
|
||||
_add_news_log_entry '1.28.0' 'X' '' 1 '2017-02-13 v1.28.0'.
|
||||
_add_news_log_entry '1.28.0' '' '' 0 '+ Staging page redesigned'.
|
||||
_add_news_log_entry '1.28.0' '' 'X' 0 '! Support for core data services'.
|
||||
|
||||
" Case 1. Test parsing of data
|
||||
lt_log_act = lcl_news=>parse( it_lines = lt_lines iv_current_version = '1.27.00' ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = lt_log_exp
|
||||
act = lt_log_act
|
||||
msg = ' Error during parsing: Case 2.' ).
|
||||
|
||||
" Case 3 (display tail)
|
||||
CLEAR lt_log_exp.
|
||||
" VERSION HEAD IMP UPD TEXT
|
||||
_add_news_log_entry '1.28.0' 'X' '' 0 '2017-02-13 v1.28.0'.
|
||||
_add_news_log_entry '1.28.0' '' '' 0 '+ Staging page redesigned'.
|
||||
_add_news_log_entry '1.28.0' '' 'X' 0 '! Support for core data services'.
|
||||
_add_news_log_entry '1.27.0' 'X' '' -1 '2017-01-25 v1.27.0'.
|
||||
_add_news_log_entry '1.27.0' '' '' 0 '+ Two factor authentication with github.com'.
|
||||
_add_news_log_entry '1.26.0' 'X' '' -1 '2017-01-25 v1.26.0'.
|
||||
|
||||
" Case 1. Test parsing of data
|
||||
lt_log_act = lcl_news=>parse( it_lines = lt_lines iv_current_version = '1.28.00' ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = lt_log_exp
|
||||
act = lt_log_act
|
||||
msg = ' Error during parsing: Case 3.' ).
|
||||
|
||||
ENDMETHOD. "parse
|
||||
|
||||
ENDCLASS. "ltcl_news IMPLEMENTATION
|
23
src/zabapgit_news.prog.xml
Normal file
|
@ -0,0 +1,23 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
||||
<asx:values>
|
||||
<PROGDIR>
|
||||
<NAME>ZABAPGIT_NEWS</NAME>
|
||||
<STATE>A</STATE>
|
||||
<VARCL>X</VARCL>
|
||||
<SUBC>I</SUBC>
|
||||
<RSTAT>K</RSTAT>
|
||||
<RLOAD>E</RLOAD>
|
||||
<UCCHECK>X</UCCHECK>
|
||||
</PROGDIR>
|
||||
<TPOOL>
|
||||
<item>
|
||||
<ID>R</ID>
|
||||
<ENTRY>Include ZABAPGIT_NEWS</ENTRY>
|
||||
<LENGTH>21</LENGTH>
|
||||
</item>
|
||||
</TPOOL>
|
||||
</asx:values>
|
||||
</asx:abap>
|
||||
</abapGit>
|
|
@ -150,7 +150,7 @@ CLASS lcl_object_acid IMPLEMENTATION.
|
|||
ENDMETHOD. "lif_object~jump
|
||||
|
||||
METHOD lif_object~compare_to_remote_version.
|
||||
CREATE OBJECT ro_comparison_result TYPE lcl_null_comparison_result.
|
||||
CREATE OBJECT ro_comparison_result TYPE lcl_comparison_null.
|
||||
ENDMETHOD.
|
||||
|
||||
ENDCLASS. "lcl_object_acid IMPLEMENTATION
|
||||
|
|
|
@ -115,12 +115,19 @@ CLASS lcl_object_auth IMPLEMENTATION.
|
|||
|
||||
METHOD lif_object~jump.
|
||||
|
||||
lcx_exception=>raise( 'todo, AUTH jump' ).
|
||||
DATA: field TYPE fieldname.
|
||||
|
||||
field = ms_item-obj_name.
|
||||
|
||||
CALL FUNCTION 'SU20_MAINTAIN_SNGL'
|
||||
EXPORTING
|
||||
id_field = field
|
||||
id_wbo_mode = abap_false.
|
||||
|
||||
ENDMETHOD. "lif_object~jump
|
||||
|
||||
METHOD lif_object~compare_to_remote_version.
|
||||
CREATE OBJECT ro_comparison_result TYPE lcl_null_comparison_result.
|
||||
CREATE OBJECT ro_comparison_result TYPE lcl_comparison_null.
|
||||
ENDMETHOD.
|
||||
|
||||
ENDCLASS. "lcl_object_auth IMPLEMENTATION
|
||||
|
|
|
@ -14,7 +14,7 @@ CLASS lcl_object_clas DEFINITION INHERITING FROM lcl_objects_program.
|
|||
ALIASES mo_files FOR lif_object~mo_files.
|
||||
METHODS constructor
|
||||
IMPORTING
|
||||
is_item TYPE ty_item
|
||||
is_item TYPE lif_defs=>ty_item
|
||||
iv_language TYPE spras.
|
||||
|
||||
PROTECTED SECTION.
|
||||
|
@ -26,7 +26,7 @@ CLASS lcl_object_clas DEFINITION INHERITING FROM lcl_objects_program.
|
|||
METHODS deserialize_docu
|
||||
IMPORTING io_xml TYPE REF TO lcl_xml_input
|
||||
RAISING lcx_exception.
|
||||
DATA mo_object_oriented_object_fct TYPE REF TO lif_object_oriented_object_fnc.
|
||||
DATA mo_object_oriented_object_fct TYPE REF TO lif_oo_object_fnc.
|
||||
PRIVATE SECTION.
|
||||
DATA mv_skip_testclass TYPE abap_bool.
|
||||
|
||||
|
@ -202,9 +202,9 @@ CLASS lcl_object_clas IMPLEMENTATION.
|
|||
|
||||
DATA: ls_vseoclass TYPE vseoclass,
|
||||
lt_tpool TYPE textpool_table,
|
||||
lt_descriptions TYPE ty_seocompotx_tt,
|
||||
lt_descriptions TYPE lif_defs=>ty_seocompotx_tt,
|
||||
ls_clskey TYPE seoclskey,
|
||||
lt_sotr TYPE ty_sotr_tt,
|
||||
lt_sotr TYPE lif_defs=>ty_sotr_tt,
|
||||
lt_lines TYPE tlinetab.
|
||||
|
||||
|
||||
|
@ -272,7 +272,7 @@ CLASS lcl_object_clas IMPLEMENTATION.
|
|||
|
||||
METHOD deserialize_sotr.
|
||||
"OTR stands for Online Text Repository
|
||||
DATA: lt_sotr TYPE ty_sotr_tt.
|
||||
DATA: lt_sotr TYPE lif_defs=>ty_sotr_tt.
|
||||
|
||||
io_xml->read( EXPORTING iv_name = 'SOTR'
|
||||
CHANGING cg_data = lt_sotr ).
|
||||
|
@ -309,7 +309,7 @@ CLASS lcl_object_clas IMPLEMENTATION.
|
|||
METHOD deserialize_tpool.
|
||||
|
||||
DATA: lv_clsname TYPE seoclsname,
|
||||
lt_tpool_ext TYPE ty_tpool_tt,
|
||||
lt_tpool_ext TYPE lif_defs=>ty_tpool_tt,
|
||||
lt_tpool TYPE textpool_table.
|
||||
|
||||
|
||||
|
@ -338,7 +338,7 @@ CLASS lcl_object_clas IMPLEMENTATION.
|
|||
lt_local_implementations TYPE seop_source_string,
|
||||
lt_local_macros TYPE seop_source_string,
|
||||
lt_test_classes TYPE seop_source_string,
|
||||
lt_descriptions TYPE ty_seocompotx_tt,
|
||||
lt_descriptions TYPE lif_defs=>ty_seocompotx_tt,
|
||||
ls_class_key TYPE seoclskey.
|
||||
|
||||
|
||||
|
@ -389,36 +389,36 @@ CLASS lcl_object_clas IMPLEMENTATION.
|
|||
ENDMETHOD. "deserialize
|
||||
|
||||
METHOD lif_object~compare_to_remote_version.
|
||||
CREATE OBJECT ro_comparison_result TYPE lcl_null_comparison_result.
|
||||
CREATE OBJECT ro_comparison_result TYPE lcl_comparison_null.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD constructor.
|
||||
super->constructor(
|
||||
is_item = is_item
|
||||
iv_language = iv_language ).
|
||||
mo_object_oriented_object_fct = lcl_object_oriented_factory=>make( iv_object_type = ms_item-obj_type ).
|
||||
mo_object_oriented_object_fct = lcl_oo_factory=>make( iv_object_type = ms_item-obj_type ).
|
||||
ENDMETHOD.
|
||||
|
||||
ENDCLASS. "lcl_object_CLAS IMPLEMENTATION
|
||||
|
||||
CLASS lcl_oo_class DEFINITION INHERITING FROM lcl_oo_base.
|
||||
|
||||
CLASS lcl_object_oriented_class DEFINITION
|
||||
INHERITING FROM lcl_object_oriented_base.
|
||||
PUBLIC SECTION.
|
||||
METHODS:
|
||||
lif_object_oriented_object_fnc~create REDEFINITION,
|
||||
lif_object_oriented_object_fnc~generate_locals REDEFINITION,
|
||||
lif_object_oriented_object_fnc~insert_text_pool REDEFINITION,
|
||||
lif_object_oriented_object_fnc~create_sotr REDEFINITION,
|
||||
lif_object_oriented_object_fnc~get_includes REDEFINITION,
|
||||
lif_object_oriented_object_fnc~get_class_properties REDEFINITION,
|
||||
lif_object_oriented_object_fnc~read_text_pool REDEFINITION,
|
||||
lif_object_oriented_object_fnc~read_sotr REDEFINITION,
|
||||
lif_object_oriented_object_fnc~delete REDEFINITION.
|
||||
lif_oo_object_fnc~create REDEFINITION,
|
||||
lif_oo_object_fnc~generate_locals REDEFINITION,
|
||||
lif_oo_object_fnc~insert_text_pool REDEFINITION,
|
||||
lif_oo_object_fnc~create_sotr REDEFINITION,
|
||||
lif_oo_object_fnc~get_includes REDEFINITION,
|
||||
lif_oo_object_fnc~get_class_properties REDEFINITION,
|
||||
lif_oo_object_fnc~read_text_pool REDEFINITION,
|
||||
lif_oo_object_fnc~read_sotr REDEFINITION,
|
||||
lif_oo_object_fnc~delete REDEFINITION.
|
||||
|
||||
ENDCLASS.
|
||||
CLASS lcl_object_oriented_class IMPLEMENTATION.
|
||||
METHOD lif_object_oriented_object_fnc~create.
|
||||
|
||||
CLASS lcl_oo_class IMPLEMENTATION.
|
||||
METHOD lif_oo_object_fnc~create.
|
||||
CALL FUNCTION 'SEO_CLASS_CREATE_COMPLETE'
|
||||
EXPORTING
|
||||
devclass = iv_package
|
||||
|
@ -437,7 +437,8 @@ CLASS lcl_object_oriented_class IMPLEMENTATION.
|
|||
lcx_exception=>raise( 'error from SEO_CLASS_CREATE_COMPLETE' ).
|
||||
ENDIF.
|
||||
ENDMETHOD.
|
||||
METHOD lif_object_oriented_object_fnc~generate_locals.
|
||||
|
||||
METHOD lif_oo_object_fnc~generate_locals.
|
||||
CALL FUNCTION 'SEO_CLASS_GENERATE_LOCALS'
|
||||
EXPORTING
|
||||
clskey = is_key
|
||||
|
@ -456,7 +457,7 @@ CLASS lcl_object_oriented_class IMPLEMENTATION.
|
|||
lcx_exception=>raise( 'error from generate_locals' ).
|
||||
ENDIF.
|
||||
ENDMETHOD.
|
||||
METHOD lif_object_oriented_object_fnc~insert_text_pool.
|
||||
METHOD lif_oo_object_fnc~insert_text_pool.
|
||||
DATA: lv_cp TYPE program.
|
||||
|
||||
lv_cp = cl_oo_classname_service=>get_classpool_name( iv_class_name ).
|
||||
|
@ -473,8 +474,8 @@ CLASS lcl_object_oriented_class IMPLEMENTATION.
|
|||
iv_name = lv_cp ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD lif_object_oriented_object_fnc~create_sotr.
|
||||
DATA: lt_sotr TYPE ty_sotr_tt,
|
||||
METHOD lif_oo_object_fnc~create_sotr.
|
||||
DATA: lt_sotr TYPE lif_defs=>ty_sotr_tt,
|
||||
lt_objects TYPE sotr_objects,
|
||||
ls_paket TYPE sotr_pack,
|
||||
lv_object LIKE LINE OF lt_objects.
|
||||
|
@ -533,7 +534,7 @@ CLASS lcl_object_oriented_class IMPLEMENTATION.
|
|||
ENDLOOP.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD lif_object_oriented_object_fnc~get_includes.
|
||||
METHOD lif_oo_object_fnc~get_includes.
|
||||
* note: includes returned might not exist
|
||||
* method cl_oo_classname_service=>GET_ALL_CLASS_INCLUDES does not exist in 702
|
||||
|
||||
|
@ -566,7 +567,7 @@ CLASS lcl_object_oriented_class IMPLEMENTATION.
|
|||
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD lif_object_oriented_object_fnc~get_class_properties.
|
||||
METHOD lif_oo_object_fnc~get_class_properties.
|
||||
CALL FUNCTION 'SEO_CLIF_GET'
|
||||
EXPORTING
|
||||
cifkey = is_class_key
|
||||
|
@ -585,7 +586,7 @@ CLASS lcl_object_oriented_class IMPLEMENTATION.
|
|||
ENDIF.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD lif_object_oriented_object_fnc~read_text_pool.
|
||||
METHOD lif_oo_object_fnc~read_text_pool.
|
||||
DATA:
|
||||
lv_cp TYPE program.
|
||||
|
||||
|
@ -593,7 +594,7 @@ CLASS lcl_object_oriented_class IMPLEMENTATION.
|
|||
READ TEXTPOOL lv_cp INTO rt_text_pool LANGUAGE iv_language. "#EC CI_READ_REP
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD lif_object_oriented_object_fnc~read_sotr.
|
||||
METHOD lif_oo_object_fnc~read_sotr.
|
||||
DATA: lv_concept TYPE sotr_head-concept,
|
||||
lt_seocompodf TYPE STANDARD TABLE OF seocompodf WITH DEFAULT KEY,
|
||||
ls_header TYPE sotr_head,
|
||||
|
@ -611,7 +612,7 @@ CLASS lcl_object_oriented_class IMPLEMENTATION.
|
|||
AND exposure = '2'
|
||||
AND attdecltyp = '2'
|
||||
AND type = 'SOTR_CONC'
|
||||
ORDER BY PRIMARY KEY.
|
||||
ORDER BY PRIMARY KEY. "#EC CI_SUBRC
|
||||
|
||||
LOOP AT lt_seocompodf ASSIGNING <ls_seocompodf>.
|
||||
|
||||
|
@ -652,7 +653,7 @@ CLASS lcl_object_oriented_class IMPLEMENTATION.
|
|||
ENDLOOP.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD lif_object_oriented_object_fnc~delete.
|
||||
METHOD lif_oo_object_fnc~delete.
|
||||
CALL FUNCTION 'SEO_CLASS_DELETE_COMPLETE'
|
||||
EXPORTING
|
||||
clskey = is_deletion_key
|
||||
|
|
189
src/zabapgit_object_dcls.prog.abap
Normal file
|
@ -0,0 +1,189 @@
|
|||
*&---------------------------------------------------------------------*
|
||||
*& Include zabapgit_object_dcls
|
||||
*&---------------------------------------------------------------------*
|
||||
|
||||
CLASS lcl_object_dcls DEFINITION INHERITING FROM lcl_objects_super FINAL.
|
||||
|
||||
PUBLIC SECTION.
|
||||
INTERFACES lif_object.
|
||||
ALIASES mo_files FOR lif_object~mo_files.
|
||||
|
||||
ENDCLASS.
|
||||
|
||||
CLASS lcl_object_dcls IMPLEMENTATION.
|
||||
|
||||
METHOD lif_object~has_changed_since.
|
||||
rv_changed = abap_true.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD lif_object~changed_by.
|
||||
rv_user = c_user_unknown.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD lif_object~get_metadata.
|
||||
rs_metadata = get_metadata( ).
|
||||
|
||||
rs_metadata-ddic = abap_true.
|
||||
rs_metadata-delete_tadir = abap_true.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD lif_object~exists.
|
||||
|
||||
DATA: li_dcl TYPE REF TO object.
|
||||
|
||||
TRY.
|
||||
CALL METHOD ('CL_ACM_DCL_HANDLER_FACTORY')=>('CREATE')
|
||||
RECEIVING
|
||||
ro_handler = li_dcl.
|
||||
|
||||
CALL METHOD li_dcl->('CHECK_EXISTENCE')
|
||||
EXPORTING
|
||||
iv_objectname = ms_item-obj_name
|
||||
RECEIVING
|
||||
rv_exists = rv_bool.
|
||||
|
||||
CATCH cx_root.
|
||||
rv_bool = abap_false.
|
||||
ENDTRY.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD lif_object~jump.
|
||||
|
||||
TRY.
|
||||
|
||||
jump_adt( i_obj_name = ms_item-obj_name
|
||||
i_obj_type = ms_item-obj_type ).
|
||||
|
||||
CATCH lcx_exception.
|
||||
lcx_exception=>raise( 'DCLS Jump Error' ).
|
||||
ENDTRY.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD lif_object~delete.
|
||||
|
||||
DATA: li_dcl TYPE REF TO object.
|
||||
|
||||
TRY.
|
||||
CALL METHOD ('CL_ACM_DCL_HANDLER_FACTORY')=>('CREATE')
|
||||
RECEIVING
|
||||
ro_handler = li_dcl.
|
||||
|
||||
CALL METHOD li_dcl->('DELETE')
|
||||
EXPORTING
|
||||
iv_dclname = ms_item-obj_name.
|
||||
|
||||
CATCH cx_root.
|
||||
lcx_exception=>raise( 'DCLS error' ).
|
||||
ENDTRY.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD lif_object~serialize.
|
||||
|
||||
DATA: lr_data TYPE REF TO data,
|
||||
li_dcl TYPE REF TO object.
|
||||
|
||||
FIELD-SYMBOLS: <ls_data> TYPE any,
|
||||
<field> TYPE any.
|
||||
|
||||
CREATE DATA lr_data TYPE ('ACM_S_DCLSRC').
|
||||
ASSIGN lr_data->* TO <ls_data>.
|
||||
|
||||
TRY.
|
||||
CALL METHOD ('CL_ACM_DCL_HANDLER_FACTORY')=>('CREATE')
|
||||
RECEIVING
|
||||
ro_handler = li_dcl.
|
||||
|
||||
CALL METHOD li_dcl->('READ')
|
||||
EXPORTING
|
||||
iv_dclname = ms_item-obj_name
|
||||
IMPORTING
|
||||
es_dclsrc = <ls_data>.
|
||||
|
||||
ASSIGN COMPONENT 'AS4USER' OF STRUCTURE <ls_data> TO <field>.
|
||||
ASSERT sy-subrc = 0.
|
||||
CLEAR <field>.
|
||||
|
||||
ASSIGN COMPONENT 'AS4DATE' OF STRUCTURE <ls_data> TO <field>.
|
||||
ASSERT sy-subrc = 0.
|
||||
CLEAR <field>.
|
||||
|
||||
ASSIGN COMPONENT 'AS4TIME' OF STRUCTURE <ls_data> TO <field>.
|
||||
ASSERT sy-subrc = 0.
|
||||
CLEAR <field>.
|
||||
|
||||
ASSIGN COMPONENT 'CREATED_BY' OF STRUCTURE <ls_data> TO <field>.
|
||||
ASSERT sy-subrc = 0.
|
||||
CLEAR <field>.
|
||||
|
||||
ASSIGN COMPONENT 'CREATED_DATE' OF STRUCTURE <ls_data> TO <field>.
|
||||
ASSERT sy-subrc = 0.
|
||||
CLEAR <field>.
|
||||
|
||||
ASSIGN COMPONENT 'SOURCE' OF STRUCTURE <ls_data> TO <field>.
|
||||
ASSERT sy-subrc = 0.
|
||||
|
||||
mo_files->add_string( iv_ext = 'asdcls' iv_string = <field> ).
|
||||
|
||||
CLEAR <field>.
|
||||
|
||||
io_xml->add( iv_name = 'DCLS'
|
||||
ig_data = <ls_data> ).
|
||||
|
||||
CATCH cx_root.
|
||||
lcx_exception=>raise( 'DCLS error' ).
|
||||
ENDTRY.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD lif_object~deserialize.
|
||||
|
||||
DATA: lr_data TYPE REF TO data,
|
||||
li_dcl TYPE REF TO object.
|
||||
|
||||
FIELD-SYMBOLS: <ls_data> TYPE any,
|
||||
<field> TYPE any.
|
||||
|
||||
CREATE DATA lr_data TYPE ('ACM_S_DCLSRC').
|
||||
ASSIGN lr_data->* TO <ls_data>.
|
||||
|
||||
io_xml->read(
|
||||
EXPORTING
|
||||
iv_name = 'DCLS'
|
||||
CHANGING
|
||||
cg_data = <ls_data> ).
|
||||
|
||||
ASSIGN COMPONENT 'SOURCE' OF STRUCTURE <ls_data> TO <field>.
|
||||
ASSERT sy-subrc = 0.
|
||||
<field> = mo_files->read_string( 'asdcls' ).
|
||||
|
||||
TRY.
|
||||
CALL METHOD ('CL_ACM_DCL_HANDLER_FACTORY')=>('CREATE')
|
||||
RECEIVING
|
||||
ro_handler = li_dcl.
|
||||
|
||||
CALL METHOD li_dcl->('SAVE')
|
||||
EXPORTING
|
||||
iv_dclname = ms_item-obj_name
|
||||
iv_put_state = 'A'
|
||||
is_dclsrc = <ls_data>
|
||||
iv_devclass = iv_package
|
||||
iv_access_mode = 'INSERT'.
|
||||
|
||||
tadir_insert( iv_package ).
|
||||
|
||||
CATCH cx_root.
|
||||
lcx_exception=>raise( 'DCLS error' ).
|
||||
ENDTRY.
|
||||
|
||||
lcl_objects_activation=>add_item( ms_item ).
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD lif_object~compare_to_remote_version.
|
||||
CREATE OBJECT ro_comparison_result TYPE lcl_comparison_null.
|
||||
ENDMETHOD.
|
||||
|
||||
ENDCLASS.
|
22
src/zabapgit_object_dcls.prog.xml
Normal file
|
@ -0,0 +1,22 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
||||
<asx:values>
|
||||
<PROGDIR>
|
||||
<NAME>ZABAPGIT_OBJECT_DCLS</NAME>
|
||||
<STATE>A</STATE>
|
||||
<VARCL>X</VARCL>
|
||||
<SUBC>I</SUBC>
|
||||
<RLOAD>E</RLOAD>
|
||||
<UCCHECK>X</UCCHECK>
|
||||
</PROGDIR>
|
||||
<TPOOL>
|
||||
<item>
|
||||
<ID>R</ID>
|
||||
<ENTRY>Include ZABAPGIT_OBJECT_DCLS</ENTRY>
|
||||
<LENGTH>28</LENGTH>
|
||||
</item>
|
||||
</TPOOL>
|
||||
</asx:values>
|
||||
</asx:abap>
|
||||
</abapGit>
|
|
@ -13,6 +13,11 @@ CLASS lcl_object_ddls DEFINITION INHERITING FROM lcl_objects_super FINAL.
|
|||
INTERFACES lif_object.
|
||||
ALIASES mo_files FOR lif_object~mo_files.
|
||||
|
||||
PROTECTED SECTION.
|
||||
METHODS open_adt_stob
|
||||
IMPORTING iv_ddls_name TYPE tadir-obj_name
|
||||
RAISING lcx_exception.
|
||||
|
||||
ENDCLASS. "lcl_object_dtel DEFINITION
|
||||
|
||||
*----------------------------------------------------------------------*
|
||||
|
@ -67,7 +72,26 @@ CLASS lcl_object_ddls IMPLEMENTATION.
|
|||
ENDMETHOD. "lif_object~exists
|
||||
|
||||
METHOD lif_object~jump.
|
||||
lcx_exception=>raise( 'todo, DDLS jump' ).
|
||||
|
||||
DATA: lv_typename TYPE typename.
|
||||
DATA: lv_ddtypekind TYPE ddtypekind.
|
||||
|
||||
lv_typename = ms_item-obj_name.
|
||||
|
||||
CALL FUNCTION 'DDIF_TYPEINFO_GET'
|
||||
EXPORTING
|
||||
typename = lv_typename
|
||||
IMPORTING
|
||||
typekind = lv_ddtypekind.
|
||||
|
||||
CASE lv_ddtypekind.
|
||||
WHEN 'STOB'.
|
||||
|
||||
me->open_adt_stob( iv_ddls_name = ms_item-obj_name ).
|
||||
WHEN OTHERS.
|
||||
lcx_exception=>raise( 'DDLS Jump Error' ).
|
||||
ENDCASE.
|
||||
|
||||
ENDMETHOD. "jump
|
||||
|
||||
METHOD lif_object~delete.
|
||||
|
@ -91,8 +115,8 @@ CLASS lcl_object_ddls IMPLEMENTATION.
|
|||
|
||||
METHOD lif_object~serialize.
|
||||
|
||||
DATA: li_ddl TYPE REF TO object,
|
||||
lr_data TYPE REF TO data.
|
||||
DATA: li_ddl TYPE REF TO object,
|
||||
lr_data TYPE REF TO data.
|
||||
|
||||
FIELD-SYMBOLS: <ls_data> TYPE any,
|
||||
<lv_field> TYPE any.
|
||||
|
@ -183,7 +207,61 @@ CLASS lcl_object_ddls IMPLEMENTATION.
|
|||
ENDMETHOD. "deserialize
|
||||
|
||||
METHOD lif_object~compare_to_remote_version.
|
||||
CREATE OBJECT ro_comparison_result TYPE lcl_null_comparison_result.
|
||||
CREATE OBJECT ro_comparison_result TYPE lcl_comparison_null.
|
||||
ENDMETHOD. "lif_object~compare_to_remote_version
|
||||
|
||||
METHOD open_adt_stob.
|
||||
|
||||
DATA: lr_data TYPE REF TO data.
|
||||
DATA: li_ddl TYPE REF TO object.
|
||||
FIELD-SYMBOLS: <lt_ddnames> TYPE STANDARD TABLE.
|
||||
FIELD-SYMBOLS: <lt_entity_view> TYPE STANDARD TABLE.
|
||||
FIELD-SYMBOLS: <ls_ddnames> TYPE any.
|
||||
FIELD-SYMBOLS: <ls_entity_view> TYPE any.
|
||||
FIELD-SYMBOLS: <lv_ddname> TYPE any.
|
||||
FIELD-SYMBOLS: <lv_ddlname> TYPE any.
|
||||
TRY.
|
||||
|
||||
CREATE DATA lr_data TYPE ('IF_DD_DDL_TYPES=>TY_T_DDOBJ').
|
||||
ASSIGN lr_data->* TO <lt_ddnames>.
|
||||
|
||||
CREATE DATA lr_data LIKE LINE OF <lt_ddnames>.
|
||||
ASSIGN lr_data->* TO <ls_ddnames>.
|
||||
|
||||
CREATE DATA lr_data TYPE ('IF_DD_DDL_TYPES=>TY_T_ENTITY_OF_VIEW').
|
||||
ASSIGN lr_data->* TO <lt_entity_view>.
|
||||
|
||||
CREATE DATA lr_data LIKE LINE OF <lt_entity_view>.
|
||||
ASSIGN lr_data->* TO <ls_entity_view>.
|
||||
|
||||
CLEAR <lt_ddnames>.
|
||||
ASSIGN COMPONENT 'NAME' OF STRUCTURE <ls_ddnames> TO <lv_ddname>.
|
||||
<lv_ddname> = iv_ddls_name.
|
||||
INSERT <ls_ddnames> INTO TABLE <lt_ddnames>.
|
||||
|
||||
CALL METHOD ('CL_DD_DDL_HANDLER_FACTORY')=>('CREATE')
|
||||
RECEIVING
|
||||
handler = li_ddl.
|
||||
|
||||
CALL METHOD li_ddl->('IF_DD_DDL_HANDLER~GET_VIEWNAME_FROM_ENTITYNAME')
|
||||
EXPORTING
|
||||
ddnames = <lt_ddnames>
|
||||
IMPORTING
|
||||
view_of_entity = <lt_entity_view>.
|
||||
|
||||
READ TABLE <lt_entity_view> ASSIGNING <ls_entity_view> INDEX 1.
|
||||
IF sy-subrc = 0.
|
||||
ASSIGN COMPONENT 'DDLNAME' OF STRUCTURE <ls_entity_view> TO <lv_ddlname>.
|
||||
|
||||
jump_adt( i_obj_name = <lv_ddlname>
|
||||
i_obj_type = 'DDLS' ).
|
||||
|
||||
ENDIF.
|
||||
|
||||
CATCH cx_root.
|
||||
lcx_exception=>raise( 'DDLS Jump Error' ).
|
||||
ENDTRY.
|
||||
|
||||
ENDMETHOD. "open_adt_stob
|
||||
|
||||
ENDCLASS. "lcl_object_view IMPLEMENTATION
|
||||
|
|
|
@ -152,7 +152,7 @@ CLASS lcl_object_doct IMPLEMENTATION.
|
|||
ENDMETHOD. "serialize
|
||||
|
||||
METHOD lif_object~compare_to_remote_version.
|
||||
CREATE OBJECT ro_comparison_result TYPE lcl_null_comparison_result.
|
||||
CREATE OBJECT ro_comparison_result TYPE lcl_comparison_null.
|
||||
ENDMETHOD.
|
||||
|
||||
ENDCLASS. "lcl_object_msag IMPLEMENTATION
|
||||
|
|