public interface DomainService extends AgrosystService
| Modifier and Type | Field and Description |
|---|---|
static String |
NEW_EQUIPMENT |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkDomainExistence(String domainName)
Check if a domain already exists if specified name.
|
List<String> |
copyTools(String fromDomain,
List<String> toDomains,
Boolean includeToolCouplings,
List<Equipment> equipmentsToCopy,
List<ToolsCoupling> toolsCouplingsToCopy)
Copy equipments and optionally tools couplings and manuals interventions from domain the given fromDomain to domain the given toDomains list
|
Domain |
createOrUpdateDomain(Domain domain,
String locationId,
String legalStatusId,
List<GeoPoint> gpsData,
List<CroppingPlanEntryDto> croppingPlan,
Integer otex18,
Integer otex70,
List<Ground> grounds,
List<Equipment> equipments,
List<ToolsCoupling> toolsCouplings,
List<Price> prices) |
void |
deleteToolsCouplings(Collection<ToolsCoupling> toolsCouplings)
delete Tools couplings and the associated object
|
void |
deleteUnusedMainAction(String toolsCouplingCode,
Collection<RefInterventionAgrosystTravailEDI> originalMainsActions,
Collection<RefInterventionAgrosystTravailEDI> actualMainsActions)
delete related object to the actions that are no more used
|
InputStream |
exportDomainAsXlsStream(List<String> domainIds)
Export selected domains id as excel sheet.
|
Domain |
extendDomain(String domainTopiaId,
int extendCampaign)
Extend domain for specified campaign.
|
List<String> |
findDomainIdsForCodeAndCampaigns(String code,
Set<Integer> campaigns,
boolean includeCropsFromInactiveDomains)
return all domains TopiaId that match the domain code given as parameter for the given campaigns range.
|
RefStationMeteo |
findRefStationMeteoByTopiaId(String topiaId)
Find the
RefStationMeteo instance by a given TopiaEntity.getTopiaId(). |
Map<String,org.apache.commons.lang3.tuple.Pair<CroppingPlanEntry,Map<String,CroppingPlanSpecies>>> |
findSpeciesCodeByCropCodeForCampaigns(List<String> croppingPlanEntryCodes,
Set<Integer> campaignsSet) |
List<Domain> |
getActiveWritableDomainsForDecisionRuleCreation()
Do not use this method to get writable domains, this is only usable on DecisionRule creation !
See https://forge.codelutin.com/issues/4439#note-6
|
List<Domain> |
getAllDomains()
Find all domain.
|
List<RefLegalStatus> |
getAllRefLegalStatus()
Find all LegalStaus
|
List<String> |
getCroppingPlanCodeForDomainsAndCampaigns(String code,
Set<Integer> campaigns)
List of CroppingPlan's Codes for domains with code the given code and for given campaigns.
|
List<CroppingPlanEntryDto> |
getCroppingPlanDtos(String domainId)
Get the list of cropping plan (assolement) of the given domain containing only main
crops (not intermediate).
|
UsageList<CroppingPlanEntryDto> |
getCroppingPlanEntryDtoAndUsage(String domainId)
The CroppingPlanEntryDto UsageList from domain with id the given domainId.
|
List<String> |
getCroppingPlanSpeciesCodeForCropCodeAndCampaigns(String cropCode,
Set<Integer> campaigns) |
Map<String,Boolean> |
getCroppingPlanSpeciesUsage(String domainId)
All CroppingPlanSpecies Ids and there usage status
|
Domain |
getDomain(String domainId)
Find a specific domain from identifier.
|
DomainDto |
getDomainByCode(String domainCode)
Find random domain by code.
|
String |
getDomainCodeForGrowingSystem(String growingSystemId)
return the domain code associated to the growing system with topiaId the growingSystemId parameters.
|
List<Price> |
getDomainPrices(String domainTopiaId) |
List<DomainDto> |
getDomains(Collection<String> domainIds) |
double |
getDomainSAUArea(String domainId)
Get domain'plots total area.
|
long |
getDomainsCount(Boolean active)
Return the number of domains
|
List<Domain> |
getDomainWithName(String name) |
org.apache.commons.lang3.tuple.Pair<CroppingPlanEntry,Map<String,CroppingPlanSpecies>> |
getEntryAndSpeciesFromCode(String croppingPlanEntryCode,
Set<Integer> campaignsSet)
Charge les couples cultures/especes à partir du code de l'espèce et d'un Set de campagnes
|
List<Equipment> |
getEquipments(String domainId) |
ResultList<Domain> |
getFilteredDomains(DomainFilter filter)
Find domain matching user filter and navigation context.
|
ResultList<DomainDto> |
getFilteredDomainsDto(DomainFilter filter)
Find domain matching user filter and navigation context.
|
List<GeoPoint> |
getGeoPoints(String domainId)
return GeoPoint for domain with id the given domainId
Data are anonymize if user has no right to see them
|
List<Ground> |
getGrounds(String domainId) |
LinkedHashMap<Integer,String> |
getRelatedDomains(String domainCode)
Get domain related to current domain.
|
UsageList<ToolsCoupling> |
getToolsCouplingAndUsage(String domainId)
The tools coupling UsageList from domain with id the given domainId.
|
List<String> |
getToolsCouplingCodeForDomainsAndCampaigns(String code,
Set<Integer> campaigns)
list of ToolsCoupling's Codes for domains with code the given code and for given campaigns.
|
List<ToolsCoupling> |
getToolsCouplings(String domainId) |
List<ToolsCoupling> |
getToolsCouplingsForDomainCodeAndCampaigns(String code,
Set<Integer> campaigns)
List of ToolsCouplings for domains with code the given code and for given campaigns.
|
void |
importDomainForXlsStream(InputStream is)
Import domain from input stream
|
void |
importPZ0Domains(Map<Class,ImportResults> allResult)
Try to Import domains created from from PZ0 csv
|
Domain |
newDomain()
Create a new (empty) Domain entity.
|
GeoPoint |
newGpsData()
Create a new (empty) GPSData entity.
|
Equipment |
newMateriel()
Create new instance of domain materiel.
|
Ground |
newSol()
Create sol instance.
|
ToolsCoupling |
newToolsCoupling()
Create ToolsCoupling instance.
|
WeatherStation |
newWeatherStation()
Creates a new (empty)
WeatherStation. |
void |
unactivateDomains(List<String> domainIds,
boolean activate)
Unactivate or reactivate the given domains.
|
Domain |
validateAndCommit(String domainId)
Do validate the current domain state
|
static final String NEW_EQUIPMENT
Domain newDomain()
GeoPoint newGpsData()
WeatherStation newWeatherStation()
WeatherStation.
This returned instance is not persisted yet.
WeatherStation instanceDomain getDomain(String domainId)
domainId - domain idDomainDto getDomainByCode(String domainCode)
domainCode - domain codeDomain createOrUpdateDomain(Domain domain, String locationId, String legalStatusId, List<GeoPoint> gpsData, List<CroppingPlanEntryDto> croppingPlan, Integer otex18, Integer otex70, List<Ground> grounds, List<Equipment> equipments, List<ToolsCoupling> toolsCouplings, List<Price> prices)
domain - domainlocationId - RefLocation's topiaID associated to the domainlegalStatusId - RefLegalStatus topiaIdgpsData - Domain's geoPointscroppingPlan - Domain's cropsotex18 - otext 18 codeotex70 - otex 70 codegrounds - Domain's groundequipments - Domain"s EquipmenttoolsCouplings - Domain's tools couplingsprices - Domain's crop's and fuel pricesResultList<Domain> getFilteredDomains(DomainFilter filter)
filter - custom user filterResultList<DomainDto> getFilteredDomainsDto(DomainFilter filter)
filter - custom user filterList<DomainDto> getDomains(Collection<String> domainIds)
void unactivateDomains(List<String> domainIds, boolean activate)
domainIds - domains topiaId to unactivateList<RefLegalStatus> getAllRefLegalStatus()
RefStationMeteo findRefStationMeteoByTopiaId(String topiaId)
RefStationMeteo instance by a given TopiaEntity.getTopiaId().topiaId - RefStationMeteo ID (TopiaEntity.getTopiaId())RefStationMeteo instanceEquipment newMateriel()
Ground newSol()
Domain extendDomain(String domainTopiaId, int extendCampaign) throws DomainExtendException
domainTopiaId - domain to duplicateextendCampaign - extend domain campaignDomainExtendExceptionLinkedHashMap<Integer,String> getRelatedDomains(String domainCode)
domainCode - the code identifying the domainToolsCoupling newToolsCoupling()
List<GeoPoint> getGeoPoints(String domainId)
domainId - domain'idList<Equipment> getEquipments(String domainId)
domainId - domain'idList<Ground> getGrounds(String domainId)
domainId - domain'idList<ToolsCoupling> getToolsCouplings(String domainId)
domainId - domain'idUsageList<ToolsCoupling> getToolsCouplingAndUsage(String domainId)
domainId - domain'idUsageList<CroppingPlanEntryDto> getCroppingPlanEntryDtoAndUsage(String domainId)
domainId - domain'idList<String> getCroppingPlanCodeForDomainsAndCampaigns(String code, Set<Integer> campaigns)
code - domain's codecampaigns - required campaigns for domain, can not be null or emptyList<String> getCroppingPlanSpeciesCodeForCropCodeAndCampaigns(String cropCode, Set<Integer> campaigns)
List<String> getToolsCouplingCodeForDomainsAndCampaigns(String code, Set<Integer> campaigns)
code - domain's codecampaigns - required campaigns for domain, can not be null or emptyList<ToolsCoupling> getToolsCouplingsForDomainCodeAndCampaigns(String code, Set<Integer> campaigns)
code - domain's codecampaigns - required campaigns for domain, can not be null or emptyList<CroppingPlanEntryDto> getCroppingPlanDtos(String domainId)
domainId - domain's idMap<String,Boolean> getCroppingPlanSpeciesUsage(String domainId)
domainId - domain's idorg.apache.commons.lang3.tuple.Pair<CroppingPlanEntry,Map<String,CroppingPlanSpecies>> getEntryAndSpeciesFromCode(String croppingPlanEntryCode, Set<Integer> campaignsSet)
croppingPlanEntryCode - code de la culturecampaignsSet - liste des campagnesInputStream exportDomainAsXlsStream(List<String> domainIds)
void importDomainForXlsStream(InputStream is)
is - domains as InputStreamboolean checkDomainExistence(String domainName)
domainName - domain name to checktrue if a domain already exists with that namelong getDomainsCount(Boolean active)
active - optional active filter (may be null)List<Price> getDomainPrices(String domainTopiaId)
domainTopiaId - the domain's topiaId, can be null, if null an empty list is returned.void deleteToolsCouplings(Collection<ToolsCoupling> toolsCouplings)
toolsCouplings - void deleteUnusedMainAction(String toolsCouplingCode, Collection<RefInterventionAgrosystTravailEDI> originalMainsActions, Collection<RefInterventionAgrosystTravailEDI> actualMainsActions)
toolsCouplingCode - tools coupling codeoriginalMainsActions - collection of previous mains actionsactualMainsActions - collection of actuel mains actionsDomain validateAndCommit(String domainId)
domainId - the identifier of the domain to validateMap<String,org.apache.commons.lang3.tuple.Pair<CroppingPlanEntry,Map<String,CroppingPlanSpecies>>> findSpeciesCodeByCropCodeForCampaigns(List<String> croppingPlanEntryCodes, Set<Integer> campaignsSet)
String getDomainCodeForGrowingSystem(String growingSystemId)
growingSystemId - The id of the growing systemList<Domain> getActiveWritableDomainsForDecisionRuleCreation()
List<String> findDomainIdsForCodeAndCampaigns(String code, Set<Integer> campaigns, boolean includeCropsFromInactiveDomains)
code - the domains codecampaigns - the required campaignsList<String> copyTools(String fromDomain, List<String> toDomains, Boolean includeToolCouplings, List<Equipment> equipmentsToCopy, List<ToolsCoupling> toolsCouplingsToCopy)
fromDomain - source domain IdtoDomains - target domains IdsincludeToolCouplings - true if tools coupling have to be includeequipmentsToCopy - list of source domain equipmentstoolsCouplingsToCopy - list of tools couplingsdouble getDomainSAUArea(String domainId)
domainId - domain idvoid importPZ0Domains(Map<Class,ImportResults> allResult)
allResult - All domains and there dependencies required to save it.Copyright © 2013–2015 Inra. All rights reserved.