Commits

John Kodumal  committed eca320e

Update links reps

  • Participants
  • Parent commits 5e65401

Comments (0)

Files changed (4)

         <confluence.version>3.4.7</confluence.version>
         <confluence.data.version>3.1</confluence.data.version>
         <jackson.version>1.4.4</jackson.version>
-        <pac.baseurl>https://plugins.atlassian.com</pac.baseurl>
+        <pac.baseurl>https://marketplace.atlassian.com</pac.baseurl>
     </properties>
 
 </project>

File src/main/java/com/atlassian/plugins/macros/OverviewTable.java

         if (!screenshots.isEmpty())
         {
             ScreenshotRepresentation screenshot = screenshots.get(0);
-            String url = Sys.getPacBaseUrl() + screenshot.getImage().getLocation();
+            String url = screenshot.getImage().getLocation();
             return format("<a href=\"%s\", target=\"_blank\">" +
                 "<img src=\"%s\">" +
                 "</a>", url, url);

File src/main/java/com/atlassian/plugins/macros/PluginRepresentation.java

 import javax.xml.bind.annotation.XmlRootElement;
 import java.util.Date;
 import java.util.List;
-import java.util.Map;
 
 @XmlRootElement
 @XmlAccessorType(XmlAccessType.FIELD)
 public class PluginRepresentation
 {
     @XmlElement
-    private Map<String, String> links;
+    private List<Link> links;
 
     @XmlAttribute
     private String name;
 
     public String getHomepageUrl()
     {
-        return getLinks().get("homepage");
+        return Link.find(links, "homepage");
     }
 
     public String getVersionHistoryLink()
     {
-        return getLinks().get("alternate") + "#versions";
+        return Link.find(links, "alternate") + "#versions";
     }
     
-    public Map<String, String> getLinks()
+    public List<Link> getLinks()
     {
         return links;
     }
 
-    public void setLinks(Map<String, String> links)
+    public void setLinks(List<Link> links)
     {
         this.links = links;
     }
     public static class VendorRepresentation
     {
         @XmlElement
-        private Map<String, String> links;
+        private List<Link> links;
 
         @XmlAttribute
         private String name;
 
         public String getUrl()
         {
-            return getLinks().get("homepage");
+            return Link.find(links, "homepage");
         }
 
-        public Map<String, String> getLinks()
+        public List<Link> getLinks()
         {
             return links;
         }
 
-        public void setLinks(Map<String, String> links)
+        public void setLinks(List<Link> links)
         {
             this.links = links;
         }
     public static class PluginCategoryRepresentation
     {
         @XmlElement
-        private Map<String, String> links;
+        private List<Link> links;
 
         @XmlAttribute
         private String name;
 
         public String getAlternateLink()
         {
-            return getLinks().get("alternate");
+            return Link.find(links, "alternate");
         }
 
-        public Map<String, String> getLinks()
+        public List<Link> getLinks()
         {
             return links;
         }
 
-        public void setLinks(Map<String, String> links)
+        public void setLinks(List<Link> links)
         {
             this.links = links;
         }
     public static class PluginVersionRepresentation
     {
         @XmlElement
-        private Map<String, String> links;
+        private List<Link> links;
 
         @XmlAttribute
         private Long buildNumber;
 
         public String getBinaryUrl()
         {
-            return getLinks().get("binary");
+            return Link.find(links, "binary");
         }
 
         public String getJiraUrl()
         {
-            return getLinks().get("issueTracker");
+            return Link.find(links, "issueTracker");
         }
 
         public String getBambooUrl()
         {
-            return getLinks().get("builds");
+            return Link.find(links, "builds");
         }
 
         public String getReleaseNotesUrl()
         {
-            return getLinks().get("releaseNotes");
+            return Link.find(links, "releaseNotes");
         }
 
         public String getSourceUrl()
         {
-            return getLinks().get("source");
+            return Link.find(links, "source");
         }
 
         public String getJavadocsUrl()
         {
-            return getLinks().get("javadocs");
+            return Link.find(links, "javadocs");
         }
 
         public String getLicenseUrl()
         {
-            return getLinks().get("license");
+            return Link.find(links, "license");
         }
 
-        public Map<String, String> getLinks()
+        public List<Link> getLinks()
         {
             return links;
         }
 
-        public void setLinks(Map<String, String> links)
+        public void setLinks(List<Link> links)
         {
             this.links = links;
         }
     public static class ImageRepresentation
     {
         @XmlElement
-        private Map<String, String> links;
+        private List<Link> links;
 
         public String getLocation()
         {
-            return links.get("binary");
+            return Link.find(links, "binary");
         }
 
-        public Map<String, String> getLinks()
+        public List<Link> getLinks()
         {
             return links;
         }
 
-        public void setLinks(Map<String, String> links)
+        public void setLinks(List<Link> links)
         {
             this.links = links;
         }
     public static class LicenseRepresentation
     {
         @XmlElement
-        private Map<String, String> links;
+        private List<Link> links;
 
         @XmlAttribute
         private String id;
         @XmlAttribute
         private String name;
 
-        public Map<String, String> getLinks()
+        public List<Link> getLinks()
         {
             return links;
         }
 
-        public void setLinks(Map<String, String> links)
+        public void setLinks(List<Link> links)
         {
             this.links = links;
         }

File src/main/java/com/atlassian/plugins/macros/Sys.java

 {
     public static String getPacBaseUrl()
     {
-        return System.getProperty("pac.baseurl", "https://plugins.atlassian.com");
+        return System.getProperty("pac.baseurl", "https://marketplace.atlassian.com");
     }
 }