From 4de543f41590020f1b5642496b91a8cd9c686e8b Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Fri, 9 Nov 2012 10:39:59 +0100 Subject: [PATCH 01/56] use dummy key --- .../data-repo/data/google-analytics-key-config.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/realms/yanel-website/data-repo/data/google-analytics-key-config.xml b/src/realms/yanel-website/data-repo/data/google-analytics-key-config.xml index e0843b056..5f40b3257 100644 --- a/src/realms/yanel-website/data-repo/data/google-analytics-key-config.xml +++ b/src/realms/yanel-website/data-repo/data/google-analytics-key-config.xml @@ -4,10 +4,10 @@ + - From 6b926785ee71380e67a349a4900dec7f96ff3235 Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Fri, 9 Nov 2012 10:41:37 +0100 Subject: [PATCH 02/56] use dummy key, whereas already target-environment set --- .../data-repo/data/google-analytics-key-config.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/realms/yanel-website/data-repo/data/google-analytics-key-config.xml b/src/realms/yanel-website/data-repo/data/google-analytics-key-config.xml index 5f40b3257..8662d6ee9 100644 --- a/src/realms/yanel-website/data-repo/data/google-analytics-key-config.xml +++ b/src/realms/yanel-website/data-repo/data/google-analytics-key-config.xml @@ -4,10 +4,10 @@ - + + From 0d8bcfe870fa7d6df32d5b7b282a88b89b42eb74 Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Fri, 9 Nov 2012 11:08:18 +0100 Subject: [PATCH 03/56] annotations added --- .../yarep-meta/en/documentation/index.html.yarep/meta | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/realms/yanel-website/data-repo/yarep-meta/en/documentation/index.html.yarep/meta b/src/realms/yanel-website/data-repo/yarep-meta/en/documentation/index.html.yarep/meta index c1c1de1fb..e10cf2565 100644 --- a/src/realms/yanel-website/data-repo/yarep-meta/en/documentation/index.html.yarep/meta +++ b/src/realms/yanel-website/data-repo/yarep-meta/en/documentation/index.html.yarep/meta @@ -3,7 +3,8 @@ yarep_size:7589 yarep_checkinDate:2011-02-16T15\:40\:50\:650+0100 yarep_lastModifed:1275913276000 yarep_type:resource +yarep_mimeType:application/xhtml+xml yarep_checkoutUserID:alice +annotations:Documentation Table of Contents yarep_checkoutDate:2011-02-16T15\:39\:34\:098+0100 yarep_isCheckedOut:false -yarep_mimeType:application/xhtml+xml From 501936cec383fdf0717e931a0d95495e6b3e01aa Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Fri, 9 Nov 2012 11:09:35 +0100 Subject: [PATCH 04/56] annotations added --- .../misc/google-analytics-integration.html.yarep/meta | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/realms/yanel-website/data-repo/yarep-meta/en/documentation/misc/google-analytics-integration.html.yarep/meta b/src/realms/yanel-website/data-repo/yarep-meta/en/documentation/misc/google-analytics-integration.html.yarep/meta index af0f20d71..1d9e464f2 100644 --- a/src/realms/yanel-website/data-repo/yarep-meta/en/documentation/misc/google-analytics-integration.html.yarep/meta +++ b/src/realms/yanel-website/data-repo/yarep-meta/en/documentation/misc/google-analytics-integration.html.yarep/meta @@ -1,2 +1,4 @@ +yarep_vfs-meta-file-version:1.0 yarep_type:resource yarep_mimeType:application/xhtml+xml +annotations:Google analytics integration From 48bb44c5f4102634e78763d67f2138d6774166ef Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Fri, 9 Nov 2012 05:35:27 -0500 Subject: [PATCH 05/56] annotations added --- .../yarep-meta/en/getting-started/windows.html.yarep/meta | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/realms/yanel-website/data-repo/yarep-meta/en/getting-started/windows.html.yarep/meta b/src/realms/yanel-website/data-repo/yarep-meta/en/getting-started/windows.html.yarep/meta index c85dba1f3..da967b0ca 100644 --- a/src/realms/yanel-website/data-repo/yarep-meta/en/getting-started/windows.html.yarep/meta +++ b/src/realms/yanel-website/data-repo/yarep-meta/en/getting-started/windows.html.yarep/meta @@ -1,5 +1,7 @@ +yarep_vfs-meta-file-version:1.0 yarep_type:resource +yarep_mimeType:application/xhtml+xml yarep_checkoutUserID:lenya -yarep_checkoutDate:2007-05-12T21:50:54:000+0200 +annotations:Getting started on Windows +yarep_checkoutDate:2007-05-12T15\:50\:54\:000-0400 yarep_isCheckedOut:false -yarep_mimeType:application/xhtml+xml From 4f068f03dfbe301309cd14339623a8166e68c947 Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Fri, 9 Nov 2012 12:08:42 +0100 Subject: [PATCH 06/56] history/results improved and third party cookie/domain testing added --- .../boost/PersonalizedContentResource.java | 36 +++++++++++++------ 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/src/resources/personalized-content/src/java/org/wyona/yanel/impl/resources/boost/PersonalizedContentResource.java b/src/resources/personalized-content/src/java/org/wyona/yanel/impl/resources/boost/PersonalizedContentResource.java index eb33f17b9..4e5db4fc2 100644 --- a/src/resources/personalized-content/src/java/org/wyona/yanel/impl/resources/boost/PersonalizedContentResource.java +++ b/src/resources/personalized-content/src/java/org/wyona/yanel/impl/resources/boost/PersonalizedContentResource.java @@ -123,16 +123,19 @@ protected InputStream getContentXML(String viewId) throws Exception { for(Node node : nodes) { Element res_node = doc.createElementNS(NAMESPACE, "result"); - Element res_path = doc.createElementNS(NAMESPACE, "path"); - Element res_name = doc.createElementNS(NAMESPACE, "name"); - Element res_time = doc.createElementNS(NAMESPACE, "last-modified"); + resultsEl.appendChild(res_node); + Element res_path = doc.createElementNS(NAMESPACE, "path"); res_path.appendChild(doc.createTextNode(node.getPath())); - res_name.appendChild(doc.createTextNode(node.getName())); - res_time.appendChild(doc.createTextNode(Long.toString(node.getLastModified()))); res_node.appendChild(res_path); - resultsEl.appendChild(res_node); + Element res_name = doc.createElementNS(NAMESPACE, "name"); + res_name.appendChild(doc.createTextNode(node.getName())); + res_node.appendChild(res_name); + + Element res_time = doc.createElementNS(NAMESPACE, "last-modified"); + res_time.appendChild(doc.createTextNode(Long.toString(node.getLastModified()))); + res_node.appendChild(res_time); } } root.appendChild(resultsEl); @@ -144,13 +147,26 @@ protected InputStream getContentXML(String viewId) throws Exception { * Get the user profile given a cookie. * @param boostServiceUrl Boost service URL * @param cookie Unique cookie id + * @param realm Domain name + * @param apiKey Key to access Boost API */ - protected Iterable getUserInterests(String boostServiceUrl, String cookie, String realm, String apiKey) - throws Exception { + protected Iterable getUserInterests(String boostServiceUrl, String cookie, String realm, String apiKey) throws Exception { - BoostServiceConfig bsc = new BoostServiceConfig(boostServiceUrl, realm, apiKey); + String domain = realm; + if (getResourceConfigProperty("domain") != null) { + log.warn("Try to get user profile for third party domain: " + getResourceConfigProperty("domain")); + domain = getResourceConfigProperty("domain"); + } + + BoostServiceConfig bsc = new BoostServiceConfig(boostServiceUrl, domain, apiKey); BoostService boost = new BoostService(bsc); - return boost.getUserProfile(cookie); + + if (getResourceConfigProperty("cookie") != null) { + log.warn("Try to get user profile for third party cookie: " + getResourceConfigProperty("cookie")); + return boost.getUserProfile(getResourceConfigProperty("cookie")); + } else { + return boost.getUserProfile(cookie); + } } /** From 527f4d660c6f062973c402a06f40658c09b4fa7d Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Fri, 9 Nov 2012 12:09:08 +0100 Subject: [PATCH 07/56] note about cookie and domain added --- src/resources/personalized-content/resource.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/resources/personalized-content/resource.xml b/src/resources/personalized-content/resource.xml index 9d0367710..a2b98a6eb 100644 --- a/src/resources/personalized-content/resource.xml +++ b/src/resources/personalized-content/resource.xml @@ -12,5 +12,9 @@ Generates personalized content based on the interests of a user (see for example + + + + From 023ea0ffa000b42410261d8299570245cb949c3d Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Fri, 9 Nov 2012 12:23:50 +0100 Subject: [PATCH 08/56] order reversed and epoch time as attribute and otherwise human readable date --- .../impl/resources/boost/PersonalizedContentResource.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/resources/personalized-content/src/java/org/wyona/yanel/impl/resources/boost/PersonalizedContentResource.java b/src/resources/personalized-content/src/java/org/wyona/yanel/impl/resources/boost/PersonalizedContentResource.java index 4e5db4fc2..4e8cd569f 100644 --- a/src/resources/personalized-content/src/java/org/wyona/yanel/impl/resources/boost/PersonalizedContentResource.java +++ b/src/resources/personalized-content/src/java/org/wyona/yanel/impl/resources/boost/PersonalizedContentResource.java @@ -121,7 +121,8 @@ protected InputStream getContentXML(String viewId) throws Exception { break; } - for(Node node : nodes) { + for(int i = nodes.length - 1; i >= 0; i++) { + Node node = nodes[i]; Element res_node = doc.createElementNS(NAMESPACE, "result"); resultsEl.appendChild(res_node); @@ -134,7 +135,8 @@ protected InputStream getContentXML(String viewId) throws Exception { res_node.appendChild(res_name); Element res_time = doc.createElementNS(NAMESPACE, "last-modified"); - res_time.appendChild(doc.createTextNode(Long.toString(node.getLastModified()))); + res_time.setAttribute("epoch", Long.toString(node.getLastModified())); + res_time.appendChild(doc.createTextNode(new java.util.Date(node.getLastModified()).toString())); res_node.appendChild(res_time); } } From 63482a7bda713794448f0fe956f641360cc9925a Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Fri, 9 Nov 2012 06:33:38 -0500 Subject: [PATCH 09/56] for loop fixed --- .../yanel/impl/resources/boost/PersonalizedContentResource.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/resources/personalized-content/src/java/org/wyona/yanel/impl/resources/boost/PersonalizedContentResource.java b/src/resources/personalized-content/src/java/org/wyona/yanel/impl/resources/boost/PersonalizedContentResource.java index 4e8cd569f..b678bf41a 100644 --- a/src/resources/personalized-content/src/java/org/wyona/yanel/impl/resources/boost/PersonalizedContentResource.java +++ b/src/resources/personalized-content/src/java/org/wyona/yanel/impl/resources/boost/PersonalizedContentResource.java @@ -121,7 +121,7 @@ protected InputStream getContentXML(String viewId) throws Exception { break; } - for(int i = nodes.length - 1; i >= 0; i++) { + for(int i = nodes.length - 1; i >= 0; i--) { Node node = nodes[i]; Element res_node = doc.createElementNS(NAMESPACE, "result"); resultsEl.appendChild(res_node); From 20b1706e26491f570f4746a06d10a3fba85be419 Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Fri, 9 Nov 2012 06:42:14 -0500 Subject: [PATCH 10/56] annotations added --- .../yarep-meta/en/documentation/misc/xopus3.html.yarep/meta | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/realms/yanel-website/data-repo/yarep-meta/en/documentation/misc/xopus3.html.yarep/meta b/src/realms/yanel-website/data-repo/yarep-meta/en/documentation/misc/xopus3.html.yarep/meta index d30ef4ed2..b100b0ce9 100644 --- a/src/realms/yanel-website/data-repo/yarep-meta/en/documentation/misc/xopus3.html.yarep/meta +++ b/src/realms/yanel-website/data-repo/yarep-meta/en/documentation/misc/xopus3.html.yarep/meta @@ -1,2 +1,4 @@ +yarep_vfs-meta-file-version:1.0 yarep_type:resource -yarep_mimeType:application/xhtml+xml \ No newline at end of file +yarep_mimeType:application/xhtml+xml +annotations:Xopus From b7a1f85e8a95f0f2c328688ebe0b09d8cf28ee6c Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Fri, 9 Nov 2012 06:45:41 -0500 Subject: [PATCH 11/56] annotations added --- .../yarep-meta/en/documentation/i18n.html.yarep/meta | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/realms/yanel-website/data-repo/yarep-meta/en/documentation/i18n.html.yarep/meta b/src/realms/yanel-website/data-repo/yarep-meta/en/documentation/i18n.html.yarep/meta index 9f51485ca..63776a75e 100644 --- a/src/realms/yanel-website/data-repo/yarep-meta/en/documentation/i18n.html.yarep/meta +++ b/src/realms/yanel-website/data-repo/yarep-meta/en/documentation/i18n.html.yarep/meta @@ -1,8 +1,10 @@ +yarep_vfs-meta-file-version:1.0 yarep_size:3704 -yarep_checkinDate:2008-03-05T17:33:38:000+0100 -yarep_lastModifed:1204734818000 +yarep_checkinDate:2008-03-05T11\:33\:38\:000-0500 yarep_type:resource +yarep_lastModifed:1204734818000 +yarep_mimeType:application/xhtml+xml +annotations:internationalization, i18n yarep_checkoutUserID:lenya -yarep_checkoutDate:2008-03-05T17:28:31:000+0100 yarep_isCheckedOut:false -yarep_mimeType:application/xhtml+xml +yarep_checkoutDate:2008-03-05T11\:28\:31\:000-0500 From 8edf3c610d247d889ad8084e3fb7dd0f488aba3d Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Fri, 9 Nov 2012 13:37:23 +0100 Subject: [PATCH 12/56] interest added as attribute such that it is clear which result is associated with which interest --- .../impl/resources/boost/PersonalizedContentResource.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/resources/personalized-content/src/java/org/wyona/yanel/impl/resources/boost/PersonalizedContentResource.java b/src/resources/personalized-content/src/java/org/wyona/yanel/impl/resources/boost/PersonalizedContentResource.java index b678bf41a..fa7029459 100644 --- a/src/resources/personalized-content/src/java/org/wyona/yanel/impl/resources/boost/PersonalizedContentResource.java +++ b/src/resources/personalized-content/src/java/org/wyona/yanel/impl/resources/boost/PersonalizedContentResource.java @@ -109,8 +109,8 @@ protected InputStream getContentXML(String viewId) throws Exception { } root.appendChild(interestsEl); - // Search for related content in data repository - Element resultsEl = doc.createElementNS(NAMESPACE, "results"); + // INFO: Search for related content in data repository of this realm + Element resultsEl = doc.createElementNS(NAMESPACE, "search-results"); Searcher search = getRealm().getRepository().getSearcher(); for(String interest : userInterests) { Node[] nodes; @@ -124,6 +124,7 @@ protected InputStream getContentXML(String viewId) throws Exception { for(int i = nodes.length - 1; i >= 0; i--) { Node node = nodes[i]; Element res_node = doc.createElementNS(NAMESPACE, "result"); + res_node.setAttribute("interest", interest); resultsEl.appendChild(res_node); Element res_path = doc.createElementNS(NAMESPACE, "path"); From eb343c28a77f2f85a6c5fae59225fddaa52b3e85 Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Sat, 10 Nov 2012 00:17:47 +0100 Subject: [PATCH 13/56] get user clickstream --- .../boost/PersonalizedContentResource.java | 55 +++++++++++++++++-- 1 file changed, 49 insertions(+), 6 deletions(-) diff --git a/src/resources/personalized-content/src/java/org/wyona/yanel/impl/resources/boost/PersonalizedContentResource.java b/src/resources/personalized-content/src/java/org/wyona/yanel/impl/resources/boost/PersonalizedContentResource.java index fa7029459..fe9ac9587 100644 --- a/src/resources/personalized-content/src/java/org/wyona/yanel/impl/resources/boost/PersonalizedContentResource.java +++ b/src/resources/personalized-content/src/java/org/wyona/yanel/impl/resources/boost/PersonalizedContentResource.java @@ -54,7 +54,7 @@ protected InputStream getContentXML(String viewId) throws Exception { log.error("No boost service URL '" + BOOST_SERVICE_URL_PARAM + "' configured!"); } - // Is the user logged into Yanel? + // INFO: Check whether the user is logged into Yanel? String username = getEnvironment().getIdentity().getUsername(); if(username != null) { Element uid = doc.createElement("yanel-user-id"); @@ -70,7 +70,7 @@ protected InputStream getContentXML(String viewId) throws Exception { domainEl.appendChild(doc.createTextNode(boost_domain)); root.appendChild(domainEl); - // Get the cookie + // INFO: Get the cookie HttpServletRequest req = getEnvironment().getRequest(); Cookie cookie = AccessLog.getYanelAnalyticsCookie(req); @@ -84,11 +84,14 @@ protected InputStream getContentXML(String viewId) throws Exception { cookieEl.appendChild(doc.createTextNode(cookie.getValue())); root.appendChild(cookieEl); + // INFO: Get user interests and clickstream Iterable userInterests; + Iterable clickStream; try { userInterests = getUserInterests(service, cookie.getValue(), boost_domain, api_key); + clickStream = getClickstream(service, cookie.getValue(), boost_domain, api_key); } catch(ServiceException e) { - // No interests + // No interests or clickstream log.error(e, e); Element exceptionEl = doc.createElementNS(NAMESPACE, "exception"); @@ -100,7 +103,7 @@ protected InputStream getContentXML(String viewId) throws Exception { return XMLHelper.getInputStream(doc, false, false, null); } - // Add all interests to user profile + // INFO: Add all interests to user profile Element interestsEl = doc.createElementNS(NAMESPACE, "interests"); for(String interest : userInterests) { Element interestEl = doc.createElementNS(NAMESPACE, "interest"); @@ -121,6 +124,7 @@ protected InputStream getContentXML(String viewId) throws Exception { break; } + //for(int i = 0; i < nodes.length; i++) { for(int i = nodes.length - 1; i >= 0; i--) { Node node = nodes[i]; Element res_node = doc.createElementNS(NAMESPACE, "result"); @@ -143,18 +147,57 @@ protected InputStream getContentXML(String viewId) throws Exception { } root.appendChild(resultsEl); + // INFO: Add clickstream to user profile + Element clickstreamEl = doc.createElementNS(NAMESPACE, "clickstream"); + for(String url : clickStream) { + Element urlEl = doc.createElementNS(NAMESPACE, "url"); + urlEl.appendChild(doc.createTextNode(url)); + if (clickstreamEl.hasChildNodes()) { + clickstreamEl.insertBefore(urlEl, clickstreamEl.getFirstChild()); + } else { + clickstreamEl.appendChild(urlEl); + } + } + root.appendChild(clickstreamEl); + return XMLHelper.getInputStream(doc, false, false, null); } /** - * Get the user profile given a cookie. + * Get clickstream for a given cookie (also see http://en.wikipedia.org/wiki/Clickstream) * @param boostServiceUrl Boost service URL * @param cookie Unique cookie id * @param realm Domain name * @param apiKey Key to access Boost API + * @return list of URLs which were requested by user with a given cookie */ - protected Iterable getUserInterests(String boostServiceUrl, String cookie, String realm, String apiKey) throws Exception { + private Iterable getClickstream(String boostServiceUrl, String cookie, String realm, String apiKey) throws Exception { + String domain = realm; + if (getResourceConfigProperty("domain") != null) { + log.warn("Try to get user profile for third party domain: " + getResourceConfigProperty("domain")); + domain = getResourceConfigProperty("domain"); + } + + String c = cookie; + if (getResourceConfigProperty("cookie") != null) { + log.warn("Try to get user profile for third party cookie: " + getResourceConfigProperty("cookie")); + c = getResourceConfigProperty("cookie"); + } + + BoostServiceConfig bsc = new BoostServiceConfig(boostServiceUrl, domain, apiKey); + BoostService boost = new BoostService(bsc); + return boost.getClickStream(c); + } + /** + * Get the user profile given a cookie. + * @param boostServiceUrl Boost service URL + * @param cookie Unique cookie id + * @param realm Domain name + * @param apiKey Key to access Boost API + * @return list of interests + */ + private Iterable getUserInterests(String boostServiceUrl, String cookie, String realm, String apiKey) throws Exception { String domain = realm; if (getResourceConfigProperty("domain") != null) { log.warn("Try to get user profile for third party domain: " + getResourceConfigProperty("domain")); From 4ccf71432ab14186cf8fb3d794e4155775eb620c Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Mon, 12 Nov 2012 10:56:17 +0100 Subject: [PATCH 14/56] annotations updated --- .../data-repo/yarep-meta/principles.html.yarep/meta | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/realms/yanel-website/data-repo/yarep-meta/principles.html.yarep/meta b/src/realms/yanel-website/data-repo/yarep-meta/principles.html.yarep/meta index bfcc0099d..7508c3eb7 100644 --- a/src/realms/yanel-website/data-repo/yarep-meta/principles.html.yarep/meta +++ b/src/realms/yanel-website/data-repo/yarep-meta/principles.html.yarep/meta @@ -1,8 +1,10 @@ +yarep_vfs-meta-file-version:1.0 yarep_size:1997 -yarep_checkinDate:2008-11-14T15:21:03:000+0100 +yarep_checkinDate:2008-11-14T15\:21\:03\:000+0100 yarep_lastModifed:1226672463000 yarep_type:resource +yarep_mimeType:application/xhtml+xml yarep_checkoutUserID:michi -yarep_checkoutDate:2008-11-14T15:19:29:000+0100 +annotations:Principles +yarep_checkoutDate:2008-11-14T15\:19\:29\:000+0100 yarep_isCheckedOut:false -yarep_mimeType:application/xhtml+xml From d75622e5a9364ff84bda1797a08ba9599ad08777 Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Mon, 12 Nov 2012 10:56:38 +0100 Subject: [PATCH 15/56] annotations updated --- .../yanel-website/data-repo/yarep-meta/license.html.yarep/meta | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/realms/yanel-website/data-repo/yarep-meta/license.html.yarep/meta b/src/realms/yanel-website/data-repo/yarep-meta/license.html.yarep/meta index e6199ba21..747a310b6 100644 --- a/src/realms/yanel-website/data-repo/yarep-meta/license.html.yarep/meta +++ b/src/realms/yanel-website/data-repo/yarep-meta/license.html.yarep/meta @@ -1,8 +1,9 @@ yarep_vfs-meta-file-version:1.0 yarep_checkinDate:2011-02-17T11\:13\:34\:679+0100 yarep_type:resource +yarep_mimeType:application/xhtml+xml yarep_checkoutUserID:alice +annotations:License yarep_checkoutDate:2011-02-17T11\:12\:50\:356+0100 yarep_isCheckedOut:false live-revision:1297937613462 -yarep_mimeType:application/xhtml+xml From 2e4d9a29e35a6b1a13891676cc85489544ea6f8a Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Mon, 12 Nov 2012 10:56:56 +0100 Subject: [PATCH 16/56] obsolete --- .../data-repo/data/license.xhtml | 20 ------------------- 1 file changed, 20 deletions(-) delete mode 100644 src/realms/yanel-website/data-repo/data/license.xhtml diff --git a/src/realms/yanel-website/data-repo/data/license.xhtml b/src/realms/yanel-website/data-repo/data/license.xhtml deleted file mode 100644 index 3c2d820c9..000000000 --- a/src/realms/yanel-website/data-repo/data/license.xhtml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - License - - -

License

- -

-Apache License, Version 2.0 -

- -

-The Apache License, Version 2.0 has been approved by the OSI -

- - From 0469c1adbb6de9b02c1dec573ace9ad63bb5c6b2 Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Mon, 12 Nov 2012 10:57:16 +0100 Subject: [PATCH 17/56] obsolete --- .../yanel-website/data-repo/yarep-meta/license.xhtml.yarep/meta | 1 - 1 file changed, 1 deletion(-) delete mode 100644 src/realms/yanel-website/data-repo/yarep-meta/license.xhtml.yarep/meta diff --git a/src/realms/yanel-website/data-repo/yarep-meta/license.xhtml.yarep/meta b/src/realms/yanel-website/data-repo/yarep-meta/license.xhtml.yarep/meta deleted file mode 100644 index 6479828f6..000000000 --- a/src/realms/yanel-website/data-repo/yarep-meta/license.xhtml.yarep/meta +++ /dev/null @@ -1 +0,0 @@ -yarep_type:resource From dc513a3ad031c63be4c9a1722530432c8bc8ab5e Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Mon, 12 Nov 2012 11:41:40 +0100 Subject: [PATCH 18/56] BoostClient library upgraded --- src/resources/personalized-content/src/build/dependencies.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/resources/personalized-content/src/build/dependencies.xml b/src/resources/personalized-content/src/build/dependencies.xml index 267502103..4dded2151 100644 --- a/src/resources/personalized-content/src/build/dependencies.xml +++ b/src/resources/personalized-content/src/build/dependencies.xml @@ -10,12 +10,12 @@ - + - + From e5d39313ae36dad446c5a274af83ed487be0443a Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Mon, 12 Nov 2012 11:56:06 +0100 Subject: [PATCH 19/56] version updated --- src/resources/contact-form/src/build/build.properties | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/resources/contact-form/src/build/build.properties b/src/resources/contact-form/src/build/build.properties index aa0881336..83289fbbc 100644 --- a/src/resources/contact-form/src/build/build.properties +++ b/src/resources/contact-form/src/build/build.properties @@ -1,2 +1,4 @@ resource.name=contact-form -resource.version=1.0-dev-r43764 +resource.version=2.0.0 +# Versions according to http://semver.org +# 2.0.0: XML and XSLT moved to htdocs directory such that these files are accessible via rthtdocs protocol From 6f1adef8d2c8cc522039c76c4600a6bfaab894ac Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Mon, 12 Nov 2012 17:32:39 +0100 Subject: [PATCH 20/56] my profile view started --- .../data-repo/data/xslt/profile.xsl | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 src/realms/yanel-website/data-repo/data/xslt/profile.xsl diff --git a/src/realms/yanel-website/data-repo/data/xslt/profile.xsl b/src/realms/yanel-website/data-repo/data/xslt/profile.xsl new file mode 100644 index 000000000..6936a1da7 --- /dev/null +++ b/src/realms/yanel-website/data-repo/data/xslt/profile.xsl @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + My Profile + + + + + +Back 2 Realm: , +Yanel reserved prefix: + + +

My Profile

+ +

Show XML source

+ +

+The DNT header parameter (see http://donottrack.us/) is currently set to: +

+ + + +
+ +
From 724ceeb35243d5810d936bc5926e6cfb27422368 Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Mon, 12 Nov 2012 17:32:50 +0100 Subject: [PATCH 21/56] my profile view started --- .../data/my-profile.html.yanel-rc | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/realms/yanel-website/res-configs-repo/data/my-profile.html.yanel-rc diff --git a/src/realms/yanel-website/res-configs-repo/data/my-profile.html.yanel-rc b/src/realms/yanel-website/res-configs-repo/data/my-profile.html.yanel-rc new file mode 100644 index 000000000..34bb64ced --- /dev/null +++ b/src/realms/yanel-website/res-configs-repo/data/my-profile.html.yanel-rc @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + /xslt/profile.xsl + /xslt/global.xsl + /xslt/apply-google-analytics.xsl + text/html + + + + application/xml + + + + From 67f90482fd775f895c0f34e43545ee9e950b32b7 Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Mon, 12 Nov 2012 17:33:24 +0100 Subject: [PATCH 22/56] link to my-profile --- src/realms/yanel-website/data-repo/data/xslt/global.xsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/realms/yanel-website/data-repo/data/xslt/global.xsl b/src/realms/yanel-website/data-repo/data/xslt/global.xsl index 0e13be515..7aee73b39 100644 --- a/src/realms/yanel-website/data-repo/data/xslt/global.xsl +++ b/src/realms/yanel-website/data-repo/data/xslt/global.xsl @@ -114,7 +114,7 @@ WARNING: This content has been generated dynamically. All changes will be lost. Wyona Yanel | Wyona Balancer | Apache Tomcat | Apache HTTP Server
- Copyright © 2011 Wyona. . - - Toolbar - Do not track: + Copyright © 2011 Wyona. . - - Toolbar - Do not track: From 32b526b17ccc4013592772f01f76c14f36d20b12 Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Mon, 12 Nov 2012 17:37:26 +0100 Subject: [PATCH 23/56] note added re duplication --- .../yanel-website/res-configs-repo/data/boost.xml.yanel-rc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/realms/yanel-website/res-configs-repo/data/boost.xml.yanel-rc b/src/realms/yanel-website/res-configs-repo/data/boost.xml.yanel-rc index 0c7d28aac..35ebe32af 100644 --- a/src/realms/yanel-website/res-configs-repo/data/boost.xml.yanel-rc +++ b/src/realms/yanel-website/res-configs-repo/data/boost.xml.yanel-rc @@ -1,5 +1,7 @@ + + From 8d895c4892ccfd6e15a963212b4275345bcc49ed Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Mon, 12 Nov 2012 17:45:48 +0100 Subject: [PATCH 24/56] obsolete --- .../res-configs-repo/data/boost.xml.yanel-rc | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 src/realms/yanel-website/res-configs-repo/data/boost.xml.yanel-rc diff --git a/src/realms/yanel-website/res-configs-repo/data/boost.xml.yanel-rc b/src/realms/yanel-website/res-configs-repo/data/boost.xml.yanel-rc deleted file mode 100644 index 35ebe32af..000000000 --- a/src/realms/yanel-website/res-configs-repo/data/boost.xml.yanel-rc +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - From 997b85c615898cc19864a9caf9e52de933333b41 Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Mon, 12 Nov 2012 18:11:41 +0100 Subject: [PATCH 25/56] display clickstream and interests --- .../data-repo/data/xslt/profile.xsl | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/realms/yanel-website/data-repo/data/xslt/profile.xsl b/src/realms/yanel-website/data-repo/data/xslt/profile.xsl index 6936a1da7..fef54b928 100644 --- a/src/realms/yanel-website/data-repo/data/xslt/profile.xsl +++ b/src/realms/yanel-website/data-repo/data/xslt/profile.xsl @@ -6,6 +6,7 @@ xmlns="http://www.w3.org/1999/xhtml" xmlns:yanel="http://www.wyona.org/yanel/1.0" xmlns:i18n="http://www.wyona.org/yanel/i18n/1.0" + xmlns:boost="http://www.wyona.org/yanel/boost/1.0" > @@ -35,9 +36,29 @@ Yanel reserved prefix:

Show XML source

-The DNT header parameter (see http://donottrack.us/) is currently set to: +Your DNT header parameter is currently set to '', which means that you are currently not being tracked.you are currently being tracked!

+

Depending on your browser you can disable or enable the DNT header parameter. For more details see http://donottrack.us/.

+ +

Interests

+

Based on your clickstream which we have tracked so far we have detected the following interests:

+ +
    + +
  • +
    +
+ +

Clickstream

+

TODO

+ +
    + +
  • +
    +
+ From d78cbdc94c1cc2c25870937b6a0f84b68f872690 Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Mon, 12 Nov 2012 20:10:16 +0100 Subject: [PATCH 26/56] exception added and interests and clickstream moved into separate templates --- .../data-repo/data/xslt/profile.xsl | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/realms/yanel-website/data-repo/data/xslt/profile.xsl b/src/realms/yanel-website/data-repo/data/xslt/profile.xsl index fef54b928..6191b9b07 100644 --- a/src/realms/yanel-website/data-repo/data/xslt/profile.xsl +++ b/src/realms/yanel-website/data-repo/data/xslt/profile.xsl @@ -41,26 +41,39 @@ Your DNT header parameter is

Depending on your browser you can disable or enable the DNT header parameter. For more details see http://donottrack.us/.

+ + + + + + + + + + +

Exception: 

+
+ +

Interests

-

Based on your clickstream which we have tracked so far we have detected the following interests:

+

Based on your clickstream, which we have tracked so far, we have detected the following interests:

+
+

Clickstream

-

TODO

+

Your clickstream contains the following URLs:

- - -
From 173e416524aa6e72dc9c6b4a67d24206105ed208 Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Mon, 12 Nov 2012 14:35:14 -0500 Subject: [PATCH 27/56] better handling when no interests detected yet --- .../data-repo/data/xslt/profile.xsl | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/realms/yanel-website/data-repo/data/xslt/profile.xsl b/src/realms/yanel-website/data-repo/data/xslt/profile.xsl index 6191b9b07..00fc04886 100644 --- a/src/realms/yanel-website/data-repo/data/xslt/profile.xsl +++ b/src/realms/yanel-website/data-repo/data/xslt/profile.xsl @@ -56,24 +56,38 @@ Your DNT header parameter is

Interests

+ +

Based on your clickstream, which we have tracked so far, we have detected the following interests:

    - +
+
+ +

No interests detected yet.

+
+

Clickstream

+ +

Your clickstream contains the following URLs:

    - +
+
+ +

No interests detected yet.

+
+
From 6a88bfc696095dcba78a931ea87d901d4931bc5c Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Tue, 13 Nov 2012 13:46:35 +0100 Subject: [PATCH 28/56] yarep upgraded --- src/build/dependencies.xml | 4 ++-- src/build/pom-core.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/build/dependencies.xml b/src/build/dependencies.xml index 6c3128560..2a3d9d55e 100644 --- a/src/build/dependencies.xml +++ b/src/build/dependencies.xml @@ -47,7 +47,7 @@ - + @@ -90,7 +90,7 @@ - + yarep yarep-core - 1.0-dev-rad19798901b2280b7236e915ae96746ab630fcc1 + 1.0.1-r91cff3e04f95401bcfcaf7c03c959d8923991cd3 yarep yarep-impl - 1.0-dev-rad19798901b2280b7236e915ae96746ab630fcc1 + 1.0.1-r91cff3e04f95401bcfcaf7c03c959d8923991cd3 wyona-org-commons From a9f742446072e8d937128c2849d8ebd4cb695c1b Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Wed, 14 Nov 2012 07:33:34 +0100 Subject: [PATCH 29/56] getting cookie value refactored --- .../boost/PersonalizedContentResource.java | 27 ++++++++----------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/src/resources/personalized-content/src/java/org/wyona/yanel/impl/resources/boost/PersonalizedContentResource.java b/src/resources/personalized-content/src/java/org/wyona/yanel/impl/resources/boost/PersonalizedContentResource.java index fe9ac9587..6b6be1009 100644 --- a/src/resources/personalized-content/src/java/org/wyona/yanel/impl/resources/boost/PersonalizedContentResource.java +++ b/src/resources/personalized-content/src/java/org/wyona/yanel/impl/resources/boost/PersonalizedContentResource.java @@ -80,16 +80,22 @@ protected InputStream getContentXML(String viewId) throws Exception { return XMLHelper.getInputStream(doc, false, false, null); } + String cookieVal = cookie.getValue(); + if (getResourceConfigProperty("cookie") != null) { + log.warn("Try to get user profile for third party cookie: " + getResourceConfigProperty("cookie")); + cookieVal = getResourceConfigProperty("cookie"); + } + Element cookieEl = doc.createElementNS(NAMESPACE, "yanel-cookie-id"); - cookieEl.appendChild(doc.createTextNode(cookie.getValue())); + cookieEl.appendChild(doc.createTextNode(cookieVal)); root.appendChild(cookieEl); // INFO: Get user interests and clickstream Iterable userInterests; Iterable clickStream; try { - userInterests = getUserInterests(service, cookie.getValue(), boost_domain, api_key); - clickStream = getClickstream(service, cookie.getValue(), boost_domain, api_key); + userInterests = getUserInterests(service, cookieVal, boost_domain, api_key); + clickStream = getClickstream(service, cookieVal, boost_domain, api_key); } catch(ServiceException e) { // No interests or clickstream log.error(e, e); @@ -178,15 +184,9 @@ private Iterable getClickstream(String boostServiceUrl, String cookie, S domain = getResourceConfigProperty("domain"); } - String c = cookie; - if (getResourceConfigProperty("cookie") != null) { - log.warn("Try to get user profile for third party cookie: " + getResourceConfigProperty("cookie")); - c = getResourceConfigProperty("cookie"); - } - BoostServiceConfig bsc = new BoostServiceConfig(boostServiceUrl, domain, apiKey); BoostService boost = new BoostService(bsc); - return boost.getClickStream(c); + return boost.getClickStream(cookie); } /** @@ -207,12 +207,7 @@ private Iterable getUserInterests(String boostServiceUrl, String cookie, BoostServiceConfig bsc = new BoostServiceConfig(boostServiceUrl, domain, apiKey); BoostService boost = new BoostService(bsc); - if (getResourceConfigProperty("cookie") != null) { - log.warn("Try to get user profile for third party cookie: " + getResourceConfigProperty("cookie")); - return boost.getUserProfile(getResourceConfigProperty("cookie")); - } else { - return boost.getUserProfile(cookie); - } + return boost.getUserProfile(cookie); } /** From dc8f1395b2e1a751bfaabdaea29226630f3f5b95 Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Wed, 14 Nov 2012 08:51:55 +0100 Subject: [PATCH 30/56] get domain refactored --- .../boost/PersonalizedContentResource.java | 21 ++++++------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/src/resources/personalized-content/src/java/org/wyona/yanel/impl/resources/boost/PersonalizedContentResource.java b/src/resources/personalized-content/src/java/org/wyona/yanel/impl/resources/boost/PersonalizedContentResource.java index 6b6be1009..b2fd77f1c 100644 --- a/src/resources/personalized-content/src/java/org/wyona/yanel/impl/resources/boost/PersonalizedContentResource.java +++ b/src/resources/personalized-content/src/java/org/wyona/yanel/impl/resources/boost/PersonalizedContentResource.java @@ -63,6 +63,10 @@ protected InputStream getContentXML(String viewId) throws Exception { String realm = getRealm().getID(); String boost_domain = getRealm().getUserTrackingDomain(); + if (getResourceConfigProperty("domain") != null) { + log.warn("Try to get user profile for third party domain: " + getResourceConfigProperty("domain")); + boost_domain = getResourceConfigProperty("domain"); + } Element realmEl = doc.createElementNS(NAMESPACE, "yanel-realm-id"); realmEl.appendChild(doc.createTextNode(realm)); root.appendChild(realmEl); @@ -178,13 +182,7 @@ protected InputStream getContentXML(String viewId) throws Exception { * @return list of URLs which were requested by user with a given cookie */ private Iterable getClickstream(String boostServiceUrl, String cookie, String realm, String apiKey) throws Exception { - String domain = realm; - if (getResourceConfigProperty("domain") != null) { - log.warn("Try to get user profile for third party domain: " + getResourceConfigProperty("domain")); - domain = getResourceConfigProperty("domain"); - } - - BoostServiceConfig bsc = new BoostServiceConfig(boostServiceUrl, domain, apiKey); + BoostServiceConfig bsc = new BoostServiceConfig(boostServiceUrl, realm, apiKey); BoostService boost = new BoostService(bsc); return boost.getClickStream(cookie); } @@ -198,15 +196,8 @@ private Iterable getClickstream(String boostServiceUrl, String cookie, S * @return list of interests */ private Iterable getUserInterests(String boostServiceUrl, String cookie, String realm, String apiKey) throws Exception { - String domain = realm; - if (getResourceConfigProperty("domain") != null) { - log.warn("Try to get user profile for third party domain: " + getResourceConfigProperty("domain")); - domain = getResourceConfigProperty("domain"); - } - - BoostServiceConfig bsc = new BoostServiceConfig(boostServiceUrl, domain, apiKey); + BoostServiceConfig bsc = new BoostServiceConfig(boostServiceUrl, realm, apiKey); BoostService boost = new BoostService(bsc); - return boost.getUserProfile(cookie); } From 8de2fbc45576d6ff0d5f83f884aac204945fe28b Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Wed, 14 Nov 2012 15:29:25 +0100 Subject: [PATCH 31/56] Log URL which was requested from reverse proxy if configured --- .../org/wyona/yanel/servlet/AccessLog.java | 65 ++----------------- .../org/wyona/yanel/servlet/YanelServlet.java | 29 ++++++--- 2 files changed, 25 insertions(+), 69 deletions(-) diff --git a/src/webapp/src/java/org/wyona/yanel/servlet/AccessLog.java b/src/webapp/src/java/org/wyona/yanel/servlet/AccessLog.java index b96c15e73..d41cac524 100644 --- a/src/webapp/src/java/org/wyona/yanel/servlet/AccessLog.java +++ b/src/webapp/src/java/org/wyona/yanel/servlet/AccessLog.java @@ -86,10 +86,14 @@ public static String encodeLogField(String field, String value) { /** * Get log message, whereas set Yanel analytics cookie if it does not exist yet as persistent cookie + * @param url URL which was requested from reverse proxy + * @param request Request which Yanel received * @param response HTTP response in order to set persistent Yanel analytics cookie in case it does not exist yet + * @param realmID Domain ID + * @param tags Tags associated with request/response * @param TAG_SEPARATOR Tag delimiter */ - static String getLogMessage(HttpServletRequest request, HttpServletResponse response, String realmID, String[] tags, String TAG_SEPARATOR) { + static String getLogMessage(String url, HttpServletRequest request, HttpServletResponse response, String realmID, String[] tags, String TAG_SEPARATOR) { Cookie cookie = getSetYanelAnalyticsCookie(request, response); try { org.wyona.security.core.api.Identity identity = YanelServlet.getIdentity(request.getSession(true), realmID); @@ -97,20 +101,7 @@ static String getLogMessage(HttpServletRequest request, HttpServletResponse resp } catch(Exception e) { log.error(e, e); } - return getLogMessage(getURLInclQueryString(request), realmID, cookie.getValue(), request.getHeader("referer"), request.getHeader("User-Agent"),tags, TAG_SEPARATOR); - } - - /** - * Get log message - * @param TAG_SEPARATOR Tag delimiter - */ - private static String getLogMessage(HttpServletRequest request, String realmID, String[] tags, String TAG_SEPARATOR) { - Cookie cookie = getYanelAnalyticsCookie(request); - String cookieValue = null; - if (cookie != null) { - cookieValue = cookie.getValue(); - } - return getLogMessage(getURLInclQueryString(request), realmID, cookieValue, request.getHeader("referer"), request.getHeader("User-Agent"), tags, TAG_SEPARATOR); + return getLogMessage(url, realmID, cookie.getValue(), request.getHeader("referer"), request.getHeader("User-Agent"),tags, TAG_SEPARATOR); } /** @@ -153,48 +144,4 @@ private static Cookie getSetYanelAnalyticsCookie(HttpServletRequest request, Htt response.addCookie(analyticsCookie); return analyticsCookie; } - - /** - * Get request URL including query string - */ - private static String getURLInclQueryString(HttpServletRequest request) { - String qs = request.getQueryString(); - try { - ForwardedURL url = new ForwardedURL(request); - if (qs != null) { - return url.toString() + "?" + qs; - } else { - return url.toString(); - } - } catch(Exception e) { - log.error(e, e); - return request.getRequestURL().toString(); - } - } -} - -/** - * Utility class to replace hostname by forwarded hostname if available - */ -class ForwardedURL { - - private java.net.URL url; - - /** - * @param request HTTP request containing requested URL and if there was a reverse proxy in between also the forwarded host name - */ - public ForwardedURL(HttpServletRequest request) throws java.net.MalformedURLException { - url = new java.net.URL(request.getRequestURL().toString()); - String originalHost = request.getHeader("X-FORWARDED-HOST"); - if (originalHost != null) { - url = new java.net.URL(url.getProtocol(), originalHost, url.getPort(), url.getFile()); - } - } - - /** - * @see java.lang.Object#toString() - */ - public String toString() { - return url.toString(); - } } diff --git a/src/webapp/src/java/org/wyona/yanel/servlet/YanelServlet.java b/src/webapp/src/java/org/wyona/yanel/servlet/YanelServlet.java index bbabf9301..c9eeb5418 100644 --- a/src/webapp/src/java/org/wyona/yanel/servlet/YanelServlet.java +++ b/src/webapp/src/java/org/wyona/yanel/servlet/YanelServlet.java @@ -1309,6 +1309,10 @@ private HttpServletResponse doAccessControl(HttpServletRequest request, HttpServ /** * Patch request with proxy settings re realm configuration + * @param request Request which Yanel received + * @param addQS Additonal query string + * @param xml Flag whether returned URL should be XML compatible, e.g. re ampersands + * @return URL which was received by reverse proxy, e.g. http://www.yanel.org/en/download/index.html instead http://127.0.0.1:8080/yanel/yanel-website/en/download/index.html */ private String getRequestURLQS(HttpServletRequest request, String addQS, boolean xml) { try { @@ -1321,20 +1325,23 @@ private String getRequestURLQS(HttpServletRequest request, String addQS, boolean int proxyPort = realm.getProxyPort(); String proxyPrefix = realm.getProxyPrefix(); - URL url = null; - - url = new URL(request.getRequestURL().toString()); + URL url = new URL(request.getRequestURL().toString()); - //if(proxyHostName != null || proxyPort >= null || proxyPrefix != null) { if(realm.isProxySet()) { + String forwardedHost = request.getHeader("X-FORWARDED-HOST"); + if (forwardedHost != null) { + url = new java.net.URL(url.getProtocol(), forwardedHost, url.getFile()); + } if (proxyHostName != null) { - url = new URL(url.getProtocol(), proxyHostName, url.getPort(), url.getFile()); + url = new URL(url.getProtocol(), proxyHostName, url.getFile()); } if (proxyPort >= 0) { + //log.debug("Configured proxy port: " + proxyPort); url = new URL(url.getProtocol(), url.getHost(), proxyPort, url.getFile()); } else { - url = new URL(url.getProtocol(), url.getHost(), url.getDefaultPort(), url.getFile()); + //log.debug("No proxy port configured, hence use default port: " + url.getDefaultPort()); + url = new URL(url.getProtocol(), url.getHost(), url.getFile()); // INFO: Please note that if one does not set the port explicitely, then toString() won't add the port to the returned string. } if (proxyPrefix != null) { @@ -1353,7 +1360,9 @@ private String getRequestURLQS(HttpServletRequest request, String addQS, boolean if (addQS != null) urlQS = urlQS + "?" + addQS; } - if (xml) urlQS = urlQS.replaceAll("&", "&"); + if (xml) { + urlQS = urlQS.replaceAll("&", "&"); + } if(log.isDebugEnabled()) log.debug("Request: " + urlQS); @@ -2698,10 +2707,10 @@ Differentiate between hits, pageviews (only html or also PDF, etc.?) and visits if (trackInfo != null) { String[] trackingTags = trackInfo.getTags(); if (trackingTags != null && trackingTags.length > 0) { // INFO: Either/Or, but not both. If you want both, then make sure that that your resource adds its annotations to the tracking information. - accessLogMessage = AccessLog.getLogMessage(request, response, realm.getUserTrackingDomain(), trackingTags, ACCESS_LOG_TAG_SEPARATOR); + accessLogMessage = AccessLog.getLogMessage(getRequestURLQS(request, null, false), request, response, realm.getUserTrackingDomain(), trackingTags, ACCESS_LOG_TAG_SEPARATOR); } else { String[] tags = getTagsFromAnnotatableResource(resource, request.getServletPath()); - accessLogMessage = AccessLog.getLogMessage(request, response, realm.getUserTrackingDomain(), tags, ACCESS_LOG_TAG_SEPARATOR); + accessLogMessage = AccessLog.getLogMessage(getRequestURLQS(request, null, false), request, response, realm.getUserTrackingDomain(), tags, ACCESS_LOG_TAG_SEPARATOR); } String pageType = trackInfo.getPageType(); @@ -2722,7 +2731,7 @@ Differentiate between hits, pageviews (only html or also PDF, etc.?) and visits } } else { String[] tags = getTagsFromAnnotatableResource(resource, request.getServletPath()); - accessLogMessage = AccessLog.getLogMessage(request, response, realm.getUserTrackingDomain(), tags, ACCESS_LOG_TAG_SEPARATOR); + accessLogMessage = AccessLog.getLogMessage(getRequestURLQS(request, null, false), request, response, realm.getUserTrackingDomain(), tags, ACCESS_LOG_TAG_SEPARATOR); } // TBD/TODO: What if user has logged out, but still has a persistent cookie?! From 538c0ee336af2307dbbbca280fe6cb57176a109f Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Thu, 15 Nov 2012 08:52:04 +0100 Subject: [PATCH 32/56] global parameters removed and check whether TO address has been configured --- .../contactform/ContactResourceV2.java | 26 ++++++++----------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/src/resources/contact-form/src/java/org/wyona/yanel/impl/resources/contactform/ContactResourceV2.java b/src/resources/contact-form/src/java/org/wyona/yanel/impl/resources/contactform/ContactResourceV2.java index 2700a455f..c582c7fc0 100644 --- a/src/resources/contact-form/src/java/org/wyona/yanel/impl/resources/contactform/ContactResourceV2.java +++ b/src/resources/contact-form/src/java/org/wyona/yanel/impl/resources/contactform/ContactResourceV2.java @@ -81,13 +81,6 @@ public class ContactResourceV2 extends BasicXMLResource implements TrackableV1 { private static final String TO = "to"; private static final String SUBJECT = "subject"; - // Values for sending email - private String smtpHost = ""; - private int smtpPort = 25; - private String to = ""; - private ContactBean contact = null; - //private Path path = null; - // Email validation private String defaultEmailRegEx = "(\\w+)@(\\w+\\.)(\\w+)(\\.\\w+)*"; @@ -177,7 +170,11 @@ protected InputStream getContentXML(String viewId) throws Exception { } // Now send email - sendMail(cookieValue); + if (getResourceConfigProperty(TO) != null) { + sendMail(cookieValue); + } else { + log.warn("No email has been sent, because no 'TO' address configured!"); + } // Pass transformer paramters for output if(request.getParameter("company") != null) { @@ -226,8 +223,7 @@ protected void passTransformerParameters(Transformer transformer) /** * Send e-mail to administrator of this contact form - * @param cookieValue Yanel analytics cookie value (in order to connect - * history with this e-mail). + * @param cookieValue Yanel analytics cookie value (in order to connect clickstream with this e-mail). */ private void sendMail(String cookieValue) throws Exception { String email = getEnvironment().getRequest().getParameter("email"); @@ -246,13 +242,13 @@ private void sendMail(String cookieValue) throws Exception { return; } - contact = new ContactBean(request); + ContactBean contact = new ContactBean(request); String subject = getResourceConfigProperty(SUBJECT); if (subject == null) { subject = "Yanel Contact Resource: No subject specified"; } - to = getResourceConfigProperty(TO); + String from = getResourceConfigProperty("from"); if (from == null) { @@ -261,18 +257,19 @@ private void sendMail(String cookieValue) throws Exception { String content = getBody(contact, cookieValue); + String to = getResourceConfigProperty(TO); if(to == null) { // INFO: Also see conf/contact-form_en.properties setParameter("error", "smtpConfigError"); return; } - smtpHost = getResourceConfigProperty(SMTP_HOST); + String smtpHost = getResourceConfigProperty(SMTP_HOST); String smtpPortAsString = getResourceConfigProperty(SMTP_PORT); try { if(smtpHost != null && smtpPortAsString != null) { - smtpPort = Integer.parseInt(smtpPortAsString); + int smtpPort = Integer.parseInt(smtpPortAsString); MailUtil.send(smtpHost, smtpPort, from, to, subject, content); setParameter("sent", "true"); } else { @@ -300,7 +297,6 @@ private void sendMail(String cookieValue) throws Exception { } catch(NumberFormatException nfe) { log.error(nfe); setParameter("error", "smtpPortNotCorrect"); - smtpPort = 0; } } From 8cde0ed1a883c92b8075cd04d3565bb8041f215d Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Thu, 15 Nov 2012 08:52:38 +0100 Subject: [PATCH 33/56] note about smtp configuration added --- src/resources/contact-form/resource-v2.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/resources/contact-form/resource-v2.xml b/src/resources/contact-form/resource-v2.xml index a1f20c6c5..3e98bba40 100644 --- a/src/resources/contact-form/resource-v2.xml +++ b/src/resources/contact-form/resource-v2.xml @@ -17,9 +17,9 @@ Contact form for sending email - + - + From 22d89a1205886406246878d51cf99445f010331b Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Thu, 15 Nov 2012 10:11:48 +0100 Subject: [PATCH 34/56] title fixed --- src/realms/yanel-website/data-repo/data/xslt/global.xsl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/realms/yanel-website/data-repo/data/xslt/global.xsl b/src/realms/yanel-website/data-repo/data/xslt/global.xsl index 7aee73b39..8087e3af0 100644 --- a/src/realms/yanel-website/data-repo/data/xslt/global.xsl +++ b/src/realms/yanel-website/data-repo/data/xslt/global.xsl @@ -38,7 +38,10 @@ WARNING: This content has been generated dynamically. All changes will be lost. Name: (without suffix: ), Path: , Back 2 Realm: , Back 2 Context: + + <xsl:copy-of select="/xhtml:html/xhtml:head/xhtml:title/node()"/> - Yanel From e478e68f703b2dbdbc1670fef7b6fbc89553e71d Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Thu, 15 Nov 2012 10:47:55 +0100 Subject: [PATCH 35/56] save messages containing cookie value as XML --- .../contactform/ContactResourceV2.java | 69 ++++++++++++++++--- 1 file changed, 58 insertions(+), 11 deletions(-) diff --git a/src/resources/contact-form/src/java/org/wyona/yanel/impl/resources/contactform/ContactResourceV2.java b/src/resources/contact-form/src/java/org/wyona/yanel/impl/resources/contactform/ContactResourceV2.java index c582c7fc0..f3e9cc145 100644 --- a/src/resources/contact-form/src/java/org/wyona/yanel/impl/resources/contactform/ContactResourceV2.java +++ b/src/resources/contact-form/src/java/org/wyona/yanel/impl/resources/contactform/ContactResourceV2.java @@ -24,6 +24,7 @@ import java.util.HashMap; import java.util.Map; +import java.util.UUID; import java.util.regex.Pattern; import java.util.regex.Matcher; @@ -68,13 +69,20 @@ import org.xml.sax.XMLReader; import org.xml.sax.helpers.XMLReaderFactory; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +import org.wyona.commons.xml.XMLHelper; + /** - * Simple contact form resource. + * Simple contact form resource, such that a user can send a message/email to an 'administrator' */ public class ContactResourceV2 extends BasicXMLResource implements TrackableV1 { private static Logger log = Logger.getLogger(ContactResourceV2.class); + private static final String NAMESPACE = "http://www.wyona.org/yanel/contact-message/1.0.0"; + // Constants private static final String SMTP_HOST = "smtpHost"; private static final String SMTP_PORT = "smtpPort"; @@ -169,10 +177,14 @@ protected InputStream getContentXML(String viewId) throws Exception { log.warn("No Yanel analytics cookie set yet!"); } - // Now send email + // INFO: Save message on server + String messageID = saveMessage(cookieValue); + + // INFO: Now send email if (getResourceConfigProperty(TO) != null) { - sendMail(cookieValue); + sendMail(messageID); } else { + setParameter("error", "couldNotSendMail"); log.warn("No email has been sent, because no 'TO' address configured!"); } @@ -223,9 +235,27 @@ protected void passTransformerParameters(Transformer transformer) /** * Send e-mail to administrator of this contact form - * @param cookieValue Yanel analytics cookie value (in order to connect clickstream with this e-mail). + * @param cookieValue Yanel analytics cookie value (in order to connect clickstream with this message). + */ + private String saveMessage(String cookieValue) throws Exception { + String uuid = UUID.randomUUID().toString(); + Document doc = getMessageDocument(uuid, cookieValue); + String messagesBasePath = "/contact-messages"; // TODO: Make base path configurable + String messagePath = messagesBasePath + "/" + uuid + ".xml"; + if (!getRealm().getRepository().existsNode(messagePath)) { + org.wyona.yarep.core.Node messageNode = org.wyona.yarep.util.YarepUtil.addNodes(getRealm().getRepository(), messagePath, org.wyona.yarep.core.NodeType.RESOURCE); + XMLHelper.writeDocument(doc, messageNode.getOutputStream()); + } else { + log.error("Node '" + messagePath + "' already exists!"); + } + return uuid; + } + + /** + * Send e-mail to administrator of this contact form + * @param messageID Message ID in order to link back from email to message enriched with additional information */ - private void sendMail(String cookieValue) throws Exception { + private void sendMail(String messageID) throws Exception { String email = getEnvironment().getRequest().getParameter("email"); if(email == null || "".equals(email)) { @@ -255,7 +285,7 @@ private void sendMail(String cookieValue) throws Exception { from = email; } - String content = getBody(contact, cookieValue); + String content = getBody(contact, messageID); String to = getResourceConfigProperty(TO); if(to == null) { @@ -328,10 +358,10 @@ public void doTrack(TrackingInformationV1 trackInfo) { /** * Get email body. Please overwrite this method in order to customize email body. * @param contact Contact information - * @param cookieValue Yanel analytics cookie value + * @param messageID Message ID */ - protected String getBody(ContactBean contact, String cookieValue){ - StringBuffer content = new StringBuffer(""); + protected String getBody(ContactBean contact, String messageID){ + StringBuilder content = new StringBuilder(""); if(contact.getCompany() != null) { content.append("Company: "); content.append(contact.getCompany()); @@ -367,8 +397,8 @@ protected String getBody(ContactBean contact, String cookieValue){ content.append(contact.getMessage()); content.append("\n\n"); } - content.append("Yanel-analytics-cookie: "); - content.append(cookieValue); + content.append("Message ID: " + messageID); + return content.toString(); } @@ -381,4 +411,21 @@ private InputStream getXMLDocument() throws Exception { return new java.io.FileInputStream(xmlFile.getAbsolutePath()); //return new ByteArrayInputStream("".getBytes()); } + + /** + * Generate message as XML document + * @param messageID Message ID + * @param cookieValue Cookie which helps to associate clickstream of user with this message + * @return message as XML document + */ + private Document getMessageDocument(String messageID, String cookieValue) { + Document doc = XMLHelper.createDocument(NAMESPACE, "message"); + Element rootEl = doc.getDocumentElement(); + + Element cookieEl = doc.createElementNS(NAMESPACE, "yanel-analytics-cookie"); + rootEl.appendChild(cookieEl); + cookieEl.appendChild(doc.createTextNode(cookieValue)); + + return doc; + } } From f899a7962460afef448631dc268a9fb61ab569cd Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Thu, 15 Nov 2012 14:11:53 +0100 Subject: [PATCH 36/56] log whole message --- .../contactform/ContactResourceV2.java | 40 +++++++++++++++++-- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/src/resources/contact-form/src/java/org/wyona/yanel/impl/resources/contactform/ContactResourceV2.java b/src/resources/contact-form/src/java/org/wyona/yanel/impl/resources/contactform/ContactResourceV2.java index f3e9cc145..e05865c95 100644 --- a/src/resources/contact-form/src/java/org/wyona/yanel/impl/resources/contactform/ContactResourceV2.java +++ b/src/resources/contact-form/src/java/org/wyona/yanel/impl/resources/contactform/ContactResourceV2.java @@ -421,11 +421,45 @@ private InputStream getXMLDocument() throws Exception { private Document getMessageDocument(String messageID, String cookieValue) { Document doc = XMLHelper.createDocument(NAMESPACE, "message"); Element rootEl = doc.getDocumentElement(); + rootEl.setAttributeNS(NAMESPACE, "yanel-analytics-cookie", cookieValue); + rootEl.setAttributeNS(NAMESPACE, "uuid", messageID); - Element cookieEl = doc.createElementNS(NAMESPACE, "yanel-analytics-cookie"); - rootEl.appendChild(cookieEl); - cookieEl.appendChild(doc.createTextNode(cookieValue)); + ContactBean contact = new ContactBean(getEnvironment().getRequest()); + + if(contact.getCompany() != null) { + appendChild(rootEl, "company", contact.getCompany()); + } + if(contact.getFirstName() != null) { + appendChild(rootEl, "firstname", contact.getFirstName()); + } + if(contact.getLastName() != null) { + appendChild(rootEl, "lastname", contact.getLastName()); + } + if(contact.getAddress() != null) { + appendChild(rootEl, "address", contact.getAddress()); + } + if(contact.getCity() != null) { + appendChild(rootEl, "city", contact.getCity()); + } + if(contact.getEmail() != null) { + appendChild(rootEl, "e-mail", contact.getEmail()); + } + if(contact.getMessage() != null) { + appendChild(rootEl, "body", contact.getMessage()); + } return doc; } + + /** + * Append element with text node to another element + * @param parent Parent element to which element will be appended + * @param name Element name + * @param value String value of element + */ + private void appendChild(Element parent, String name, String value) { + Element companyEl = parent.getOwnerDocument().createElementNS(NAMESPACE, name); + parent.appendChild(companyEl); + companyEl.appendChild(parent.getOwnerDocument().createTextNode(value)); + } } From 6a3890c6362a64a1e23ffdbe03a7751ed67a4c4b Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Thu, 15 Nov 2012 14:26:39 +0100 Subject: [PATCH 37/56] work on back link started --- .../resources/contactform/ContactResourceV2.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/resources/contact-form/src/java/org/wyona/yanel/impl/resources/contactform/ContactResourceV2.java b/src/resources/contact-form/src/java/org/wyona/yanel/impl/resources/contactform/ContactResourceV2.java index e05865c95..ce1d5a4d6 100644 --- a/src/resources/contact-form/src/java/org/wyona/yanel/impl/resources/contactform/ContactResourceV2.java +++ b/src/resources/contact-form/src/java/org/wyona/yanel/impl/resources/contactform/ContactResourceV2.java @@ -83,6 +83,8 @@ public class ContactResourceV2 extends BasicXMLResource implements TrackableV1 { private static final String NAMESPACE = "http://www.wyona.org/yanel/contact-message/1.0.0"; + private static final String MESSAGE_PARAM_NAME = "message-id"; + // Constants private static final String SMTP_HOST = "smtpHost"; private static final String SMTP_PORT = "smtpPort"; @@ -179,6 +181,7 @@ protected InputStream getContentXML(String viewId) throws Exception { // INFO: Save message on server String messageID = saveMessage(cookieValue); + log.warn("DEBUG: Back link: " + getBackLink(messageID)); // INFO: Now send email if (getResourceConfigProperty(TO) != null) { @@ -397,7 +400,7 @@ protected String getBody(ContactBean contact, String messageID){ content.append(contact.getMessage()); content.append("\n\n"); } - content.append("Message ID: " + messageID); + content.append("Message ID: " + getBackLink(messageID)); return content.toString(); } @@ -462,4 +465,13 @@ private void appendChild(Element parent, String name, String value) { parent.appendChild(companyEl); companyEl.appendChild(parent.getOwnerDocument().createTextNode(value)); } + + /** + * Get back link to Yanel + * @param messageID Message ID + */ + private String getBackLink(String messageID) { + // TODO: Protocol, Host, Port (also make sure to consider reverse proxy). TBD: Make base URL configurable... + return "" + messageID + ""; + } } From b81413289184f9bb94e26a8b78d70c70080dfda4 Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Thu, 15 Nov 2012 15:21:11 +0100 Subject: [PATCH 38/56] make messages available via query string --- .../contactform/ContactResourceV2.java | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/resources/contact-form/src/java/org/wyona/yanel/impl/resources/contactform/ContactResourceV2.java b/src/resources/contact-form/src/java/org/wyona/yanel/impl/resources/contactform/ContactResourceV2.java index ce1d5a4d6..16991f007 100644 --- a/src/resources/contact-form/src/java/org/wyona/yanel/impl/resources/contactform/ContactResourceV2.java +++ b/src/resources/contact-form/src/java/org/wyona/yanel/impl/resources/contactform/ContactResourceV2.java @@ -113,7 +113,10 @@ protected InputStream getContentXML(String viewId) throws Exception { log.warn("Tracking information bean is null! Check life cycle of resource!"); } - //path = new Path(request.getServletPath()); + String requestedMsgID = getEnvironment().getRequest().getParameter(MESSAGE_PARAM_NAME); + if (requestedMsgID != null && viewId.equals("message")) { + return getRealm().getRepository().getNode(getMessagePath(requestedMsgID)).getInputStream(); + } String email = request.getParameter("email"); // Checking if form was submitted @@ -243,8 +246,7 @@ protected void passTransformerParameters(Transformer transformer) private String saveMessage(String cookieValue) throws Exception { String uuid = UUID.randomUUID().toString(); Document doc = getMessageDocument(uuid, cookieValue); - String messagesBasePath = "/contact-messages"; // TODO: Make base path configurable - String messagePath = messagesBasePath + "/" + uuid + ".xml"; + String messagePath = getMessagePath(uuid); if (!getRealm().getRepository().existsNode(messagePath)) { org.wyona.yarep.core.Node messageNode = org.wyona.yarep.util.YarepUtil.addNodes(getRealm().getRepository(), messagePath, org.wyona.yarep.core.NodeType.RESOURCE); XMLHelper.writeDocument(doc, messageNode.getOutputStream()); @@ -472,6 +474,15 @@ private void appendChild(Element parent, String name, String value) { */ private String getBackLink(String messageID) { // TODO: Protocol, Host, Port (also make sure to consider reverse proxy). TBD: Make base URL configurable... - return "" + messageID + ""; + return "" + messageID + ""; + } + + /** + * Get message path + * @param uuid Message ID + */ + private String getMessagePath(String uuid) { + String messagesBasePath = "/contact-messages"; // TODO: Make base path configurable + return messagesBasePath + "/" + uuid + ".xml"; } } From c137979ed43eb2de8fce6b1d32781dfb726f468f Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Thu, 15 Nov 2012 15:22:37 +0100 Subject: [PATCH 39/56] message view added --- .../res-configs-repo/data/en/contact.html.yanel-rc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/realms/yanel-website/res-configs-repo/data/en/contact.html.yanel-rc b/src/realms/yanel-website/res-configs-repo/data/en/contact.html.yanel-rc index cc78c2c94..3d9899810 100644 --- a/src/realms/yanel-website/res-configs-repo/data/en/contact.html.yanel-rc +++ b/src/realms/yanel-website/res-configs-repo/data/en/contact.html.yanel-rc @@ -30,6 +30,9 @@ + + application/xml + application/xml From 50d8ad09e97379cdb0bab1254dbd26bbe05849a3 Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Thu, 15 Nov 2012 15:25:15 +0100 Subject: [PATCH 40/56] XSLT added to generate XHTML --- .../res-configs-repo/data/en/contact.html.yanel-rc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/realms/yanel-website/res-configs-repo/data/en/contact.html.yanel-rc b/src/realms/yanel-website/res-configs-repo/data/en/contact.html.yanel-rc index 3d9899810..a325cfcad 100644 --- a/src/realms/yanel-website/res-configs-repo/data/en/contact.html.yanel-rc +++ b/src/realms/yanel-website/res-configs-repo/data/en/contact.html.yanel-rc @@ -31,7 +31,13 @@ + + rthtdocs:/xslt/message.xsl + /xslt/global.xsl + text/html + application/xml From 9c8766f209f2de88b6adf3a83cd5adffe898cc09 Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Thu, 15 Nov 2012 15:28:18 +0100 Subject: [PATCH 41/56] message XSLT started --- .../contact-form/htdocs/xslt/message.xsl | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/resources/contact-form/htdocs/xslt/message.xsl diff --git a/src/resources/contact-form/htdocs/xslt/message.xsl b/src/resources/contact-form/htdocs/xslt/message.xsl new file mode 100644 index 000000000..44ffd6458 --- /dev/null +++ b/src/resources/contact-form/htdocs/xslt/message.xsl @@ -0,0 +1,27 @@ + + + + + + + + + + Message + + + +

Contact Message

+ + + +
+ +
From d28c801deee9863b12f694a507653f0cd700fdc6 Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Thu, 15 Nov 2012 15:30:03 +0100 Subject: [PATCH 42/56] message namespace added --- src/resources/contact-form/htdocs/xslt/message.xsl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/resources/contact-form/htdocs/xslt/message.xsl b/src/resources/contact-form/htdocs/xslt/message.xsl index 44ffd6458..022b7f6d1 100644 --- a/src/resources/contact-form/htdocs/xslt/message.xsl +++ b/src/resources/contact-form/htdocs/xslt/message.xsl @@ -5,6 +5,7 @@ xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:i18n="http://www.wyona.org/yanel/i18n/1.0" xmlns="http://www.w3.org/1999/xhtml" + xmlns:msg="http://www.wyona.org/yanel/contact-message/1.0.0" > @@ -17,6 +18,8 @@

Contact Message

+ + Company: From c7cd0eaa493e5c64f0b5fb024d7a22aa07171e36 Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Thu, 15 Nov 2012 15:44:29 +0100 Subject: [PATCH 43/56] show rest of message and provide link to user profile --- .../contact-form/htdocs/xslt/message.xsl | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/resources/contact-form/htdocs/xslt/message.xsl b/src/resources/contact-form/htdocs/xslt/message.xsl index 022b7f6d1..38359dbe0 100644 --- a/src/resources/contact-form/htdocs/xslt/message.xsl +++ b/src/resources/contact-form/htdocs/xslt/message.xsl @@ -17,12 +17,24 @@ -

Contact Message

+

Contact Message:

Company: - +
+ Firstname: +
+ Lastname: +
+ Address: +
+ City: +
+ E-Mail: +

+ Message:

+
+ + User Profile (Clickstream, etc.): From 306557a9c905f060d58bc25a84df62918d37e371 Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Thu, 15 Nov 2012 17:07:12 +0100 Subject: [PATCH 44/56] note about back link base url added --- src/resources/contact-form/resource-v2.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/resources/contact-form/resource-v2.xml b/src/resources/contact-form/resource-v2.xml index 3e98bba40..e72194f3d 100644 --- a/src/resources/contact-form/resource-v2.xml +++ b/src/resources/contact-form/resource-v2.xml @@ -19,6 +19,7 @@ Contact form for sending email + From 94ccf50e600d5f297a3ae24a0d0588e7ae1b530b Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Thu, 15 Nov 2012 17:07:26 +0100 Subject: [PATCH 45/56] back link base url configured --- .../res-configs-repo/data/en/contact.html.yanel-rc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/realms/yanel-website/res-configs-repo/data/en/contact.html.yanel-rc b/src/realms/yanel-website/res-configs-repo/data/en/contact.html.yanel-rc index a325cfcad..6a4989c43 100644 --- a/src/realms/yanel-website/res-configs-repo/data/en/contact.html.yanel-rc +++ b/src/realms/yanel-website/res-configs-repo/data/en/contact.html.yanel-rc @@ -15,6 +15,9 @@ + + + + + + + + + + + + + + + My Profile + + + + + +Back 2 Realm: , +Yanel reserved prefix: + + +

My Profile

+ +

Show XML source

+ +

+Your DNT header parameter is currently set to '', which means that you are currently not being tracked.you are currently being tracked! +

+ +

Depending on your browser you can disable or enable the DNT header parameter. For more details see http://donottrack.us/.

+ + + + + + + + +
+ + +

Exception: 

+
+ + +

Interests

+ + +

Based on your clickstream, which we have tracked so far, we have detected the following interests:

+ +
    + +
  • +
    +
+
+ +

No interests detected yet.

+
+
+
+ + +

Clickstream

+ + +

Your clickstream contains the following URLs:

+ +
    + +
  • +
    +
+
+ +

No interests detected yet.

+
+
+
+ + From cdece77f9c12f67c5f88a7030e3d1ba69886de0d Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Thu, 15 Nov 2012 23:29:41 +0100 Subject: [PATCH 55/56] use global profile XSLT --- .../res-configs-repo/data/my-profile.html.yanel-rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/realms/yanel-website/res-configs-repo/data/my-profile.html.yanel-rc b/src/realms/yanel-website/res-configs-repo/data/my-profile.html.yanel-rc index 34bb64ced..e8a72c74b 100644 --- a/src/realms/yanel-website/res-configs-repo/data/my-profile.html.yanel-rc +++ b/src/realms/yanel-website/res-configs-repo/data/my-profile.html.yanel-rc @@ -11,7 +11,7 @@ - /xslt/profile.xsl + rthtdocs:/xslt/profile.xsl /xslt/global.xsl /xslt/apply-google-analytics.xsl text/html From a3eb6b12e686019050455c730671329dc06fb9fd Mon Sep 17 00:00:00 2001 From: Michael Wechner Date: Thu, 15 Nov 2012 23:30:16 +0100 Subject: [PATCH 56/56] obsolete XSLT removed, because moved into resource --- .../data-repo/data/xslt/profile.xsl | 93 ------------------- 1 file changed, 93 deletions(-) delete mode 100644 src/realms/yanel-website/data-repo/data/xslt/profile.xsl diff --git a/src/realms/yanel-website/data-repo/data/xslt/profile.xsl b/src/realms/yanel-website/data-repo/data/xslt/profile.xsl deleted file mode 100644 index 00fc04886..000000000 --- a/src/realms/yanel-website/data-repo/data/xslt/profile.xsl +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - - - - - - - My Profile - - - - - -Back 2 Realm: , -Yanel reserved prefix: - - -

My Profile

- -

Show XML source

- -

-Your DNT header parameter is currently set to '', which means that you are currently not being tracked.you are currently being tracked! -

- -

Depending on your browser you can disable or enable the DNT header parameter. For more details see http://donottrack.us/.

- - - - - - - - -
- - -

Exception: 

-
- - -

Interests

- - -

Based on your clickstream, which we have tracked so far, we have detected the following interests:

- -
    - -
  • -
    -
-
- -

No interests detected yet.

-
-
-
- - -

Clickstream

- - -

Your clickstream contains the following URLs:

- -
    - -
  • -
    -
-
- -

No interests detected yet.

-
-
-
- -