Skip to content

Commit

Permalink
KAA-1146: Adding CTL in Admin UI for EventClass.
Browse files Browse the repository at this point in the history
  • Loading branch information
vchizhevsky committed Jul 26, 2016
1 parent 71e6f1d commit e072eed
Show file tree
Hide file tree
Showing 22 changed files with 750 additions and 231 deletions.
Expand Up @@ -108,4 +108,11 @@ public interface EventClassService {
*/
EventClassDto findEventClassByTenantIdAndFQNAndVersion(String tenantId, String fqn, int version);

/**
* Remove Event Class by id.
*
* @param eventClassId the tenant id
*/
void removeEventClassById(String eventClassId);

}
Expand Up @@ -48,9 +48,9 @@ public interface EventClassDao<T> extends SqlDao<T> {
/**
* Remove all Event Classes by Event Class Family id.
*
* @param tenantId the tenant id
* @param ecfId the tenant id
*/
void removeByEcfId(String tenantId);
void deleteEventClassById(String ecfId);

/**
* Find Event Class by Tenant id and FQN.
Expand Down
Expand Up @@ -90,7 +90,7 @@ public List<EventClass> findByEcfIdVersionAndType(String ecfId, int version, Eve
}

@Override
public void removeByEcfId(String ecfId) {
public void deleteEventClassById(String ecfId) {
if (isNotBlank(ecfId)) {
List<EventClass> eventClasses = findListByCriterionWithAlias(ECF_PROPERTY, ECF_ALIAS,
Restrictions.eq(ECF_REFERENCE, Long.valueOf(ecfId)));
Expand Down
Expand Up @@ -226,7 +226,13 @@ public EventClassDto findEventClassByTenantIdAndFQNAndVersion(String tenantId, S
} else {
throw new IncorrectParameterException("Incorrect tenant id: " + tenantId);
}
}

@Override
public void removeEventClassById(String eventClassId) {
Validator.validateId(eventClassId, "Unable to remove Event Class. Invalid Event Class ID: " + eventClassId);
eventClassDao.removeById(eventClassId);
LOG.debug("Removed Event Class [{}]", eventClassId);
}


Expand Down
Expand Up @@ -27,6 +27,7 @@
import org.kaaproject.kaa.common.dto.admin.TenantUserDto;
import org.kaaproject.kaa.common.dto.admin.UserDto;
import org.kaaproject.kaa.common.dto.event.ApplicationEventFamilyMapDto;
import org.kaaproject.kaa.common.dto.event.EventClassDto;
import org.kaaproject.kaa.common.dto.event.EventClassFamilyDto;
import org.kaaproject.kaa.common.dto.logs.LogAppenderDto;
import org.kaaproject.kaa.common.dto.logs.LogSchemaDto;
Expand Down Expand Up @@ -62,6 +63,7 @@
import com.google.gwt.place.shared.Place;
import com.google.gwt.place.shared.PlaceController;
import com.google.web.bindery.event.shared.EventBus;
import org.kaaproject.kaa.server.common.dao.model.sql.EventClass;

public interface ClientFactory {
EventBus getEventBus();
Expand Down Expand Up @@ -135,8 +137,14 @@ public interface ClientFactory {
EcfView getEcfView();
EcfView getCreateEcfView();

EcfSchemaView getEcfSchemaView();
EcfSchemaView getCreateEcfSchemaView();
BaseCtlSchemaView getEventClassView();
BaseCtlSchemaView getCreateEventClassView();

// EcfSchemaView getEcfSchemaView();
// EcfSchemaView getCreateEcfSchemaView();

//BaseListView<EventClassDto> getEcfSchemaView();
BaseListView<EventClassDto> getCreateEcfSchemaView();

BaseListView<ApplicationEventFamilyMapDto> getAefMapsView();
AefMapView getAefMapView();
Expand Down
Expand Up @@ -28,6 +28,7 @@
import org.kaaproject.kaa.common.dto.admin.TenantUserDto;
import org.kaaproject.kaa.common.dto.admin.UserDto;
import org.kaaproject.kaa.common.dto.event.ApplicationEventFamilyMapDto;
import org.kaaproject.kaa.common.dto.event.EventClassDto;
import org.kaaproject.kaa.common.dto.event.EventClassFamilyDto;
import org.kaaproject.kaa.common.dto.logs.LogAppenderDto;
import org.kaaproject.kaa.common.dto.logs.LogSchemaDto;
Expand Down Expand Up @@ -82,6 +83,7 @@
import org.kaaproject.kaa.server.admin.client.mvp.view.event.EcfSchemaViewImpl;
import org.kaaproject.kaa.server.admin.client.mvp.view.event.EcfViewImpl;
import org.kaaproject.kaa.server.admin.client.mvp.view.event.EcfsViewImpl;
import org.kaaproject.kaa.server.admin.client.mvp.view.event.EventClassViewImpl;
import org.kaaproject.kaa.server.admin.client.mvp.view.header.HeaderViewImpl;
import org.kaaproject.kaa.server.admin.client.mvp.view.log.LogSchemaViewImpl;
import org.kaaproject.kaa.server.admin.client.mvp.view.log.LogSchemasViewImpl;
Expand Down Expand Up @@ -195,8 +197,11 @@ public class ClientFactoryImpl implements ClientFactory {
private final EcfView ecfView = new EcfViewImpl(false);
private final EcfView createEcfView = new EcfViewImpl(true);

private final EcfSchemaView ecfSchemaView = new EcfSchemaViewImpl(false);
private final EcfSchemaView createEcfSchemaView = new EcfSchemaViewImpl(true);
private final BaseCtlSchemaView eventClassView = new EventClassViewImpl(false);
private final BaseCtlSchemaView createEventClassView = new EventClassViewImpl(true);

//private final BaseListView<EventClassDto> ecfSchemaView = new EcfSchemaViewImpl(false);
private final BaseListView<EventClassDto> createEcfSchemaView = new EcfSchemaViewImpl(true);

private final BaseListView<ApplicationEventFamilyMapDto> aefMapsView = new AefMapsViewImpl();
private final AefMapView aefMapView = new AefMapViewImpl(false);
Expand Down Expand Up @@ -466,12 +471,17 @@ public EcfView getCreateEcfView() {
}

@Override
public EcfSchemaView getEcfSchemaView() {
return ecfSchemaView;
public BaseCtlSchemaView getEventClassView() {
return eventClassView;
}

@Override
public BaseCtlSchemaView getCreateEventClassView() {
return createEventClassView;
}

@Override
public EcfSchemaView getCreateEcfSchemaView() {
public BaseListView<EventClassDto> getCreateEcfSchemaView() {
return createEcfSchemaView;
}

Expand Down
Expand Up @@ -33,6 +33,7 @@
import org.kaaproject.kaa.server.admin.client.mvp.place.EndpointGroupsPlace;
import org.kaaproject.kaa.server.admin.client.mvp.place.EndpointProfilePlace;
import org.kaaproject.kaa.server.admin.client.mvp.place.EndpointProfilesPlace;
import org.kaaproject.kaa.server.admin.client.mvp.place.EventClassPlace;
import org.kaaproject.kaa.server.admin.client.mvp.place.GeneralPropertiesPlace;
import org.kaaproject.kaa.server.admin.client.mvp.place.AddSdkProfilePlace;
import org.kaaproject.kaa.server.admin.client.mvp.place.LogAppenderPlace;
Expand Down Expand Up @@ -111,7 +112,9 @@ public Activity getActivity(Place place) {
return new EcfActivity((EcfPlace) place, clientFactory);
} else if (clazz == EcfSchemaPlace.class) {
return new EcfSchemaActivity((EcfSchemaPlace) place, clientFactory);
} else if (clazz == ProfileSchemasPlace.class) {
} else if (clazz == EcfSchemaPlace.class) {
return new EventClassActivity((EventClassPlace) place, clientFactory);
}else if (clazz == ProfileSchemasPlace.class) {
return new ProfileSchemasActivity((ProfileSchemasPlace) place, clientFactory);
} else if (clazz == ServerProfileSchemasPlace.class) {
return new ServerProfileSchemasActivity((ServerProfileSchemasPlace) place, clientFactory);
Expand Down

0 comments on commit e072eed

Please sign in to comment.