1 5 6 package com.raptus.owxv3.api.components; 7 8 import java.util.Vector ; 9 10 import javax.servlet.http.HttpServletRequest ; 11 12 import org.apache.struts.action.ActionMapping; 13 14 import com.raptus.owxv3.LoggingManager; 15 import com.raptus.owxv3.api.FilesSelector; 16 17 39 public class CmpFilesBean extends ComponentBean 40 { 41 44 protected String selCategory = null; 45 46 49 protected int fileToLink = -1; 50 51 54 protected FilesSelector fileSelector = null; 55 56 59 61 62 65 protected String [] title = null; 66 67 70 public String getSelCategory() { return selCategory; } 71 public void setSelCategory(String category) { this.selCategory = category; } 72 73 76 public int getFileToLink() { return fileToLink; } 77 public void setFileToLink(int fileId) { this.fileToLink = fileId; } 78 79 82 public FilesSelector getFilesSelector() { return fileSelector; } 83 public void setFilesSelector(FilesSelector fs) { this.fileSelector = fs; } 84 85 86 92 93 96 public String [] getTitle() { return title; } 97 public void setTitle(String [] t) { this.title = t; } 98 99 100 103 public void reset(ActionMapping mapping, HttpServletRequest request) 104 { 105 super.reset(mapping, request); 106 107 selCategory = null; 108 fileToLink = -1; 109 title=null; 110 } 111 112 115 public boolean populateViewFields() 116 { 117 if(selCategory != null){ 118 119 fileSelector.switchToCategory(selCategory); 120 return true; 121 } 122 else if(fileToLink != -1 && title!=null) 123 { 124 boolean ret=fileSelector.linkFile(fileToLink,title); 125 selCategory = null; 127 fileToLink = -1; 128 title=null; 129 return ret; 130 } 131 else 132 LoggingManager.log("Missing data for populating view fields!", this); 133 134 return true; 135 } 136 137 140 141 public Vector getLinkedFiles(){ 142 if(fileSelector==null) return null; 143 return fileSelector.getLinkedFiles( getCurrLocale() ); 144 145 } 146 147 } 148 149 | Popular Tags |