You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2018/01/18 08:53:10 UTC
[myfaces-tobago] 02/02: * Add migration script for the layout
properties.
This is an automated email from the ASF dual-hosted git repository.
lofwyr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git
commit 95e1a9feb96556b2c1d6dfc1e6d9d644c0b7000c
Author: Udo Schnurpfeil <lo...@apache.org>
AuthorDate: Thu Jan 18 09:52:09 2018 +0100
* Add migration script for the layout properties.
---
.../50-migration/96-migration/migrate4-layout.sh | 49 +++++++++++-----------
.../50-migration/99-migration/migration15.xhtml | 4 +-
.../50000-java/20-ajax-execute/ajax-execute.xhtml | 2 +-
3 files changed, 28 insertions(+), 27 deletions(-)
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/10-intro/50-migration/96-migration/migrate4-layout.sh b/tobago-example/tobago-example-demo/src/main/webapp/content/10-intro/50-migration/96-migration/migrate4-layout.sh
index 7d73dc4..f5c88f0 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/10-intro/50-migration/96-migration/migrate4-layout.sh
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/10-intro/50-migration/96-migration/migrate4-layout.sh
@@ -5,47 +5,48 @@
# usage: run this file "migrate-layout.sh" in the project parent directory.
# it will process all files in all subfolder with suffix .xhtml
+# The sed command syntax works with macOS.
+# For Windows (MinGW) or Linux you'll need to remove the "" behind all sed -i commands.
+# For Windows (MinGW) you may need to call unix2dos at the end.
+
function replace_segment_one {
- file=$1
- sed -i -E "s/(extraSmall|small|medium|large|extraLarge)=\"([^\"^ ]*)([0-9]+);([0-9]+)/\1=\"\2\3seg \4/g" $file
+ sed -i "" -E "s/(extraSmall|small|medium|large|extraLarge)=\"([^\"^ ]*)([0-9]+);([0-9]+)/\1=\"\2\3seg \4/g" $1
}
function replace_segment_last {
- file=$1
- sed -i -E "s/(extraSmall|small|medium|large|extraLarge)=\"([^\"]*)([0-9]+)\"/\1=\"\2\3seg\"/g" $file
+ sed -i "" -E "s/(extraSmall|small|medium|large|extraLarge)=\"([^\"]*)([0-9]+)\"/\1=\"\2\3seg\"/g" $1
}
function replace_columns_rows {
- file=$1
- sed -i -E "s/(columns|rows)=\"([^\"]*)([0-9]+)\*/\1=\"\2\3fr/g" $file
+ sed -i "" -E "s/(columns|rows)=\"([^\"]*)([0-9]+)\*/\1=\"\2\3fr/g" $1
}
function replace_columns_rows_one {
- file=$1
- sed -i -E "s/(columns|rows)=\"([^\"]*)\*/\1=\"\21fr/g" $file
+ sed -i "" -E "s/(columns|rows)=\"([^\"]*)\*/\1=\"\21fr/g" $1
}
find . -name "*.xhtml" | while read file; do
- echo "Processing file $file"
+ echo "Processing file $file"
+
+ for i in `seq 1 11`;
+ do
+ replace_segment_one $file
+ done
- for i in `seq 1 11`;
- do
- replace_segment_one $file
- done
+ replace_segment_last $file
- replace_segment_last $file
+ for i in `seq 1 20`;
+ do
+ replace_columns_rows $file
+ done
- for i in `seq 1 20`;
- do
- replace_columns_rows $file
- done
+ for i in `seq 1 20`;
+ do
+ replace_columns_rows_one $file
+ done
- for i in `seq 1 20`;
- do
- replace_columns_rows_one $file
- done
+ # Windows only
+ # unix2dos -q $file
-# only on Windows:
-# unix2dos -q $file
done
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/10-intro/50-migration/99-migration/migration15.xhtml b/tobago-example/tobago-example-demo/src/main/webapp/content/10-intro/50-migration/99-migration/migration15.xhtml
index 2e6bbb9..b5d6f02 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/10-intro/50-migration/99-migration/migration15.xhtml
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/10-intro/50-migration/99-migration/migration15.xhtml
@@ -46,7 +46,7 @@
<tc:section label="Tag Library">
<p>The main changes in the tag library are</p>
- <tc:segmentLayout extraSmall="6;6">
+ <tc:segmentLayout extraSmall="6seg 6seg">
<tc:panel><b>deprecated</b></tc:panel>
<tc:panel><b>replacement</b></tc:panel>
<tc:panel><code class="language-markup"><tc:menuCheckbox></code></tc:panel>
@@ -109,7 +109,7 @@
</ul>
<p>The CSS class name schema has been revised. See the JavaDoc of the <code>Classes</code> class to check the
naming schema.</p>
- <tc:segmentLayout extraSmall="6;6">
+ <tc:segmentLayout extraSmall="6seg 6seg">
<tc:panel><b>old name</b></tc:panel>
<tc:panel><b>new name</b></tc:panel>
<tc:panel><code>tobago-[tagName]-default</code></tc:panel>
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/50000-java/20-ajax-execute/ajax-execute.xhtml b/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/50000-java/20-ajax-execute/ajax-execute.xhtml
index dd4a46a..b8b1c8e 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/50000-java/20-ajax-execute/ajax-execute.xhtml
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/40-test/50000-java/20-ajax-execute/ajax-execute.xhtml
@@ -62,4 +62,4 @@
</tc:segmentLayout>
-</ui:composition>
\ No newline at end of file
+</ui:composition>
--
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.