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 StringHTACCESSstatic StringINDEX_HTML
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractPhpBuilder(F format, String encoding, String packagePath)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected StringbuildLanguagePhp()language.php erzeugen.protected voidbuildObjectPdf(AbstractExpose exposeBuilder, ExportEntry entry, String estateKey, File estateDir, Connection c)PDF-Exposé einer Immobilie erzeugen.protected voidbuildObjectPdf(AbstractExpose exposeBuilder, ExportEntry entry, String estateKey, File estateDir, Locale lang, Connection c)PDF-Exposé einer Immobilie erzeugen.protected StringbuildObjectPhp(EstateImpl estate, String estateKey, DbAgencyObject.Status status, AgentImpl agent, AgentContactImpl contact, Date createdAt, Date modifiedAt)object.php erzeugen.protected StringbuildObjectTextsPhp(EstateImpl estate, String estateKey)texts.php erzeugen.protected StringbuildTermsPhp(AgentImpl agent)terms.php erzeugen.protected StringbuildTranslationPhp(Locale l)i18n.php erzeugen.protected voidextractScripts(File directory)FgetFormat()protected voidinitLanguagePhpValues(Map<String,String> values)protected voidinitObjectPhpValues(Map<String,String> values, EstateImpl estate, String estateKey, DbAgencyObject.Status status, AgentImpl agent, AgentContactImpl contact, Date createdAt, Date modifiedAt)protected voidinitObjectTextsPhpValues(Map<String,String> values, EstateImpl estate, String estateKey)protected voidinitTermsPhpValues(Map<String,String> values, AgentImpl agent)protected voidinitTranslationPhpValues(Map<String,String> values, Locale l)protected AgentContactImpllookupContact(String contactId, TransferAgencyImpl agency)protected EstateImpllookupEstate(String key, TransferAgencyImpl agency)protected StringreadResource(String name)protected StringreadResource(String name, Map<String,String> values)protected StringreplaceVariable(String php, String varName, Object varValue)protected voidsaveResource(String name, File f)Hilfsfunktion zum Speichern einer Ressource aus dem PHP-Classpath in eine Datei.protected voidsaveText(String txt, File f)Hilfsfunktion zum Speichern eines Textes in eine Datei.abstract voidwrite(TransferImpl transfer, ExportContext context, DbAgencyExpose expose)protected StringwriteAddress(AddressImpl address, Locale[] languages, int indent)Adresse als PHP-Array schreiben.protected StringwriteArrayLine(String key, Boolean value, int indent)Key-/Value-Paar in ein PHP-Array schreiben.protected StringwriteArrayLine(String key, Enum[] options, int indent)Key-/Value-Paar in ein PHP-Array schreiben.protected StringwriteArrayLine(String key, Number value, int indent)Key-/Value-Paar in ein PHP-Array schreiben.protected StringwriteArrayLine(String key, String[] value, int indent)Key-/Value-Paar in ein PHP-Array schreiben.protected StringwriteArrayLine(String key, String value, int indent)Key-/Value-Paar in ein PHP-Array schreiben.protected StringwriteArrayLine(String key, Date value, int indent)Key-/Value-Paar in ein PHP-Array schreiben.protected StringwriteArrayNode(String node, int indent)PHP-Array innerhalb eines PHP-Arrays darstellen.protected StringwriteArrayNode(String key, String node, int indent)PHP-Array innerhalb eines PHP-Arrays darstellen.protected voidwriteHtaccess(File folder)protected voidwriteIndexHtml(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:
IOExceptioncom.lowagie.text.DocumentExceptionSQLException
-
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:
IOExceptioncom.lowagie.text.DocumentExceptionSQLException
-
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:
IOExceptionSQLException
-
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
-
-