Search in sources :

Example 21 with GeoprismUser

use of net.geoprism.GeoprismUser in project geoprism-registry by terraframe.

the class CurationService method details.

@Request(RequestType.SESSION)
public JsonObject details(String sessionId, String historyId, boolean onlyUnresolved, int pageSize, int pageNumber) {
    final ListCurationHistory hist = ListCurationHistory.get(historyId);
    final ListTypeVersion version = hist.getVersion();
    final ListType listType = version.getListType();
    final ListCurationJob job = (ListCurationJob) hist.getAllJob().getAll().get(0);
    final GeoprismUser user = GeoprismUser.get(job.getRunAsUser().getOid());
    final ServerGeoObjectType serverGOT = listType.getGeoObjectType();
    final String orgCode = listType.getOrganization().getCode();
    this.checkPermissions(orgCode, serverGOT);
    JsonObject jo = this.serializeHistory(hist, user, job);
    jo.add("page", this.page(sessionId, historyId, onlyUnresolved, pageSize, pageNumber));
    return jo;
}
Also used : ServerGeoObjectType(net.geoprism.registry.model.ServerGeoObjectType) ListType(net.geoprism.registry.ListType) JsonObject(com.google.gson.JsonObject) GeoprismUser(net.geoprism.GeoprismUser) ListTypeVersion(net.geoprism.registry.ListTypeVersion) Request(com.runwaysdk.session.Request)

Example 22 with GeoprismUser

use of net.geoprism.GeoprismUser in project geoprism-registry by terraframe.

the class AccountServiceControllerTest method deleteUser.

public void deleteUser(String username) {
    GeoprismUserQuery query = new GeoprismUserQuery(new QueryFactory());
    query.WHERE(query.getUsername().EQ(username));
    OIterator<? extends GeoprismUser> it = query.getIterator();
    try {
        if (it.hasNext()) {
            GeoprismUser user = it.next();
            UserInfo info = UserInfo.getByUser(user);
            if (info != null) {
                info.delete();
            }
            user.delete();
        }
    } finally {
        it.close();
    }
}
Also used : QueryFactory(com.runwaysdk.query.QueryFactory) GeoprismUserQuery(net.geoprism.GeoprismUserQuery) GeoprismUser(net.geoprism.GeoprismUser) UserInfo(net.geoprism.registry.UserInfo)

Aggregations

GeoprismUser (net.geoprism.GeoprismUser)22 Transaction (com.runwaysdk.dataaccess.transaction.Transaction)9 JsonObject (com.google.gson.JsonObject)8 Request (com.runwaysdk.session.Request)8 QueryFactory (com.runwaysdk.query.QueryFactory)7 ServerGeoObjectType (net.geoprism.registry.model.ServerGeoObjectType)6 ProgrammingErrorException (com.runwaysdk.dataaccess.ProgrammingErrorException)5 JobHistory (com.runwaysdk.system.scheduler.JobHistory)5 SimpleDateFormat (java.text.SimpleDateFormat)5 LinkedList (java.util.LinkedList)5 DataExportJob (net.geoprism.registry.etl.export.DataExportJob)5 ExportHistory (net.geoprism.registry.etl.export.ExportHistory)5 RoleDAOIF (com.runwaysdk.business.rbac.RoleDAOIF)4 SingleActorDAOIF (com.runwaysdk.business.rbac.SingleActorDAOIF)3 ArrayList (java.util.ArrayList)3 RegistryRole (org.commongeoregistry.adapter.metadata.RegistryRole)3 JsonArray (com.google.gson.JsonArray)2 JsonParser (com.google.gson.JsonParser)2 JsonSyntaxException (com.google.gson.JsonSyntaxException)2 MultipartFileParameter (com.runwaysdk.controller.MultipartFileParameter)2