Skip to content

Instantly share code, notes, and snippets.

Created May 9, 2011 15:52
Show Gist options
  • Save anonymous/962767 to your computer and use it in GitHub Desktop.
Save anonymous/962767 to your computer and use it in GitHub Desktop.
JRapid Sample CRM
<panel menu=".Panels" name="Index" title="Welcome to JRapid CRM">
<menu/>
<header><![CDATA[<h1>Welcome to JRapid CRM</h1><h2>This application manages opportunities of business deals with customers</h2>]]></header>
<column width="70%">
<accordeon>
<accordeonitem title="Customers">
<html><![CDATA[<div style="height:600px;float:left;"></div>]]></html>
<listing entity="Customer" listing="main" name="customers" panelheight="600px" title="Customers"/>
</accordeonitem>
</accordeon>
</column>
<column width="30%">
<accordeon>
<accordeonitem title="Opportunities">
<listing entity="Opportunity" name="opportunities" panelheight="600px" subset="forCustomer" subsetparams="customers" title="Opportunities"/>
</accordeonitem>
</accordeon>
</column>
<footer><![CDATA[<h4>This application is entirely built with JRapid</h4>Visit us at <a href="http://www.jrapid.com">www.jrapid.com</a>]]></footer>
</panel>
<panel menu=".Panels" name="Entities" title="Entities">
<menu/>
<header><![CDATA[<h1>Welcome to JRapid CRM</h1><h2>This application manages opportunities of business deals with customers</h2>]]></header>
<column width="100%">
<accordeon>
<accordeonitem title="Contacts">
<listing entity="Contact" name="contacts" panelheight="40%" title="Contacts"/>
</accordeonitem>
<accordeonitem title="Sales Representatives">
<listing entity="SalesRepresentative" name="salesRepresentatives" panelheight="40%" title="Sales Representatives"/>
</accordeonitem>
</accordeon>
</column>
<footer><![CDATA[<h4>This application is entirely built with JRapid</h4>Visit us at <a href="http://www.jrapid.com">www.jrapid.com</a>]]></footer>
</panel>
<entity comboproperty="name" label="Customer" menu="Entities" name="Customer" navigator="navigator">
<subset name="forUser">
<condition field="salesRepresentative" value="SalesRepresentative:findOneBy('user.id', userId)"/>
</subset>
<subset displayproperties="name,salesRepresentative.firstName,salesRepresentative.lastName,logo" name="forThumbs"/>
<listing layout="left" name="main"/>
<listing displayproperties="name;salesRepresentative.firstName,salesRepresentative.lastName;logo" name="thumbs" view="thumbnails"/>
<tab label="Main" name="main">
<column>
<property label="Logo" name="logo" type="image"/>
<property display="secondary" height="50" hidden="hidden" imagecopyof="logo" name="thumb" type="image"/>
<property display="primary" label="Customer Name" name="name" required="required" unique="unique"/>
<property enumset="Industry" label="Industry" name="industry" type="enum" widget="radio"/>
<property label="Phone" name="phone" type="phone"/>
<property label="Address" name="address"/>
<property autosuggest="autosuggest" label="ZIP" name="zip"/>
<property autosuggest="autosuggest" label="State" name="state"/>
<property autosuggest="autosuggest" label="Country" name="country"/>
</column>
<column>
<property display="secondary" entity="SalesRepresentative" label="Sales Representative" name="salesRepresentative"/>
<property label="Number Of Employees" name="numberOfEmployees" type="integer"/>
<property label="Annual Budget ($)" name="annualBudget" type="integer"/>
</column>
<property label="Comments" name="comments" type="text"/>
</tab>
<tab label="Contacts" name="contacts">
<property childproperty="customer" collection="set" embedded="inline" entity="Contact" extendable="extendable" label="Contact" name="contact"/>
</tab>
<tab label="Opportunities" name="opportunities">
<embeddedlisting defaultset="defaultForCustomer" defaultsetparams="." entity="Opportunity" name="opportunities" subset="forCustomer" subsetparams="."/>
</tab>
<filter display="primary" label="Name" name="name" property="name"/>
<filter display="primary" label="Country" name="country" property="country"/>
<filter display="primary" label="More Of # Employees" name="moreOfEmployees" type="integer">
<condition field="numberOfEmployees" gt="moreOfEmployees"/>
</filter>
<filter display="primary" label="Sales Representative" name="salesRepresentative" property="salesRepresentative"/>
<filter display="primary" label="Address" name="address">
<condition field="address" like="concat('%',concat(address,'%'))"/>
</filter>
<action defaultset="defaultForCustomer" entity="Opportunity" label="Add Opportunity" location="form" name="addOpportunity" type="relatedentity"/>
</entity>
<entity label="Contact" menu="Entities" name="Contact">
<subset name="forCustomer">
<param entity="Customer" name="customerParam"/>
<condition field="customer" value="customerParam"/>
</subset>
<property display="primary" label="Contact First Name" name="firstName" required="required"/>
<property display="primary" label="Contact Last Name" name="lastName" required="required"/>
<property display="secondary" label="Email" name="email" type="email"/>
<property display="secondary" label="Phone" name="phone" type="phone"/>
<property entity="Customer" label="Customer" name="customer" required="required"/>
</entity>
<entity label="Sales Representative" menu="Entities" name="SalesRepresentative">
<property display="primary" label="SR First Name" name="firstName" required="required"/>
<property display="primary" label="SR Last Name" name="lastName" required="required"/>
<property display="secondary" label="Email" name="email" type="email"/>
<property display="secondary" label="Phone" name="phone" type="phone"/>
<!--<property display="secondary" entity="User" label="Username" name="user" required="required"/>-->
</entity>
<entity label="Commercial Action" name="CommercialAction">
<defaultset name="defaultForOpportunity">
<param entity="Opportunity" name="opportunityParam"/>
<default name="opportunity" value="opportunityParam"/>
<default name="salesRepresentative" value="opportunityParam.customer.salesRepresentative"/>
<default name="date" value="now"/>
</defaultset>
<subset name="forOpportunity">
<param entity="Opportunity" name="opportunityParam"/>
<condition field="opportunity" value="opportunityParam"/>
<condition field="salesRepresentative" value="opportunityParam.customer.salesRepresentative"/>
</subset>
<property disabled="disabled" display="primary" entity="Opportunity" label="Opportunity" name="opportunity" required="required"/>
<property disabled="disabled" entity="Customer" expr="this.opportunity.customer" label="Customer" name="customer" transient="transient" widget="combo"/>
<property default="now" display="secondary" label="Date" name="date" required="required" type="date" widget="jdatepicker"/>
<property display="secondary" enumset="ActionType" label="Type" name="type" type="enum" widget="radio"/>
<property disabledif="salesRepresentative != ''" display="secondary" entity="SalesRepresentative" label="Sales Representative" name="salesRepresentative" required="required"/>
<property display="secondary" entity="Contact" label="Contact" name="contact" required="required" subset="forCustomer" subsetparams="customer"/>
<property label="Description" name="description" type="text"/>
</entity>
<entity crosstab="crosstab" defaultlisting="withFilters" label="Opportunity" menu="Operations" name="Opportunity">
<defaultset name="defaultForCustomer">
<param entity="Customer" name="customerParam"/>
<default name="customer" value="customerParam"/>
<default name="state" value="'NEW'"/>
</defaultset>
<listing displayfilters="name,customerName,closingDateBefore" name="withFilters"/>
<subset name="forCustomer">
<param entity="Customer" name="customerParam"/>
<condition field="customer" value="customerParam"/>
</subset>
<tab label="Opportunity" name="opportunity">
<property display="primary" label="Opportunity Name" name="name" required="required" unique="unique"/>
<property display="secondary" entity="Customer" label="Customer" name="customer" required="required" widget="combo"/>
<property dimension="column" display="secondary" label="Closing Date" name="closingDate" type="date" widget="jdatepicker"/>
<property default="'NEW'" dimension="row" display="secondary" enumset="Stages" label="State" name="state" required="required" type="enum"/>
<property label="Amount" name="amount" type="double"/>
<property label="Annual Budget" name="annualBudget" transient="transient" type="integer">
<dynamicvalue expr="customerParam.annualBudget">
<param entity="Customer" name="customerParam" value="customer"/>
</dynamicvalue>
</property>
</tab>
<tab label="Commercial Actions" name="commercialActions">
<embeddedlisting defaultset="defaultForOpportunity" defaultsetparams="." entity="CommercialAction" name="actions" subset="forOpportunity" subsetparams="."/>
</tab>
<filter label="Customer Name" name="customerName">
<condition field="customer.name" like="concat(concat('%',customerName),'%')"/>
</filter>
<filter flag="contains" label="Name" name="name" property="name"/>
<filter label="Closing Date Before" name="closingDateBefore" type="date" widget="selectdate">
<condition field="closingDate" le="closingDateBefore"/>
</filter>
<action defaultset="defaultForOpportunity" entity="CommercialAction" label="Add Commercial Action" location="form" name="addCommercialAction" type="relatedentity"/>
</entity>
<enumset name="Stages">
<enum value="NEW">New</enum>
<enum value="IN_PROCESS">In Process</enum>
<enum value="SUCCESSFUL">Successful</enum>
<enum value="DISCARDED">Discarded</enum>
</enumset>
<enumset name="Industry">
<enum value="FOOD">Food</enum>
<enum value="PETROLEUM">Petroleum</enum>
<enum value="AGRICULTURE">Agriculture</enum>
<enum value="AUTOMOTIVE">Automotive</enum>
<enum value="TRANSPORT">Transport</enum>
</enumset>
<enumset name="ActionType">
<enum value="MAIL">Mail</enum>
<enum value="PHONE_CALL">Phone Call</enum>
<enum value="MEETING">Meeting</enum>
<enum value="EMAIL">E-mail</enum>
</enumset>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment