Este programa se denomina Antonio.Salmeron pues es el constructor
del sitio web AntonioSalmeron.com.
La construcción del sitio web se realiza a partir de contenidos en formato
de posts albergados en unos ficheros que se denominan agendas.
Cada agenda contiene un conjunto de post, agrupados generalmente por temas.
Estos ficheros de agendas se almacenan en un directorio que puede
considerarse un banco de contenidos.
Los post pueden pertenecer a múltiples clases,
unas clases definidas en los posts y otras calculadas, como por ejemplo,
las clase de los periodos de publicación de cada post.
Este programa crea páginas Html de posts y de conjuntos de post por cada
clase, a estas clases también se las denomina categorías.
El programa esta basado en un macro-expansor a doble nivel de Tol en Html,
donde las semillas de Html contienen Tol embebido y los post para publicar
también pueden contener Tol embebido, por lo que:
a) dentro de la primera expansion, la de las semillas,
b) se pueden realizar otras expansiones, que son las del lenguaje Tol
contenido en los post.
Hay 2 tipos de semillas para este sitio web:
a) una para las páginas web del sitio AntonioSalmeron.com y
b) otra para la elaboración de los curriculum viatae que es la misma para
el curriculum en inglés y el curriculum en español.
Este programa emplea un directorio de agenda de posts, dentro de este
directorio los posts se estructuran en varios ficheros que permiten
organizarlos por su tipo de contenido y dentro de cada fichero por su fecha
de publicación, los más recientes al principio.
Con parte de los contenidos de los post este programa crea 4 documentos,
2 en español y 2 en ingles, en Html y en formato Pdf que son un curriculun
vitae.
A diferencia de otros sitios web construidos por Tol, en el sitio web
AntonioSalmeron.com todos los post tienen el mismo nivel de importancia.
Con este programa:
a) las páginas de artículos se generan con la opción art,
b) las páginas con los artículos agrupados por categorías con la opción
cat,
c) las páginas Html por defecto del sitio (index.html) y de cada
directorio, la página absoluta y la de control de errores con la
opción rot,
d) el mapa del sitio web en Xml con la opción xsm, que son las siglas de
Xml site map y
e) las opciones ftp, fup y snd permiten poner el contenido en online.
Los comentarios del código de este programa están realizados utilizando
unas veces el español, sin acentos, y otras veces el inglés.
Este programa sólo escribe los ficheros de páginas Html que son diferentes
a los ya creados en ejecuciones anteriores de forma que no haya que enviar
todo el conjunto de páginas sino las de modificadas de fecha más reciente
que el último log de envío. Este control lo realiza la opcion fup, de
ftp update, frente a la opción ftp que generar ficheros de mandatos de
envío con todo el contenido del web. Nótese que las opciones fup y ftp solo
generan ficheros de mandatos ftp de envío y luego se pueden ejecutar con
la opcion snd.
Antonio.Salmeron construye las páginas y documentos del sitio web antoniosalmeron.con
Inclusiones
Set allIncConstantes
Text makSepText CtrAgeText CtrFilReal CtrRecReal CtrTitReal CtrDesSet CatEspSet CatGenSet CatCurSet CatTemSet CatMisSet CatAreSet CatSecSet CatTopSet CatForSet CatExpSet CatEmpSet CatConSet CatComSet CatAllProceso
Text ctrExeReal makHlpLee la agenda
Set CtrPdbGenera el contenido
//////////////////////////////////////////////////////////////////////////////
Set allInc = Include("tol/inc.tol");
//////////////////////////////////////////////////////////////////////////////
PutDescription("Inclusion de las funciones comunes y de aplicacion.", allInc);
//////////////////////////////////////////////////////////////////////////////
Struct PdbSt // Posts database
{
Set pstCla, // Conjunto de tipos de post
Text pstNam, // Identificador del post, si no se usa se pone Pst+fecha
Text pstTit, // Titulo del post
Date pstDte, // Fecha de ocurrencia
Date pstUpd, // Fecha de actualizacion
Text pstTxt, // Texto del post es html
Text pstLnk // Enlaces del post es html
};
//////////////////////////////////////////////////////////////////////////////
Text makSep = "\n"+Repeat("_", 72)+"\n";
//////////////////////////////////////////////////////////////////////////////
PutDescription("Linea horizontal para separar fases de operacion.",makSep);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Text CtrAge = "agenda";
//////////////////////////////////////////////////////////////////////////////
PutDescription("All text files inside this directory.",CtrAge);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Text CtrFil = "poststat.csv";
//////////////////////////////////////////////////////////////////////////////
PutDescription("Estadísticas de posts por clases.",CtrFil);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Real CtrRec = 15;
//////////////////////////////////////////////////////////////////////////////
PutDescription("Number of posts per recent page.",CtrRec);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Real CtrTit = 4;
//////////////////////////////////////////////////////////////////////////////
PutDescription("Number of posts per title.",CtrTit);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Real CtrDes = 8;
//////////////////////////////////////////////////////////////////////////////
PutDescription("Number of posts per description.",CtrDes);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Set CatEsp = [["Reciente",
"Completo"]];
//////////////////////////////////////////////////////////////////////////////
PutDescription("Categorias especiales.",CatEsp);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Set CatGen = [["Pintura y poesía",
"Negocios",
"Tecnología"]]; //
//////////////////////////////////////////////////////////////////////////////
PutDescription("Categorias generales.",CatGen);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Set CatCur = [["Formación";
"Experiencia";
"Contribución";
"Información complementaria"]];
//////////////////////////////////////////////////////////////////////////////
PutDescription("Categorias curriculares.",CatCur);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Set CatTem = [["2015-2019",
"2010-2014",
"2005-2009",
"2000-2004",
"1995-1999",
"1990-1994",
"1983-1989"]];
//////////////////////////////////////////////////////////////////////////////
PutDescription("Categorias temporales.",CatTem);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Set CatMis = [["Código";
"Educación básica",
"Web, post y vídeo"]];
//////////////////////////////////////////////////////////////////////////////
PutDescription("Categorias miscelaneas.",CatMis);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Set CatAre = [["Dirección y estrategia",
"Economía y financiera",
"Marketing y comercial",
"Operaciones y logística",
"Personal y formación"]];
//////////////////////////////////////////////////////////////////////////////
PutDescription("Categorias de areas de aplicacion: funciones.",CatAre);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Set CatSec = [["Banca y seguros",
"Industria y energía",
"Inmobiliario y edificación",
"Legal y función pública",
"Logística y transporte",
"Prensa, editorial y medios"]];
//////////////////////////////////////////////////////////////////////////////
PutDescription("Categorias de sectores de actividad.",CatSec);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Set CatTop = CatEsp <<
CatGen <<
CatCur <<
CatTem <<
CatMis <<
CatAre <<
CatSec;
//////////////////////////////////////////////////////////////////////////////
PutDescription("Categorias principales, top.",CatTop);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Set CatFor = [["Titulación",
"Curso recibido"]];
//////////////////////////////////////////////////////////////////////////////
PutDescription("Categorias dentro de la formacion.",CatFor);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Set CatExp = [["Profesional",
"Empresarial",
"Directiva",
"Inicial"]];
//////////////////////////////////////////////////////////////////////////////
PutDescription("Categorias de la experiencia.",CatExp);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Set CatEmp = [["ASolver",
"Bayes",
"EQ"]];
//////////////////////////////////////////////////////////////////////////////
PutDescription("Categorias de experiencia pero con empresa concreta.",CatEmp);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Set CatCon = [["Publicación",
"Curso impartido",
"Ponencia",
"Registro",
"Referencia"]];
//////////////////////////////////////////////////////////////////////////////
PutDescription("Categorias de contribución.",CatCon);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Set CatCom = [["Dato de interés",
"Interés personal"]];
//////////////////////////////////////////////////////////////////////////////
PutDescription("Categorias de información complementaria.",CatCom);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Set CatAll = CatTop <<
CatFor <<
CatExp <<
CatEmp <<
CatCon <<
CatCom;
//////////////////////////////////////////////////////////////////////////////
PutDescription("Todas las categorias.",CatAll);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Text ctrExe = If(Not(ObjectExist("Text","ctrBat")), "hlp",
If(ctrBat=="", "hlp",
ToLower(ctrBat)));
//////////////////////////////////////////////////////////////////////////////
PutDescription("Argumento validado para la ejecucion del make.", ctrExe);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Real makHlp = If(ctrExe!="hlp", FALSE,
{
Text WriteLn(
makSep+"help:
Usage: make [OPTION]
Builds antoniosalmeron.com site
OPTION
cat: build all category pages
art: build all articles pages
rot: build root absolute page
cvs: build cv pages: english, spanish and theirs Pdf files
xsm: build xml site maps
ftp: build ftp files (go to ftp dir and run manually)
fup: build a file update protocol (newer than ftp.log file)
snd: send file via ftp
___
web: build local web: cat, art, rot, cvs, xms
all: do all works: cat, art, rot, cvs, xms, fup y snd
hlp: show this help");
TRUE
});
//////////////////////////////////////////////////////////////////////////////
PutDescription("Es cierto si se ha visualizado la ayuda.", makHlp);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Set CtrPdb = If(ctrExe <: [["all", "web", "cat", "art", "cvs"]],
PdbRead(CtrAge),
Empty);
//////////////////////////////////////////////////////////////////////////////
PutDescription("Read all posts.", CtrPdb);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Real makCat = If(Or(ctrExe=="all", ctrExe=="web", ctrExe=="cat"),
{
Text WriteLn(makSep+"building all category pages...");
Text WriteFile(CtrFil, "Posts; Class\n");
Real CtrArt = FALSE; // Categories, not articles
// Make category pages
Set cicCat = EvalSet(CatAll, Real(Text CtrPag)
{
Text filNam = PhtFileName(CtrPag); // Output file
Text WriteLn("["+CtrPag+"|"+filNam+"]");
Set SelPdb = // Selected post from database for this page
{
Set selSet =
If(CtrPag=="Completo",
CtrPdb,
If(CtrPag=="Reciente",
PdbFirstN(CtrPdb, CtrRec, Real(Set pdbObj) { TRUE }),
Select(CtrPdb, Real(Set pdbObj) { CtrPag <: pdbObj->pstCla })));
Real selCrd = Card(selSet);
Text txtCrd = FormatReal(selCrd,"%.0lf");
Text WriteLn(" "+txtCrd+" posts selected");
Text AppendFile(CtrFil, txtCrd+"; "+CtrPag+"\n");
// If none then the most recent
If(selCrd, selSet, PdbFirstN(CtrPdb, CtrRec, Real(Set pdbObj) { TRUE }))
};
TmeFile("web/seed/seed.htm", "web/"+filNam)
});
Card(cicCat)
},FALSE);
//////////////////////////////////////////////////////////////////////////////
PutDescription("build all category pages.",makCat);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Real makArt = If(Or(ctrExe=="all", ctrExe=="web", ctrExe=="art"),
{
Text WriteLn(makSep+"building all article pages...");
Real CtrArt = TRUE; // Articles
// Make article pages
Set cicArt = For(1, Card(CtrPdb), Real(Real pstNum)
{
Set SelPdb = SetSubCicle(CtrPdb, pstNum, CtrRec);
Text CtrPag = TxtOutside2Tag(CtrPdb[pstNum]->pstTit,"<",">");
Text filNam = PhtFileName(CtrPag); // Output file
Text WriteLn("["+CtrPag+"|"+filNam+"]");
TmeFile("web/seed/seed.htm", "web/"+filNam)
});
Card(cicArt)
},FALSE);
//////////////////////////////////////////////////////////////////////////////
PutDescription("Build all articles pages.", makArt);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Real makRot = If(Or(ctrExe=="all", ctrExe=="web", ctrExe=="rot"),
{
Text WriteLn(makSep+"building root absolute page...");
Text WriteLn("-> homepage index.html");
Text inxHtm = ReadFile("web/categorias/index.html");
Text inxRot = Replace(inxHtm,"\"../", "\"");
Text WriteFile("web/index.html", inxRot);
Text WriteLn("-> absolute index");
Text absSav = Replace(inxHtm, " href=\"http",
" _XX_=\"_XX_"); // Save external references
Text absRep = ReplaceTable(absSav,
[[
[[ " src=\"../", " src=\"http://www.antoniosalmeron.com/"]],
[[" href=\"../", " href=\"http://www.antoniosalmeron.com/"]]
]],1);
Text absRec = Replace(absRep, " _XX_=\"_XX_",
" href=\"http"); // Recall external references
Real FilWriteIfDiff("web/absoluto.html", absRec);
Text WriteLn("-> common directory page, utf-8");
FilCopy("../common/dir.html", "web/categorias/comxidir.html", TRUE)
},FALSE);
//////////////////////////////////////////////////////////////////////////////
PutDescription("Build root absolute page.", makRot);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Real makCvs = If(Or(ctrExe=="all", ctrExe=="web", ctrExe=="cvs"),
{
Text e2(Text eng, Text spa) { If(CtrEng, eng, spa) };
Text tx(Real int) { FormatReal(int, "%.0lf") };
Text inSet(Text claTxt, Real newOld) // Si True new->old, si false old->new
{
Text iniTag = "<li class=\"" + If(CtrEng, "eng", "spa") + "\">";
Text endTag = "</li>";
Set selSet = Select(CtrPdb, Real(Set objPst) { claTxt<:objPst->pstCla });
Set ordSet = If(newOld, selSet, SetReverse(selSet));
Set txtSet = EvalSet(ordSet, Text(Set objPst)
{
Text txtCit = TxtBetween2Tag(objPst->pstTxt, iniTag, endTag, TRUE);
If(txtCit == "", "", " <li>\n "+txtCit+"\n </li>\n")
});
"\n"+SetSum(txtSet)+"\n"
};
Text liSet(Text claTxt) { inSet(claTxt, TRUE) };
Text liRev(Text claTxt) { inSet(claTxt, FALSE) };
Text WriteLn(makSep+"building Cv html and pdf pages...");
Text sedPth = "web/seed/seed.cv.htm";
Real engBld =
{
Real CtrEng = TRUE;
Text htmPth = "web/curriculum/antoniosalmeroncveng.html";
Text pdfPth = Replace(htmPth, ".html", ".pdf");
Real htmBld = TmeFile(sedPth, htmPth);
Real pdfBld = PdfBuild(htmPth, pdfPth);
htmBld + pdfBld
};
Real spaBld =
{
Real CtrEng = FALSE;
Text htmPth = "web/curriculum/antoniosalmeroncvspa.html";
Text pdfPth = Replace(htmPth, ".html", ".pdf");
Real htmBld = TmeFile(sedPth, htmPth);
Real pdfBld = PdfBuild(htmPth, pdfPth);
htmBld + pdfBld
};
engBld + spaBld
},FALSE);
//////////////////////////////////////////////////////////////////////////////
PutDescription("Build Cv html and pdf pages.",makCvs);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Real makXsm = If(Or(ctrExe=="all", ctrExe=="web", ctrExe=="xsm"),
{
Text WriteLn(makSep+"building xml site map...");
XsmDir("web/sitemap.xml", "web", "http://www.antoniosalmeron.com/")
},FALSE);
//////////////////////////////////////////////////////////////////////////////
PutDescription("Build Xml site map.", makXsm);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Real makFtp = If(ctrExe <: [["ftp", "fup", "all"]],
{
Text msgTxt = If(ctrExe=="ftp", "ftp (all files)", "fup (update)");
Text absPth = Replace(GetSourcePath(ctrExe),"/make.tol",""); // Absoluto
Text locPth = absPth+"/web"; // Ha de ser una ruta absoluta
Text webNam = GetFileName(absPth); // Nombre del directorio actual
Text dtePth = If(ctrExe=="ftp", "", "ftp/"+webNam+".log"); // Relativo
Text WriteLn(makSep+webNam+": building "+msgTxt+" from "+locPth+"...");
FtpAll(
webNam, // Web name
"www.antoniosalmeron.com", // Host remoto
locPth, // Directorio local
dtePth, // Fichero señal de fecha de actualizacion
[[//dir extension type binary or ascii
[["", "html", "html", FALSE]], // ASCII
[["", "ico", "ico", TRUE]], // Binary favicon.ico
[["", "xml", "xml", FALSE]], // ASCII site map, rss
[["", "css", "css", FALSE]], // ASCII
[["src", "js", "js", FALSE]], // ASCII javascript
[["", "gif", "gif", TRUE]], // Binary
[["", "jpg", "jpg", TRUE]], // Binary
[["", "png", "png", TRUE]], // Binary
[["", "xls", "xls", TRUE]], // Binary
[["", "pdf", "pdf", TRUE]] // Binary
]])
},FALSE);
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Crear los ficheros de mandatos completos ftp o de actualizacion fup.",
makFtp);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Real makSnd = If(Or(ctrExe=="all", ctrExe=="snd"),
{
Text WriteLn(makSep+"sending files using ftp...");
System(W("ftp/Antonio.Salmeron.bat"))
},FALSE);
//////////////////////////////////////////////////////////////////////////////
PutDescription("Send files via ftp.",makSnd);
//////////////////////////////////////////////////////////////////////////////
Text WriteLn("\nAntonio.Salmeron make: end");
//////////////////////////////////////////////////////////////////////////////
// FILE : make.tol
// AUTHOR : http://www.asolver.com
// CLASS : Metaprogramación; Hipertexto
// VERSION : Tol 1.1.5; Tol 1.1.6; Tol 2.0.1
// PURPOSE : Este programa se denomina Antonio.Salmeron pues es el constructor
// del sitio web AntonioSalmeron.com.
//
// La construcción del sitio web se realiza a partir de contenidos en formato
// de posts albergados en unos ficheros que se denominan agendas.
// Cada agenda contiene un conjunto de post, agrupados generalmente por temas.
// Estos ficheros de agendas se almacenan en un directorio que puede
// considerarse un banco de contenidos.
//
// Los post pueden pertenecer a múltiples clases,
// unas clases definidas en los posts y otras calculadas, como por ejemplo,
// las clase de los periodos de publicación de cada post.
// Este programa crea páginas Html de posts y de conjuntos de post por cada
// clase, a estas clases también se las denomina categorías.
// _
// El programa esta basado en un macro-expansor a doble nivel de Tol en Html,
// donde las semillas de Html contienen Tol embebido y los post para publicar
// también pueden contener Tol embebido, por lo que:
// a) dentro de la primera expansion, la de las semillas,
// b) se pueden realizar otras expansiones, que son las del lenguaje Tol
// contenido en los post.
//
// Hay 2 tipos de semillas para este sitio web:
// a) una para las páginas web del sitio AntonioSalmeron.com y
// b) otra para la elaboración de los curriculum viatae que es la misma para
// el curriculum en inglés y el curriculum en español.
// _
// Este programa emplea un directorio de agenda de posts, dentro de este
// directorio los posts se estructuran en varios ficheros que permiten
// organizarlos por su tipo de contenido y dentro de cada fichero por su fecha
// de publicación, los más recientes al principio.
//
// Con parte de los contenidos de los post este programa crea 4 documentos,
// 2 en español y 2 en ingles, en Html y en formato Pdf que son un curriculun
// vitae.
//
// A diferencia de otros sitios web construidos por Tol, en el sitio web
// AntonioSalmeron.com todos los post tienen el mismo nivel de importancia.
// _
// Con este programa:
// a) las páginas de artículos se generan con la opción art,
// b) las páginas con los artículos agrupados por categorías con la opción
// cat,
// c) las páginas Html por defecto del sitio (index.html) y de cada
// directorio, la página absoluta y la de control de errores con la
// opción rot,
// d) el mapa del sitio web en Xml con la opción xsm, que son las siglas de
// Xml site map y
// e) las opciones ftp, fup y snd permiten poner el contenido en online.
//
// Los comentarios del código de este programa están realizados utilizando
// unas veces el español, sin acentos, y otras veces el inglés.
// _
// Este programa sólo escribe los ficheros de páginas Html que son diferentes
// a los ya creados en ejecuciones anteriores de forma que no haya que enviar
// todo el conjunto de páginas sino las de modificadas de fecha más reciente
// que el último log de envío. Este control lo realiza la opcion fup, de
// ftp update, frente a la opción ftp que generar ficheros de mandatos de
// envío con todo el contenido del web. Nótese que las opciones fup y ftp solo
// generan ficheros de mandatos ftp de envío y luego se pueden ejecutar con
// la opcion snd.
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// INCLUDE
//////////////////////////////////////////////////////////////////////////////
Text WriteLn("\nAntonio.Salmeron make: begin");
//////////////////////////////////////////////////////////////////////////////
Set allInc = Include("tol/inc.tol");
//////////////////////////////////////////////////////////////////////////////
PutDescription("Inclusion de las funciones comunes y de aplicacion.", allInc);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// STRUCTS
//////////////////////////////////////////////////////////////////////////////
Struct PdbSt // Posts database
{
Set pstCla, // Conjunto de tipos de post
Text pstNam, // Identificador del post, si no se usa se pone Pst+fecha
Text pstTit, // Titulo del post
Date pstDte, // Fecha de ocurrencia
Date pstUpd, // Fecha de actualizacion
Text pstTxt, // Texto del post es html
Text pstLnk // Enlaces del post es html
};
//////////////////////////////////////////////////////////////////////////////
// CONSTANTS
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Text makSep = "\n"+Repeat("_", 72)+"\n";
//////////////////////////////////////////////////////////////////////////////
PutDescription("Linea horizontal para separar fases de operacion.",makSep);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Text CtrAge = "agenda";
//////////////////////////////////////////////////////////////////////////////
PutDescription("All text files inside this directory.",CtrAge);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Text CtrFil = "poststat.csv";
//////////////////////////////////////////////////////////////////////////////
PutDescription("Estadísticas de posts por clases.",CtrFil);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Real CtrRec = 15;
//////////////////////////////////////////////////////////////////////////////
PutDescription("Number of posts per recent page.",CtrRec);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Real CtrTit = 4;
//////////////////////////////////////////////////////////////////////////////
PutDescription("Number of posts per title.",CtrTit);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Real CtrDes = 8;
//////////////////////////////////////////////////////////////////////////////
PutDescription("Number of posts per description.",CtrDes);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Set CatEsp = [["Reciente",
"Completo"]];
//////////////////////////////////////////////////////////////////////////////
PutDescription("Categorias especiales.",CatEsp);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Set CatGen = [["Pintura y poesía",
"Negocios",
"Tecnología"]]; //
//////////////////////////////////////////////////////////////////////////////
PutDescription("Categorias generales.",CatGen);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Set CatCur = [["Formación";
"Experiencia";
"Contribución";
"Información complementaria"]];
//////////////////////////////////////////////////////////////////////////////
PutDescription("Categorias curriculares.",CatCur);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Set CatTem = [["2015-2019",
"2010-2014",
"2005-2009",
"2000-2004",
"1995-1999",
"1990-1994",
"1983-1989"]];
//////////////////////////////////////////////////////////////////////////////
PutDescription("Categorias temporales.",CatTem);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Set CatMis = [["Código";
"Educación básica",
"Web, post y vídeo"]];
//////////////////////////////////////////////////////////////////////////////
PutDescription("Categorias miscelaneas.",CatMis);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Set CatAre = [["Dirección y estrategia",
"Economía y financiera",
"Marketing y comercial",
"Operaciones y logística",
"Personal y formación"]];
//////////////////////////////////////////////////////////////////////////////
PutDescription("Categorias de areas de aplicacion: funciones.",CatAre);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Set CatSec = [["Banca y seguros",
"Industria y energía",
"Inmobiliario y edificación",
"Legal y función pública",
"Logística y transporte",
"Prensa, editorial y medios"]];
//////////////////////////////////////////////////////////////////////////////
PutDescription("Categorias de sectores de actividad.",CatSec);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Set CatTop = CatEsp <<
CatGen <<
CatCur <<
CatTem <<
CatMis <<
CatAre <<
CatSec;
//////////////////////////////////////////////////////////////////////////////
PutDescription("Categorias principales, top.",CatTop);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Set CatFor = [["Titulación",
"Curso recibido"]];
//////////////////////////////////////////////////////////////////////////////
PutDescription("Categorias dentro de la formacion.",CatFor);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Set CatExp = [["Profesional",
"Empresarial",
"Directiva",
"Inicial"]];
//////////////////////////////////////////////////////////////////////////////
PutDescription("Categorias de la experiencia.",CatExp);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Set CatEmp = [["ASolver",
"Bayes",
"EQ"]];
//////////////////////////////////////////////////////////////////////////////
PutDescription("Categorias de experiencia pero con empresa concreta.",CatEmp);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Set CatCon = [["Publicación",
"Curso impartido",
"Ponencia",
"Registro",
"Referencia"]];
//////////////////////////////////////////////////////////////////////////////
PutDescription("Categorias de contribución.",CatCon);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Set CatCom = [["Dato de interés",
"Interés personal"]];
//////////////////////////////////////////////////////////////////////////////
PutDescription("Categorias de información complementaria.",CatCom);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Set CatAll = CatTop <<
CatFor <<
CatExp <<
CatEmp <<
CatCon <<
CatCom;
//////////////////////////////////////////////////////////////////////////////
PutDescription("Todas las categorias.",CatAll);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// MAKE
//////////////////////////////////////////////////////////////////////////////
Text WriteLn("\nAntonio.Salmeron make: process");
//////////////////////////////////////////////////////////////////////////////
Text ctrExe = If(Not(ObjectExist("Text","ctrBat")), "hlp",
If(ctrBat=="", "hlp",
ToLower(ctrBat)));
//////////////////////////////////////////////////////////////////////////////
PutDescription("Argumento validado para la ejecucion del make.", ctrExe);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Real makHlp = If(ctrExe!="hlp", FALSE,
{
Text WriteLn(
makSep+"help:
Usage: make [OPTION]
Builds antoniosalmeron.com site
OPTION
cat: build all category pages
art: build all articles pages
rot: build root absolute page
cvs: build cv pages: english, spanish and theirs Pdf files
xsm: build xml site maps
ftp: build ftp files (go to ftp dir and run manually)
fup: build a file update protocol (newer than ftp.log file)
snd: send file via ftp
___
web: build local web: cat, art, rot, cvs, xms
all: do all works: cat, art, rot, cvs, xms, fup y snd
hlp: show this help");
TRUE
});
//////////////////////////////////////////////////////////////////////////////
PutDescription("Es cierto si se ha visualizado la ayuda.", makHlp);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// Lee la agenda
//////////////////////////////////////////////////////////////////////////////
Text Write(makSep);
//////////////////////////////////////////////////////////////////////////////
Set CtrPdb = If(ctrExe <: [["all", "web", "cat", "art", "cvs"]],
PdbRead(CtrAge),
Empty);
//////////////////////////////////////////////////////////////////////////////
PutDescription("Read all posts.", CtrPdb);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// Genera el contenido
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Real makCat = If(Or(ctrExe=="all", ctrExe=="web", ctrExe=="cat"),
{
Text WriteLn(makSep+"building all category pages...");
Text WriteFile(CtrFil, "Posts; Class\n");
Real CtrArt = FALSE; // Categories, not articles
// Make category pages
Set cicCat = EvalSet(CatAll, Real(Text CtrPag)
{
Text filNam = PhtFileName(CtrPag); // Output file
Text WriteLn("["+CtrPag+"|"+filNam+"]");
Set SelPdb = // Selected post from database for this page
{
Set selSet =
If(CtrPag=="Completo",
CtrPdb,
If(CtrPag=="Reciente",
PdbFirstN(CtrPdb, CtrRec, Real(Set pdbObj) { TRUE }),
Select(CtrPdb, Real(Set pdbObj) { CtrPag <: pdbObj->pstCla })));
Real selCrd = Card(selSet);
Text txtCrd = FormatReal(selCrd,"%.0lf");
Text WriteLn(" "+txtCrd+" posts selected");
Text AppendFile(CtrFil, txtCrd+"; "+CtrPag+"\n");
// If none then the most recent
If(selCrd, selSet, PdbFirstN(CtrPdb, CtrRec, Real(Set pdbObj) { TRUE }))
};
TmeFile("web/seed/seed.htm", "web/"+filNam)
});
Card(cicCat)
},FALSE);
//////////////////////////////////////////////////////////////////////////////
PutDescription("build all category pages.",makCat);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Real makArt = If(Or(ctrExe=="all", ctrExe=="web", ctrExe=="art"),
{
Text WriteLn(makSep+"building all article pages...");
Real CtrArt = TRUE; // Articles
// Make article pages
Set cicArt = For(1, Card(CtrPdb), Real(Real pstNum)
{
Set SelPdb = SetSubCicle(CtrPdb, pstNum, CtrRec);
Text CtrPag = TxtOutside2Tag(CtrPdb[pstNum]->pstTit,"<",">");
Text filNam = PhtFileName(CtrPag); // Output file
Text WriteLn("["+CtrPag+"|"+filNam+"]");
TmeFile("web/seed/seed.htm", "web/"+filNam)
});
Card(cicArt)
},FALSE);
//////////////////////////////////////////////////////////////////////////////
PutDescription("Build all articles pages.", makArt);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Real makRot = If(Or(ctrExe=="all", ctrExe=="web", ctrExe=="rot"),
{
Text WriteLn(makSep+"building root absolute page...");
Text WriteLn("-> homepage index.html");
Text inxHtm = ReadFile("web/categorias/index.html");
Text inxRot = Replace(inxHtm,"\"../", "\"");
Text WriteFile("web/index.html", inxRot);
Text WriteLn("-> absolute index");
Text absSav = Replace(inxHtm, " href=\"http",
" _XX_=\"_XX_"); // Save external references
Text absRep = ReplaceTable(absSav,
[[
[[ " src=\"../", " src=\"http://www.antoniosalmeron.com/"]],
[[" href=\"../", " href=\"http://www.antoniosalmeron.com/"]]
]],1);
Text absRec = Replace(absRep, " _XX_=\"_XX_",
" href=\"http"); // Recall external references
Real FilWriteIfDiff("web/absoluto.html", absRec);
Text WriteLn("-> common directory page, utf-8");
FilCopy("../common/dir.html", "web/categorias/comxidir.html", TRUE)
},FALSE);
//////////////////////////////////////////////////////////////////////////////
PutDescription("Build root absolute page.", makRot);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Real makCvs = If(Or(ctrExe=="all", ctrExe=="web", ctrExe=="cvs"),
{
Text e2(Text eng, Text spa) { If(CtrEng, eng, spa) };
Text tx(Real int) { FormatReal(int, "%.0lf") };
Text inSet(Text claTxt, Real newOld) // Si True new->old, si false old->new
{
Text iniTag = "<li class=\"" + If(CtrEng, "eng", "spa") + "\">";
Text endTag = "</li>";
Set selSet = Select(CtrPdb, Real(Set objPst) { claTxt<:objPst->pstCla });
Set ordSet = If(newOld, selSet, SetReverse(selSet));
Set txtSet = EvalSet(ordSet, Text(Set objPst)
{
Text txtCit = TxtBetween2Tag(objPst->pstTxt, iniTag, endTag, TRUE);
If(txtCit == "", "", " <li>\n "+txtCit+"\n </li>\n")
});
"\n"+SetSum(txtSet)+"\n"
};
Text liSet(Text claTxt) { inSet(claTxt, TRUE) };
Text liRev(Text claTxt) { inSet(claTxt, FALSE) };
Text WriteLn(makSep+"building Cv html and pdf pages...");
Text sedPth = "web/seed/seed.cv.htm";
Real engBld =
{
Real CtrEng = TRUE;
Text htmPth = "web/curriculum/antoniosalmeroncveng.html";
Text pdfPth = Replace(htmPth, ".html", ".pdf");
Real htmBld = TmeFile(sedPth, htmPth);
Real pdfBld = PdfBuild(htmPth, pdfPth);
htmBld + pdfBld
};
Real spaBld =
{
Real CtrEng = FALSE;
Text htmPth = "web/curriculum/antoniosalmeroncvspa.html";
Text pdfPth = Replace(htmPth, ".html", ".pdf");
Real htmBld = TmeFile(sedPth, htmPth);
Real pdfBld = PdfBuild(htmPth, pdfPth);
htmBld + pdfBld
};
engBld + spaBld
},FALSE);
//////////////////////////////////////////////////////////////////////////////
PutDescription("Build Cv html and pdf pages.",makCvs);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Real makXsm = If(Or(ctrExe=="all", ctrExe=="web", ctrExe=="xsm"),
{
Text WriteLn(makSep+"building xml site map...");
XsmDir("web/sitemap.xml", "web", "http://www.antoniosalmeron.com/")
},FALSE);
//////////////////////////////////////////////////////////////////////////////
PutDescription("Build Xml site map.", makXsm);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Real makFtp = If(ctrExe <: [["ftp", "fup", "all"]],
{
Text msgTxt = If(ctrExe=="ftp", "ftp (all files)", "fup (update)");
Text absPth = Replace(GetSourcePath(ctrExe),"/make.tol",""); // Absoluto
Text locPth = absPth+"/web"; // Ha de ser una ruta absoluta
Text webNam = GetFileName(absPth); // Nombre del directorio actual
Text dtePth = If(ctrExe=="ftp", "", "ftp/"+webNam+".log"); // Relativo
Text WriteLn(makSep+webNam+": building "+msgTxt+" from "+locPth+"...");
FtpAll(
webNam, // Web name
"www.antoniosalmeron.com", // Host remoto
locPth, // Directorio local
dtePth, // Fichero señal de fecha de actualizacion
[[//dir extension type binary or ascii
[["", "html", "html", FALSE]], // ASCII
[["", "ico", "ico", TRUE]], // Binary favicon.ico
[["", "xml", "xml", FALSE]], // ASCII site map, rss
[["", "css", "css", FALSE]], // ASCII
[["src", "js", "js", FALSE]], // ASCII javascript
[["", "gif", "gif", TRUE]], // Binary
[["", "jpg", "jpg", TRUE]], // Binary
[["", "png", "png", TRUE]], // Binary
[["", "xls", "xls", TRUE]], // Binary
[["", "pdf", "pdf", TRUE]] // Binary
]])
},FALSE);
//////////////////////////////////////////////////////////////////////////////
PutDescription(
"Crear los ficheros de mandatos completos ftp o de actualizacion fup.",
makFtp);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
Real makSnd = If(Or(ctrExe=="all", ctrExe=="snd"),
{
Text WriteLn(makSep+"sending files using ftp...");
System(W("ftp/Antonio.Salmeron.bat"))
},FALSE);
//////////////////////////////////////////////////////////////////////////////
PutDescription("Send files via ftp.",makSnd);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// END
//////////////////////////////////////////////////////////////////////////////
Text WriteLn("\nAntonio.Salmeron make: end");
2015 asolver.com | Aviso legal | XHTML | Δ Θ Ξ | Creative Commons | Mapa y funciones del sitio