Skip to content

Commit

Permalink
added SolutionsModule
Browse files Browse the repository at this point in the history
  • Loading branch information
krishperumal committed Feb 28, 2013
1 parent 0f1145a commit 3ff2a8e
Show file tree
Hide file tree
Showing 9 changed files with 172 additions and 0 deletions.
Binary file not shown.
Binary file not shown.
Binary file added SolutionsModule/bin/com/solutions/Person.class
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions SolutionsModule/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
javac -d bin -sourcepath src -cp lib/saplo4java-3.0.0.jar src/com/solutions/*.java
Binary file added SolutionsModule/lib/saplo4java-3.0.0.jar
Binary file not shown.
64 changes: 64 additions & 0 deletions SolutionsModule/src/com/solutions/Department.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
package com.solutions;

class Department
{
String dept_name, Address, RTI_Info, location;
long departmentid;
public enum department {CENTRAL, STATE, NGO};
department dept_type;
public void setDeptName(String names)
{
this.dept_name = names;
}
public void setDepartmentId(long deptid)
{
this.departmentid = deptid;
}
public void setAddress(String addr)
{
this.Address = addr;
}
public void setLocation(String loc)
{
this.location = loc;
}
public void setRTIInfo(String rti)
{
this.RTI_Info = rti;
}
public void setDepartmentType(department dept)
{
this.dept_type = dept;
}
public String getDeptName()
{
return dept_name;
}
public long getDepartmentId()
{
return departmentid;
}
public String getAddress()
{
return Address;
}
public String getLocation()
{
return location;
}
public String getRTIInfo()
{
return RTI_Info;
}
public department getDepartmentType()
{
return dept_type;
}

public static void main(String[] args)
{
Department D = new Department();
D.setDeptName("electrical");
System.out.println(D.getDeptName());
}
}
60 changes: 60 additions & 0 deletions SolutionsModule/src/com/solutions/Person.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package com.solutions;

class Person
{
String name,designation,emailid,phone;
long departmentid;
public void setName(String names)
{
this.name = names;
}
public void setDesignation(String desig)
{
this.designation = desig;
}
public void setPhone(String phonenum)
{
this.phone = phonenum;
}
public void setEmail(String email)
{
this.emailid = email;
}
public void setDepartmentId(long deptid)
{
this.departmentid = deptid;
}
public String getName()
{
return name;
}
public String getDesignation()
{
return designation;
}
public String getPhone()
{
return phone;
}
public String getEmail()
{
return emailid;
}
public long getDepartmentId()
{
return departmentid;
}


public static void main(String[] args)
{
// Person p = new Person("aditya","eng",12121,"0800181","[email protected]");
Person p = new Person();
p.setName("aditya");
p.setDesignation("eng");
p.setDepartmentId(12121);
p.setEmail("[email protected]");
p.setPhone("132131");
System.out.println(p.getEmail());
}
}
47 changes: 47 additions & 0 deletions SolutionsModule/src/com/solutions/TestingWithSaploAPI.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package com.solutions;
import com.saplo.api.client.SaploClient;
import com.saplo.api.client.entity.SaploCollection;
import com.saplo.api.client.entity.SaploCollection.Language;
import com.saplo.api.client.entity.SaploTag;
import com.saplo.api.client.entity.SaploText;
import com.saplo.api.client.manager.SaploCollectionManager;
import com.saplo.api.client.manager.SaploTextManager;

public class TestingWithSaploAPI {
public static void main(String args[]) throws Exception
{
SaploClient client = new SaploClient("a69ef0eb267e3578963a465b2b871208", "e88b050934321f88acb257fda2e892e2");
// Your access_token is stored in the client.
// If you want to retrieve it, you can
String accessToken = client.getAccessToken();
System.out.println(accessToken);

// First you need to create a manager to work with collections
SaploCollectionManager collectionMgr = new SaploCollectionManager(client);

// Then create a collection object
SaploCollection collection = new SaploCollection("My Collection Name", Language.en);

// Save the created collection in the API using the manager
collectionMgr.create(collection);

// First create a manager to work with text
SaploTextManager textMgr = new SaploTextManager(client);

// Then create a text object in your collection
SaploText text = new SaploText(collection, "Some cool text about Apple - the company, goes here");
text.setHeadline("Some cool headline");
text.setAuthors("Me");

// Then save your text using the manager
textMgr.create(text);

// Get a list of tags that exist in your text
java.util.List<SaploTag> tags = textMgr.tags(text);

// Print them out
for(SaploTag tag: tags)
System.out.println("Category: " + tag.getCategory()
+ " TagWord: " + tag.getTagWord());
}
}

0 comments on commit 3ff2a8e

Please sign in to comment.