299 lines
8.1 KiB
Plaintext
299 lines
8.1 KiB
Plaintext
|
||
|
||
eclipse 3.2
|
||
|
||
To build/run the swt stuff you need the Visual Editor plug in installed from the calisto site.
|
||
|
||
eclipse 3.3
|
||
|
||
Down load http://www.ehecht.com/eclipse_ve/ve.html (lin_mac version)
|
||
|
||
Unzip and move the plug ins and features into the plug in and features directory of eclipse.
|
||
|
||
Swing will run by default.
|
||
|
||
-- XyReasscan ?
|
||
|
||
zie tables statline.cbs.nl voor bs asielverzoeken nl
|
||
|
||
|
||
---- Object tree:
|
||
|
||
3 layers
|
||
|
||
- Data Backend
|
||
- JPA or Hibernate
|
||
- Meta Query
|
||
- LDAP
|
||
# List via geparametered xql query
|
||
# Save
|
||
# Merge
|
||
# Delete
|
||
# Create ?
|
||
FilteringDataSource
|
||
PagingDataSource
|
||
FilteringPagingDataSource
|
||
Ordering
|
||
Parameter
|
||
|
||
- Data Source Controller
|
||
- Data Access Controller
|
||
# User ACL on data items/columns
|
||
# Create new entry hooks
|
||
|
||
- Table Controller
|
||
- User Settings
|
||
|
||
|
||
- Data Frontends
|
||
- Extjs
|
||
- Swing
|
||
- WS
|
||
- SWT via SwingWT
|
||
- JSF (met utr plugin)
|
||
|
||
|
||
|
||
- default view field
|
||
- Admin fields and order
|
||
- Admin field groups -> 'collapse
|
||
- List filters auto by type
|
||
- search fields
|
||
|
||
verbose_name_plural
|
||
The plural name for the object:
|
||
verbose_name_plural = "stories"
|
||
If this isn’t given, Django will use verbose_name + "s"
|
||
|
||
|
||
- plural
|
||
- ordering
|
||
- order_with_respect_to
|
||
|
||
# admin
|
||
- date_hierarchy
|
||
- fields = (
|
||
(None, {
|
||
'fields': ('url', 'title', 'content', 'sites')
|
||
}),
|
||
('Advanced options', {
|
||
'classes': 'collapse',
|
||
'fields' : ('enable_comments', 'registration_required', 'template_name')
|
||
'description' : 'sdf'
|
||
}),
|
||
)
|
||
- JS
|
||
- list_display_links
|
||
- list_filter = BooleanField, DateField, DateTimeField or ForeignKey.
|
||
- list_per_page
|
||
- ordering def
|
||
- save_as
|
||
- search_fields
|
||
|
||
@Entity
|
||
@VascAdmin(list=true,edit=true,create=true,delete=false)
|
||
public class BlogPost {
|
||
|
||
@VascPrimaryKey
|
||
@VascName(key="generic.id.name")
|
||
@VascDescription(key="generic.id.name")
|
||
@VascHelpId(key="generic.id.help")
|
||
@VascImage(key="generid.id.image");
|
||
Integer id;
|
||
|
||
@Column(columnName="title")
|
||
@VascDisplayName
|
||
@VascUserRoles(list="(floormanager&sitemanager)|admin" editViewOnly="floormanager" edit="sitemanager|admin")
|
||
String title;
|
||
|
||
@VascEditorType(type="slugField")
|
||
String slug;
|
||
|
||
@VascChoices()
|
||
@VascDefaultValue(key="")
|
||
String tags;
|
||
|
||
@VascRegex(regex="<(.*)>" key="generic.regex.html.tagsNotAllowed")
|
||
String content;
|
||
|
||
@VascEditorType(type="floatField" hints="max_digits=3,decimal_places=2")
|
||
@VascFieldOptions
|
||
@VascColumnWidth(width=130)
|
||
Float price;
|
||
|
||
@VascModelReference
|
||
@VascDefaultValue
|
||
@VascObjectNotNull
|
||
BlogStatus blogStatus;
|
||
|
||
@VascEditorType(type="dateField" hints="auto_now=true,auto_now_add=true")
|
||
@VascDefaultValue(key="new_date")
|
||
@VascUserRoles(list="admin")
|
||
Date createdDate
|
||
|
||
@VascEventChannel(channel="BlogPost.modifiedDate" create=true)
|
||
Date modifiedDate
|
||
|
||
@VascDateFuture
|
||
Date publicedDate
|
||
}
|
||
|
||
|
||
|
||
$it['ldap']['user']="uid=admin-sudo,ou=services,dc=m4n,dc=nl";
|
||
$it['ldap']['pass']="adminSudo";
|
||
$it['ldap']['baseDN']="ou=sudoers,dc=m4n,dc=nl";
|
||
$it['ldap']['key']="cn";
|
||
|
||
$it['columns'][0]['name']="Edit";
|
||
$it['columns'][0]['columnType']="edit";
|
||
$it['columns'][1]['name']="Delete";
|
||
$it['columns'][1]['columnType']="delete";
|
||
$it['columns'][2]['name']="User";
|
||
$it['columns'][2]['attr']="cn";
|
||
$it['columns'][3]['name']="Description";
|
||
$it['columns'][3]['attr']="description";
|
||
$it['columns'][4]['name']="sudoCommand";
|
||
$it['columns'][4]['attr']="sudocommand";
|
||
$it['columns'][4]['columnType']="list";
|
||
$it['columns'][5]['name']="sudoHost";
|
||
$it['columns'][5]['attr']="sudohost";
|
||
$it['columns'][5]['columnType']="list";
|
||
$it['columns'][6]['name']="sudoUser";
|
||
$it['columns'][6]['attr']="sudouser";
|
||
$it['columns'][6]['columnType']="list";
|
||
|
||
$it['list']['filter']="(&(objectClass=sudoRole))";
|
||
$it['list']['columns']="0,2,6,4,5,1";
|
||
$it['delete']['filter']="cn=%s";
|
||
|
||
$it['edit']['filter']="(cn=%s)";
|
||
$it['edit']['create_dn_key']="cn=%s";
|
||
$it['edit']['columns_edit']="2,3,4,5,6";
|
||
$it['edit']['columns_edit_readonly']="2";
|
||
$it['edit']['columns_create']="2,3,4,5,6";
|
||
$it['edit']['map']['objectclass'][]="sudoRole";
|
||
$it['edit']['map']['objectclass'][]="top";
|
||
$it['edit']['map']['cn']="\$key";
|
||
$it['edit']['map']['description']="\$formData['description']";
|
||
|
||
<servlet>
|
||
<name>vasc</name>
|
||
<class></class>
|
||
<property>admin=true</property>
|
||
<property>backend=extjs</property>
|
||
<property>path=/js/extjs/*</property>
|
||
</servlet>
|
||
<servlet-mapping>
|
||
<name>vasc</name>
|
||
<mapping>/vasc/*</mapping>
|
||
</servlet-mapping>
|
||
|
||
|
||
DefaultVascController r = new D..();
|
||
|
||
r.set
|
||
|
||
|
||
EmployeeDataSource dataSource = new EmployeeDataSource();
|
||
dataSource.setJdbcTemplate(new JdbcTemplate(employeeDataSource()));
|
||
FilteringPaginator filteringPaginator = new FilteringPaginator(dataSource, EmployeeReportObject.class);
|
||
JsfCrudAdapter adapter = new JsfCrudAdapter(filteringPaginator, (CrudController)empCrud().getController()){
|
||
public Serializable getEntity() {
|
||
Object object = ((Row)getModel().getRowData()).getObject();
|
||
EmployeeReportObject employeeReportObject = (EmployeeReportObject) object;
|
||
Employee employee = new Employee();
|
||
employee.setId(employeeReportObject.getId());
|
||
return employee;
|
||
}
|
||
};
|
||
|
||
return adapter;
|
||
|
||
|
||
|
||
EVt;
|
||
|
||
<a4j:form id="blogForm" enctype="multipart/form-data">
|
||
<vasc:form crud="${crud}" parentForm="blogForm"
|
||
propertyNames="firstName,lastName,department,description,file,age,numberOfPromotions,active,status,dob">
|
||
|
||
<vasc:compositePanel entity="${crud.entity.address}" name="address"
|
||
propertyNames="line_1,line2,zipCode" />
|
||
|
||
<vasc:detailListing
|
||
detailController="${directReportDetailController}"
|
||
propertyNames="firstName,lastName,description,age,numberOfPromotions" />
|
||
|
||
<vasc:detailListing detailController="${taskDetailController}"
|
||
propertyNames="name,startDate,endDate,complete" />
|
||
|
||
<vasc:detailListing detailController="${contactDetailController}"
|
||
propertyNames="name,phone" />
|
||
|
||
<vasc:selectMany jsfSelectManyController="${employeeToRoleController}"
|
||
propertyNames="name"
|
||
parentForm="employeeForm"/>
|
||
|
||
</vasc:form>
|
||
</a4j:form>
|
||
|
||
Table def:
|
||
|
||
|
||
|
||
|
||
|
||
|
||
@SuppressWarnings({ "unchecked", "serial" })
|
||
@Bean(scope = DefaultScopes.SESSION)
|
||
public JsfCrudAdapter empRecordCrud() {
|
||
EmployeeDataSource dataSource = new EmployeeDataSource();
|
||
dataSource.setJdbcTemplate(new JdbcTemplate(employeeDataSource()));
|
||
FilteringPaginator filteringPaginator = new FilteringPaginator(dataSource, EmployeeReportObject.class);
|
||
JsfCrudAdapter adapter = new JsfCrudAdapter(filteringPaginator, (CrudController)empCrud().getController()){
|
||
public Serializable getEntity() {
|
||
Object object = ((Row)getModel().getRowData()).getObject();
|
||
EmployeeReportObject employeeReportObject = (EmployeeReportObject) object;
|
||
Employee employee = new Employee();
|
||
employee.setId(employeeReportObject.getId());
|
||
return employee;
|
||
}
|
||
};
|
||
|
||
return adapter;
|
||
}
|
||
|
||
<a4j:form id="employeeListingForm">
|
||
<a4j:outputPanel ajaxRendered="true">
|
||
<h:panelGroup rendered="${empRecordCrud.controller.showForm}">
|
||
<crank:form
|
||
crud="${empRecordCrud.controller}"
|
||
parentForm="employeeListingForm"
|
||
propertyNames="firstName,lastName,numberOfPromotions,age,department" ajax="${true}" />
|
||
</h:panelGroup>
|
||
</a4j:outputPanel>
|
||
|
||
<crank:listing
|
||
jsfCrudAdapter="${empRecordCrud}"
|
||
propertyNames="firstName,lastName"
|
||
parentForm="employeeListingForm"
|
||
/>
|
||
</a4j:form>
|
||
|
||
|
||
|
||
<h:form id="expListForm" rendered="#{controllerBean.showListing}">
|
||
<crank:listing paginator="${paginators['Employee']}"
|
||
jsfCrudAdapter="${cruds['Employee']}"
|
||
propertyNames="firstName,lastName,active,dob,age,phone,email,department.name,description"
|
||
pageTitle="Employees"
|
||
parentForm="expListForm"
|
||
reRender="${reRender}"
|
||
crud="${cruds['Employee'].controller}"/>
|
||
</h:form>
|
||
|
||
|
||
|
||
|