Thanks for your reply.
To return List<Option>, you mean from package
I have changed the code as follows.
Thanks Guys
To return List<Option>, you mean from package
Code: Select all
.import com.openkm.bean.form.Option;I have changed the code as follows.
Code: Select all
And Java class:
import com.openkm.bean.form.Option;
import java.util.List;
public interface OptionSelectValues {
public List<Option> getOptions();
}Code: Select all
See attachment of how I think the Forms.xml and PropertyGroup.xml should look like. Correct me if I am wrong.import com.openkm.api.OKMAuth;
import com.openkm.bean.form.Option;
import com.openkm.rest.util.UserList;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class ListClass implements OptionSelectValues {
@Override
public List<Option> getOptions() {
List<Option> options = new ArrayList<Option>();
Option n = new Option();
try {
UserList users = new UserList();
List<String> userList = (List<String>) users.getList();
String token = OKMAuth.getInstance().login("okmAdmin", "admin");
List<String> usersL = OKMAuth.getInstance().getUsers(token);
String name = null;
int i=0;
for (Iterator<String> it = usersL.iterator(); it.hasNext(); i++) {
String usr = it.next();
name = OKMAuth.getInstance().getName(token, usr.toString());
n.setLabel(name);
n.setValue(usr.toString());
options.add(n);
}
} catch(Exception e){
System.out.println("Exceptin occured: " + e.getMessage());
}
return options;
}
}Thanks Guys
