1 | |
package org.kuali.student.lum.lu.ui.course.client.views; |
2 | |
|
3 | |
import org.kuali.student.common.assembly.data.Metadata; |
4 | |
import org.kuali.student.common.ui.client.application.KSAsyncCallback; |
5 | |
import org.kuali.student.common.ui.client.mvc.Controller; |
6 | |
import org.kuali.student.common.ui.client.mvc.ViewComposite; |
7 | |
import org.kuali.student.common.ui.client.service.MetadataRpcService; |
8 | |
import org.kuali.student.common.ui.client.service.MetadataRpcServiceAsync; |
9 | |
import org.kuali.student.common.ui.client.widgets.field.layout.element.SpanPanel; |
10 | |
import org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService; |
11 | |
import org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcServiceAsync; |
12 | |
import org.kuali.student.lum.lu.ui.main.client.configuration.CurriculumHomeConfigurer; |
13 | |
|
14 | |
import com.google.gwt.core.client.GWT; |
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
|
20 | |
|
21 | |
|
22 | |
|
23 | 0 | public class CurriculumHomeView extends ViewComposite{ |
24 | |
|
25 | 0 | private final SpanPanel container = new SpanPanel(); |
26 | 0 | MetadataRpcServiceAsync metadataServiceAsync = GWT.create(MetadataRpcService.class); |
27 | 0 | CreditCourseProposalRpcServiceAsync cluProposalRpcServiceAsync = GWT.create(CreditCourseProposalRpcService.class); |
28 | 0 | CurriculumHomeConfigurer configurer = GWT.create(CurriculumHomeConfigurer.class); |
29 | |
|
30 | |
public CurriculumHomeView(Controller controller, Enum<?> viewType) { |
31 | 0 | super(controller, "", viewType); |
32 | 0 | this.initWidget(container); |
33 | 0 | setup(); |
34 | 0 | } |
35 | |
|
36 | |
protected void setup(){ |
37 | 0 | metadataServiceAsync.getMetadata("search", null, null, new KSAsyncCallback<Metadata>() { |
38 | |
@Override |
39 | |
public void handleFailure(Throwable caught) { |
40 | 0 | container.add(configurer.configure(null)); |
41 | |
|
42 | 0 | throw new RuntimeException("Could not retreive metadata: " + caught.getMessage(), caught); |
43 | |
} |
44 | |
@Override |
45 | |
public void onSuccess(Metadata metadata) { |
46 | |
|
47 | |
|
48 | |
|
49 | 0 | container.add(configurer.configure(metadata)); |
50 | 0 | } |
51 | |
}); |
52 | 0 | } |
53 | |
|
54 | |
|
55 | |
} |