Skip to content

Commit 20113b2

Browse files
JihoonKim1004JihoonKim1004
authored andcommitted
Some of the changes for this commit :
(1) Started the work for DataGrid component, have yet to fully implement it and will do so in later commit (2) Increased the max memory of compiler from 1024 to 2048 (3) Better packaged the ActionScript files and etcetera
1 parent e57aa4d commit 20113b2

File tree

65 files changed

+2583
-414
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+2583
-414
lines changed

jsf-flex-build-plugIn/jsf-flex-plugIn/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<configuration>
3030
<source>1.5</source>
3131
<target>1.5</target>
32-
<maxmem>1024</maxmem>
32+
<maxmem>2048</maxmem>
3333
<meminitial>256</meminitial>
3434
</configuration>
3535
</plugin>
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
package com.googlecode.jsfFlex.shared.beans;
20+
21+
import java.util.HashMap;
22+
import java.util.LinkedHashSet;
23+
import java.util.LinkedList;
24+
import java.util.List;
25+
import java.util.Map;
26+
import java.util.Set;
27+
28+
/**
29+
* @author Ji Hoon Kim
30+
*/
31+
public final class AdditionalApplicationScriptContent {
32+
33+
private final Set _actionScriptImports;
34+
private final Map _dataGridScriptContent;
35+
36+
public AdditionalApplicationScriptContent(){
37+
super();
38+
_actionScriptImports = new LinkedHashSet();
39+
_dataGridScriptContent = new HashMap();
40+
}
41+
42+
public void addActionScriptImport(String actionScriptImport){
43+
_actionScriptImports.add(actionScriptImport);
44+
}
45+
46+
public Set getActionScriptImports() {
47+
return _actionScriptImports;
48+
}
49+
public Map getDataGridScriptContent() {
50+
return _dataGridScriptContent;
51+
}
52+
53+
public void addDataGridScriptContent(String dataGridId){
54+
_dataGridScriptContent.put(dataGridId, new DataGridScriptContent(dataGridId));
55+
}
56+
57+
public void addDataGridColumnToDataGridScriptContent(String dataGridId, String dataGridColumnId){
58+
DataGridScriptContent dataGridScriptContentInstance;
59+
if((dataGridScriptContentInstance = (DataGridScriptContent) _dataGridScriptContent.get(dataGridId)) == null){
60+
dataGridScriptContentInstance = new DataGridScriptContent(dataGridId);
61+
_dataGridScriptContent.put(dataGridId, dataGridScriptContentInstance);
62+
}
63+
64+
dataGridScriptContentInstance.addDataGridColumnContent(dataGridColumnId);
65+
}
66+
67+
public void addDataGridColumnToDataGridScriptContent(String dataGridId, List dataGridColumnIdList){
68+
DataGridScriptContent dataGridScriptContentInstance;
69+
if((dataGridScriptContentInstance = (DataGridScriptContent) _dataGridScriptContent.get(dataGridId)) == null){
70+
dataGridScriptContentInstance = new DataGridScriptContent(dataGridId);
71+
_dataGridScriptContent.put(dataGridId, dataGridScriptContentInstance);
72+
}
73+
74+
dataGridScriptContentInstance.addDataGridColumnContent(dataGridColumnIdList);
75+
}
76+
77+
public static final class DataGridScriptContent {
78+
79+
private final String _dataGridId;
80+
private final List _dataGridColumns;
81+
82+
private DataGridScriptContent(String dataGridId){
83+
super();
84+
_dataGridId = dataGridId;
85+
_dataGridColumns = new LinkedList();
86+
}
87+
88+
private void addDataGridColumnContent(String dataGridColumnId){
89+
_dataGridColumns.add(dataGridColumnId);
90+
}
91+
92+
private void addDataGridColumnContent(List dataGridColumnIdList){
93+
_dataGridColumns.addAll(dataGridColumnIdList);
94+
}
95+
96+
public String getDataGridId() {
97+
return _dataGridId;
98+
}
99+
public List getDataGridColumns() {
100+
return _dataGridColumns;
101+
}
102+
103+
public boolean equals(Object instance) {
104+
if(!(instance instanceof DataGridScriptContent)){
105+
return false;
106+
}
107+
108+
DataGridScriptContent _dataGridScriptContentInstance = (DataGridScriptContent) instance;
109+
return this._dataGridId.equals(_dataGridScriptContentInstance._dataGridId);
110+
}
111+
public int hashCode() {
112+
return _dataGridId.hashCode();
113+
}
114+
115+
}
116+
117+
}

jsf-flex-shared/core/src/main/java/com/googlecode/jsfFlex/shared/context/MxmlContext.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import java.util.List;
2222
import java.util.Map;
2323

24+
import com.googlecode.jsfFlex.shared.beans.AdditionalApplicationScriptContent;
2425
import com.googlecode.jsfFlex.shared.tasks._CommonTaskRunner;
2526
import com.googlecode.jsfFlex.shared.tasks._FileManipulatorTaskRunner;
2627
import com.googlecode.jsfFlex.shared.tasks._FlexTaskRunner;
@@ -47,6 +48,8 @@ public abstract class MxmlContext {
4748

4849
public abstract void setSimplySWF(boolean simplySWF);
4950

51+
public abstract AdditionalApplicationScriptContent getAdditionalAppScriptContent();
52+
5053
public abstract List getApplicationInitValueList();
5154

5255
public abstract String getCurrMxml();

jsf-flex-shared/core/src/main/java/com/googlecode/jsfFlex/shared/context/MxmlContextImpl.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import java.util.Map;
2424
import java.util.TreeMap;
2525

26+
import com.googlecode.jsfFlex.shared.beans.AdditionalApplicationScriptContent;
2627
import com.googlecode.jsfFlex.shared.tasks._CommonTaskRunner;
2728
import com.googlecode.jsfFlex.shared.tasks._FileManipulatorTaskRunner;
2829
import com.googlecode.jsfFlex.shared.tasks._FlexTaskRunner;
@@ -46,7 +47,9 @@ public class MxmlContextImpl extends MxmlContext {
4647
private boolean _simplySWF;
4748

4849
private Map _preMxmlCompMap;
50+
private AdditionalApplicationScriptContent _additionalAppScriptContent;
4951
private List _applicationInitValueList;
52+
5053
private String _currMxml;
5154

5255
private String _mxmlPath;
@@ -66,6 +69,7 @@ public MxmlContextImpl(String currMxml){
6669
super();
6770
_currMxml = currMxml;
6871
_preMxmlCompMap = new TreeMap();
72+
_additionalAppScriptContent = new AdditionalApplicationScriptContent();
6973
_applicationInitValueList = new LinkedList();
7074
_runnerFactoryInstance = _RunnerFactory.getInstance();
7175
_flexRunner = _runnerFactoryInstance.getFlexTaskRunnerImpl();
@@ -86,6 +90,9 @@ public boolean isSimplySWF() {
8690
public void setSimplySWF(boolean simplySWF) {
8791
_simplySWF = simplySWF;
8892
}
93+
public AdditionalApplicationScriptContent getAdditionalAppScriptContent() {
94+
return _additionalAppScriptContent;
95+
}
8996
public List getApplicationInitValueList() {
9097
return _applicationInitValueList;
9198
}

jsf-flex-shared/core/src/main/java/com/googlecode/jsfFlex/shared/tasks/_FileManipulatorTaskRunner.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import java.io.FileReader;
2525
import java.io.IOException;
2626
import java.io.InputStreamReader;
27+
import java.util.Map;
2728
import java.util.Properties;
2829
import java.util.Set;
2930

@@ -39,6 +40,8 @@ public abstract class _FileManipulatorTaskRunner extends TaskRunnerImpl {
3940

4041
private final static Log _log = LogFactory.getLog(_FileManipulatorTaskRunner.class);
4142

43+
public abstract void createFileContent(String _filePath, String _templateFile, Properties _initProperties, Map _tokenMap);
44+
4245
public abstract void createPreMxmlFile(String _preMxmlFilePath, Properties _initProperties, Set _tokenList, String _mxmlComponentName,
4346
String _bodyContent, String _childIdentifier, String _siblingIdentifier);
4447

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
/**
21+
* @author Ji Hoon Kim
22+
*/
23+
package com.googlecode.jsfFlex.communication.component
24+
{
25+
26+
import com.googlecode.jsfFlex.communication.logger.ILogger;
27+
import com.googlecode.jsfFlex.communication.logger.LoggerFactory
28+
29+
import com.googlecode.jsfFlex.communication.services.JSONHttpService;
30+
31+
public class DataGridAsynchronousRequest {
32+
33+
private static var _log:ILogger;
34+
35+
private var _dataGridARId:String;
36+
private var _dataGridColumnList:Array;
37+
38+
{
39+
_log = LoggerFactory.newJSLoggerInstance(DataGridAsynchronousRequest);
40+
}
41+
42+
public function DataGridAsynchronousRequest(dataGridARId:String){
43+
super();
44+
_dataGridARId = dataGridARId;
45+
_dataGridColumnList = new Array();
46+
}
47+
48+
public function addDataGridColumBean(dataGridStringId:String):void {
49+
_dataGridColumnList.push(new DataGridColumnBean(dataGridStringId));
50+
}
51+
52+
}
53+
54+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
/**
21+
* @author Ji Hoon Kim
22+
*/
23+
package com.googlecode.jsfFlex.communication.component
24+
{
25+
26+
internal class DataGridColumnBean {
27+
28+
private var _columnId:String;
29+
private var columnEntries:XMLList;
30+
31+
public function DataGridColumnBean(columnId:String){
32+
super();
33+
_columnId = columnId;
34+
}
35+
36+
}
37+
38+
}

jsf-flex-shared/core/src/main/resources/com/googlecode/jsfFlex/shared/actionScript/com/googlecode/jsfFlex/communication/core/ComponentValueMapper.as

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ package com.googlecode.jsfFlex.communication.core
3232
import mx.collections.ArrayCollection;
3333
import mx.core.UIComponent;
3434

35-
import com.googlecode.jsfFlex.communication.logger.JavaScriptLogger;
35+
import com.googlecode.jsfFlex.communication.logger.ILogger;
36+
import com.googlecode.jsfFlex.communication.logger.LoggerFactory
3637

37-
public class ComponentValueMapper extends JavaScriptLogger {
38+
public class ComponentValueMapper {
3839

3940
private static const LINE_FEED:String = "\n";
4041
private static const LINE_FEED_ESCAPER:RegExp = /LINE_FEED/g;
@@ -51,36 +52,41 @@ package com.googlecode.jsfFlex.communication.core
5152

5253
private static var _compValueMapper:XML;
5354

55+
private static var _log:ILogger;
56+
private static var _loader:URLLoader;
57+
5458
private var _refApp:UIComponent;
5559

60+
{
61+
_log = LoggerFactory.newJSLoggerInstance(ComponentValueMapper);
62+
63+
_loader = new URLLoader();
64+
_loader.addEventListener(Event.COMPLETE, function (event:Event):void {
65+
var _loader:URLLoader = URLLoader(event.target);
66+
_compValueMapper = new XML(_loader.data);
67+
});
68+
try{
69+
_loader.load(new URLRequest(COMP_VALUE_MAPPER));
70+
}catch(loadingError:Error){
71+
trace("Failure in loading of the componentValueMapper.xml file");
72+
_log.logInfo("Failure in loading of the componentValueMapper.xml file");
73+
}
74+
}
75+
5676
public function ComponentValueMapper(refApp:UIComponent){
5777
super();
5878
_refApp = refApp;
5979
}
6080

6181
public function initialize():void {
6282

63-
if(_compValueMapper == null){
64-
var _loader:URLLoader = new URLLoader();
65-
_loader.addEventListener(Event.COMPLETE, function (event:Event):void {
66-
var _loader:URLLoader = URLLoader(event.target);
67-
_compValueMapper = new XML(_loader.data);
68-
});
69-
try{
70-
_loader.load(new URLRequest(COMP_VALUE_MAPPER));
71-
}catch(loadingError:Error){
72-
trace("Failure in loading of the componentValueMapper.xml file");
73-
logInfo("Failure in loading of the componentValueMapper.xml file");
74-
}
75-
}
76-
7783
try{
7884
ExternalInterface.addCallback(AS_GET_COMP_VALUE_FUNCTION, this.getCompValue);
7985
}catch(callBackError:Error){
8086
trace("Failure in setting up of getCompValue callBack");
81-
logInfo("Failure in setting up of getCompValue callBack");
87+
_log.logInfo("Failure in setting up of getCompValue callBack");
8288
}
83-
logInfo("Finished with the initialization of " + _refApp["id"]);
89+
_log.logInfo("Finished with the initialization of " + _refApp["id"]);
8490
}
8591

8692
public function populateInitValues(appInfo:Object):void {
@@ -227,7 +233,7 @@ package com.googlecode.jsfFlex.communication.core
227233
attributeId = null;
228234
attributeValue = null;
229235
trace("Failure in getting access to reference " + nestedObjects[k].toString());
230-
logInfo("Failure in getting access to reference " + nestedObjects[k].toString());
236+
_log.logInfo("Failure in getting access to reference " + nestedObjects[k].toString());
231237
break;
232238
}
233239
}

0 commit comments

Comments
 (0)