Rename soy templates to use consistent naming scheme

We use {EPP resource}{action} as the naming scheme everywhere else, so we shoudl do so here too.  It's generally nicer for files to group by type of EPP resource (so all of the domain actions are together) than by type of action.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130955192
This commit is contained in:
mcilwain 2016-08-22 10:42:46 -07:00 committed by Ben McIlwain
parent 1482e413e0
commit dd09dc1837
4 changed files with 11 additions and 12 deletions

View file

@ -22,13 +22,14 @@ import com.beust.jcommander.Parameters;
import com.google.template.soy.data.SoyMapData; import com.google.template.soy.data.SoyMapData;
import google.registry.tools.Command.GtechCommand; import google.registry.tools.Command.GtechCommand;
import google.registry.tools.params.PhoneNumberParameter; import google.registry.tools.params.PhoneNumberParameter;
import google.registry.tools.soy.CreateContactSoyInfo; import google.registry.tools.soy.ContactCreateSoyInfo;
import java.util.List; import java.util.List;
import javax.inject.Inject; import javax.inject.Inject;
/** A command to create a new contact via EPP. */ /** A command to create a new contact via EPP. */
@Parameters(separators = " =", commandDescription = "Create a new contact via EPP.") @Parameters(separators = " =", commandDescription = "Create a new contact via EPP.")
final class CreateContactCommand extends MutatingEppToolCommand implements GtechCommand { final class CreateContactCommand extends MutatingEppToolCommand implements GtechCommand {
// TODO(b/19016175): Expand to allow full suite of contact flows. // TODO(b/19016175): Expand to allow full suite of contact flows.
@Parameter( @Parameter(
names = {"-c", "--client"}, names = {"-c", "--client"},
@ -111,12 +112,10 @@ final class CreateContactCommand extends MutatingEppToolCommand implements Gtech
if (isNullOrEmpty(password)) { if (isNullOrEmpty(password)) {
password = passwordGenerator.createPassword(PASSWORD_LENGTH); password = passwordGenerator.createPassword(PASSWORD_LENGTH);
} }
checkArgument(street == null || street.size() <= 3, checkArgument(street == null || street.size() <= 3,
"Addresses must contain at most 3 street lines."); "Addresses must contain at most 3 street lines.");
setSoyTemplate(CreateContactSoyInfo.getInstance(), setSoyTemplate(ContactCreateSoyInfo.getInstance(), ContactCreateSoyInfo.CONTACTCREATE);
CreateContactSoyInfo.CREATECONTACT);
addSoyRecord(clientIdentifier, new SoyMapData( addSoyRecord(clientIdentifier, new SoyMapData(
"id", id, "id", id,
"name", name, "name", name,

View file

@ -21,14 +21,16 @@ import com.beust.jcommander.Parameter;
import com.beust.jcommander.Parameters; import com.beust.jcommander.Parameters;
import com.google.template.soy.data.SoyMapData; import com.google.template.soy.data.SoyMapData;
import google.registry.tools.Command.GtechCommand; import google.registry.tools.Command.GtechCommand;
import google.registry.tools.soy.CreateDomainSoyInfo; import google.registry.tools.soy.DomainCreateSoyInfo;
import java.util.List; import java.util.List;
import javax.inject.Inject; import javax.inject.Inject;
/** A command to create a new domain via EPP. */ /** A command to create a new domain via EPP. */
@Parameters(separators = " =", commandDescription = "Create a new domain via EPP.") @Parameters(separators = " =", commandDescription = "Create a new domain via EPP.")
final class CreateDomainCommand extends MutatingEppToolCommand implements GtechCommand { final class CreateDomainCommand extends MutatingEppToolCommand implements GtechCommand {
@Parameter(names = {"-c", "--client"},
@Parameter(
names = {"-c", "--client"},
description = "Client identifier of the registrar to execute the command as", description = "Client identifier of the registrar to execute the command as",
required = true) required = true)
String clientIdentifier; String clientIdentifier;
@ -83,10 +85,9 @@ final class CreateDomainCommand extends MutatingEppToolCommand implements GtechC
if (isNullOrEmpty(password)) { if (isNullOrEmpty(password)) {
password = passwordGenerator.createPassword(PASSWORD_LENGTH); password = passwordGenerator.createPassword(PASSWORD_LENGTH);
} }
checkArgument(ns == null || ns.size() <= 13, "There can be at most 13 nameservers."); checkArgument(ns == null || ns.size() <= 13, "There can be at most 13 nameservers.");
setSoyTemplate(CreateDomainSoyInfo.getInstance(), CreateDomainSoyInfo.CREATEDOMAIN); setSoyTemplate(DomainCreateSoyInfo.getInstance(), DomainCreateSoyInfo.DOMAINCREATE);
addSoyRecord(clientIdentifier, new SoyMapData( addSoyRecord(clientIdentifier, new SoyMapData(
"domain", domain, "domain", domain,
"period", period == null ? null : period.toString(), "period", period == null ? null : period.toString(),

View file

@ -16,7 +16,7 @@
/** /**
* Create contact * Create contact
*/ */
{template .createcontact} {template .contactcreate}
{@param? id: string} {@param? id: string}
{@param? name: string} {@param? name: string}
{@param? org: string} {@param? org: string}

View file

@ -16,7 +16,7 @@
/** /**
* Create domain * Create domain
*/ */
{template .createdomain} {template .domaincreate}
{@param domain: string} {@param domain: string}
{@param? period: string} {@param? period: string}
{@param? ns: list<string>} {@param? ns: list<string>}
@ -53,4 +53,3 @@
</command> </command>
</epp> </epp>
{/template} {/template}