Java Doc for Attachment.java in  » Issue-Tracking » scarab-0.21 » org » tigris » scarab » om » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Issue Tracking » scarab 0.21 » org.tigris.scarab.om 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.tigris.scarab.om.BaseAttachment
   org.tigris.scarab.om.Attachment

Attachment
public class Attachment extends BaseAttachment implements Persistent(Code)
Attachments contain data associated with an issue. It used to be that an issue could have multiple attachments of a given type but only one value for a given Attribute. Attributes are now multi-valued, so the difference is blurred in some cases. A comment given as a reason for a modification to attribute values is considered an Attachment. Notes and urls are also considered attachments, though these two could probably be implemented as attributes (with some ui redesign). The obvious form of attachment is a file uploaded and associated with an issue, such as a screenshot showing an error or a patch.
author:
   John McNally
author:
   Jon S. Stevens
version:
   $Id: Attachment.java 9977 2005-12-09 00:40:59Z hair $


Field Summary
final public static  IntegerCOMMENT__PK
    
final public static  IntegerFILE__PK
    
final public static  IntegerMODIFICATION__PK
    
final public static  IntegerURL__PK
    


Method Summary
public  Attachmentcopy()
     Makes a copy of this object.
public  voidcopyFileFromTo(String from, String path)
    
public  voidcopyFileTo(String path)
    
public  booleandeletePhysicalAttachment()
    
public  StringdoMakeURLFromData()
    
public  ActivitygetActivity()
     Retrieves the Activity in which this attachment was created.
public  FileItemgetFile()
     There is no reason to reconstruct the FileItem, always returns null.
public  StringgetFullPath()
    
public  StringgetRelativePath()
     The path to an attachment file relative to the base file repository. Files are saved according to: moduleId/(issue_IdCount/1000)/issueID_attID_filename where moduleId and attId are primary keys of the related module and this attachment.
public static  StringgetRepositoryDirectory()
     Get the repository path info as given in the configuration.
public  longgetSize()
     Get the attachment file size.
public  voidsave(Connection dbCon)
     Calls super.save(Connection) and also checks for a FileItem.
protected static  voidsetConfiguration(Configuration configuration)
    
public  voidsetFile(FileItem v)
     Set the value of file.
public  voidsetFileName(String name)
     Makes sure to only save the simple filename which is the part following the last path separator.
public  voidsetTextFields(ScarabUser user, Issue issue, Integer typeId)
     Populates fields for a text (non-file) type of attachment.

Field Detail
COMMENT__PK
final public static Integer COMMENT__PK(Code)
ObjectKey for a note/comment type attachment



FILE__PK
final public static Integer FILE__PK(Code)
ObjectKey for a file type attachment



MODIFICATION__PK
final public static Integer MODIFICATION__PK(Code)
ObjectKey for a reason for modification type attachment



URL__PK
final public static Integer URL__PK(Code)
ObjectKey for a url type attachment





Method Detail
copy
public Attachment copy() throws TorqueException(Code)
Makes a copy of this object. It creates a new object filling in the simple attributes.



copyFileFromTo
public void copyFileFromTo(String from, String path) throws TorqueException, FileNotFoundException, IOException(Code)



copyFileTo
public void copyFileTo(String path) throws TorqueException, ScarabException, FileNotFoundException, IOException(Code)



deletePhysicalAttachment
public boolean deletePhysicalAttachment() throws TorqueException, ScarabException(Code)
Delete the attachment file on disk true if the file was deleted, false otherwise



doMakeURLFromData
public String doMakeURLFromData()(Code)
This is a little method that uses getData() to make a http url if it isn't already prefixed with "htt://"



getActivity
public Activity getActivity() throws TorqueException(Code)
Retrieves the Activity in which this attachment was created.



getFile
public FileItem getFile()(Code)
There is no reason to reconstruct the FileItem, always returns null. This is not used, but required by the bean introspector used by intake. value of file.



getFullPath
public String getFullPath() throws TorqueException, ScarabException(Code)
Prepends the base repository path to the path returnedby Attachment.getRelativePath(), returns null Attachment.getRelativePath() does.



getRelativePath
public String getRelativePath() throws TorqueException, ScarabException(Code)
The path to an attachment file relative to the base file repository. Files are saved according to: moduleId/(issue_IdCount/1000)/issueID_attID_filename where moduleId and attId are primary keys of the related module and this attachment. issueID is the unique id generally used to specify the issue within the ui. issue_IdCount is the numerical suffix of the unique id. So if the pk of module PACS is 201 and this attachment pk is 123 the path would be: 201/0/PACS5_123_diff.txt or if the issue count were higher: 201/2/PACS2115_123_diff.txt. The first two directories are used to keep the number of files per directory reasonable while the issue unique id and the final textual filename allow someone browsing the file system to be better able to pick out relevant files.



getRepositoryDirectory
public static String getRepositoryDirectory()(Code)
Get the repository path info as given in the configuration. if the path begins with a '/', it is assumed to be absolute. Otherwise the path is constructed relative to the webapp directory.



getSize
public long getSize() throws TorqueException, ScarabException(Code)
Get the attachment file size. It reads this information from the FileSystem (this information is not saved into the database) the number of bytes or -1 if there's some kind of problem
throws:
  TorqueException -



save
public void save(Connection dbCon) throws TorqueException(Code)
Calls super.save(Connection) and also checks for a FileItem. if one exists the file is moved to its final location.
Parameters:
  dbCon - a DBConnection value
exception:
  TorqueException - if an error occurs



setConfiguration
protected static void setConfiguration(Configuration configuration)(Code)



setFile
public void setFile(FileItem v)(Code)
Set the value of file.
Parameters:
  v - Value to assign to file.



setFileName
public void setFileName(String name)(Code)
Makes sure to only save the simple filename which is the part following the last path separator. This is appended as the last part of the the path returned by getRelativePath() following the It would generally be set to original filename as given on the client that uploaded the file. Spaces are replaced by underscores.



setTextFields
public void setTextFields(ScarabUser user, Issue issue, Integer typeId) throws TorqueException(Code)
Populates fields for a text (non-file) type of attachment.



Fields inherited from org.tigris.scarab.om.BaseAttachment
protected List collActivitySets(Code)(Java Doc)
protected List collActivitys(Code)(Java Doc)

Methods inherited from org.tigris.scarab.om.BaseAttachment
public void addActivity(Activity l) throws TorqueException(Code)(Java Doc)
public void addActivitySet(ActivitySet l) throws TorqueException(Code)(Java Doc)
public Attachment copy() throws TorqueException(Code)(Java Doc)
protected Attachment copyInto(Attachment copyObj) throws TorqueException(Code)(Java Doc)
public List getActivitySets() throws TorqueException(Code)(Java Doc)
public List getActivitySets(Criteria criteria) throws TorqueException(Code)(Java Doc)
public List getActivitySets(Connection con) throws TorqueException(Code)(Java Doc)
public List getActivitySets(Criteria criteria, Connection con) throws TorqueException(Code)(Java Doc)
protected List getActivitySetsJoinActivitySetType(Criteria criteria) throws TorqueException(Code)(Java Doc)
protected List getActivitySetsJoinAttachment(Criteria criteria) throws TorqueException(Code)(Java Doc)
protected List getActivitySetsJoinScarabUserImpl(Criteria criteria) throws TorqueException(Code)(Java Doc)
public List getActivitys() throws TorqueException(Code)(Java Doc)
public List getActivitys(Criteria criteria) throws TorqueException(Code)(Java Doc)
public List getActivitys(Connection con) throws TorqueException(Code)(Java Doc)
public List getActivitys(Criteria criteria, Connection con) throws TorqueException(Code)(Java Doc)
protected List getActivitysJoinActivitySet(Criteria criteria) throws TorqueException(Code)(Java Doc)
protected List getActivitysJoinAttachment(Criteria criteria) throws TorqueException(Code)(Java Doc)
protected List getActivitysJoinAttribute(Criteria criteria) throws TorqueException(Code)(Java Doc)
protected List getActivitysJoinAttributeOptionRelatedByNewOptionId(Criteria criteria) throws TorqueException(Code)(Java Doc)
protected List getActivitysJoinAttributeOptionRelatedByOldOptionId(Criteria criteria) throws TorqueException(Code)(Java Doc)
protected List getActivitysJoinDepend(Criteria criteria) throws TorqueException(Code)(Java Doc)
protected List getActivitysJoinIssue(Criteria criteria) throws TorqueException(Code)(Java Doc)
protected List getActivitysJoinScarabUserImplRelatedByNewUserId(Criteria criteria) throws TorqueException(Code)(Java Doc)
protected List getActivitysJoinScarabUserImplRelatedByOldUserId(Criteria criteria) throws TorqueException(Code)(Java Doc)
public Long getAttachmentId()(Code)(Java Doc)
public AttachmentType getAttachmentType() throws TorqueException(Code)(Java Doc)
public AttachmentType getAttachmentType(Connection connection) throws TorqueException(Code)(Java Doc)
public Object getByName(String name)(Code)(Java Doc)
public Object getByPeerName(String name)(Code)(Java Doc)
public Object getByPosition(int pos)(Code)(Java Doc)
public Integer getCreatedBy()(Code)(Java Doc)
public Date getCreatedDate()(Code)(Java Doc)
public String getData()(Code)(Java Doc)
public boolean getDeleted()(Code)(Java Doc)
public static synchronized List getFieldNames()(Code)(Java Doc)
public String getFileName()(Code)(Java Doc)
public Issue getIssue() throws TorqueException(Code)(Java Doc)
public Issue getIssue(Connection connection) throws TorqueException(Code)(Java Doc)
public Long getIssueId()(Code)(Java Doc)
public String getMimeType()(Code)(Java Doc)
public Integer getModifiedBy()(Code)(Java Doc)
public Date getModifiedDate()(Code)(Java Doc)
public String getName()(Code)(Java Doc)
public AttachmentPeer getPeer()(Code)(Java Doc)
public ObjectKey getPrimaryKey()(Code)(Java Doc)
public String getQueryKey()(Code)(Java Doc)
public ScarabUser getScarabUserRelatedByCreatedBy() throws TorqueException(Code)(Java Doc)
public ScarabUser getScarabUserRelatedByCreatedBy(Connection connection) throws TorqueException(Code)(Java Doc)
public ScarabUser getScarabUserRelatedByModifiedBy() throws TorqueException(Code)(Java Doc)
public ScarabUser getScarabUserRelatedByModifiedBy(Connection connection) throws TorqueException(Code)(Java Doc)
public Integer getTypeId()(Code)(Java Doc)
protected void initActivitySets()(Code)(Java Doc)
protected void initActivitys()(Code)(Java Doc)
protected boolean isCacheOnSave()(Code)(Java Doc)
public void save() throws TorqueException(Code)(Java Doc)
public void save(String dbName) throws TorqueException(Code)(Java Doc)
public void save(Connection con) throws TorqueException(Code)(Java Doc)
public void setAttachmentId(Long v) throws TorqueException(Code)(Java Doc)
public void setAttachmentType(AttachmentType v) throws TorqueException(Code)(Java Doc)
public void setAttachmentTypeKey(ObjectKey key) throws TorqueException(Code)(Java Doc)
public void setCreatedBy(Integer v) throws TorqueException(Code)(Java Doc)
public void setCreatedDate(Date v)(Code)(Java Doc)
public void setData(String v)(Code)(Java Doc)
public void setDeleted(boolean v)(Code)(Java Doc)
public void setFileName(String v)(Code)(Java Doc)
public void setIssue(Issue v) throws TorqueException(Code)(Java Doc)
public void setIssueId(Long v) throws TorqueException(Code)(Java Doc)
public void setIssueKey(ObjectKey key) throws TorqueException(Code)(Java Doc)
public void setMimeType(String v)(Code)(Java Doc)
public void setModifiedBy(Integer v) throws TorqueException(Code)(Java Doc)
public void setModifiedDate(Date v)(Code)(Java Doc)
public void setName(String v)(Code)(Java Doc)
public void setPrimaryKey(ObjectKey key) throws TorqueException(Code)(Java Doc)
public void setPrimaryKey(String key) throws TorqueException(Code)(Java Doc)
public void setQueryKey(String key) throws TorqueException(Code)(Java Doc)
public void setScarabUserRelatedByCreatedBy(ScarabUser v) throws TorqueException(Code)(Java Doc)
public void setScarabUserRelatedByCreatedByKey(ObjectKey key) throws TorqueException(Code)(Java Doc)
public void setScarabUserRelatedByModifiedBy(ScarabUser v) throws TorqueException(Code)(Java Doc)
public void setScarabUserRelatedByModifiedByKey(ObjectKey key) throws TorqueException(Code)(Java Doc)
public void setTypeId(Integer v) throws TorqueException(Code)(Java Doc)
public String toString()(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.