ALF-4785: Update the Help URLs for 3.4 Enterprise Beta and Enterprise

ALF-4583: Online Help URLs too hard-coded
  Share: Help URLs split out into separate config file, which is overridden for Enterprise deployments.
  Explorer: Help URL is templated and populated when first queried.
  Office add-in webscripts: Help URL is templated via I18N properties.
  Office add-in client: Not currently possible due to proprietary build and installer build steps.
  AWE: Also not currently possible without significant refactoring.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@22892 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mike Hatfield
2010-10-05 15:24:52 +00:00
parent 89d5a75b55
commit 686abca3c9
5 changed files with 32 additions and 6 deletions

View File

@@ -11,7 +11,7 @@ office.title.document_tags=Document Tags
# Help # Help
office.help.title=Online Help office.help.title=Online Help
office.help.url=http://www.alfresco.com/help/34/community/msaddin/ office.help.url=http://www.alfresco.com/help/{0}{1}/{2}/msaddin/
# Headers and Subheaders # Headers and Subheaders
office.header.my_checked_out_documents=My Checked Out Documents office.header.my_checked_out_documents=My Checked Out Documents

View File

@@ -72,7 +72,7 @@
<allow-guest-config>false</allow-guest-config> <allow-guest-config>false</allow-guest-config>
<!-- the URL to the client Help file --> <!-- the URL to the client Help file -->
<help-url>http://www.alfresco.com/help/34/community/ecmexplorerhelp/</help-url> <help-url>http://www.alfresco.com/help/{version.major}{version.minor}/{version.edition}/ecmexplorerhelp/</help-url>
<!-- the type of edit link to use, NOTE: inline editable will always take precedence --> <!-- the type of edit link to use, NOTE: inline editable will always take precedence -->
<!-- can be: http|webdav --> <!-- can be: http|webdav -->

View File

@@ -25,6 +25,8 @@ import java.util.Enumeration;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.faces.context.FacesContext; import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent; import javax.faces.event.ActionEvent;
@@ -52,6 +54,7 @@ import org.alfresco.service.cmr.search.SearchService;
import org.alfresco.service.cmr.security.AccessStatus; import org.alfresco.service.cmr.security.AccessStatus;
import org.alfresco.service.cmr.security.MutableAuthenticationService; import org.alfresco.service.cmr.security.MutableAuthenticationService;
import org.alfresco.service.cmr.security.PermissionService; import org.alfresco.service.cmr.security.PermissionService;
import org.alfresco.service.descriptor.Descriptor;
import org.alfresco.service.namespace.NamespaceService; import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.web.app.Application; import org.alfresco.web.app.Application;
import org.alfresco.web.app.context.UIContextService; import org.alfresco.web.app.context.UIContextService;
@@ -498,8 +501,31 @@ public class NavigationBean implements Serializable
*/ */
public void setHelpUrl(String helpUrl) public void setHelpUrl(String helpUrl)
{ {
if (this.helpUrl == null)
{
Descriptor serverDescriptor = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getDescriptorService().getServerDescriptor();
// search / replace each available key occurrence in the template string
// Note: server descriptor is looking for "version.major", "version.minor", etc.
Pattern p = Pattern.compile("\\{(\\w+\\.?\\w+)\\}");
Matcher m = p.matcher(helpUrl);
boolean result = m.find();
if (result)
{
StringBuffer sb = new StringBuffer();
String value = null;
do
{
value = serverDescriptor.getDescriptor(m.group(1));
m.appendReplacement(sb, value != null ? value.toLowerCase() : m.group(1));
result = m.find();
} while (result);
m.appendTail(sb);
helpUrl = sb.toString();
}
this.helpUrl = helpUrl; this.helpUrl = helpUrl;
} }
}
/** /**
* @return the number of rules associated with the current space * @return the number of rules associated with the current space
@@ -1047,7 +1073,7 @@ public class NavigationBean implements Serializable
/* package */ void initFromClientConfig() /* package */ void initFromClientConfig()
{ {
this.clientConfig = Application.getClientConfig(FacesContext.getCurrentInstance()); this.clientConfig = Application.getClientConfig(FacesContext.getCurrentInstance());
this.helpUrl = clientConfig.getHelpUrl(); this.setHelpUrl(clientConfig.getHelpUrl());
this.shelfExpanded = clientConfig.isShelfVisible(); this.shelfExpanded = clientConfig.isShelfVisible();
} }

View File

@@ -14,7 +14,6 @@ var OfficeNavigation =
init: function() init: function()
{ {
$('overlayPanel').setStyle('opacity', 0);
OfficeNavigation.setupToggles(); OfficeNavigation.setupToggles();
OfficeNavigation.setupCreateSpace(); OfficeNavigation.setupCreateSpace();
OfficeNavigation.getDocumentNames(); OfficeNavigation.getDocumentNames();
@@ -24,7 +23,6 @@ var OfficeNavigation =
{ {
OfficeNavigation.showCreateSpace(); OfficeNavigation.showCreateSpace();
} }
}, },
setupToggles: function() setupToggles: function()

View File

@@ -11,6 +11,8 @@ var OfficeAddin =
init: function() init: function()
{ {
$('overlayPanel').setStyle('opacity', 0);
window.queryObject = OfficeAddin.toQueryObject(document.location.search); window.queryObject = OfficeAddin.toQueryObject(document.location.search);
window.contextPath = OfficeAddin.getContextPath(); window.contextPath = OfficeAddin.getContextPath();
window.serviceContextPath = OfficeAddin.getServiceContextPath(); window.serviceContextPath = OfficeAddin.getServiceContextPath();