|
@@ -1,54 +1,54 @@ |
1 |
|
- |
package org.litesoft.datt.client.support; |
2 |
|
- |
|
3 |
|
- |
import org.litesoft.bo.views.*; |
4 |
|
- |
import org.litesoft.datt.client.boviews.*; |
5 |
|
- |
|
6 |
|
- |
public class StoryScreenViewHelper { |
7 |
|
- |
public static boolean assertStoryURL( StoryFindable pStoryFindable, ObjectURL pStoryURL ) { |
8 |
|
- |
if ( pStoryURL == null ) { |
9 |
|
- |
pStoryFindable.backToHome( "No Story Selected" ); |
10 |
|
- |
return false; |
11 |
|
- |
} |
12 |
|
- |
return true; |
13 |
|
- |
} |
14 |
|
- |
|
15 |
|
- |
public static boolean requestRequiredStory( final StoryFindable pStoryFindable, ObjectURL pStoryURL, final Integer pRequestID ) { |
16 |
|
- |
if ( !assertStoryURL( pStoryFindable, pStoryURL ) ) { |
17 |
|
- |
return false; |
18 |
|
- |
} |
19 |
|
- |
StoryViewDataProvider.getInstance().requestRow( pStoryURL, new FetchRowDataProviderCallBack<StoryView>() { |
20 |
|
- |
@Override |
21 |
|
- |
public void success( StoryView pRow ) { |
22 |
|
- |
if ( pRow != null ) { |
23 |
|
- |
pStoryFindable.foundStory( pRow, pRequestID ); |
24 |
|
- |
return; |
25 |
|
- |
} |
26 |
|
- |
error( "Story Not Found" ); |
27 |
|
- |
} |
28 |
|
- |
|
29 |
|
- |
@Override |
30 |
|
- |
public void error( String pError ) { |
31 |
|
- |
pStoryFindable.backToHome( pError ); |
32 |
|
- |
} |
33 |
|
- |
} ); |
34 |
|
- |
return true; |
35 |
|
- |
} |
36 |
|
- |
|
37 |
|
- |
public static void requestOptionalStory( final StoryFindable pStoryFindable, ObjectURL pStoryURL, final Integer pRequestID ) { |
38 |
|
- |
if ( pStoryURL != null ) { |
39 |
|
- |
StoryViewDataProvider.getInstance().requestRow( pStoryURL, new FetchRowDataProviderCallBack<StoryView>() { |
40 |
|
- |
@Override |
41 |
|
- |
public void success( StoryView pRow ) { |
42 |
|
- |
if ( pRow != null ) { |
43 |
|
- |
pStoryFindable.foundStory( pRow, pRequestID ); |
44 |
|
- |
} |
45 |
|
- |
} |
46 |
|
- |
|
47 |
|
- |
@Override |
48 |
|
- |
public void error( String pError ) { |
49 |
|
- |
pStoryFindable.getStatusMessageSinc().setErrorMessage( pError ); |
50 |
|
- |
} |
51 |
|
- |
} ); |
52 |
|
- |
} |
53 |
|
- |
} |
54 |
|
- |
} |
|
1 |
+ |
package org.litesoft.datt.client.support; |
|
2 |
+ |
|
|
3 |
+ |
import org.litesoft.bo.views.*; |
|
4 |
+ |
import org.litesoft.datt.client.boviews.*; |
|
5 |
+ |
|
|
6 |
+ |
public class StoryScreenViewHelper { |
|
7 |
+ |
public static boolean assertStoryURL( StoryFindable pStoryFindable, ObjectURL pStoryURL ) { |
|
8 |
+ |
if ( pStoryURL == null ) { |
|
9 |
+ |
pStoryFindable.backToHome( "No Story Selected" ); |
|
10 |
+ |
return false; |
|
11 |
+ |
} |
|
12 |
+ |
return true; |
|
13 |
+ |
} |
|
14 |
+ |
|
|
15 |
+ |
public static boolean requestRequiredStory( final StoryFindable pStoryFindable, ObjectURL pStoryURL, final Integer pRequestID ) { |
|
16 |
+ |
if ( !assertStoryURL( pStoryFindable, pStoryURL ) ) { |
|
17 |
+ |
return false; |
|
18 |
+ |
} |
|
19 |
+ |
StoryViewDataProvider.getInstance().requestRow( pStoryURL, new FetchRowDataProviderCallBack<StoryView>() { |
|
20 |
+ |
@Override |
|
21 |
+ |
public void success( StoryView pRow ) { |
|
22 |
+ |
if ( pRow != null ) { |
|
23 |
+ |
pStoryFindable.foundStory( pRow, pRequestID ); |
|
24 |
+ |
return; |
|
25 |
+ |
} |
|
26 |
+ |
error( "Story Not Found" ); |
|
27 |
+ |
} |
|
28 |
+ |
|
|
29 |
+ |
@Override |
|
30 |
+ |
public void error( String pError ) { |
|
31 |
+ |
pStoryFindable.backToHome( pError ); |
|
32 |
+ |
} |
|
33 |
+ |
} ); |
|
34 |
+ |
return true; |
|
35 |
+ |
} |
|
36 |
+ |
|
|
37 |
+ |
public static void requestOptionalStory( final StoryFindable pStoryFindable, ObjectURL pStoryURL, final Integer pRequestID ) { |
|
38 |
+ |
if ( pStoryURL != null ) { |
|
39 |
+ |
StoryViewDataProvider.getInstance().requestRow( pStoryURL, new FetchRowDataProviderCallBack<StoryView>() { |
|
40 |
+ |
@Override |
|
41 |
+ |
public void success( StoryView pRow ) { |
|
42 |
+ |
if ( pRow != null ) { |
|
43 |
+ |
pStoryFindable.foundStory( pRow, pRequestID ); |
|
44 |
+ |
} |
|
45 |
+ |
} |
|
46 |
+ |
|
|
47 |
+ |
@Override |
|
48 |
+ |
public void error( String pError ) { |
|
49 |
+ |
pStoryFindable.getStatusMessageSinc().setErrorMessage( pError ); |
|
50 |
+ |
} |
|
51 |
+ |
} ); |
|
52 |
+ |
} |
|
53 |
+ |
} |
|
54 |
+ |
} |