Skip to content
This repository
  • 2 commits
  • 2 files changed
  • 0 comments
  • 1 contributor

Showing 2 changed files with 12 additions and 7 deletions. Show diff stats Hide diff stats

  1. +1 1  README
  2. +11 6 ReplacePreview/client/commands/ViewInFrontEnd.js
2  README
@@ -5,9 +5,9 @@ ReplacePreview Features:
5 5
6 6 Currently working on:
7 7 -Functionality for View In Staging/Live
  8 +-Integration with Extension Manager to select which items should be shown/hidden
8 9
9 10 Future enhancements:
10   --Integration with Extension Manager to select which items should be shown/hidden
11 11 -Removing preview-box and button from inside Page View
12 12
13 13 Original Extension Manager done by Yoav Niran (http://yoavniran.wordpress.com/2011/03/30/one-extension-to-rule-them-all/)
17 ReplacePreview/client/commands/ViewInFrontEnd.js
@@ -73,7 +73,6 @@ function ViewInFrontEnd(settings)
73 73 };
74 74
75 75 classToBeReturned.prototype._execute = function (selection, pipeline) {
76   -
77 76 var itemId = selection.getItem(0);
78 77
79 78 if(item){
@@ -89,8 +88,10 @@ function ViewInFrontEnd(settings)
89 88 $extUtils.getStaticItem(itemId,
90 89 function (item) //load the item info asynchronously
91 90 {
92   - var publicationId = item.getPublication().getId();
93   - var frontEndUrl = "http://www.front.end"; //Get the URL from XML based on Publication ID
  91 + var frontEndUrl = _getFrontEndUrlBasedOnPublicationId(item.getPublication().getId());
  92 + if(!frontEndUrl) {
  93 + frontEndUrl = this.settings.frontEndUrl;
  94 + }
94 95 var itemXml = item.getStaticXmlDocument();
95 96 window.open(frontEndUrl + _getPublishLocationUrl(itemXml));
96 97 }, null, false);
@@ -100,15 +101,19 @@ function ViewInFrontEnd(settings)
100 101 return $xml.getInnerText(itemXml, "//tcm:Info/tcm:LocationInfo/tcm:PublishLocationUrl");
101 102 }
102 103
  104 + function _getFrontEndUrlBasedOnPublicationId(pubId) {
  105 + return null; //Get the URL from XML based on Publication ID
  106 + }
  107 +
103 108 return classToBeReturned;
104 109 };
105 110
106 111
107 112 CommandsExtensions.ViewInStaging = ViewInFrontEnd({fullQName: "CommandsExtensions.ViewInStaging",
108 113 className: "ViewInStaging",
109   - urlListFile: "stagingUrls.xml"});
  114 + frontEndUrl: "http://staging.frontend.com"});
110 115 CommandsExtensions.ViewInLive = ViewInFrontEnd({fullQName: "CommandsExtensions.ViewInLive",
111 116 className: "ViewInLive",
112   - urlListFile: "liveUrls.xml"});
  117 + frontEndUrl: "http://www.frontend.com"});
113 118
114   -})(window.$j);
  119 +})(window.$j);

No commit comments for this range

Something went wrong with that request. Please try again.