Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9102895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T01:29:38+00:00 2026-06-17T01:29:38+00:00

I have succesfully able to populate the my storage extension table using my custom

  • 0

I have succesfully able to populate the my storage extension table using my custom deployer, now I can see my records are going perfectly if user publish any page.

Now I want to handle the Unpublishing part, so I have written the Custom page undeployer, please see sample code below:

@SuppressWarnings({ "rawtypes" })
public void process(TransportPackage data) throws ProcessingException 
{
    ProcessorInstructions instructions = data.getProcessorInstructions();       

    try 
    {
        for (Iterator iterator = instructions.getArguments(); iterator.hasNext(); ) 
        {
            Object argument = iterator.next();
            if (argument instanceof PageKey) 
            {
              PageKey pageKey = (PageKey)argument;
              TCDURI pageMetaURI = new TCDURI(pageKey.getId().getPublicationId(), 1168231104576L, pageKey.getId().getItemId());
              PageMeta pageMeta = this.pageMetaHome.findByPrimaryKey(pageMetaURI.getPublicationId(), 
                (int)pageMetaURI.getItemId());
              if (pageMeta == null)
              {
                  DeploymentHandler.undeploy(pageMetaURI);
              }
              else
              {
                  PublishAction publishAction = new PublishAction();
                  publishAction.setAction("DEL");
                  long id = publishAction.getId();
                  PublishActionDAO publishActionDAO = (PublishActionDAO) StorageManagerFactory.getDefaultDAO("PublishAction");
                  publishAction = publishActionDAO.findByPrimaryKey(id);
                  if (publishAction == null) 
                  {
                      log.debug("FindByPrimaryKey: cannot retrieve object with primary key:" + id);
                  }
                  else
                  {
                      publishAction = publishActionDAO.update(publishAction);
                      log.debug("SearchPageUndeployer Updated bean -" + publishAction);                      
                  }
              }
            }
        }
    }
    catch (Exception e) 
    {
        throw new ProcessingException("SearchPageUndeployer: Could not undeploy page", e);
    }
    super.process(data);
}

In above code you can see I am trying to update my new storage extension “PublishAction”, however when I am trying to fetch the ID from the table for which record I want to modify, I am always getting ID as 0 as I am not able to get the ID from the table.

Please suggest what need to implemented in my DAO to get the ID of from table for record which needs to be updated.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T01:29:40+00:00Added an answer on June 17, 2026 at 1:29 am

    You can create in your DAO a method like findByTCMURI to search for your publish action based on the page tcm uri. The code would be something like this:

    public PublishAction findByTCMURI(String tcmURI) throws StorageException {
        StringBuilder queryBuilder = new StringBuilder();
        queryBuilder.append("from PublishAction pa where pa.tcmuri = :tcmuri");
    
        Map<String, Object> queryParams = new HashMap<String, Object>();
        queryParams.put("tcmuri", tcmURI);
    
        return executeQuerySingleResult(queryBuilder.toString(), queryParams);
    }
    

    Should do the trick.
    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have successfully created a custom Facebook open graph action, and have been able
I have started using https://github.com/omab/django-social-auth and been successfully able to login via twitter, google
i have succesfully installed OpenCv & Qt in Ubuntu..i can debug and run some
I have ListView . i am successfully able to populate that ListView but what
I have created an sqlite table using the following statement: CREATE TABLE IF NOT
I'm able to delete one entry at a time using AJAX. Now I've made
I've been able to have JPA/Hibernate to replicate the ON DELETE CASCADE functionality successfully
I have an atomfeed with which is succesfully getting parsed. All the articles are
I have written several procedures and succesfully implemented them on my webhost's server. However
Stuck and have no clue why Spring Form is not able to submit successfully

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.