Elephant goes social

New & Noteworthy
9/4/18
Lluís Turró Cutiller
6.893
0
elephant social

Next release of the Elephant libraries will come with formatting support for social networks. The goal is achieved by generating Open Graph metas.

The user is in full control

Images can be socialized by simply following the instructions in http://www.turro.org/docs/elephant/components/social. For publications, images will be selected using the conventions described in http://www.turro.org/docs/brightside/publications/conventions.

How does it look like?


Twitter example


Whatsapp example


Facebook example

Google Drive canvia el model Mac/PC pel File Stream

Customer Relationship
16/2/18
Lluís Turró Cutiller
11.312
0

Google Drive per a Mac/PC es desactiva definitivament el 12 de maig de 2018. Tots els usuaris que el facin servir com eina de sincronització hauran de migrar a File Stream de Drive.

File Stream de Drive és una nova aplicació per a Mac o PC que et permet accedir a tots els teus arxius de Google Drive des de l'ordinador al mateix temps que s'estalvia espai en disc i es redueix el temps de sincronització.

Com funciona?

Amb File Stream de Drive pots:

  • Veure ràpidament tots els teus arxius de Google Drive a Finder o en l'Explorador de Windows (incloses les unitats d'equip).
  • Explorar i organitzar els arxius de Google Drive sense haver de descarregar-los tots a l'ordinador.
  • Triar quins arxius o carpetes voleu que estiguin disponibles fora de línia.
  • Obrir arxius en aplicacions com Microsoft Office i Adobe Photoshop.

Què he de fer per començar?

Visita el Centre d'Ajuda de Drive per instal·lar File Stream de Drive i començar a utilitzar aquesta aplicació.

Elephant's new features for SEO

New & Noteworthy
29/1/18
Lluís Turró Cutiller
10.072
0
elephant

The new Elephant version comes with some new features that will make life easier for SEO. The most relevant are:

Publication URLs

Previous to Elephant URL-as-parameter, BrightSide Publication URLs were generated using the publication ID. Something like ?item=n. This has been override by easy-to-read URLs. Something like /elephants-new-features-for-seo, which happens to be the URL for this one you're now reading.

Currently, the URLs are auto-generated when the publication is saved. And wont change in future savings. The new system is backward compatible with the previous one.

The URL-as-parameter generates when publication entities have their own context defined. See Sitemap.

No follow property for some links

The links affected (but not exclusively) are:

  • Authentication required links.
  • Print version links.
  • Pagination links.
  • Cloud tag links.
  • Category links.

Auto-generated sitemap

Elephant generates a sitemap from all its contexts. Also, requires BrightSide modules to provide relevant URLs. See Sitemap for more information.

Detect the charset in Java strings

Blog
13/12/17
Lluís Turró Cutiller
47.662
0
java

Before start, I would like to mention Apache Tika and juniversalchardet. Tika is a full-featured file type detection library and, because so much features, takes a big amount of dependencies. I haven't tried juniversalchardet for does not detect ISO-8859-1, which is the reason I needed charset detection.

Since none well suited my problem, I decided to detect charsets myself and, once results were in production, share it with anyone else. Hope you like it

Why charset detection?

Anyone developing web applications with data inputs and third-party frameworks, with a different charset than UTF-8, might have encountered the need to auto-detect charset. Guessing the source of the input on utility classes, or passing the charset along among methods, doesn't seem to be the right way and isn't always possible.

Changing the string charset

We'll need a convert method, in order to change the string charset. The most simple way would be using String supplied methods. Something like:

public String convert(String value, String fromEncoding, String toEncoding) {
  return new String(value.getBytes(fromEncoding), toEncoding);
}

The problem remains, though. The variable fromEncoding isn't always known.

Charset guessing

Guessing? Well, let's be clear, we are guessing. Also taking some premises that might be not true. For instance, we probe using UTF-8 against a set of expected charsets. The good thing about it is that we know the elements at play and can change them at will.

The approach is very simple: if I do change the string from the expected charset to UTF-8 and then back from UTF-8 to the expected charset, shouldn't be the resulting string exactly the same than the original one?

Let's put this at work:

public static String charset(String value, String charsets[]) {
  String probe = StandardCharsets.UTF_8.name();
  for(String c : charsets) {
    Charset charset = Charset.forName(c);
    if(charset != null) {
      if(value.equals(convert(convert(value, charset.name(), probe), probe, charset.name()))) {
        return c;
      }
    }
  }
  return StandardCharsets.UTF_8.name();
}

A possible call to the charset() method would be:

String detectedCharset = charset(value, new String[] { "ISO-8859-1", "UTF-8" });

As I said, the approach uses the premise that UTF-8 will behave well on all transformations and that there is a reduced set of expected charsets. I haven't tried probing the whole Charset.availableCharsets(). In case you do and find a better way, please let me know.

Actualització major del BaaS preparada per aquest Nadal

New & Noteworthy
12/12/17
Lluís Turró Cutiller
11.371
0
BaaS

L'octubre ha estat un mes de preparació per actualitzacions majors dins el sistema BaaS (BrightSide as a Service). Els canvis afecten totes les àrees: web, aplicació i base de dades.

La web

El canvi més gran és, sense dubte, l'actualització a la nova versió de Semantic-Ui. Inclou una millor adaptació a dispositius mòbils, sense oblidar las pantalles grans.

També s'actualitzen els charts, la darrera versió de Highcharts.

L'aplicació

L'estrella dels mòduls, ZK, arriba amb una versió millorada, molt més ràpida de càrrega. Amés inclou noves prestacions que milloren les parts que utilitzen el port web. Amb seguretat, una de les actualitzacions que més novetats permetrà ens els propers mesos.

La base de dades

Una de les actualitzacions que més ha costat, i que potser més ha valgut la pena, és la implementació de la capa de persistència. La darrera versió de Hibernate aterra al BaaS.

El que ens espera aquests propers mesos

El motiu principal de fer aquestes actualitzacions majors és l'afermament de la darrera versió de Java i JEE. Com a motor del BaaS, el canvi a Java 9 i JEE 8 serà un dels més importants. Així que anem-nos preparant per un 2018 amb un BaaS a la última.