Java Doc for Metadata.java in  » Issue-Tracking » jTrac » info » jtrac » domain » 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 » jTrac » info.jtrac.domain 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   info.jtrac.domain.Metadata

Metadata
public class Metadata implements Serializable(Code)
XML metadata is one of the interesting design decisions of JTrac. Metadata is defined for each space and so Items that belong to a space are customized by the space metadata. This class can marshall and unmarshall itself to XML and this XML is stored in the database in a single column. Because of this approach, Metadata can be made more and more complicated in the future without impact to the database schema. Things that the Metadata configures for a Space: 1) custom Fields for an Item (within a Space) - Label - whether mandatory or not [ DEPRECATED ] - the option values (drop down list options) - the option "key" values are stored in the database (WITHOUT any relationships) - the values corresponding to "key"s are resolved in memory from the Metadata and not through a database join. 2) the Roles available within a space - for each (from) State the (to) State transitions allowed for this role - and within each (from) State the fields that this Role can view / edit 3) the State labels corresponding to each state - internally States are integers, but for display we need a label - labels can be customized - special State values: 0 = New, 1 = Open, 99 = Closed 4) the order in which the fields are displayed on the data entry screens and the query result screens etc. There is one downside to this approach and that is there is a limit to the nunmbers of custom fields available. The existing limits are - Drop Down: 10 - Free Text: 5 - Numeric: 3 - Date/Time: 3 Metadata can be inherited, and this allows for "reuse" TODO



Constructor Summary
public  Metadata()
    

Method Summary
public  voidadd(Field field)
    
public  voidaddRole(String roleName)
    
public  voidaddState(String stateName)
    
public  Map<String, String>getAvailableFieldTypes()
    
public  StringgetCustomValue(Field.Name fieldName, Integer key)
    
public  StringgetCustomValue(Field.Name fieldName, String key)
    
public  StringgetDescription()
    
public  List<Field>getEditableFields(String roleKey, int status)
    
public  List<Field>getEditableFields(Collection<String> roleKeys, int status)
    
public  List<Field>getEditableFields()
    
public  FieldgetField(String fieldName)
    
public  intgetFieldCount()
    
public  List<Field>getFieldList()
    
public  List<Field.Name>getFieldOrder()
    
public  Map<Field.Name, Field>getFields()
    
public  longgetId()
    
public  StringgetName()
    
public  FieldgetNextAvailableField(int fieldType)
    
public  MetadatagetParent()
    
public  Map<Integer, String>getPermittedTransitions(List<String> roleKeys, int status)
    
public  StringgetPrettyXml()
    
public  intgetRoleCount()
    
public  Collection<Role>getRoleList()
    
public  Map<String, Role>getRoles()
    
public  Map<String, Boolean>getRolesAbleToTransition(int fromStatus, int toStatus)
    
public  Set<String>getRolesAbleToTransitionFrom(int state)
    
public  intgetStateCount()
    
public  Map<Integer, String>getStates()
    
public  StringgetStatusValue(Integer key)
    
public  IntegergetType()
    
public  Set<Field.Name>getUnusedFieldNames()
    
public  intgetVersion()
    
public  StringgetXmlString()
    
public  voidinitRoles()
    
public  voidremoveField(String fieldName)
    
public  voidremoveRole(String roleName)
    
public  voidremoveState(int stateId)
    
public  voidrenameRole(String oldRole, String newRole)
    
public  voidsetDescription(String description)
    
public  voidsetId(long id)
    
public  voidsetName(String name)
    
public  voidsetParent(Metadata parent)
    
public  voidsetType(Integer type)
    
public  voidsetVersion(int version)
    
public  voidsetXmlString(String xmlString)
    
public  voidswitchMask(int stateKey, String roleKey, String fieldName)
    
public  StringtoString()
    
public  voidtoggleTransition(String roleKey, int fromState, int toState)
    


Constructor Detail
Metadata
public Metadata()(Code)




Method Detail
add
public void add(Field field)(Code)



addRole
public void addRole(String roleName)(Code)



addState
public void addState(String stateName)(Code)



getAvailableFieldTypes
public Map<String, String> getAvailableFieldTypes()(Code)



getCustomValue
public String getCustomValue(Field.Name fieldName, Integer key)(Code)



getCustomValue
public String getCustomValue(Field.Name fieldName, String key)(Code)



getDescription
public String getDescription()(Code)



getEditableFields
public List<Field> getEditableFields(String roleKey, int status)(Code)



getEditableFields
public List<Field> getEditableFields(Collection<String> roleKeys, int status)(Code)



getEditableFields
public List<Field> getEditableFields()(Code)



getField
public Field getField(String fieldName)(Code)



getFieldCount
public int getFieldCount()(Code)



getFieldList
public List<Field> getFieldList()(Code)



getFieldOrder
public List<Field.Name> getFieldOrder()(Code)



getFields
public Map<Field.Name, Field> getFields()(Code)



getId
public long getId()(Code)



getName
public String getName()(Code)



getNextAvailableField
public Field getNextAvailableField(int fieldType)(Code)



getParent
public Metadata getParent()(Code)



getPermittedTransitions
public Map<Integer, String> getPermittedTransitions(List<String> roleKeys, int status)(Code)
logic for resolving the next possible transitions for a given role and state - lookup Role by roleKey - for this Role, lookup state by key (integer) - for the State, iterate over transitions, get the label for each and add to map The map returned is used to render the drop down list on screen, [ key = value ]



getPrettyXml
public String getPrettyXml()(Code)



getRoleCount
public int getRoleCount()(Code)



getRoleList
public Collection<Role> getRoleList()(Code)



getRoles
public Map<String, Role> getRoles()(Code)



getRolesAbleToTransition
public Map<String, Boolean> getRolesAbleToTransition(int fromStatus, int toStatus)(Code)



getRolesAbleToTransitionFrom
public Set<String> getRolesAbleToTransitionFrom(int state)(Code)



getStateCount
public int getStateCount()(Code)



getStates
public Map<Integer, String> getStates()(Code)



getStatusValue
public String getStatusValue(Integer key)(Code)



getType
public Integer getType()(Code)



getUnusedFieldNames
public Set<Field.Name> getUnusedFieldNames()(Code)



getVersion
public int getVersion()(Code)



getXmlString
public String getXmlString()(Code)



initRoles
public void initRoles()(Code)



removeField
public void removeField(String fieldName)(Code)



removeRole
public void removeRole(String roleName)(Code)



removeState
public void removeState(int stateId)(Code)



renameRole
public void renameRole(String oldRole, String newRole)(Code)



setDescription
public void setDescription(String description)(Code)



setId
public void setId(long id)(Code)



setName
public void setName(String name)(Code)



setParent
public void setParent(Metadata parent)(Code)



setType
public void setType(Integer type)(Code)



setVersion
public void setVersion(int version)(Code)



setXmlString
public void setXmlString(String xmlString)(Code)



switchMask
public void switchMask(int stateKey, String roleKey, String fieldName)(Code)



toString
public String toString()(Code)



toggleTransition
public void toggleTransition(String roleKey, int fromState, int toState)(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(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.