MarsDD
Occasional Observer

aktuellen User in Variable speichern

Hallo zusammen,

ich habe wieder einmal eine Frage ...

Bzgl. des Posts (https://community.e-spirit.com/message/16468#16468) kann ich den aktuellen User auslesen. Speichere ich diesen in eine Variable mittels CMS_SET, so wir jedoch der JSP-Quelltext mit hineingespeichert.

Ziel ist es, dank Vor- und Nachname, seine Datensätze aus den Datenquellen herauszufiltern.

Durch Tests kommt derzeit folgendes heraus (am Beispiel "Marcel")

Länge (statisch) des Vornamens: 6

Länge des via JSP ausgelesenen Vornamens: 260

Gibt es eine Möglichkeit, das Ergebnisses der JSP-Auszuges direkt in eine für FS zur Verfügung stehenden Variable zu speichern um diese an einer anderen Stelle zu verwenden?

mfg Marcel

13 Replies
zava
Elite Observer

Hi Marcel,

do you mean FS's user or Frontend's user?

ciao,

Antonio

0 Kudos
MarsDD
Occasional Observer

Hi Antonio,

I mean the frontend user who is equals the fs user.

best regards

Marcel

0 Kudos

Sorry I'm quite confused,

you want to read a FS user from the Live system, not Preview not Webedit, Live?

0 Kudos
MarsDD
Occasional Observer

Following situation

in one dataset you selected your user from a dropdown element

after that, in preview && webedit you can see all datasets with this user property because the user in the table and the fs users are the same.

i hope u could understand me

0 Kudos

like this...

<%@ page import="de.espirit.firstspirit.access.*" %>

<%@ page import="de.espirit.firstspirit.access.project.Project" %>

<%

  Connection connection = (Connection) session.getAttribute("connection");

  if (connection != null) {

  Project project = (Project) connection.getProjectByName("agv");

  UserService us = project.getUserService();

  User loggedInEditor = us.getUser();

 

  if (loggedInEditor != null) {

     String loggedInEditorName = loggedInEditor.getRealname();

     String loggedInEditorEMail = loggedInEditor.getEMail();

     out.println(loggedInEditorName);

  }

  }

%>

0 Kudos
MarsDD
Occasional Observer

ofc

and now ... my problem is ... how could i save the result of this code in a fs-variable?

if i do around a cms_set ... and put out the length, i dosn't get real result length (like from "Marcel" => 6) but i get the length of this jsp-code (like 260).

0 Kudos

Hi Marcel,

no way Smiley Happy you can not save the result on cms variable.

Why you need a CMS var?

0 Kudos
MarsDD
Occasional Observer

Hi Antonio,

because i need it for a contentSelect

0 Kudos

ok on header, can you not migrate the function to JSP Smiley Happy ?

just change the render time from CMS to JSP, on JSP you have all information you need Smiley Happy

0 Kudos