64,6 → 64,13 |
private ObjectFactory of; |
private List<TableData> tables = new ArrayList<TableData>(); |
|
/** |
* Instantiates a new SBM client. |
* Creates new instance of the aewebservices71 {@link net.brutex.sbm.wsclient.ObjectFactory} and |
* initializes web service endpoint from repository url. |
* |
* @param repository the repository |
*/ |
public SBMClient(TaskRepository repository) { |
this.repository = repository; |
this.of = new ObjectFactory(); |
77,6 → 84,13 |
repository.getRepositoryUrl()); |
} |
|
/** |
* Can authenticate checks if this SBMClient instance has proper authentication details |
* set in its related repository. The check is done by invoking the GetUser web service. |
* |
* @return true, if successful |
* @throws CoreException the core exception |
*/ |
public boolean canAuthenticate() throws CoreException { |
try { |
port.getUser(getAuth(), repository.getCredentials(AuthenticationType.REPOSITORY).getUserName()); |
88,6 → 102,15 |
return true; |
} |
|
/** |
* Gets the SBM items from a table. The result size is limited to 500 and the sorting is done |
* by submit date descending. |
* |
* @param tablename the tablename |
* @param sql_where the sql_where |
* @return the tT items by table |
* @throws CoreException the core exception |
*/ |
public List<TTItem> getTTItemsByTable(String tablename, String sql_where) throws CoreException { |
List<TTItem> list = new ArrayList<TTItem>(); |
if(sql_where==null || sql_where.isEmpty()) sql_where = "TS_ID>0"; |
106,6 → 129,12 |
return list; |
} |
|
/** |
* Gets a SBM item specified by its internal identifier ([tableid:recordid]) |
* |
* @param itemid the itemid |
* @return the tT item |
*/ |
public TTItem getTTItem(String itemid) { |
TTItem item = of.createTTItem(); |
try { |
242,6 → 271,14 |
return "UNKNOWN"; |
} |
|
/** |
* Gets the field label. The SBM item is used to determine the table id of |
* the table where this field is in. |
* |
* @param ttitem the ttitem |
* @param fieldname the fieldname |
* @return the field label |
*/ |
public String getFieldLabel(TTItem ttitem, String fieldname) { |
refreshTables(); |
String itemid = ttitem.getGenericItem().getValue().getItemID().getValue(); |
279,6 → 316,12 |
return null; |
} |
|
/** |
* Gets the notes attached to a SBM item. |
* |
* @param ttitem the ttitem |
* @return the notes |
*/ |
public List<SBMNote> getNotes(TTItem ttitem) { |
List<SBMNote> notes = new ArrayList<SBMNote>(); |
Iterator<Note> iter = ttitem.getNoteList().iterator(); |