Ignore:
Timestamp:
09/14/11 11:32:48 (14 years ago)
Author:
mcichenski
Message:

downloadable files

Location:
gssim_ui/branches/vine/gssimstudio/src/web/ui/flex/java/gssim/gssimstudio/flex/app/editor
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • gssim_ui/branches/vine/gssimstudio/src/web/ui/flex/java/gssim/gssimstudio/flex/app/editor/GSSimStudio.java

    r78 r81  
    133133     
    134134    @BlazeDsMethod() 
     135    public GSSimStudioModel getOpenURL(String fileUrl) throws MalformedURLException { 
     136        GSSimStudioModel model = (GSSimStudioModel) VineFlexUtilClass.getUIModel(); 
     137        FileLocation fileLocation = new FileLocation(fileUrl); 
     138        ServletContext servletContext = FlexContext.getServletContext(); 
     139        String contentType = servletContext.getMimeType(fileLocation.getFileName().toLowerCase()); 
     140        log.debug("getOpenURL : contentType: " + contentType); 
     141        String openUrl = null; 
     142        if (contentType != null) { 
     143            openUrl = VineFlexUtilClass.getURL(fileLocation, contentType); 
     144        } else { 
     145            openUrl = VineFlexUtilClass.getDownloadURL(fileLocation); 
     146        } 
     147 
     148        model.setOpenUrl(openUrl); 
     149        return model; 
     150    } 
     151     
     152    @BlazeDsMethod() 
    135153        public GSSimStudioModel uploadAndSubmitExperiment(String destFileName, String fileContent, String grmsURL, String grmsDN, String jobDescription) throws IOException { 
    136154                String expName = destFileName.split("_")[1].split(".properties")[0]; 
  • gssim_ui/branches/vine/gssimstudio/src/web/ui/flex/java/gssim/gssimstudio/flex/app/editor/GSSimStudioModel.java

    r73 r81  
    132132        /* END OF DB DATA */ 
    133133 
     134        private String openUrl; 
     135         
     136        /** 
     137         * @return the grmsDN 
     138         */ 
     139        public String getOpenUrl() { 
     140                return openUrl; 
     141        } 
     142 
     143        /** 
     144         * @param grmsDN the grmsDN to set 
     145         */ 
     146        public void setOpenUrl(String openUrl) { 
     147                this.openUrl = openUrl; 
     148        } 
     149         
    134150    /** 
    135151         * @return the grmsDN 
Note: See TracChangeset for help on using the changeset viewer.