Skip to main content

Informationen über Eigenschaften gelöschter Objekte erhalten

Comments

1 comment

  • Zendesk API User
    Author: brueder - 12/19/2017 15:30

    Hallo Marco,

    an der Stelle muss ich dich auf die API verweisen - dafür musst du ein bisschen was programmieren. Um dir zu helfen habe ich mal ein Snippet aus unserer Codebasis geholt, das etwas ähnliches tut. Das musst du schon noch anpassen, sollte aber zumindest dabei helfen, auf die richtige Lösung für dein Problem zu kommen.

    long currentRevision = revisionId;

    Revision revision = null;

    IDProvider oldElement = null;

    while (currentRevision > 0) {

      revision = scheduleContext.getProject().getRevision(currentRevision);

      if (revision != null) {

      final SiteStoreRoot oldSiteStore =

      (SiteStoreRoot) scheduleContext.getProject().getUserService(revision).getStore(Store.Type.SITESTORE, true);

      oldElement = oldSiteStore.getStoreElement(deletedPageRef.getUid(), IDProvider.UidType.SITESTORE_LEAF);

      if (oldElement != null) {

      scheduleContext.logDebug("Found old element for deleted element!");

      sendDeleteCommandsPerLanguage(caaSConnection, scheduleContext, caaSService, nameNormalizer, parser, deletedPageRef,

      (ContentProducer) oldElement);

      break;

      }

      }

      currentRevision--;

    }

    if (revision == null) {

      scheduleContext.logWarning("Last revision not found! That should not happen, "
      + "because the last previous revision is needed to reconstruct the parenting of a deleted pageref.");

    }

    if (oldElement == null) {

      scheduleContext.logWarning("No old element (element in the previous revision) found for deleted element! "
      + "That should not happen, because the old element is needed to reconstruct the parenting of the deleted pageref.");

    }

    Abgesehen davon kannst du an dieser Stelle die API ansehen:

    https://www.e-spirit.com/odfs52/access/de/espirit/firstspirit/access/project/Project.html#getRevisions-de.espirit.firsts…

    https://www.e-spirit.com/odfs52/access/de/espirit/firstspirit/storage/Revision.html

    https://www.e-spirit.com/odfs52/access/de/espirit/firstspirit/storage/RevisionMetaData.html

    Klar, das ist jetzt nur eine Outline - ich hoffe erst einmal, dass dir das schon hilft?

    Viele Grüße,

    Lena

    0

Please sign in to leave a comment.