Skip to content

Commit

Permalink
Merge branch 'feature/KAA-1279' of github.com:Acarus/kaa into working
Browse files Browse the repository at this point in the history
  • Loading branch information
Acarus committed Sep 30, 2016
2 parents a1a522d + 320d734 commit 79a10d7
Show file tree
Hide file tree
Showing 50 changed files with 487 additions and 401 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ public void onSuccess(Void result) {
private void login(final String userName, String password) {
String postData = preparePostData("j_username=" + userName, "j_password=" + password);

RequestBuilder builder = new RequestBuilder(RequestBuilder.POST, GWT.getModuleBaseURL() + "j_spring_security_check?" + postData);
RequestBuilder builder = new RequestBuilder(RequestBuilder.POST,
GWT.getModuleBaseURL() + "j_spring_security_check?" + postData);
try {
builder.sendRequest(null, new RequestCallback() {
public void onError(Request request, Throwable exception) {
Expand Down Expand Up @@ -210,8 +211,8 @@ public void onCancel() {
}
}
});
} catch (RequestException e) {
Utils.handleException(e, view);
} catch (RequestException ex) {
Utils.handleException(ex, view);
}
}

Expand Down Expand Up @@ -308,15 +309,16 @@ public void onKeyDown(KeyDownEvent event) {
class ForgotPasswordHandler implements ClickHandler {
@Override
public void onClick(ClickEvent event) {
ResetPasswordDialog resetPasswordDialog = new ResetPasswordDialog(new ResetPasswordDialog.Listener() {
@Override
public void onSendResetPasswordLink() {
}
ResetPasswordDialog resetPasswordDialog = new ResetPasswordDialog(
new ResetPasswordDialog.Listener() {
@Override
public void onSendResetPasswordLink() {
}

@Override
public void onCancel() {
}
});
@Override
public void onCancel() {
}
});

resetPasswordDialog.show();
resetPasswordDialog.center();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ public abstract class AbstractBaseCtlSchemaActivity<S extends BaseSchemaDto,
extends AbstractDetailsActivity<T, V, P>
implements ErrorMessageCustomizer, FormDataLoader {

private static final ErrorMessageCustomizer schemaErrorMessageCustomizer = new SchemaErrorMessageCustomizer();
private static final ErrorMessageCustomizer schemaErrorMessageCustomizer =
new SchemaErrorMessageCustomizer();

public AbstractBaseCtlSchemaActivity(P place,
ClientFactory clientFactory) {
public AbstractBaseCtlSchemaActivity(P place, ClientFactory clientFactory) {
super(place, clientFactory);
}

Expand All @@ -51,7 +51,8 @@ protected P existingSchemaPlace(String applicationId, String schemaId) {
return null;
}

protected P existingSchemaPlaceForEvent(String ecfId, String ecfVersionId, int ecfVersion, String schemaId) {
protected P existingSchemaPlaceForEvent(String ecfId, String ecfVersionId, int ecfVersion,
String schemaId) {
return null;
}

Expand All @@ -74,7 +75,8 @@ protected void bindDetailsView(boolean fireChanged) {
detailsView.getName().setValue(schema.getName());
detailsView.getDescription().setValue(schema.getDescription());
detailsView.getCreatedUsername().setValue(schema.getCreatedUsername());
detailsView.getCreatedDateTime().setValue(Utils.millisecondsToDateTimeString(schema.getCreatedTime()));
detailsView.getCreatedDateTime()
.setValue(Utils.millisecondsToDateTimeString(schema.getCreatedTime()));
if (entity.getCtlSchemaForm() != null) {
detailsView.getSchemaForm().setValue(entity.getCtlSchemaForm().getSchema(), fireChanged);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ protected void onEntityRetrieved() {
registrations.add(detailsView.getNewCtlButton().addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
CtlSchemaPlace newCtlPlace = new CtlSchemaPlace("", null, CTLSchemaScopeDto.APPLICATION, place.getApplicationId(), true, true);
CtlSchemaPlace newCtlPlace = new CtlSchemaPlace("", null, CTLSchemaScopeDto.APPLICATION,
place.getApplicationId(), true, true);
newCtlPlace.setSchemaType(getPlaceSchemaType());
newCtlPlace.setPreviousPlace(place);
canceled = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ public abstract class AbstractBaseCtlSchemaActivityEvent<S extends BaseSchemaDto
protected String ecfVersionId;
protected int ecfVersion;

public AbstractBaseCtlSchemaActivityEvent(P place,
ClientFactory clientFactory) {
public AbstractBaseCtlSchemaActivityEvent(P place, ClientFactory clientFactory) {
super(place, clientFactory);
}

Expand All @@ -70,7 +69,8 @@ protected void onEntityRetrieved() {
public void onClick(ClickEvent event) {
CtlSchemaPlace newCtlPlace = null;

newCtlPlace = new CtlSchemaPlace("", null, CTLSchemaScopeDto.TENANT, place.getEcfId(), place.getEcfVersionId(), place.getEcfVersion(), true, true);
newCtlPlace = new CtlSchemaPlace("", null, CTLSchemaScopeDto.TENANT, place.getEcfId(),
place.getEcfVersionId(), place.getEcfVersion(), true, true);
newCtlPlace.setSchemaType(getPlaceSchemaType());
newCtlPlace.setPreviousPlace(place);
canceled = true;
Expand All @@ -79,18 +79,19 @@ public void onClick(ClickEvent event) {
}
}));

KaaAdmin.getDataSource().getTenantLevelCtlSchemaReferenceForEcf(place.getEcfId(), place.getEventClassDtoList(), new BusyAsyncCallback<List<CtlSchemaReferenceDto>>() {
@Override
public void onFailureImpl(Throwable caught) {
Utils.handleException(caught, detailsView);
}
KaaAdmin.getDataSource().getTenantLevelCtlSchemaReferenceForEcf(place.getEcfId(),
place.getEventClassDtoList(), new BusyAsyncCallback<List<CtlSchemaReferenceDto>>() {
@Override
public void onFailureImpl(Throwable caught) {
Utils.handleException(caught, detailsView);
}

@Override
public void onSuccessImpl(List<CtlSchemaReferenceDto> result) {
detailsView.getCtlSchemaReference().setAcceptableValues(result);
bindDetailsView(true);
}
});
@Override
public void onSuccessImpl(List<CtlSchemaReferenceDto> result) {
detailsView.getCtlSchemaReference().setAcceptableValues(result);
bindDetailsView(true);
}
});
detailsView.getSchemaForm().setFormDataLoader(this);
} else {
bindDetailsView(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
import org.kaaproject.kaa.server.admin.client.servlet.ServletHelper;
import org.kaaproject.kaa.server.admin.client.util.Utils;

public abstract class AbstractBaseCtlSchemasActivity<T extends BaseSchemaDto, P extends TreePlace> extends AbstractListActivity<T, P> {
public abstract class AbstractBaseCtlSchemasActivity<T extends BaseSchemaDto, P extends TreePlace>
extends AbstractListActivity<T, P> {

public AbstractBaseCtlSchemasActivity(P place, Class<T> dataClass,
ClientFactory clientFactory) {
Expand Down Expand Up @@ -56,6 +57,9 @@ protected void onCustomRowAction(RowActionEvent<String> event) {
case KaaRowAction.CTL_EXPORT_LIBRARY:
exportSchema(schemaId, CTLSchemaExportMethod.LIBRARY);
break;
default:
exportSchema(schemaId, CTLSchemaExportMethod.SHALLOW); // shallow is default export
break;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
import java.util.ArrayList;
import java.util.List;

public abstract class AbstractDetailsActivity<T, V extends BaseDetailsView, P extends TreePlace> extends AbstractActivity implements BaseDetailsView.Presenter {
public abstract class AbstractDetailsActivity<T, V extends BaseDetailsView, P extends TreePlace>
extends AbstractActivity
implements BaseDetailsView.Presenter {

protected final ClientFactory clientFactory;
protected final String entityId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@

import java.util.List;

public abstract class AbstractPluginActivity<T extends PluginDto, V extends BasePluginView, P extends AbstractPluginPlace> extends AbstractDetailsActivity<T, V, P> {
public abstract class AbstractPluginActivity
<T extends PluginDto, V extends BasePluginView, P extends AbstractPluginPlace>
extends AbstractDetailsActivity<T, V, P> {

protected String applicationId;

Expand Down Expand Up @@ -69,10 +71,15 @@ public void onFailureImpl(Throwable caught) {
detailsView.getName().setValue(entity.getName());
detailsView.getDescription().setValue(entity.getDescription());
detailsView.getCreatedUsername().setValue(entity.getCreatedUsername());
detailsView.getCreatedDateTime().setValue(Utils.millisecondsToDateTimeString(entity.getCreatedTime()));
detailsView
.getCreatedDateTime()
.setValue(Utils.millisecondsToDateTimeString(entity.getCreatedTime()));
detailsView.getConfiguration().setValue(entity.getFieldConfiguration());
PluginInfoDto appenderInfo =
new PluginInfoDto(entity.getPluginTypeName(), entity.getFieldConfiguration(), entity.getPluginClassName());
new PluginInfoDto(entity.getPluginTypeName(),
entity.getFieldConfiguration(),
entity.getPluginClassName()
);
detailsView.getPluginInfo().setValue(appenderInfo);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@
import java.util.List;

public class AefMapActivity
extends
AbstractDetailsActivity<ApplicationEventFamilyMapDto, AefMapView, AefMapPlace> {
extends AbstractDetailsActivity<ApplicationEventFamilyMapDto, AefMapView, AefMapPlace> {

private EventMapDataProvider eventMapDataProvider;

Expand All @@ -57,14 +56,15 @@ public void start(AcceptsOneWidget containerWidget, EventBus eventBus) {
protected void bind(final EventBus eventBus) {
super.bind(eventBus);
if (create) {
registrations.add(detailsView.getEcf().addValueChangeHandler(new ValueChangeHandler<EcfInfoDto>() {
@Override
public void onValueChange(ValueChangeEvent<EcfInfoDto> event) {
EcfInfoDto ecf = detailsView.getEcf().getValue();
eventMapDataProvider.setEcf(ecf);
eventMapDataProvider.reload();
}
}));
registrations.add(detailsView.getEcf().addValueChangeHandler(
new ValueChangeHandler<EcfInfoDto>() {
@Override
public void onValueChange(ValueChangeEvent<EcfInfoDto> event) {
EcfInfoDto ecf = detailsView.getEcf().getValue();
eventMapDataProvider.setEcf(ecf);
eventMapDataProvider.reload();
}
}));
}
}

Expand Down Expand Up @@ -92,20 +92,22 @@ protected ApplicationEventFamilyMapDto newEntity() {
@Override
protected void onEntityRetrieved() {
if (create) {
KaaAdmin.getDataSource().getVacantEventClassFamilies(place.getApplicationId(), new BusyAsyncCallback<List<EcfInfoDto>>() {
@Override
public void onFailureImpl(Throwable caught) {
Utils.handleException(caught, detailsView);
}

@Override
public void onSuccessImpl(List<EcfInfoDto> result) {
detailsView.updateEcfs(result);
}
});
KaaAdmin.getDataSource().getVacantEventClassFamilies(place.getApplicationId(),
new BusyAsyncCallback<List<EcfInfoDto>>() {
@Override
public void onFailureImpl(Throwable caught) {
Utils.handleException(caught, detailsView);
}

@Override
public void onSuccessImpl(List<EcfInfoDto> result) {
detailsView.updateEcfs(result);
}
});
} else {
detailsView.getCreatedUsername().setValue(entity.getCreatedUsername());
detailsView.getCreatedDateTime().setValue(Utils.millisecondsToDateTimeString(entity.getCreatedTime()));
detailsView.getCreatedDateTime()
.setValue(Utils.millisecondsToDateTimeString(entity.getCreatedTime()));
detailsView.getEcfName().setValue(entity.getEcfName());
detailsView.getEcfVersion().setValue(entity.getVersion() + "");
eventMapDataProvider.setEventMaps(entity.getEventMaps());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
import org.kaaproject.kaa.server.admin.client.mvp.place.AefMapsPlace;
import org.kaaproject.kaa.server.admin.client.mvp.view.BaseListView;

public class AefMapsActivity extends AbstractListActivity<ApplicationEventFamilyMapDto, AefMapsPlace> {
public class AefMapsActivity
extends AbstractListActivity<ApplicationEventFamilyMapDto, AefMapsPlace> {

private String applicationId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
import java.util.List;

public class ApplicationActivity
extends
AbstractDetailsActivity<ApplicationDto, ApplicationView, ApplicationPlace> {
extends AbstractDetailsActivity<ApplicationDto, ApplicationView, ApplicationPlace> {

public ApplicationActivity(ApplicationPlace place,
ClientFactory clientFactory) {
Expand Down Expand Up @@ -92,7 +91,8 @@ public void onFailure(Throwable caught) {

@Override
public void onSuccess(List<String> result) {
ApplicationActivity.this.detailsView.getCredentialsServiceName().setAcceptableValues(result);
ApplicationActivity.this.detailsView.getCredentialsServiceName()
.setAcceptableValues(result);
}
});
serviceNames.setValue(this.entity.getCredentialsServiceName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,13 @@ protected void getRecord(String endpointGroupId,
protected void bind(final EventBus eventBus) {
super.bind(eventBus);
if (create) {
registrations.add(recordView.getSchema().addValueChangeHandler(new ValueChangeHandler<VersionDto>() {
@Override
public void onValueChange(ValueChangeEvent<VersionDto> event) {
schemaSelected(event.getValue());
}
}));
registrations.add(recordView.getSchema().addValueChangeHandler(
new ValueChangeHandler<VersionDto>() {
@Override
public void onValueChange(ValueChangeEvent<VersionDto> event) {
schemaSelected(event.getValue());
}
}));
}
}

Expand Down Expand Up @@ -124,7 +125,8 @@ public void onSuccessImpl(List<SchemaInfoDto> result) {
inactiveStruct.setSchemaId(record.getSchemaId());
inactiveStruct.setSchemaVersion(record.getSchemaVersion());
inactiveStruct.setDescription(record.getDescription());
inactiveStruct.setConfigurationRecord(record.getActiveStructureDto().getConfigurationRecord());
inactiveStruct.setConfigurationRecord(
record.getActiveStructureDto().getConfigurationRecord());
record.setInactiveStructureDto(inactiveStruct);
}
recordView.getRecordPanel().setData(record);
Expand Down Expand Up @@ -185,9 +187,12 @@ protected void deactivateStruct(String id,

@Override
protected ConfigurationPlace getRecordPlaceImpl(String applicationId,
String endpointGroupId, boolean create, boolean showActive,
String endpointGroupId,
boolean create,
boolean showActive,
double random) {
return new ConfigurationPlace(applicationId, schemaId, endpointGroupId, create, showActive, random);
return new ConfigurationPlace(applicationId, schemaId, endpointGroupId,
create, showActive, random);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
import org.kaaproject.kaa.server.admin.shared.schema.CtlSchemaFormDto;

public class ConfigurationSchemaActivity extends
AbstractBaseCtlSchemaActivityApplication<ConfigurationSchemaDto, ConfigurationSchemaViewDto, BaseCtlSchemaView, ConfigurationSchemaPlace> {
AbstractBaseCtlSchemaActivityApplication<ConfigurationSchemaDto, ConfigurationSchemaViewDto,
BaseCtlSchemaView, ConfigurationSchemaPlace> {

public ConfigurationSchemaActivity(ConfigurationSchemaPlace place,
ClientFactory clientFactory) {
public ConfigurationSchemaActivity(ConfigurationSchemaPlace place, ClientFactory clientFactory) {
super(place, clientFactory);
}

Expand All @@ -60,7 +60,8 @@ protected void getEntity(String id, AsyncCallback<ConfigurationSchemaViewDto> ca


@Override
protected void editEntity(ConfigurationSchemaViewDto entity, AsyncCallback<ConfigurationSchemaViewDto> callback) {
protected void editEntity(ConfigurationSchemaViewDto entity,
AsyncCallback<ConfigurationSchemaViewDto> callback) {
KaaAdmin.getDataSource().saveConfigurationSchemaView(entity, callback);
}

Expand Down

0 comments on commit 79a10d7

Please sign in to comment.