Class AbstractPhpBuilder<F extends AbstractPhpFormat>
- java.lang.Object
-
- com.openindex.openestate.tool.agency.export.AbstractPhpBuilder<F>
-
- Direct Known Subclasses:
WebsitePhp1Builder
,WebsitePhp2Builder
public abstract class AbstractPhpBuilder<F extends AbstractPhpFormat> extends Object
AbstractPhpBuilder.- Author:
- Andreas Rudolph
-
-
Field Summary
Fields Modifier and Type Field Description static String
HTACCESS
static String
INDEX_HTML
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractPhpBuilder(F format, String encoding, String packagePath)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected String
buildLanguagePhp()
language.php erzeugen.protected void
buildObjectPdf(AbstractExpose exposeBuilder, ExportEntry entry, String estateKey, File estateDir, Connection c)
PDF-Exposé einer Immobilie erzeugen.protected void
buildObjectPdf(AbstractExpose exposeBuilder, ExportEntry entry, String estateKey, File estateDir, Locale lang, Connection c)
PDF-Exposé einer Immobilie erzeugen.protected String
buildObjectPhp(EstateImpl estate, String estateKey, DbAgencyObject.Status status, AgentImpl agent, AgentContactImpl contact, Date createdAt, Date modifiedAt)
object.php erzeugen.protected String
buildObjectTextsPhp(EstateImpl estate, String estateKey)
texts.php erzeugen.protected String
buildTermsPhp(AgentImpl agent)
terms.php erzeugen.protected String
buildTranslationPhp(Locale l)
i18n.php erzeugen.protected void
extractScripts(File directory)
F
getFormat()
protected void
initLanguagePhpValues(Map<String,String> values)
protected void
initObjectPhpValues(Map<String,String> values, EstateImpl estate, String estateKey, DbAgencyObject.Status status, AgentImpl agent, AgentContactImpl contact, Date createdAt, Date modifiedAt)
protected void
initObjectTextsPhpValues(Map<String,String> values, EstateImpl estate, String estateKey)
protected void
initTermsPhpValues(Map<String,String> values, AgentImpl agent)
protected void
initTranslationPhpValues(Map<String,String> values, Locale l)
protected AgentContactImpl
lookupContact(String contactId, TransferAgencyImpl agency)
protected EstateImpl
lookupEstate(String key, TransferAgencyImpl agency)
protected String
readResource(String name)
protected String
readResource(String name, Map<String,String> values)
protected String
replaceVariable(String php, String varName, Object varValue)
protected void
saveResource(String name, File f)
Hilfsfunktion zum Speichern einer Ressource aus dem PHP-Classpath in eine Datei.protected void
saveText(String txt, File f)
Hilfsfunktion zum Speichern eines Textes in eine Datei.abstract void
write(TransferImpl transfer, ExportContext context, DbAgencyExpose expose)
protected String
writeAddress(AddressImpl address, Locale[] languages, int indent)
Adresse als PHP-Array schreiben.protected String
writeArrayLine(String key, Boolean value, int indent)
Key-/Value-Paar in ein PHP-Array schreiben.protected String
writeArrayLine(String key, Enum[] options, int indent)
Key-/Value-Paar in ein PHP-Array schreiben.protected String
writeArrayLine(String key, Number value, int indent)
Key-/Value-Paar in ein PHP-Array schreiben.protected String
writeArrayLine(String key, String[] value, int indent)
Key-/Value-Paar in ein PHP-Array schreiben.protected String
writeArrayLine(String key, String value, int indent)
Key-/Value-Paar in ein PHP-Array schreiben.protected String
writeArrayLine(String key, Date value, int indent)
Key-/Value-Paar in ein PHP-Array schreiben.protected String
writeArrayNode(String node, int indent)
PHP-Array innerhalb eines PHP-Arrays darstellen.protected String
writeArrayNode(String key, String node, int indent)
PHP-Array innerhalb eines PHP-Arrays darstellen.protected void
writeHtaccess(File folder)
protected void
writeIndexHtml(File folder)
-
-
-
Field Detail
-
INDEX_HTML
public static final String INDEX_HTML
- See Also:
- Constant Field Values
-
HTACCESS
public static final String HTACCESS
- See Also:
- Constant Field Values
-
-
Method Detail
-
buildLanguagePhp
protected String buildLanguagePhp() throws IOException
language.php erzeugen.- Throws:
IOException
-
buildObjectPdf
protected void buildObjectPdf(AbstractExpose exposeBuilder, ExportEntry entry, String estateKey, File estateDir, Connection c) throws IOException, com.lowagie.text.DocumentException, SQLException
PDF-Exposé einer Immobilie erzeugen.- Throws:
IOException
com.lowagie.text.DocumentException
SQLException
-
buildObjectPdf
protected void buildObjectPdf(AbstractExpose exposeBuilder, ExportEntry entry, String estateKey, File estateDir, Locale lang, Connection c) throws IOException, com.lowagie.text.DocumentException, SQLException
PDF-Exposé einer Immobilie erzeugen.- Throws:
IOException
com.lowagie.text.DocumentException
SQLException
-
buildObjectPhp
protected String buildObjectPhp(EstateImpl estate, String estateKey, DbAgencyObject.Status status, AgentImpl agent, AgentContactImpl contact, Date createdAt, Date modifiedAt) throws IOException
object.php erzeugen.- Throws:
IOException
-
buildObjectTextsPhp
protected String buildObjectTextsPhp(EstateImpl estate, String estateKey) throws IOException
texts.php erzeugen.- Throws:
IOException
-
buildTermsPhp
protected String buildTermsPhp(AgentImpl agent) throws IOException
terms.php erzeugen.- Throws:
IOException
-
buildTranslationPhp
protected String buildTranslationPhp(Locale l) throws IOException
i18n.php erzeugen.- Throws:
IOException
-
extractScripts
protected void extractScripts(File directory) throws IOException
- Throws:
IOException
-
getFormat
public final F getFormat()
-
initObjectPhpValues
protected void initObjectPhpValues(Map<String,String> values, EstateImpl estate, String estateKey, DbAgencyObject.Status status, AgentImpl agent, AgentContactImpl contact, Date createdAt, Date modifiedAt)
-
initObjectTextsPhpValues
protected void initObjectTextsPhpValues(Map<String,String> values, EstateImpl estate, String estateKey)
-
initTranslationPhpValues
protected void initTranslationPhpValues(Map<String,String> values, Locale l)
-
lookupContact
protected AgentContactImpl lookupContact(String contactId, TransferAgencyImpl agency)
-
lookupEstate
protected EstateImpl lookupEstate(String key, TransferAgencyImpl agency)
-
readResource
protected String readResource(String name) throws IOException
- Throws:
IOException
-
readResource
protected String readResource(String name, Map<String,String> values) throws IOException
- Throws:
IOException
-
saveResource
protected void saveResource(String name, File f) throws IOException
Hilfsfunktion zum Speichern einer Ressource aus dem PHP-Classpath in eine Datei.- Parameters:
name
- Name der Ressourcef
- Zieldatei- Throws:
IOException
- IO-Fehler
-
saveText
protected void saveText(String txt, File f) throws IOException
Hilfsfunktion zum Speichern eines Textes in eine Datei.- Parameters:
txt
- Textf
- Zieldatei- Throws:
IOException
- IO-Fehler
-
write
public abstract void write(TransferImpl transfer, ExportContext context, DbAgencyExpose expose) throws IOException, SQLException
- Throws:
IOException
SQLException
-
writeAddress
protected String writeAddress(AddressImpl address, Locale[] languages, int indent)
Adresse als PHP-Array schreiben.- Parameters:
address
- Adresseindent
- Einrückung- Returns:
- PHP-Code
-
writeArrayLine
protected String writeArrayLine(String key, String value, int indent)
Key-/Value-Paar in ein PHP-Array schreiben.- Parameters:
key
- Keyvalue
- Valueindent
- Einrückung- Returns:
- PHP-Code
-
writeArrayLine
protected String writeArrayLine(String key, Enum[] options, int indent)
Key-/Value-Paar in ein PHP-Array schreiben.- Parameters:
key
- Keyoptions
- Valueindent
- Einrückung- Returns:
- PHP-Code
-
writeArrayLine
protected String writeArrayLine(String key, String[] value, int indent)
Key-/Value-Paar in ein PHP-Array schreiben.- Parameters:
key
- Keyvalue
- Valueindent
- Einrückung- Returns:
- PHP-Code
-
writeArrayLine
protected String writeArrayLine(String key, Date value, int indent)
Key-/Value-Paar in ein PHP-Array schreiben.- Parameters:
key
- Keyvalue
- Valueindent
- Einrückung- Returns:
- PHP-Code
-
writeArrayLine
protected String writeArrayLine(String key, Number value, int indent)
Key-/Value-Paar in ein PHP-Array schreiben.- Parameters:
key
- Keyvalue
- Valueindent
- Einrückung- Returns:
- PHP-Code
-
writeArrayLine
protected String writeArrayLine(String key, Boolean value, int indent)
Key-/Value-Paar in ein PHP-Array schreiben.- Parameters:
key
- Keyvalue
- Valueindent
- Einrückung- Returns:
- PHP-Code
-
writeArrayNode
protected String writeArrayNode(String node, int indent)
PHP-Array innerhalb eines PHP-Arrays darstellen.- Parameters:
node
- PHP-Code des eingebundenen Arraysindent
- Einrückung- Returns:
- PHP-Code
-
writeArrayNode
protected String writeArrayNode(String key, String node, int indent)
PHP-Array innerhalb eines PHP-Arrays darstellen.- Parameters:
key
- Keynode
- PHP-Code des eingebundenen Arraysindent
- Einrückung- Returns:
- PHP-Code
-
writeHtaccess
protected void writeHtaccess(File folder) throws IOException
- Throws:
IOException
-
writeIndexHtml
protected void writeIndexHtml(File folder) throws IOException
- Throws:
IOException
-
-