use of org.jaffa.components.codehelper.ICodeHelper in project jaffa-framework by jaffa-projects.
the class CallBackDropdownHelper method getOptions.
public CodeHelperOutElementDto getOptions(HttpServletRequest request, String returnField, String descField, String domainName, CriteriaElementDto[] criteriaFields) throws ApplicationExceptions, FrameworkException {
CodeHelperOutElementDto m_dropDownCodes = null;
ApplicationExceptions appExps = null;
CodeHelperInDto input = null;
System.out.println("Still alive1");
if (m_codeHelperTx == null)
m_codeHelperTx = (ICodeHelper) Factory.createObject(ICodeHelper.class);
if (m_dropDownCodes == null) {
if (input == null)
input = new CodeHelperInDto();
CodeHelperInElementDto codeHelperInElementDto = new CodeHelperInElementDto();
codeHelperInElementDto.setCode("sort");
codeHelperInElementDto.setDomainClassName(domainName);
codeHelperInElementDto.setCodeFieldName(returnField);
codeHelperInElementDto.setDescriptionFieldName(descField);
for (int i = 0; i < criteriaFields.length; i++) {
CriteriaElementDto criteriaField = criteriaFields[i];
codeHelperInElementDto.addCriteriaField(criteriaField);
}
input.addCodeHelperInElementDto(codeHelperInElementDto);
}
// throw ApplicationExceptions, if any parsing errors occured
if (appExps != null && appExps.size() > 0)
throw appExps;
// Get the Codes and populate the respective fields
if (input != null) {
System.out.println("Still alive2");
input.setHeaderDto(getHeaderDto(request));
System.out.println("Still alive3");
CodeHelperOutDto output = m_codeHelperTx.getCodes(input);
if (output != null && output.getCodeHelperOutElementDtoCount() > 0) {
CodeHelperOutElementDto[] codeHelperOutElementDtos = output.getCodeHelperOutElementDtos();
for (int i = 0; i < codeHelperOutElementDtos.length; i++) {
CodeHelperOutElementDto codeHelperOutElementDto = codeHelperOutElementDtos[i];
String code = codeHelperOutElementDto.getCode();
if (code.equals("sort"))
m_dropDownCodes = codeHelperOutElementDto;
}
}
}
System.out.println("Still alive4");
return m_dropDownCodes;
}
use of org.jaffa.components.codehelper.ICodeHelper in project jaffa-framework by jaffa-projects.
the class UserTimeEntryMaintenanceComponent method initDropDownCodes.
// .//GEN-END:_doPrevalidateUpdate_3_be
// .//GEN-BEGIN:_initDropDownCodes_1_be
/**
* This will retrieve the set of codes for dropdowns, if any are required
*/
protected void initDropDownCodes() throws ApplicationExceptions, FrameworkException {
ApplicationExceptions appExps = null;
CodeHelperInDto input = null;
if (m_codeHelperTx == null)
m_codeHelperTx = (ICodeHelper) Factory.createObject(ICodeHelper.class);
if (m_projectCodeCodes == null) {
if (input == null)
input = new CodeHelperInDto();
CodeHelperInElementDto codeHelperInElementDto = new CodeHelperInElementDto();
codeHelperInElementDto.setCode("projectCode");
codeHelperInElementDto.setDomainClassName("org.jaffa.applications.test.modules.time.domain.ProjectCode");
codeHelperInElementDto.setCodeFieldName("ProjectCode");
codeHelperInElementDto.setDescriptionFieldName("Description");
input.addCodeHelperInElementDto(codeHelperInElementDto);
}
// throw ApplicationExceptions, if any parsing errors occured
if (appExps != null && appExps.size() > 0)
throw appExps;
// Get the Codes and populate the respective fields
if (input != null) {
input.setHeaderDto(getHeaderDto());
CodeHelperOutDto output = m_codeHelperTx.getCodes(input);
if (output != null && output.getCodeHelperOutElementDtoCount() > 0) {
CodeHelperOutElementDto[] codeHelperOutElementDtos = output.getCodeHelperOutElementDtos();
for (int i = 0; i < codeHelperOutElementDtos.length; i++) {
CodeHelperOutElementDto codeHelperOutElementDto = codeHelperOutElementDtos[i];
String code = codeHelperOutElementDto.getCode();
if (code.equals("projectCode"))
m_projectCodeCodes = codeHelperOutElementDto;
}
}
}
}
use of org.jaffa.components.codehelper.ICodeHelper in project jaffa-framework by jaffa-projects.
the class PrinterDefinitionFinderComponent method initializeCriteriaScreen.
// .//GEN-END:_addListeners_1_be
// .//GEN-BEGIN:_initializeCriteriaScreen_1_be
/**
* This will retrieve the set of codes for dropdowns, if any are required
* @throws ApplicationExceptions This will be thrown in case any invalid data has been set.
* @throws FrameworkException Indicates some system error.
*/
protected void initializeCriteriaScreen() throws ApplicationExceptions, FrameworkException {
ApplicationExceptions appExps = null;
CodeHelperInDto input = null;
if (m_codeHelperTx == null)
m_codeHelperTx = (ICodeHelper) Factory.createObject(ICodeHelper.class);
if (m_outputTypeCodes == null) {
if (input == null)
input = new CodeHelperInDto();
CodeHelperInElementDto codeHelperInElementDto = new CodeHelperInElementDto();
codeHelperInElementDto.setCode("outputType");
codeHelperInElementDto.setDomainClassName("org.jaffa.modules.printing.domain.PrinterOutputType");
codeHelperInElementDto.setCodeFieldName("OutputType");
codeHelperInElementDto.setDescriptionFieldName("Description");
codeHelperInElementDto.setAppendCodeAndDescription(true);
input.addCodeHelperInElementDto(codeHelperInElementDto);
}
// throw ApplicationExceptions, if any parsing errors occured
if (appExps != null && appExps.size() > 0)
throw appExps;
// Get the Codes and populate the respective fields
if (input != null) {
input.setHeaderDto(getHeaderDto());
CodeHelperOutDto output = m_codeHelperTx.getCodes(input);
if (output != null && output.getCodeHelperOutElementDtoCount() > 0) {
CodeHelperOutElementDto[] codeHelperOutElementDtos = output.getCodeHelperOutElementDtos();
for (int i = 0; i < codeHelperOutElementDtos.length; i++) {
CodeHelperOutElementDto codeHelperOutElementDto = codeHelperOutElementDtos[i];
String code = codeHelperOutElementDto.getCode();
if (code.equals("outputType"))
m_outputTypeCodes = codeHelperOutElementDto;
}
}
}
// Get comma-separated page size business rule and create drop-down list,
// if scaleToPageSizes business rule is defined. e.g. scaleToPageSizes=LETTER,A4
CodeHelperOutElementDto codeHelperOutElementDto;
CodeHelperOutCodeDto codeHelperOutCodeDto;
if (scaleToPageSizesArray == null) {
String scaleToPageSizesRule = (String) ContextManagerFactory.instance().getProperty("jaffa.printing.scaleToPageSizes");
scaleToPageSizesArray = scaleToPageSizesRule != null ? scaleToPageSizesRule.split(",") : null;
codeHelperOutElementDto = new CodeHelperOutElementDto();
if (scaleToPageSizesArray != null) {
for (String size : scaleToPageSizesArray) {
codeHelperOutCodeDto = new CodeHelperOutCodeDto();
codeHelperOutCodeDto.setCode(size);
codeHelperOutCodeDto.setDescription(size);
codeHelperOutElementDto.addCodeHelperOutCodeDto(codeHelperOutCodeDto);
}
m_scaleToPageSizeCodes = codeHelperOutElementDto;
}
}
}
use of org.jaffa.components.codehelper.ICodeHelper in project jaffa-framework by jaffa-projects.
the class PrinterDefinitionLookupComponent method initializeCriteriaScreen.
// .//GEN-END:_addListeners_1_be
// .//GEN-BEGIN:_initializeCriteriaScreen_1_be
/**
* This will retrieve the set of codes for dropdowns, if any are required
* @throws ApplicationExceptions This will be thrown in case any invalid data has been set.
* @throws FrameworkException Indicates some system error.
*/
protected void initializeCriteriaScreen() throws ApplicationExceptions, FrameworkException {
ApplicationExceptions appExps = null;
CodeHelperInDto input = null;
if (m_codeHelperTx == null)
m_codeHelperTx = (ICodeHelper) Factory.createObject(ICodeHelper.class);
if (m_outputTypeCodes == null) {
if (input == null)
input = new CodeHelperInDto();
CodeHelperInElementDto codeHelperInElementDto = new CodeHelperInElementDto();
codeHelperInElementDto.setCode("outputType");
codeHelperInElementDto.setDomainClassName("org.jaffa.modules.printing.domain.PrinterOutputType");
codeHelperInElementDto.setCodeFieldName("OutputType");
codeHelperInElementDto.setDescriptionFieldName("Description");
codeHelperInElementDto.setAppendCodeAndDescription(true);
input.addCodeHelperInElementDto(codeHelperInElementDto);
}
// throw ApplicationExceptions, if any parsing errors occured
if (appExps != null && appExps.size() > 0)
throw appExps;
// Get the Codes and populate the respective fields
if (input != null) {
input.setHeaderDto(getHeaderDto());
CodeHelperOutDto output = m_codeHelperTx.getCodes(input);
if (output != null && output.getCodeHelperOutElementDtoCount() > 0) {
CodeHelperOutElementDto[] codeHelperOutElementDtos = output.getCodeHelperOutElementDtos();
for (int i = 0; i < codeHelperOutElementDtos.length; i++) {
CodeHelperOutElementDto codeHelperOutElementDto = codeHelperOutElementDtos[i];
String code = codeHelperOutElementDto.getCode();
if (code.equals("outputType"))
m_outputTypeCodes = codeHelperOutElementDto;
}
}
}
// Get comma-separated page size business rule and create drop-down list,
// if scaleToPageSizes business rule is defined. e.g. scaleToPageSizes=LETTER,A4
CodeHelperOutElementDto codeHelperOutElementDto;
CodeHelperOutCodeDto codeHelperOutCodeDto;
if (scaleToPageSizesArray == null) {
String scaleToPageSizesRule = (String) ContextManagerFactory.instance().getProperty("jaffa.printing.scaleToPageSizes");
scaleToPageSizesArray = scaleToPageSizesRule != null ? scaleToPageSizesRule.split(",") : null;
codeHelperOutElementDto = new CodeHelperOutElementDto();
if (scaleToPageSizesArray != null) {
for (String size : scaleToPageSizesArray) {
codeHelperOutCodeDto = new CodeHelperOutCodeDto();
codeHelperOutCodeDto.setCode(size);
codeHelperOutCodeDto.setDescription(size);
codeHelperOutElementDto.addCodeHelperOutCodeDto(codeHelperOutCodeDto);
}
m_scaleToPageSizeCodes = codeHelperOutElementDto;
}
}
}
use of org.jaffa.components.codehelper.ICodeHelper in project jaffa-framework by jaffa-projects.
the class PrinterDefinitionMaintenanceComponent method initDropDownCodes.
// .//GEN-END:_doPrevalidateUpdate_3_be
// .//GEN-BEGIN:_initDropDownCodes_1_be
/**
* This will retrieve the set of codes for dropdowns, if any are required
*/
protected void initDropDownCodes() throws ApplicationExceptions, FrameworkException {
ApplicationExceptions appExps = null;
CodeHelperInDto input = null;
if (m_codeHelperTx == null)
m_codeHelperTx = (ICodeHelper) Factory.createObject(ICodeHelper.class);
if (m_outputTypeCodes == null) {
if (input == null)
input = new CodeHelperInDto();
CodeHelperInElementDto codeHelperInElementDto = new CodeHelperInElementDto();
codeHelperInElementDto.setCode("outputType");
codeHelperInElementDto.setDomainClassName("org.jaffa.modules.printing.domain.PrinterOutputType");
codeHelperInElementDto.setCodeFieldName("OutputType");
codeHelperInElementDto.setDescriptionFieldName("OutputType");
input.addCodeHelperInElementDto(codeHelperInElementDto);
}
// throw ApplicationExceptions, if any parsing errors occured
if (appExps != null && appExps.size() > 0)
throw appExps;
// Get the Codes and populate the respective fields
if (input != null) {
input.setHeaderDto(getHeaderDto());
CodeHelperOutDto output = m_codeHelperTx.getCodes(input);
if (output != null && output.getCodeHelperOutElementDtoCount() > 0) {
CodeHelperOutElementDto[] codeHelperOutElementDtos = output.getCodeHelperOutElementDtos();
for (int i = 0; i < codeHelperOutElementDtos.length; i++) {
CodeHelperOutElementDto codeHelperOutElementDto = codeHelperOutElementDtos[i];
String code = codeHelperOutElementDto.getCode();
if (code.equals("outputType"))
m_outputTypeCodes = codeHelperOutElementDto;
}
}
}
// Get comma-separated page size business rule and create drop-down list,
// if scaleToPageSizes business rule is defined. e.g. scaleToPageSizes=LETTER,A4
CodeHelperOutElementDto codeHelperOutElementDto;
CodeHelperOutCodeDto codeHelperOutCodeDto;
if (scaleToPageSizesArray == null) {
String scaleToPageSizesRule = (String) ContextManagerFactory.instance().getProperty("jaffa.printing.scaleToPageSizes");
scaleToPageSizesArray = scaleToPageSizesRule != null ? scaleToPageSizesRule.split(",") : null;
codeHelperOutElementDto = new CodeHelperOutElementDto();
if (scaleToPageSizesArray != null) {
for (String size : scaleToPageSizesArray) {
codeHelperOutCodeDto = new CodeHelperOutCodeDto();
codeHelperOutCodeDto.setCode(size);
codeHelperOutCodeDto.setDescription(size);
codeHelperOutElementDto.addCodeHelperOutCodeDto(codeHelperOutCodeDto);
}
m_scaleToPageSizeCodes = codeHelperOutElementDto;
}
}
}
Aggregations