Changeset 6447
- Timestamp:
- Apr 15, 2014, 8:50:29 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/net/sf/basedb/core/Job.java
r6444 r6447 81 81 @SuppressWarnings("deprecation") 82 82 public class Job 83 extends OwnedItem<JobData>84 implements Nameable, Removable,Transactional83 extends CommonItem<JobData> 84 implements Transactional 85 85 { 86 86 /** … … 196 196 { 197 197 return TYPE; 198 }199 // -------------------------------------------200 /*201 From the Nameable interface202 -------------------------------------------203 */204 @Override205 public String getName()206 {207 return getData().getName();208 }209 @Override210 public void setName(String name)211 throws PermissionDeniedException, InvalidDataException212 {213 checkPermission(Permission.WRITE);214 NameableUtil.setName(getData(), name);215 }216 @Override217 public String getDescription()218 {219 return getData().getDescription();220 }221 @Override222 public void setDescription(String description)223 throws PermissionDeniedException, InvalidDataException224 {225 checkPermission(Permission.WRITE);226 NameableUtil.setDescription(getData(), description);227 }228 // -------------------------------------------229 /*230 From the Removable interface231 -------------------------------------------232 */233 @Override234 public boolean isRemoved()235 {236 return getData().isRemoved();237 }238 @Override239 public void setRemoved(boolean removed)240 throws PermissionDeniedException241 {242 checkPermission(removed ? Permission.DELETE : Permission.WRITE);243 getData().setRemoved(removed);244 198 } 245 199 // ------------------------------------------- -
trunk/src/core/net/sf/basedb/core/Update.java
r6444 r6447 40 40 import org.hibernate.mapping.PersistentClass; 41 41 import org.hibernate.mapping.Table; 42 42 43 43 44 … … 76 77 import net.sf.basedb.core.data.RoleKeyData; 77 78 import net.sf.basedb.core.data.SchemaVersionData; 79 import net.sf.basedb.core.data.ShareableData; 78 80 import net.sf.basedb.core.data.UserData; 79 81 import net.sf.basedb.core.dbengine.DbEngine; … … 212 214 <td>116</td> 213 215 <td> 214 Added {@link JobData#getExternalId()} . No special database update is needed. Only increase215 the schema version.216 Added {@link JobData#getExternalId()} and made {@link JobData} a {@link ShareableData} item. 217 No special database update is needed. Only increase the schema version. 216 218 </td> 217 219 </tr> -
trunk/src/core/net/sf/basedb/core/data/JobData.java
r6446 r6447 40 40 */ 41 41 public class JobData 42 extends OwnedData 43 implements NameableData, RemovableData 42 extends CommonData 44 43 { 45 44 46 45 public JobData() 47 46 {} 48 49 /*50 From the NameableData interface51 -------------------------------------------52 */53 private String name;54 @Override55 public String getName()56 {57 return name;58 }59 @Override60 public void setName(String name)61 {62 this.name = name;63 }64 private String description;65 @Override66 public String getDescription()67 {68 return description;69 }70 @Override71 public void setDescription(String description)72 {73 this.description = description;74 }75 // -------------------------------------------76 /*77 From the RemovableData interface78 -------------------------------------------79 */80 private boolean removed;81 @Override82 public boolean isRemoved()83 {84 return removed;85 }86 @Override87 public void setRemoved(boolean removed)88 {89 this.removed = removed;90 }91 // -------------------------------------------92 47 93 48 private int type; -
trunk/www/views/jobs/index.jsp
r6432 r6447 170 170 redirect = listPage; 171 171 } 172 else if ("ShareItem".equals(cmd)) 173 { 174 // Display a popup window for sharing a single item 175 dc = sc.newDbControl(); 176 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 177 MultiPermissions permissions = ShareableUtil.getMultiPermissions(dc, itemType, Collections.singleton(cc.getId())); 178 dc.close(); 179 cc.setObject("MultiPermissions", permissions); 180 redirect = "../../common/share/share.jsp?ID="+ID+"&item_type="+itemType.name(); 181 } 182 else if ("ShareItems".equals(cmd)) 183 { 184 // Display a popup window for sharing all selected items on the list page 185 dc = sc.newDbControl(); 186 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 187 MultiPermissions permissions = ShareableUtil.getMultiPermissions(dc, itemType, cc.getSelected()); 188 dc.close(); 189 cc.setObject("MultiPermissions", permissions); 190 redirect = "../../common/share/share.jsp?ID="+ID+"&item_type="+itemType.name(); 191 } 172 192 else if ("SetOwnerOfItem".equals(cmd)) 173 193 { -
trunk/www/views/jobs/list_jobs.jsp
r6439 r6447 36 36 import="net.sf.basedb.core.ItemContext" 37 37 import="net.sf.basedb.core.Permission" 38 import="net.sf.basedb.core.Nameable" 38 39 import="net.sf.basedb.core.PluginDefinition" 39 40 import="net.sf.basedb.core.PermissionDeniedException" … … 45 46 import="net.sf.basedb.core.plugin.Plugin" 46 47 import="net.sf.basedb.util.Enumeration" 48 import="net.sf.basedb.util.ShareableUtil" 47 49 import="net.sf.basedb.clients.web.Base" 48 50 import="net.sf.basedb.clients.web.ModeInfo" … … 58 60 import="net.sf.basedb.clients.web.extensions.list.ListColumnUtil" 59 61 import="net.sf.basedb.util.extensions.ExtensionsInvoker" 62 import="java.util.Iterator" 60 63 import="java.util.List" 61 64 import="java.util.Map" … … 382 385 title="Permission" 383 386 /> 387 <tbl:columndef 388 id="sharedTo" 389 title="Shared to" 390 filterable="true" 391 filterproperty="!sharedTo.name" 392 datatype="string" 393 /> 384 394 <tbl:columndef 385 395 id="xt-columns" … … 403 413 title="Restore" 404 414 tooltip="Restore the selected (deleted) items" 415 /> 416 <tbl:button 417 id="btnShareItems" 418 image="share.png" 419 title="Share…" 420 tooltip="Share the selected items" 405 421 /> 406 422 <tbl:button … … 701 717 /></tbl:cell> 702 718 <tbl:cell column="permission"><%=PermissionUtil.getShortPermissions(item)%></tbl:cell> 719 <tbl:cell column="sharedTo"> 720 <% 721 Iterator<Nameable> sharees = ShareableUtil.getSharedTo(dc, item).iterator(); 722 while(sharees.hasNext()) 723 { 724 Nameable n = sharees.next(); 725 if (mode.hasPropertyLink()) 726 { 727 out.write(Base.getLinkedName(ID, n, false, mode.hasEditLink())); 728 } 729 else 730 { 731 out.write(HTML.encodeTags(n.getName())); 732 } 733 out.write(sharees.hasNext() ? ", " : ""); 734 } 735 %> 736 </tbl:cell> 703 737 <tbl:xt-cells dc="<%=dc%>" item="<%=item%>"> 704 738 <tbl:cell column="xt-columns" />
Note: See TracChangeset
for help on using the changeset viewer.