Where can i get the api/jar files to connect to my team elements server?
Feedback (Suggestions, comments, etc.)
API
You need to be logged in to post messages
Not much documentation is available, and there are several easy loose-ends in most of the Class files. The jar files can be extracted from the .war or they can be generated from source. A trimmed down set is planned but not yet built, I think there's 30k needed to make this work.
XML is posted to the service URL...
1. If using Java, put the following libraries in your classpath... (a trimmed down set is planned but not yet built)
zeroio-iteam.jar
aspcfs.jar
servlet-api.jar
bsh-2.0b2.jar (optional -- used if you are writing Java bean shell scripts and executing from the command-line; see sendAPITransaction.bshl)
2. Populate the following tables:
[sync_system]
Named system, like "Team Elements API"
[sync_table]
A mapping of xml transaction item names to Team Elements Classes; project = com.zeroio.iteam.base.Project and object_key = id for referencing
[sync_client]
Contains a clientId and a plain-text code that will be used for authentication
3. Post XML data to the service URL:
http://127.0.0.1/Service.do or
https://127.0.0.1/Service.do
4. Parse the response
Example Code:
import org.aspcfs.utils.HTTPUtils;
import org.aspcfs.utils.StringUtils;
import org.aspcfs.utils.XMLUtils;
import org.aspcfs.modules.service.base.RecordList;
import org.aspcfs.modules.service.base.Record;
String xmlFile = "/home/service/test.xml";
String url = "http://127.0.0.1/Service.do";
String response = HTTPUtils.sendPacket(url, StringUtils.loadText(filename));
XMLUtils xml = new XMLUtils(response);
RecordList recordList = new RecordList(xml.getFirstElement("recordSet"));
//System.err.println("Records: " + recordList.size());
//System.out.println(response);
Iterator records = recordList.iterator();
while (records.hasNext())
Record record = (Record) records.next();
String username = (String) record.get("username");
String password = (String) record.get("password");
// do something
}
Example XML:
<!-- SELECT action, meta data describes properties to be returned -->
<!-- Note: projectList does not have String setters for properties, so it fails to set the filters... this could be updated in the API or in the List classes -->
<app>
<authentication>
<id>team_elements</id>
<clientId>1</clientId>
plaintext-code-goes-here
<systemId>1</systemId>
</authentication>
<transaction id="1">
<meta>
<property>title</property>
</meta>
<projectList action="select">
<projectsForUser>1</projectsForUser>
<openProjectsOnly>true</openProjectsOnly>
</projectList>
</transaction>
</app>
Example SQL for sync tables:
INSERT INTO sync_table (system_id, element_name, mapped_class_name, object_key) VALUES (1, 'project', 'com.zeroio.iteam.base.Project', 'id');
INSERT INTO sync_table (system_id, element_name, mapped_class_name) VALUES (1, 'projectList', 'com.zeroio.iteam.base.ProjectList');
INSERT INTO sync_table (system_id, element_name, mapped_class_name) VALUES (1, 'teamMember', 'com.zeroio.iteam.base.TeamMember');
General Rules:
- Not a whole lot of testing has been done (only the select has been tested), there are many loose-ends
- Transaction item objects can have the following actions: select, insert, update, delete
- When using select, the meta data supplied determines the field names and data returned; the body of the select is used to filter the List class; these classes end in "List"
- The List class must have String setters for each filter type
- The List class must have a select(db) method
- The update action needs one development enhancement to be useful: the object should be loaded first, then updated by the API so that existing fields are preserved (should be an easy change); this also provides feedback if the object doesn't exist
- The insert action can return a value back and if shareKey is set, and $C is used, then the key from the named record can be used in a transaction (see example -- the file sendAPITransaction.bsh was checked in)
- All of the classes and properties need to be added to SQL and documented; the classes could be used directly and transformed which would be even better
By simon s
Hi MAtt, thanks for your quick response.
I tried it but i fails. This is my response:
<?xml version="1.0" encoding="UTF-8"?><team_elements><response id="1"><status>1</status><errorText>Transaction failed
com.zeroio.iteam.base.ProjectList.select(java.sql.Connection)</errorText></response></team_elements>
Simon,
Thanks for pushing this along...
I'm on a lunch break, but wanted to get something working so a change was just committed to "TransactionItem" so that the "select" action calls the "buildList" method of the List classes instead of the select method.
This allows the "select" action to work with almost all of the classes... Now an adjustment needs to be made so that boolean and integer "setter" methods work through the API instead of just String setters.
Here's the list that should work if there is an entry in the sync_table:
com.zeroio.controller (2 usages)
UserList.java (1 usage)
UserLogList.java (1 usage)
com.zeroio.controller.base (6 usages)
AttachmentList.java (1 usage)
HTPasswdList.java (1 usage)
OptionList.java (1 usage)
OptionPriceList.java (1 usage)
OptionValueList.java (1 usage)
ProductList.java (1 usage)
com.zeroio.iteam.base (28 usages)
AssignedUserList.java (1 usage)
AssignmentFolderList.java (1 usage)
AssignmentList.java (1 usage)
AssignmentNoteList.java (1 usage)
AssignmentRoleList.java (1 usage)
ContactList.java (1 usage)
DailyTimesheetList.java (1 usage)
FileDownloadLogList.java (1 usage)
FileFolderList.java (1 usage)
FileItemList.java (1 usage)
FileItemVersionList.java (1 usage)
IssueCategoryList.java (1 usage)
IssueContactList.java (1 usage)
IssueList.java (1 usage)
IssueReplyList.java (1 usage)
NewsArticleCategoryList.java (1 usage)
NewsArticleList.java (1 usage)
PermissionCategoryLookupList.java (1 usage)
PermissionList.java (1 usage)
PermissionLookupList.java (1 usage)
ProjectCategoryList.java (1 usage)
ProjectList.java (1 usage)
RequirementList.java (1 usage)
RequirementMapList.java (1 usage)
TeamMemberList.java (1 usage)
WikiCommentList.java (1 usage)
WikiList.java (1 usage)
WikiVersionList.java (1 usage)
org.aspcfs.modules.tasks.base
TaskList.java
org.aspcfs.modules.troubletickets.base
TicketList.java
TicketLogList.java
org.aspcfs.modules.reports.base
ReportList.java
ReportQueueList.java
ParameterList.java
CriteriaList.java
Next steps:
1) Enable boolean and int setters in the TransactionItem class
2) Get the TransactionItem populateObject method to set values on a loaded class for the update action
3) Interact with the application cache and rules engine
By simon s
Hi Matt, i dont get the current status of the api.
Is it ready to use or do i have to wait to some changes?
Just want to know...
Beside of that you made a fine piece of software.
Simon, a new minor release will need to be made and posted... maybe I can do this in the next few days. This will turn on the API feature correctly.
For reference and curiosity, how do you think you or others will use the API? What types of system integration do you see?
By simon s
I was thinking about building a small Eclipse Plugin. Something like a Dashboard that a developer can use to see Tasks or Tickets inside in eclipse.
Sounds great! A 3.2.1 release is going to be made to extend the API for your use, and to patch a few issues. Should be any day now.
A 3.3 beta release is now available with the "SELECT" improvements for the API. Once the class is added to the sync table you can get a list of the items. The filters still need to be added so that you are not getting back a complete list, that will go in soon.